/* 2020-9-22 15:23:25 | 版权所有 军懋国兴  */
define(["exports","./when-cbf8cd21","./Check-35e1a91d","./Math-69007a69","./WebGLConstants-95ceb4e9"],function(e,a,i,E,r){"use strict";var t={UNSIGNED_BYTE:r.WebGLConstants.UNSIGNED_BYTE,UNSIGNED_SHORT:r.WebGLConstants.UNSIGNED_SHORT,UNSIGNED_INT:r.WebGLConstants.UNSIGNED_INT,getSizeInBytes:function(e){switch(e){case t.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case t.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case t.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new i.DeveloperError("indexDatatype is required and must be a valid IndexDatatype constant.")},fromSizeInBytes:function(e){switch(e){case 2:return t.UNSIGNED_SHORT;case 4:return t.UNSIGNED_INT;case 1:return t.UNSIGNED_BYTE;default:throw new i.DeveloperError("Size in bytes cannot be mapped to an IndexDatatype")}},validate:function(e){return a.defined(e)&&(e===t.UNSIGNED_BYTE||e===t.UNSIGNED_SHORT||e===t.UNSIGNED_INT)},createTypedArray:function(e,r){if(!a.defined(e))throw new i.DeveloperError("numberOfVertices is required.");return new(e>=E.CesiumMath.SIXTY_FOUR_KILOBYTES?Uint32Array:Uint16Array)(r)},createTypedArrayFromArrayBuffer:function(e,r,t,n){if(!a.defined(e))throw new i.DeveloperError("numberOfVertices is required.");if(!a.defined(r))throw new i.DeveloperError("sourceArray is required.");if(!a.defined(t))throw new i.DeveloperError("byteOffset is required.");return new(e>=E.CesiumMath.SIXTY_FOUR_KILOBYTES?Uint32Array:Uint16Array)(r,t,n)}},n=Object.freeze(t);e.IndexDatatype=n});