{"version":3,"file":"byteLength.mjs","sources":["../../../../../../../src/providers/s3/apis/internal/uploadData/byteLength.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Calculate the total size of the data to be uploaded. The total size is not required for multipart upload, as it's\n * only used in progress report.\n */\nexport const byteLength = (input) => {\n    if (input === null || input === undefined)\n        return 0;\n    if (typeof input === 'string') {\n        const blob = new Blob([input]);\n        return blob.size;\n    }\n    else if (typeof input.byteLength === 'number') {\n        // handles Uint8Array, ArrayBuffer, Buffer, and ArrayBufferView\n        return input.byteLength;\n    }\n    else if (typeof input.size === 'number') {\n        // handles browser File object\n        return input.size;\n    }\n    return undefined;\n};\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,UAAU,GAAG,CAAC,KAAK,KAAK;AACrC,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;AAC7C,QAAQ,OAAO,CAAC;AAChB,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,QAAQ,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;AACtC,QAAQ,OAAO,IAAI,CAAC,IAAI;AACxB,IAAI;AACJ,SAAS,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,QAAQ,EAAE;AACnD;AACA,QAAQ,OAAO,KAAK,CAAC,UAAU;AAC/B,IAAI;AACJ,SAAS,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;AAC7C;AACA,QAAQ,OAAO,KAAK,CAAC,IAAI;AACzB,IAAI;AACJ,IAAI,OAAO,SAAS;AACpB;;;;"}