'use strict';

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

var api = require('./api.js');
var subscription = require('./subscription.js');

/**
 * Returns the current authenticated `Customer`.
 *
 * The value is `undefined` if the customer isn't authenticated.
 */
function useAuthenticatedAccountCustomer() {
  const account = api.useApi().authenticatedAccount;
  return subscription.useSubscription(account.customer);
}

/**
 * Provides information about the company of the authenticated business customer.
 * The value is `undefined` if a business customer isn't authenticated.
 */
function useAuthenticatedAccountPurchasingCompany() {
  const account = api.useApi().authenticatedAccount;
  return subscription.useSubscription(account.purchasingCompany);
}

exports.useAuthenticatedAccountCustomer = useAuthenticatedAccountCustomer;
exports.useAuthenticatedAccountPurchasingCompany = useAuthenticatedAccountPurchasingCompany;
