/*! bxs-vue-ui v3.3.0 */
'use strict';

var entryVirtual = require('./entry-virtual.js');
var normalizeComponent = require('./normalize-component.js');

var SPECIES = normalizeComponent.wellKnownSymbol$1('species');
var nativeSlice = [].slice;
var max = Math.max;

// `Array.prototype.slice` method
// https://tc39.github.io/ecma262/#sec-array.prototype.slice
// fallback for not array-like ES3 strings and DOM objects
entryVirtual.$({ target: 'Array', proto: true, forced: !normalizeComponent.arrayMethodHasSpeciesSupport('slice') }, {
  slice: function slice(start, end) {
    var O = entryVirtual.toIndexedObject(this);
    var length = entryVirtual.toLength(O.length);
    var k = entryVirtual.toAbsoluteIndex(start, length);
    var fin = entryVirtual.toAbsoluteIndex(end === undefined ? length : end, length);
    // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
    var Constructor, result, n;
    if (normalizeComponent.isArray(O)) {
      Constructor = O.constructor;
      // cross-realm fallback
      if (typeof Constructor == 'function' && (Constructor === Array || normalizeComponent.isArray(Constructor.prototype))) {
        Constructor = undefined;
      } else if (entryVirtual.isObject(Constructor)) {
        Constructor = Constructor[SPECIES];
        if (Constructor === null) Constructor = undefined;
      }
      if (Constructor === Array || Constructor === undefined) {
        return nativeSlice.call(O, k, fin);
      }
    }
    result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
    for (n = 0; k < fin; k++, n++) if (k in O) normalizeComponent.createProperty(result, n, O[k]);
    result.length = n;
    return result;
  }
});

var slice = entryVirtual.entryVirtual('Array').slice;

var ArrayPrototype = Array.prototype;

var slice_1 = function (it) {
  var own = it.slice;
  return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.slice) ? slice : own;
};

var slice$1 = slice_1;

var slice$2 = slice$1;

exports._sliceInstanceProperty = slice$2;
