'use strict';

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

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

/**
 * Returns the `checkoutSettings` applied to the checkout.
 */
function useCheckoutSettings() {
  const api$1 = api.useApi();
  const extensionTarget = api$1.extension.target;
  if (!('checkoutSettings' in api$1)) {
    throw new errors.ExtensionHasNoFieldError('checkoutSettings', extensionTarget);
  }
  return subscription.useSubscription(api$1.checkoutSettings);
}

exports.useCheckoutSettings = useCheckoutSettings;
