text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = void 0;
  
  var _shared = require("@rpldy/shared");
  
  var _defaults = require("./defaults");
  
  var _utils = require("./utils");
  
  let bCounter = 0;
  
  const processFiles = (batchId, files, isPending, fileFilter) => Array.prototype.filter.call(files, fileFilter || _defaults.DEFAULT_FILTER).map(f => (0, _shared.createBatchItem)(f, batchId, isPending));
  
  var _default = (files, uploaderId, options) => {
    bCounter += 1;
    const id = `batch-${bCounter}`;
    const isFileList = (0, _utils.getIsFileList)(files);
    files = Array.isArray(files) || isFileList ? files : [files];
    const isPending = !options.autoUpload;
    const items = processFiles(id, files, isPending, options.fileFilter);
    return {
      id,
      uploaderId,
      items,
      state: isPending ? _shared.BATCH_STATES.PENDING : _shared.BATCH_STATES.ADDED,
      completed: 0,
      loaded: 0,
      orgItemCount: items.length
    };
  };
  
  exports.default = _default;