/*eslint-disable */
define(["Magento_PageBuilder/js/config", "Magento_PageBuilder/js/utils/object"], function (_config, _object) {
    /**
     * Copyright © Magento, Inc. All rights reserved.
     * See COPYING.txt for license details.
     */

    /**
     * @api
     */
    var ThreesixtyImages =
        /*#__PURE__*/
        function () {
            "use strict";

            function ThreesixtyImages() {
            }

            var _proto = ThreesixtyImages.prototype;

            /**
             * Convert value to internal format
             *
             * @param value string
             * @returns {string | object}
             */
            _proto.fromDom = function fromDom(value) {
                if (!value) {
                    return "";
                }

                var returnObj = {};
                returnObj.threesixty_images = JSON.parse(value);

                return returnObj;
            }
            /**
             * Convert value to knockout format
             *
             * @param {string} name
             * @param {DataObject} data
             * @returns {string}
             */
            ;

            _proto.toDom = function toDom(name, data) {
                var value = (0, _object.get)(data, name);

                if (!value || !value.threesixty_images){
                    return "";
                }

                value.threesixty_images.forEach(function(record){
                    record.single_image[0].storefront_path = 'wysiwyg/' + record.single_image[0].name;
                })

                return JSON.stringify(value.threesixty_images);
            };

            return ThreesixtyImages;
        }();

    return ThreesixtyImages;
});
//# sourceMappingURL=src.js.map
