/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as t,__param as o}from"tslib";import{tileSize as e}from"../../../definitions.js";import{GraphShaderModule as i,FragmentOutput as r,location as s,uniform as d,input as n,VertexInput as p,UniformGroup as l}from"../../GraphShaderModule.js";import{Mat3 as a,Vec3 as c,texture2D as m,max as y,Float as v,step as w,Vec4 as u,length as h,smoothstep as x,Vec2 as f,Sampler2D as g}from"../../graph/glsl.js";import{FeatureFragmentInput as S}from"../shaders/AFeatureShader.js";import{ViewInfo as j}from"../shaders/ViewInfo.js";class z extends p{}t([s(0,f)],z.prototype,"pos",void 0);class P extends S{}class R extends l{}t([d(v)],R.prototype,"dotSize",void 0);class b extends l{}t([d(g)],b.prototype,"locations",void 0),t([d(v)],b.prototype,"pixelRatio",void 0),t([d(v)],b.prototype,"tileZoomFactor",void 0);const F=1e-6;class C extends i{constructor(){super(...arguments),this.type="DotDensityPointShader"}vertex(t){const o=new a(1,0,0,0,-1,0,0,1,1).multiply(new c(t.pos.xy.divide(e),1)),i=m(this.draw.locations,o.xy),r=y(this.instance.dotSize.divide(2),new v(1));let s=new v(0);s=s.add(w(i.a,new v(F)).multiply(2));let d=r.add(this.instance.dotSize);const n=this.view.displayViewScreenMat3.multiply(new c(t.pos.add(.5),1)),p=new u(n.xy,s,1),l=this.instance.dotSize.divide(d),h=new v(-1).divide(r.divide(d));return d=d.multiply(this.draw.pixelRatio.multiply(this.draw.tileZoomFactor)),{glPosition:p,glPointSize:d,color:i,ratio:l,invEdgeRatio:h}}fragment(t){const o=h(t.glPointCoord.subtract(.5)).multiply(2),e=x(new v(0),new v(1),t.invEdgeRatio.multiply(o.subtract(t.ratio)).add(1)),i=new r;return i.fragColor=t.color.multiply(e),i}}t([d(R)],C.prototype,"instance",void 0),t([d(b)],C.prototype,"draw",void 0),t([d(j)],C.prototype,"view",void 0),t([o(0,n(z))],C.prototype,"vertex",null),t([o(0,n(P))],C.prototype,"fragment",null);export{b as DotDensityPointDrawUniforms,P as DotDensityPointFragmentInput,R as DotDensityPointInstanceUniforms,C as DotDensityPointShader,z as DotDensityPointVertexInput};
