import { c, n, r as r2 } from "./chunk-RWQH5X3O.js"; import { r, t } from "./chunk-YXWMMD76.js"; // node_modules/@arcgis/core/views/webgl/capabilities.js var n2; var a; function l(t2) { const e = n(t2); for (; e.length > 1; ) { const t3 = u(e.shift()); if (t3.available) return t3; } return u(e.shift()); } function u(t2) { switch (t2) { case r2.WEBGL1: return i(); case r2.WEBGL2: return f(); } } function i() { return n2 || (n2 = d()), n2; } function f() { return a || (a = x()), a; } var p = class { constructor() { this.available = false, this.majorPerformanceCaveat = false, this.maxTextureSize = 0, this.supportsVertexShaderSamplers = false, this.supportsHighPrecisionFragment = false, this.supportsElementIndexUint = false, this.supportsStandardDerivatives = false, this.supportsInstancedArrays = false, this.supportsTextureFloat = false, this.supportsTextureHalfFloat = false, this.supportsColorBufferFloat = false, this.supportsColorBufferFloatBlend = false, this.supportsColorBufferHalfFloat = false; } }; var c2 = class extends p { constructor() { super(...arguments), this.type = r2.WEBGL1; } }; var E = class extends p { constructor() { super(...arguments), this.type = r2.WEBGL2, this.supportsElementIndexUint = true, this.supportsStandardDerivatives = true, this.supportsInstancedArrays = true, this.supportsTextureFloat = true, this.supportsTextureHalfFloat = true; } }; function _(r3, n3) { var _a; if (r3 === r2.WEBGL1 && "undefined" == typeof WebGLRenderingContext || r3 === r2.WEBGL2 && "undefined" == typeof WebGL2RenderingContext) return null; const a2 = document.createElement("canvas"); if (!a2) return null; let l2 = c(a2, r3, { failIfMajorPerformanceCaveat: true }); if (t(l2) && (l2 = c(a2, r3), r(l2) && (n3.majorPerformanceCaveat = true)), t(l2)) return l2; if (r3 === r2.WEBGL1) { const t2 = (_a = l2.getParameter(l2.VERSION)) == null ? void 0 : _a.match(/^WebGL\s+([\d.]*)/); if (t2) { const e = parseFloat(t2[1]); n3.available = e >= 0.94; } } else n3.available = true; n3.maxTextureSize = l2.getParameter(l2.MAX_TEXTURE_SIZE), n3.supportsVertexShaderSamplers = l2.getParameter(l2.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0; const u2 = l2.getShaderPrecisionFormat(l2.FRAGMENT_SHADER, l2.HIGH_FLOAT); return u2 && (n3.supportsHighPrecisionFragment = u2.precision > 0), l2; } function d() { const e = new c2(), r3 = _(r2.WEBGL1, e); return t(r3) || (e.supportsElementIndexUint = null !== r3.getExtension("OES_element_index_uint"), e.supportsStandardDerivatives = null !== r3.getExtension("OES_standard_derivatives"), e.supportsInstancedArrays = null !== r3.getExtension("ANGLE_instanced_arrays"), e.supportsTextureFloat = null !== r3.getExtension("OES_texture_float"), e.supportsTextureHalfFloat = null !== r3.getExtension("OES_texture_half_float"), e.supportsColorBufferFloat = null !== r3.getExtension("WEBGL_color_buffer_float"), e.supportsColorBufferFloatBlend = null !== r3.getExtension("EXT_float_blend"), e.supportsColorBufferHalfFloat = null !== r3.getExtension("EXT_color_buffer_half_float")), e; } function x() { const e = new E(), r3 = _(r2.WEBGL2, e); return t(r3) || (e.supportsColorBufferFloat = null !== r3.getExtension("EXT_color_buffer_float"), e.supportsColorBufferFloatBlend = null !== r3.getExtension("EXT_float_blend"), e.supportsColorBufferHalfFloat = e.supportsColorBufferFloat || null !== r3.getExtension("EXT_color_buffer_half_float")), e; } export { l }; //# sourceMappingURL=chunk-YFDOPEEZ.js.map