/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as t,__param as e}from"tslib";import{location as o,uniform as r,texture as s,input as i}from"../../GraphShaderModule.js";import{Vec4 as p,Float as l,Vec2 as n,Sampler2D as a,greaterThan as m,ifElse as u,or as h}from"../../graph/glsl.js";import{BaseHittestVertexInput as f,FeatureVertexInput as d}from"./AFeatureShader.js";import{getComplexFillVertexData as c,getComplexFillFragmentColor as x}from"./ComplexFillShader.js";import{signedToUnsignedByte as y,noHit as v,trueHit as g,packPrecision as j}from"./constants.js";import{isRectHittest as O,hittestFill as b,hittestScreenRect as w}from"./hittestUtils.js";import{getLineFragmentColor as S}from"./LineShader.js";import{LocalTileOffset as F}from"./LocalTileOffset.js";import{MosaicInfo as R}from"./MosaicInfo.js";import{AOutlineFillShader as T,getOutlineFillVertexData as q}from"./OutlineFillShader.js";import{PatternOutlineFillFragmentInput as C}from"./PatternOutlineFillShader.js";const H=1/j;class I extends d{}t([o(3,p)],I.prototype,"color",void 0),t([o(4,p)],I.prototype,"tlbr",void 0),t([o(5,l)],I.prototype,"angle",void 0),t([o(6,l)],I.prototype,"aux1",void 0),t([o(7,l)],I.prototype,"aux2",void 0),t([o(8,n)],I.prototype,"aux3",void 0),t([o(9,n)],I.prototype,"aux4",void 0),t([o(10,n)],I.prototype,"zoomRange",void 0);class L extends C{}class M extends T{constructor(){super(...arguments),this.type="ComplexOutlineFillShader"}vertex(t,e){const{aux1:o,aux2:r,aux3:s,aux4:i}=t,p={...t,width:o,height:r,offset:s,scale:i.multiply(H)},n={...t,halfWidth:o,referenceHalfWidth:r,offset:s,normal:i.subtract(y).multiply(H)},a=q(this,n),u=c(this,p),h=m(a.isOutline,new l(.5));return{...a,...u,...Object.assign({},this.maybeRunHittest(t,e,h))}}fragment(t){const{isOutline:e}=t,o=m(e,new l(.5)),r=S(t,this.antialiasingControls.blur),s=x(this,t),i=u(o,r,s),p=u(o,new l(1/255),new l(0));return this.getFragmentOutput(i,t,p)}hittest(t,e,o){const{pos0:r,pos1:s,pos2:i}=this.computeHittestTriangle(t,e,null),p=O(this.hittestRequest);return u(p,()=>{const{tlbr:t}=this.hittestRequest;return w(r,s,i,t)},()=>{const r=b(this,t,e);return u(h(o,m(r,this.hittestRequest.distance)),new l(v),new l(g))})}}t([r(R)],M.prototype,"mosaicInfo",void 0),t([s(a)],M.prototype,"mosaicTexture",void 0),t([r(F)],M.prototype,"localTileOffset",void 0),t([e(0,i(I)),e(1,i(f))],M.prototype,"vertex",null),t([e(0,i(L))],M.prototype,"fragment",null);export{M as ComplexOutlineFillShader,I as ComplexOutlineFillVertexInput};
