import{a}from"./chunk-FRWNWNYJ.js";import{aasN}from"./chunk-UKWFHLUK.js";import{aast}from"./chunk-RTY3VPG6.js";import{easi}from"./chunk-LRNH5AEO.js";varr={UNSIGNED_BYTE:N.UNSIGNED_BYTE,UNSIGNED_SHORT:N.UNSIGNED_SHORT,UNSIGNED_INT:N.UNSIGNED_INT};r.getSizeInBytes=function(e){switch(e){caser.UNSIGNED_BYTE:returnUint8Array.BYTES_PER_ELEMENT;caser.UNSIGNED_SHORT:returnUint16Array.BYTES_PER_ELEMENT;caser.UNSIGNED_INT:returnUint32Array.BYTES_PER_ELEMENT}thrownewt("indexDatatype is required and must be a valid IndexDatatype constant.")};r.fromSizeInBytes=function(e){switch(e){case2:returnr.UNSIGNED_SHORT;case4:returnr.UNSIGNED_INT;case1:returnr.UNSIGNED_BYTE;default:thrownewt("Size in bytes cannot be mapped to an IndexDatatype")}};r.validate=function(e){returni(e)&&(e===r.UNSIGNED_BYTE||e===r.UNSIGNED_SHORT||e===r.UNSIGNED_INT)};r.createTypedArray=function(e,n){if(!i(e))thrownewt("numberOfVertices is required.");returne>=a.SIXTY_FOUR_KILOBYTES?newUint32Array(n):newUint16Array(n)};r.createTypedArrayFromArrayBuffer=function(e,n,E,o){if(!i(e))thrownewt("numberOfVertices is required.");if(!i(n))thrownewt("sourceArray is required.");if(!i(E))thrownewt("byteOffset is required.");returne>=a.SIXTY_FOUR_KILOBYTES?newUint32Array(n,E,o):newUint16Array(n,E,o)};r.fromTypedArray=function(e){if(einstanceofUint8Array)returnr.UNSIGNED_BYTE;if(einstanceofUint16Array)returnr.UNSIGNED_SHORT;if(einstanceofUint32Array)returnr.UNSIGNED_INT;thrownewt("array must be a Uint8Array, Uint16Array, or Uint32Array.")};varu=Object.freeze(r);export{uasa};