System.register(["__unresolved_0", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7", "__unresolved_8", "__unresolved_9", "__unresolved_10", "__unresolved_11", "__unresolved_12", "__unresolved_13", "__unresolved_14", "__unresolved_15", "__unresolved_16", "__unresolved_17", "__unresolved_18", "__unresolved_19", "__unresolved_20", "__unresolved_21", "__unresolved_22", "__unresolved_23", "__unresolved_24", "__unresolved_25", "__unresolved_26", "__unresolved_27", "__unresolved_28", "__unresolved_29", "__unresolved_30"], function (_export, _context) {
  "use strict";

  var _req, _req2, _req3, _req4, _req5, _req6, _req7, _req8, _req9, _req10, _req11, _req12, _req13, _req14, _req15, _req16, _req17, _req18, _req19, _req20, _req21, _req22, _req23, _req24, _req25, _req26, _req27, _req28, _req29, _req30, _loader, _cjsExports, __cjsMetaURL;

  _export("default", void 0);

  return {
    setters: [function (_unresolved_) {
      _req = _unresolved_.__cjsMetaURL;
    }, function (_unresolved_2) {
      _req2 = _unresolved_2.__cjsMetaURL;
    }, function (_unresolved_3) {
      _req3 = _unresolved_3.__cjsMetaURL;
    }, function (_unresolved_4) {
      _req4 = _unresolved_4.__cjsMetaURL;
    }, function (_unresolved_5) {
      _req5 = _unresolved_5.__cjsMetaURL;
    }, function (_unresolved_6) {
      _req6 = _unresolved_6.__cjsMetaURL;
    }, function (_unresolved_7) {
      _req7 = _unresolved_7.__cjsMetaURL;
    }, function (_unresolved_8) {
      _req8 = _unresolved_8.__cjsMetaURL;
    }, function (_unresolved_9) {
      _req9 = _unresolved_9.__cjsMetaURL;
    }, function (_unresolved_10) {
      _req10 = _unresolved_10.__cjsMetaURL;
    }, function (_unresolved_11) {
      _req11 = _unresolved_11.__cjsMetaURL;
    }, function (_unresolved_12) {
      _req12 = _unresolved_12.__cjsMetaURL;
    }, function (_unresolved_13) {
      _req13 = _unresolved_13.__cjsMetaURL;
    }, function (_unresolved_14) {
      _req14 = _unresolved_14.__cjsMetaURL;
    }, function (_unresolved_15) {
      _req15 = _unresolved_15.__cjsMetaURL;
    }, function (_unresolved_16) {
      _req16 = _unresolved_16.__cjsMetaURL;
    }, function (_unresolved_17) {
      _req17 = _unresolved_17.__cjsMetaURL;
    }, function (_unresolved_18) {
      _req18 = _unresolved_18.__cjsMetaURL;
    }, function (_unresolved_19) {
      _req19 = _unresolved_19.__cjsMetaURL;
    }, function (_unresolved_20) {
      _req20 = _unresolved_20.__cjsMetaURL;
    }, function (_unresolved_21) {
      _req21 = _unresolved_21.__cjsMetaURL;
    }, function (_unresolved_22) {
      _req22 = _unresolved_22.__cjsMetaURL;
    }, function (_unresolved_23) {
      _req23 = _unresolved_23.__cjsMetaURL;
    }, function (_unresolved_24) {
      _req24 = _unresolved_24.__cjsMetaURL;
    }, function (_unresolved_25) {
      _req25 = _unresolved_25.__cjsMetaURL;
    }, function (_unresolved_26) {
      _req26 = _unresolved_26.__cjsMetaURL;
    }, function (_unresolved_27) {
      _req27 = _unresolved_27.__cjsMetaURL;
    }, function (_unresolved_28) {
      _req28 = _unresolved_28.__cjsMetaURL;
    }, function (_unresolved_29) {
      _req29 = _unresolved_29.__cjsMetaURL;
    }, function (_unresolved_30) {
      _req30 = _unresolved_30.__cjsMetaURL;
    }, function (_unresolved_31) {
      _loader = _unresolved_31.default;
    }],
    execute: function () {
      _loader.define(_context.meta.url, function (exports, _require, module, __filename, __dirname) {
        let require = _loader.createRequireWithReqMap({
          "../internals/export": _req,
          "../internals/global": _req2,
          "../internals/function-call": _req3,
          "../internals/descriptors": _req4,
          "../internals/typed-array-constructors-require-wrappers": _req5,
          "../internals/array-buffer-view-core": _req6,
          "../internals/array-buffer": _req7,
          "../internals/an-instance": _req8,
          "../internals/create-property-descriptor": _req9,
          "../internals/create-non-enumerable-property": _req10,
          "../internals/is-integral-number": _req11,
          "../internals/to-length": _req12,
          "../internals/to-index": _req13,
          "../internals/to-offset": _req14,
          "../internals/to-property-key": _req15,
          "../internals/has-own-property": _req16,
          "../internals/classof": _req17,
          "../internals/is-object": _req18,
          "../internals/is-symbol": _req19,
          "../internals/object-create": _req20,
          "../internals/object-is-prototype-of": _req21,
          "../internals/object-set-prototype-of": _req22,
          "../internals/object-get-own-property-names": _req23,
          "../internals/typed-array-from": _req24,
          "../internals/array-iteration": _req25,
          "../internals/set-species": _req26,
          "../internals/object-define-property": _req27,
          "../internals/object-get-own-property-descriptor": _req28,
          "../internals/internal-state": _req29,
          "../internals/inherit-if-required": _req30
        }, _require);

        (function () {
          var $ = require('../internals/export');

          var global = require('../internals/global');

          var call = require('../internals/function-call');

          var DESCRIPTORS = require('../internals/descriptors');

          var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require('../internals/typed-array-constructors-require-wrappers');

          var ArrayBufferViewCore = require('../internals/array-buffer-view-core');

          var ArrayBufferModule = require('../internals/array-buffer');

          var anInstance = require('../internals/an-instance');

          var createPropertyDescriptor = require('../internals/create-property-descriptor');

          var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');

          var isIntegralNumber = require('../internals/is-integral-number');

          var toLength = require('../internals/to-length');

          var toIndex = require('../internals/to-index');

          var toOffset = require('../internals/to-offset');

          var toPropertyKey = require('../internals/to-property-key');

          var hasOwn = require('../internals/has-own-property');

          var classof = require('../internals/classof');

          var isObject = require('../internals/is-object');

          var isSymbol = require('../internals/is-symbol');

          var create = require('../internals/object-create');

          var isPrototypeOf = require('../internals/object-is-prototype-of');

          var setPrototypeOf = require('../internals/object-set-prototype-of');

          var getOwnPropertyNames = require('../internals/object-get-own-property-names').f;

          var typedArrayFrom = require('../internals/typed-array-from');

          var forEach = require('../internals/array-iteration').forEach;

          var setSpecies = require('../internals/set-species');

          var definePropertyModule = require('../internals/object-define-property');

          var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');

          var InternalStateModule = require('../internals/internal-state');

          var inheritIfRequired = require('../internals/inherit-if-required');

          var getInternalState = InternalStateModule.get;
          var setInternalState = InternalStateModule.set;
          var nativeDefineProperty = definePropertyModule.f;
          var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
          var round = Math.round;
          var RangeError = global.RangeError;
          var ArrayBuffer = ArrayBufferModule.ArrayBuffer;
          var ArrayBufferPrototype = ArrayBuffer.prototype;
          var DataView = ArrayBufferModule.DataView;
          var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
          var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
          var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;
          var TypedArray = ArrayBufferViewCore.TypedArray;
          var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;
          var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
          var isTypedArray = ArrayBufferViewCore.isTypedArray;
          var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
          var WRONG_LENGTH = 'Wrong length';

          var fromList = function (C, list) {
            aTypedArrayConstructor(C);
            var index = 0;
            var length = list.length;
            var result = new C(length);

            while (length > index) result[index] = list[index++];

            return result;
          };

          var addGetter = function (it, key) {
            nativeDefineProperty(it, key, {
              get: function () {
                return getInternalState(this)[key];
              }
            });
          };

          var isArrayBuffer = function (it) {
            var klass;
            return isPrototypeOf(ArrayBufferPrototype, it) || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer';
          };

          var isTypedArrayIndex = function (target, key) {
            return isTypedArray(target) && !isSymbol(key) && key in target && isIntegralNumber(+key) && key >= 0;
          };

          var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {
            key = toPropertyKey(key);
            return isTypedArrayIndex(target, key) ? createPropertyDescriptor(2, target[key]) : nativeGetOwnPropertyDescriptor(target, key);
          };

          var wrappedDefineProperty = function defineProperty(target, key, descriptor) {
            key = toPropertyKey(key);

            if (isTypedArrayIndex(target, key) && isObject(descriptor) && hasOwn(descriptor, 'value') && !hasOwn(descriptor, 'get') && !hasOwn(descriptor, 'set') // TODO: add validation descriptor w/o calling accessors
            && !descriptor.configurable && (!hasOwn(descriptor, 'writable') || descriptor.writable) && (!hasOwn(descriptor, 'enumerable') || descriptor.enumerable)) {
              target[key] = descriptor.value;
              return target;
            }

            return nativeDefineProperty(target, key, descriptor);
          };

          if (DESCRIPTORS) {
            if (!NATIVE_ARRAY_BUFFER_VIEWS) {
              getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;
              definePropertyModule.f = wrappedDefineProperty;
              addGetter(TypedArrayPrototype, 'buffer');
              addGetter(TypedArrayPrototype, 'byteOffset');
              addGetter(TypedArrayPrototype, 'byteLength');
              addGetter(TypedArrayPrototype, 'length');
            }

            $({
              target: 'Object',
              stat: true,
              forced: !NATIVE_ARRAY_BUFFER_VIEWS
            }, {
              getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,
              defineProperty: wrappedDefineProperty
            });

            module.exports = function (TYPE, wrapper, CLAMPED) {
              var BYTES = TYPE.match(/\d+$/)[0] / 8;
              var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array';
              var GETTER = 'get' + TYPE;
              var SETTER = 'set' + TYPE;
              var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME];
              var TypedArrayConstructor = NativeTypedArrayConstructor;
              var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;
              var exported = {};

              var getter = function (that, index) {
                var data = getInternalState(that);
                return data.view[GETTER](index * BYTES + data.byteOffset, true);
              };

              var setter = function (that, index, value) {
                var data = getInternalState(that);
                if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF;
                data.view[SETTER](index * BYTES + data.byteOffset, value, true);
              };

              var addElement = function (that, index) {
                nativeDefineProperty(that, index, {
                  get: function () {
                    return getter(this, index);
                  },
                  set: function (value) {
                    return setter(this, index, value);
                  },
                  enumerable: true
                });
              };

              if (!NATIVE_ARRAY_BUFFER_VIEWS) {
                TypedArrayConstructor = wrapper(function (that, data, offset, $length) {
                  anInstance(that, TypedArrayConstructorPrototype);
                  var index = 0;
                  var byteOffset = 0;
                  var buffer, byteLength, length;

                  if (!isObject(data)) {
                    length = toIndex(data);
                    byteLength = length * BYTES;
                    buffer = new ArrayBuffer(byteLength);
                  } else if (isArrayBuffer(data)) {
                    buffer = data;
                    byteOffset = toOffset(offset, BYTES);
                    var $len = data.byteLength;

                    if ($length === undefined) {
                      if ($len % BYTES) throw RangeError(WRONG_LENGTH);
                      byteLength = $len - byteOffset;
                      if (byteLength < 0) throw RangeError(WRONG_LENGTH);
                    } else {
                      byteLength = toLength($length) * BYTES;
                      if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH);
                    }

                    length = byteLength / BYTES;
                  } else if (isTypedArray(data)) {
                    return fromList(TypedArrayConstructor, data);
                  } else {
                    return call(typedArrayFrom, TypedArrayConstructor, data);
                  }

                  setInternalState(that, {
                    buffer: buffer,
                    byteOffset: byteOffset,
                    byteLength: byteLength,
                    length: length,
                    view: new DataView(buffer)
                  });

                  while (index < length) addElement(that, index++);
                });
                if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);
                TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);
              } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {
                TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) {
                  anInstance(dummy, TypedArrayConstructorPrototype);
                  return inheritIfRequired(function () {
                    if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data));
                    if (isArrayBuffer(data)) return $length !== undefined ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length) : typedArrayOffset !== undefined ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES)) : new NativeTypedArrayConstructor(data);
                    if (isTypedArray(data)) return fromList(TypedArrayConstructor, data);
                    return call(typedArrayFrom, TypedArrayConstructor, data);
                  }(), dummy, TypedArrayConstructor);
                });
                if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);
                forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) {
                  if (!(key in TypedArrayConstructor)) {
                    createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);
                  }
                });
                TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;
              }

              if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {
                createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor);
              }

              createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_CONSTRUCTOR, TypedArrayConstructor);

              if (TYPED_ARRAY_TAG) {
                createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);
              }

              exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;
              $({
                global: true,
                forced: TypedArrayConstructor != NativeTypedArrayConstructor,
                sham: !NATIVE_ARRAY_BUFFER_VIEWS
              }, exported);

              if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {
                createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);
              }

              if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {
                createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);
              }

              setSpecies(CONSTRUCTOR_NAME);
            };
          } else module.exports = function () {
            /* empty */
          };
        })();

        _export("default", _cjsExports = module.exports);
      });

      _export("__cjsMetaURL", __cjsMetaURL = _context.meta.url);
    }
  };
});
//# sourceMappingURL=typed-array-constructor.js.map