'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 current gift cards applied to the cart, and automatically re-renders
 * your component if gift cards are added or removed.
 */
function useAppliedGiftCards() {
  const api$1 = api.useApi();
  const extensionTarget = api$1.extension.target;
  if (!('appliedGiftCards' in api$1)) {
    throw new errors.ExtensionHasNoFieldError('appliedGiftCards', extensionTarget);
  }
  return subscription.useSubscription(api$1.appliedGiftCards);
}

exports.useAppliedGiftCards = useAppliedGiftCards;
