'use strict';

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

exports.default = configContext => data => {
  var _configContext$record = configContext.recordDataHelpers;
  const getPart = _configContext$record.getPart,
        deepGet = _configContext$record.deepGet;
  const getDisplayName = configContext.refNameHelpers.getDisplayName;


  if (!data) {
    return '';
  }

  const common = getPart(data, 'acquisitions_common');

  if (!common) {
    return '';
  }

  const acquisitionReferenceNumber = common.get('acquisitionReferenceNumber');
  const acquisitionSource = getDisplayName(deepGet(common, ['acquisitionSources', 'acquisitionSource', 0]));

  return [acquisitionReferenceNumber, acquisitionSource].filter(part => !!part).join(' – ');
};