Liferay.Loader.define("layout-content-page-editor-web@2.0.169/page_editor/app/processors/BackgroundImageProcessor", ['module', 'exports', 'require', '../../core/openImageSelector'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = void 0;

    var _openImageSelector = require("../../core/openImageSelector");

    /**
     * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
     * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
     */
    function createEditor(element, changeCallback, destroyCallback) {
      (0, _openImageSelector.openImageSelector)(function (image) {
        return changeCallback(image && image.url ? image.url : '');
      }, destroyCallback);
    }

    function destroyEditor(_element) {}

    function render(element, value) {
      if (typeof value === 'string' || (value === null || value === void 0 ? void 0 : value.url)) {
        var _value$url;

        element.style.backgroundImage = "url(\"".concat((_value$url = value === null || value === void 0 ? void 0 : value.url) !== null && _value$url !== void 0 ? _value$url : value, "\")");
        element.style.backgroundSize = 'cover';
      }
    }

    var _default = {
      createEditor: createEditor,
      destroyEditor: destroyEditor,
      render: render
    };
    exports.default = _default;
    //# sourceMappingURL=BackgroundImageProcessor.js.map
  }
});
//# sourceMappingURL=BackgroundImageProcessor.js.map