/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as o,__param as t}from"tslib";import{GraphShaderModule as e,FragmentOutput as i,location as p,uniform as r,option as l,input as s,VertexInput as a,UniformGroup as n,FragmentInput as y}from"../../../GraphShaderModule.js";import{Float as c,Vec3 as d,Vec4 as v,length as u,smoothstep as m,mix as h,Vec2 as x,Mat3 as f}from"../../../graph/glsl.js";const g=new c(1/15);class w extends a{}o([p(0,x)],w.prototype,"position",void 0),o([p(1,x)],w.prototype,"offset",void 0),o([p(2,x)],w.prototype,"normal",void 0),o([p(3,v)],w.prototype,"color",void 0),o([p(4,c)],w.prototype,"opacity",void 0),o([p(5,v)],w.prototype,"colorTo",void 0),o([p(6,c)],w.prototype,"opacityTo",void 0);class M extends y{}class T extends n{}o([r(f)],T.prototype,"dvsMat3",void 0),o([r(f)],T.prototype,"displayMat3",void 0);class C extends n{}o([r(x)],C.prototype,"fillTranslation",void 0),o([r(c)],C.prototype,"depth",void 0),o([r(c)],C.prototype,"outlineWidth",void 0);class O extends n{}o([r(c)],O.prototype,"value",void 0);class j extends n{}o([r(c)],j.prototype,"value",void 0);class S extends n{}o([r(v)],S.prototype,"value",void 0);class W extends n{}o([r(c)],W.prototype,"value",void 0);class b extends e{constructor(){super(...arguments),this.type="VTLShaderOutline"}vertex(o){const t=this.getColor(o).multiply(this.getOpacity(o)),{normal:e,offset:i}=o,{dvsMat3:p,displayMat3:r}=this.transform,{depth:l,outlineWidth:s,fillTranslation:a}=this.config,n=s.multiply(g).multiply(i),y=new d(p.multiply(new d(o.position,1))).add(r.multiply(new d(n.add(a),0)));return{glPosition:new v(y.xy,l,new c(1)),color:t,normal:e}}fragment(o){const t=new i,{color:e,normal:p}=o,r=u(p),l=m(new c(1),new c(0),r);return t.fragColor=e.multiply(l),t}getColor(o){return this.colorMix?.value&&o.color&&o.colorTo?h(o.color,o.colorTo,this.colorMix.value):o.color?o.color:this.color?.value||new v(0)}getOpacity(o){return this.opacityMix?.value&&o.opacity&&o.opacityTo?h(o.opacity,o.opacityTo,this.opacityMix.value):o.opacity?o.opacity:this.opacity?.value||new c(1)}}o([r(T)],b.prototype,"transform",void 0),o([r(C)],b.prototype,"config",void 0),o([l(O)],b.prototype,"opacity",void 0),o([l(j)],b.prototype,"opacityMix",void 0),o([l(S)],b.prototype,"color",void 0),o([l(W)],b.prototype,"colorMix",void 0),o([t(0,s(w))],b.prototype,"vertex",null),o([t(0,s(M))],b.prototype,"fragment",null);export{b as VTLShaderOutline};
