/*
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","../core/shaderLibrary/ShaderOutputOptions","../core/shaderTechnique/ReloadableShaderModule","../core/shaderTechnique/ShaderTechnique","../core/shaderTechnique/ShaderTechniqueConfiguration","../lib/basicInterfaces","../lib/OrderIndependentTransparency","../lib/Program","../lib/StencilUtils","../lib/VertexAttribute","../materials/DefaultTechniqueConfiguration","../materials/PatternStyle","../../../../chunks/Pattern.glsl","../../../webgl/renderState"],(function(e,t,r,a,o,i,n,s,l,p,c,u,d,h,y,f,P){"use strict";let _=function(e){function t(){return e.apply(this,arguments)||this}r._inheritsLoose(t,e);var a=t.prototype;return a.initializeProgram=function(e){const r=t.shader.get().build(this.configuration);return new c.Program(e.rctx,r,g)},a._setPipelineState=function(e,t){const r=this.configuration,a=e===l.TransparencyPassType.NONE,i=e===l.TransparencyPassType.FrontFace;return P.makePipelineState({blending:r.output===o.ShaderOutput.Color||r.output===o.ShaderOutput.Alpha?a?p.blendingDefault:p.oitBlending(e):null,culling:P.cullingParams(r.cullFace),depthTest:{func:p.oitDepthTest(e)},depthWrite:a?r.writeDepth&&P.defaultDepthWriteParams:p.oitDepthWrite(e),colorWrite:P.defaultColorWriteParams,stencilWrite:r.hasOccludees?u.stencilWriteMaskOn:null,stencilTest:r.hasOccludees?t?u.stencilToolMaskBaseParams:u.stencilBaseAllZerosParams:null,polygonOffset:a||i?r.polygonOffset&&T:p.getOITPolygonOffset(r.enableOffset)})},a.initializePipeline=function(){return this._occludeePipelineState=this._setPipelineState(this.configuration.transparencyPassType,!0),this._setPipelineState(this.configuration.transparencyPassType,!1)},a.getPipelineState=function(t,r){return r?this._occludeePipelineState:e.prototype.getPipelineState.call(this,t,r)},t}(n.ShaderTechnique);_.shader=new i.ReloadableShaderModule(f.Pattern,(()=>new Promise(((t,r)=>e(["./Pattern.glsl"],t,r)))));const T={factor:1,units:1};let O=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).output=o.ShaderOutput.Color,t.cullFace=l.CullFaceOptions.None,t.transparencyPassType=l.TransparencyPassType.NONE,t.hasSlicePlane=!1,t.hasVertexColors=!1,t.polygonOffset=!1,t.writeDepth=!0,t.hasOccludees=!1,t.enableOffset=!0,t.hasMultipassTerrain=!1,t.cullAboveGround=!1,t}return r._inheritsLoose(t,e),t}(h.DefaultTechniqueConfiguration);a.__decorate([s.parameter({count:o.ShaderOutput.COUNT})],O.prototype,"output",void 0),a.__decorate([s.parameter({count:l.CullFaceOptions.COUNT})],O.prototype,"cullFace",void 0),a.__decorate([s.parameter({count:y.Style.COUNT})],O.prototype,"style",void 0),a.__decorate([s.parameter({count:l.TransparencyPassType.COUNT})],O.prototype,"transparencyPassType",void 0),a.__decorate([s.parameter()],O.prototype,"hasSlicePlane",void 0),a.__decorate([s.parameter()],O.prototype,"hasVertexColors",void 0),a.__decorate([s.parameter()],O.prototype,"polygonOffset",void 0),a.__decorate([s.parameter()],O.prototype,"writeDepth",void 0),a.__decorate([s.parameter()],O.prototype,"hasOccludees",void 0),a.__decorate([s.parameter()],O.prototype,"patternSpacing",void 0),a.__decorate([s.parameter()],O.prototype,"lineWidth",void 0),a.__decorate([s.parameter()],O.prototype,"enableOffset",void 0),a.__decorate([s.parameter()],O.prototype,"draped",void 0),a.__decorate([s.parameter()],O.prototype,"hasMultipassTerrain",void 0),a.__decorate([s.parameter()],O.prototype,"cullAboveGround",void 0);const g=new Map([[d.VertexAttribute.POSITION,0],[d.VertexAttribute.COLOR,3],[d.VertexAttribute.UVMAPSPACE,4],[d.VertexAttribute.BOUNDINGRECT,5]]);t.PatternTechnique=_,t.PatternTechniqueConfiguration=O,t.patternVertexAttributeLocations=g,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
