Liferay.Loader.define("dynamic-data-mapping-form-renderer@5.0.35/js/hooks/useResource.es", ['module', 'exports', 'require', '@frontend-taglib-clay$clayui/data-provider', 'frontend-js-web', './useStorage.es'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.useFieldTypesResource = void 0;

    var _dataProvider = require("@frontend-taglib-clay$clayui/data-provider");

    var _frontendJsWeb = require("frontend-js-web");

    var _useStorage = require("./useStorage.es");

    /**
     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
     *
     * This library is free software; you can redistribute it and/or modify it under
     * the terms of the GNU Lesser General Public License as published by the Free
     * Software Foundation; either version 2.1 of the License, or (at your option)
     * any later version.
     *
     * This library is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
     * details.
     */
    var ENDPOINT_FIELD_TYPES = "".concat(window.location.origin).concat(themeDisplay.getPathContext(), "/o/dynamic-data-mapping-form-field-types");
    var HEADERS = {
      Accept: 'application/json',
      'Accept-Language': Liferay.ThemeDisplay.getBCP47LanguageId(),
      'Content-Type': 'application/json'
    };

    var useFieldTypesResource = function useFieldTypesResource() {
      var storage = (0, _useStorage.useStorage)();
      return (0, _dataProvider.useResource)({
        fetch: function fetch(url, options) {
          return (0, _frontendJsWeb.fetch)(url, options).then(function (res) {
            return res.json();
          });
        },
        fetchOptions: {
          headers: HEADERS
        },
        fetchPolicy: 'cache-first',
        link: ENDPOINT_FIELD_TYPES,
        storage: storage,
        variables: {
          p_auth: Liferay.authToken
        }
      });
    };

    exports.useFieldTypesResource = useFieldTypesResource;
    //# sourceMappingURL=useResource.es.js.map
  }
});
//# sourceMappingURL=useResource.es.js.map