/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/_rollupPluginBabelHelpers","../../../../core/maybe","../core/shaderLibrary/ShaderOutputOptions","../lib/basicInterfaces","../lib/GLMaterial","./WaterTechnique"],(function(e,t,a,s,r,i,o){"use strict";let n=function(e){function i(){return e.apply(this,arguments)||this}t._inheritsLoose(i,e);var n=i.prototype;return n._updateShadowState=function(e){e.shadowMap.enabled!==this._material.parameters.receiveShadows&&this._material.setParameters({receiveShadows:e.shadowMap.enabled})},n._updateSSRState=function(e){e.ssr.enabled!==this._material.parameters.hasScreenSpaceReflections&&this._material.setParameters({hasScreenSpaceReflections:e.ssr.enabled})},n._updateCloudsReflectionState=function(e){const t=a.isSome(e.clouds.data);t!==this._material.parameters.hasCloudsReflections&&this._material.setParameters({hasCloudsReflections:t})},n.ensureResources=function(e){const t=this._techniqueRepository.constructionContext.waterTextureRepository;return t.resourceState===r.ResourceState.NOT_LOADED&&t.loadTextures(e),t.resourceState},n.beginSlot=function(e){return this._output===s.ShaderOutput.Color&&(this._updateShadowState(e),this._updateSSRState(e),this._updateCloudsReflectionState(e)),this.ensureTechnique(o.WaterTechnique,e)},i}(i);e.WaterGLMaterial=n,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
