/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../chunks/vec3","../chunks/vec4"],(function(t,n,e){"use strict";const r=new Float32Array(1);function a(t){--t;for(let n=1;n<32;n<<=1)t|=t>>n;return t+1}function o(t,n,e){return Math.min(Math.max(t,n),e)}function u(t,n){return 0===n?0:Math.round(t/n)*n}function i(t){return 0==(t&t-1)}function c(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}function s(t){return 10**Math.ceil(Math.LOG10E*Math.log(t))}function f(t,n,e){return t+(n-t)*e}function h(t,n,e,r,a){return f(r,a,(t-n)/(e-n))}function l(t){return t*Math.PI/180}function M(t){return 180*t/Math.PI}function p(t,n=1e-6){return(t<0?-1:1)/Math.max(Math.abs(t),n)}function d(t){return Math.acos(o(t,-1,1))}function m(t){return Math.asin(o(t,-1,1))}function N(t,n,e=1e-6){if(isNaN(t)||isNaN(n))return!1;if(t===n)return!0;const r=Math.abs(t-n),a=Math.abs(t),o=Math.abs(n);if(0===t||0===n||a<1e-12&&o<1e-12){if(r>.01*e)return!1}else if(r/(a+o)>e)return!1;return!0}function g(t,n,e=1e-6){if(isNaN(t)||isNaN(n))return!1;return(t>n?t-n:n-t)<=e}function T(t){return w(Math.max(-A,Math.min(t,A)))}function w(t){return r[0]=t,r[0]}function O(t,n){return n<t?0:1}function b(t,n,e){const r=o((e-t)/(n-t),0,1);return r*r*(3-2*r)}function x(t,e){const r=n.length(t),a=m(t[2]/r),o=Math.atan2(t[1]/r,t[0]/r);return n.set(e,r,a,o),e}function P(t,e){const r=t[0],a=t[1],o=t[2],u=Math.cos(a);n.set(e,r*u*Math.cos(o),r*u*Math.sin(o),r*Math.sin(a))}function v(t,n,r){return e.set(t,n[0],n[1],n[2],n[3]*r)}function y(t){const n=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],e=t[3]*t[3]+t[4]*t[4]+t[5]*t[5],r=t[6]*t[6]+t[7]*t[7]+t[8]*t[8];return!(g(n,1)&&g(e,1)&&g(r,1))}const A=w(34028234663852886e22);t.NUMBER_MAX_FLOAT32=A,t.acosClamped=d,t.applyOpacity=v,t.asinClamped=m,t.cartesianToSpherical=x,t.clamp=o,t.clampFloat32=T,t.deg2rad=l,t.floatEqualAbsolute=g,t.floatEqualRelative=N,t.hasScaling=y,t.isPowerOfTwo=i,t.lerp=f,t.nextHighestPowerOfTen=s,t.nextHighestPowerOfTwo=a,t.nextPowerOfTwo=c,t.rad2deg=M,t.reciprocalClamped=p,t.roundToNearest=u,t.scale=h,t.smoothstep=b,t.sphericalToCartesian=P,t.step=O,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
