/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{getMetersPerUnitForSR as e,getMetersPerVerticalUnitForSR as t}from"../../../core/units.js";import{h as o}from"../../../chunks/vec32.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getGraphicEffectiveElevationInfo as i,zValueInAbsoluteHeightMode as n}from"../../../support/elevationInfoUtils.js";function s(r,s){const f=r?.geometry;if(!r||"mesh"!==f?.type||!s)return;const{renderCoordsHelper:l,elevationProvider:p}=s,{camera:u}=s.state,{extent:d}=f,{center:x,spatialReference:g}=d,v=e(g),j=t(g),z=e(l.spatialReference),R=d.width*v,y=d.height*j,C=(d.zmax??0)*j,b=C-(d.zmin??0)*j,w=Math.max(R,y,b)/z,{x:M,y:P}=x,S=x.z??0;o(h,M,P,S),l.toRenderCoords(h,g,h);const T=w/u.computeScreenPixelSizeAt(h);if(T>Math.min(u.width,u.height)/u.pixelRatio*a)return"meshTooClose";if(T<m)return"meshTooFar";const U=i(r),{absoluteZ:k}=n(M,P,C,g,s,U);return k<(p.getElevation(M,P,S,g,"ground")??0)*j+b*c?"meshUnderground":"mesh"}const m=20,a=1,c=.1,h=r();export{s as getDrawMeshHelpMessage};
