'use strict';

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

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

/**
 * Returns the `Shop` where the checkout is taking place.
 */
function useShop() {
  const api$1 = api.useApi();
  const extensionTarget = api$1.extension.target;
  if (!('shop' in api$1)) {
    throw new errors.ExtensionHasNoFieldError('shop', extensionTarget);
  }
  return api$1.shop;
}

exports.useShop = useShop;
