/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["require","exports","../../../../chunks/_rollupPluginBabelHelpers","../../../../chunks/tslib.es6","../../../../chunks/vec3f64","../../../ViewingMode","../core/shaderLibrary/ShaderOutputOptions","../core/shaderLibrary/attributes/PathVertexPosition.glsl","../core/shaderLibrary/shading/Normals.glsl","../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl","../core/shaderLibrary/util/DoublePrecision.glsl","../core/shaderTechnique/ReloadableShaderModule","../core/shaderTechnique/ShaderTechnique","../core/shaderTechnique/ShaderTechniqueConfiguration","../lib/basicInterfaces","../lib/OrderIndependentTransparency","../lib/Program","../lib/StencilUtils","../lib/VertexAttribute","./DefaultTechniqueConfiguration","../../../../chunks/Path.glsl","../../../webgl/renderState"],(function(e,t,r,a,o,i,n,s,l,u,c,d,p,h,b,P,y,_,v,f,m,g){"use strict";const T=new Map([[v.VertexAttribute.POSITION,0],[v.VertexAttribute.PROFILERIGHT,1],[v.VertexAttribute.PROFILEUP,2],[v.VertexAttribute.PROFILEVERTEXANDNORMAL,3],[v.VertexAttribute.FEATUREVALUE,4]]);let O=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ambient=o.fromValues(.2,.2,.2),t.diffuse=o.fromValues(.8,.8,.8),t.specular=o.fromValues(0,0,0),t.opacity=1,t}return r._inheritsLoose(t,e),t}(s.PathVertexPositionPassParameters),S=function(e){function t(){return e.apply(this,arguments)||this}r._inheritsLoose(t,e);var a=t.prototype;return a.initializeConfiguration=function(e,t){t.spherical=e.viewingMode===i.ViewingMode.Global,t.doublePrecisionRequiresObfuscation=c.doublePrecisionRequiresObfuscation(e.rctx)},a.initializeProgram=function(e){const r=t.shader.get().build(this.configuration);return new y.Program(e.rctx,r,T)},a._setPipelineState=function(e){const t=this.configuration,r=e===b.TransparencyPassType.NONE,a=e===b.TransparencyPassType.FrontFace,o=e=>!e.hasSlicePlane&&!(e.transparent||e.doubleSidedMode===l.NormalsDoubleSidedMode.None);return g.makePipelineState({blending:t.output!==n.ShaderOutput.Color&&t.output!==n.ShaderOutput.Alpha||!t.transparent?null:r?P.blendingDefault:P.oitBlending(e),culling:o(t)&&g.frontFaceCullingParams,depthTest:{func:P.oitDepthTest(e)},depthWrite:r||a?g.defaultDepthWriteParams:null,colorWrite:g.defaultColorWriteParams,stencilWrite:t.hasOccludees?_.stencilWriteMaskOn:null,stencilTest:t.hasOccludees?_.stencilBaseAllZerosParams:null,polygonOffset:r||a?null:P.OITPolygonOffset})},a.initializePipeline=function(){return this._setPipelineState(this.configuration.transparencyPassType)},t}(p.ShaderTechnique);S.shader=new d.ReloadableShaderModule(m.Path,(()=>new Promise(((t,r)=>e(["../shaders/Path.glsl"],t,r)))));let V=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).output=n.ShaderOutput.Color,t.doubleSidedMode=l.NormalsDoubleSidedMode.None,t.transparencyPassType=b.TransparencyPassType.NONE,t.spherical=!1,t.receiveShadows=!1,t.receiveAmbientOcclusion=!1,t.vvSize=!1,t.vvColor=!1,t.vvOpacity=!1,t.hasSlicePlane=!1,t.transparent=!1,t.hasOccludees=!1,t.hasMultipassTerrain=!1,t.cullAboveGround=!1,t.doublePrecisionRequiresObfuscation=!1,t}return r._inheritsLoose(t,e),t}(f.DefaultTechniqueConfiguration);a.__decorate([h.parameter({count:n.ShaderOutput.COUNT})],V.prototype,"output",void 0),a.__decorate([h.parameter({count:l.NormalsDoubleSidedMode.COUNT})],V.prototype,"doubleSidedMode",void 0),a.__decorate([h.parameter({count:b.TransparencyPassType.COUNT})],V.prototype,"transparencyPassType",void 0),a.__decorate([h.parameter()],V.prototype,"spherical",void 0),a.__decorate([h.parameter()],V.prototype,"receiveShadows",void 0),a.__decorate([h.parameter()],V.prototype,"receiveAmbientOcclusion",void 0),a.__decorate([h.parameter()],V.prototype,"vvSize",void 0),a.__decorate([h.parameter()],V.prototype,"vvColor",void 0),a.__decorate([h.parameter()],V.prototype,"vvOpacity",void 0),a.__decorate([h.parameter()],V.prototype,"hasSlicePlane",void 0),a.__decorate([h.parameter()],V.prototype,"transparent",void 0),a.__decorate([h.parameter()],V.prototype,"hasOccludees",void 0),a.__decorate([h.parameter()],V.prototype,"hasMultipassTerrain",void 0),a.__decorate([h.parameter()],V.prototype,"cullAboveGround",void 0),a.__decorate([h.parameter()],V.prototype,"doublePrecisionRequiresObfuscation",void 0),a.__decorate([h.parameter({constValue:u.PBRMode.Disabled})],V.prototype,"pbrMode",void 0),a.__decorate([h.parameter({constValue:!0})],V.prototype,"hasVvInstancing",void 0),a.__decorate([h.parameter({constValue:!1})],V.prototype,"useCustomDTRExponentForWater",void 0),a.__decorate([h.parameter({constValue:!1})],V.prototype,"useFillLights",void 0),t.PathPassParameters=O,t.PathTechnique=S,t.PathTechniqueConfiguration=V,t.pathVertexAttributeLocations=T,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
