"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.votingBalances = votingBalances;

var _rxjs = require("rxjs");

var _drr = require("../util/drr");

var _all = require("./all");

// Copyright 2017-2019 @polkadot/api-derive authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
function votingBalances(api) {
  return addresses => {
    return (!addresses || !addresses.length ? (0, _rxjs.of)([]) : (0, _rxjs.combineLatest)(addresses.map((0, _all.all)(api)))).pipe((0, _drr.drr)());
  };
}