Liferay.Loader.define("frontend-image-editor-web@4.0.37/ImageEditor.soy", ['module', 'exports', 'require', 'frontend-js-metal-web$metal-component', 'frontend-js-metal-web$metal-soy'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = exports.templates = exports.ImageEditor = void 0;

    var _metalComponent = _interopRequireDefault(require("frontend-js-metal-web$metal-component"));

    var _metalSoy = _interopRequireDefault(require("frontend-js-metal-web$metal-soy"));

    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }

    function _typeof(obj) {
      "@babel/helpers - typeof";
      if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
        _typeof = function _typeof(obj) {
          return typeof obj;
        };
      } else {
        _typeof = function _typeof(obj) {
          return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
        };
      }return _typeof(obj);
    }

    function _classCallCheck(instance, Constructor) {
      if (!(instance instanceof Constructor)) {
        throw new TypeError("Cannot call a class as a function");
      }
    }

    function _possibleConstructorReturn(self, call) {
      if (call && (_typeof(call) === "object" || typeof call === "function")) {
        return call;
      }return _assertThisInitialized(self);
    }

    function _assertThisInitialized(self) {
      if (self === void 0) {
        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      }return self;
    }

    function _getPrototypeOf(o) {
      _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
        return o.__proto__ || Object.getPrototypeOf(o);
      };return _getPrototypeOf(o);
    }

    function _inherits(subClass, superClass) {
      if (typeof superClass !== "function" && superClass !== null) {
        throw new TypeError("Super expression must either be null or a function");
      }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });if (superClass) _setPrototypeOf(subClass, superClass);
    }

    function _setPrototypeOf(o, p) {
      _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
        o.__proto__ = p;return o;
      };return _setPrototypeOf(o, p);
    }

    var templates;
    exports.templates = templates;
    goog.loadModule(function (exports) {
      var soy = goog.require('soy');

      goog.require('soydata');

      // This file was automatically generated from ImageEditor.soy.
      // Please don't edit this file by hand.

      /**
       * @fileoverview Templates in namespace ImageEditor.
       * @hassoydeltemplate {ImageEditor.Controls.idom}
       * @hassoydelcall {ImageEditor.Controls.idom}
       * @public
       */

      goog.module('ImageEditor.incrementaldom');

      goog.require('goog.string');

      var incrementalDom = goog.require('incrementaldom');

      goog.require('soy');

      goog.require('soy.idom');

      var $templateAlias2 = _metalSoy.default.getTemplate('ClayDropdown.incrementaldom', 'render');

      var $templateAlias1 = _metalSoy.default.getTemplate('ImageEditorLoading.incrementaldom', 'render');
      /**
       * @param {Object<string, *>=} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */

      function $render(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        var msg_13536__soy13537 = '';
        /** @desc  */

        var MSG_EXTERNAL_4331754503736418405 = Liferay.Language.get('redo');
        msg_13536__soy13537 += goog.string.unescapeEntities(MSG_EXTERNAL_4331754503736418405);
        var msg_13533__soy13534 = '';
        /** @desc  */

        var MSG_EXTERNAL_3347932678307141902 = Liferay.Language.get('restore');
        msg_13533__soy13534 += goog.string.unescapeEntities(MSG_EXTERNAL_3347932678307141902);
        var msg_13530__soy13531 = '';
        /** @desc  */

        var MSG_EXTERNAL_4529258443538479124 = Liferay.Language.get('undo');
        msg_13530__soy13531 += goog.string.unescapeEntities(MSG_EXTERNAL_4529258443538479124);
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('id', opt_data.id);
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'dialog-body');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'lfr-image-editor-image-container');
        incrementalDom.attr('id', opt_data.id + 'ImageContainer');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('img');
        incrementalDom.attr('class', 'hide img-responsive');
        incrementalDom.attr('src', opt_data.image);
        incrementalDom.elementOpenEnd();
        incrementalDom.elementClose('img');
        incrementalDom.elementOpenStart('canvas');
        incrementalDom.attr('class', 'fade ' + (opt_data.imageEditorReady ? 'in' : '') + ' image-preview');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementClose('canvas');
        $templateAlias1(soy.$$assignDefaults({
          ref: 'loading'
        }, opt_data), null, opt_ijData);
        incrementalDom.elementClose('div');
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'fade ' + (opt_data.imageEditorReady ? 'in' : '') + ' lfr-image-editor-tools-container');
        incrementalDom.elementOpenEnd();
        $tools(opt_data, null, opt_ijData);
        incrementalDom.elementClose('div');
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'fade ' + (opt_data.imageEditorReady && !opt_data.selectedTool ? 'in' : '') + ' lfr-image-editor-history-container');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'btn-group');
        incrementalDom.attr('role', 'group');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('a');
        incrementalDom.attr('class', 'btn btn-link btn-monospaced ' + (opt_data.history && opt_data.history.canUndo ? '' : 'disabled'));
        incrementalDom.attr('data-onclick', 'undo');
        incrementalDom.attr('href', 'javascript:;');
        incrementalDom.attr('title', msg_13530__soy13531);
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('svg');
        incrementalDom.attr('class', 'lexicon-icon');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('use');
        incrementalDom.attr('xlink:href', opt_data.pathThemeImages + '/clay/icons.svg#angle-left');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementClose('use');
        incrementalDom.elementClose('svg');
        incrementalDom.elementClose('a');
        incrementalDom.elementOpenStart('a');
        incrementalDom.attr('class', 'btn btn-link btn-monospaced ' + (opt_data.history && opt_data.history.canReset ? '' : 'disabled'));
        incrementalDom.attr('data-onclick', 'reset');
        incrementalDom.attr('href', 'javascript:;');
        incrementalDom.attr('title', msg_13533__soy13534);
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('svg');
        incrementalDom.attr('class', 'lexicon-icon');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('use');
        incrementalDom.attr('xlink:href', opt_data.pathThemeImages + '/clay/icons.svg#restore');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementClose('use');
        incrementalDom.elementClose('svg');
        incrementalDom.elementClose('a');
        incrementalDom.elementOpenStart('a');
        incrementalDom.attr('class', 'btn btn-link btn-monospaced ' + (opt_data.history && opt_data.history.canRedo ? '' : 'disabled'));
        incrementalDom.attr('data-onclick', 'redo');
        incrementalDom.attr('href', 'javascript:;');
        incrementalDom.attr('title', msg_13536__soy13537);
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('svg');
        incrementalDom.attr('class', 'lexicon-icon');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('use');
        incrementalDom.attr('xlink:href', opt_data.pathThemeImages + '/clay/icons.svg#angle-right');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementClose('use');
        incrementalDom.elementClose('svg');
        incrementalDom.elementClose('a');
        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'button-holder dialog-footer');
        incrementalDom.elementOpenEnd();
        var hasChanges__soy732 = opt_data.history && opt_data.history.canUndo;

        incrementalDom.elementOpenStart('button');
        (function saveButtonAttributes__soy734() {
          incrementalDom.attr('class', 'btn btn-primary ' + (hasChanges__soy732 ? '' : 'disabled'));
          incrementalDom.attr('data-onclick', 'save_');

          if (!hasChanges__soy732) {
            incrementalDom.attr('disabled', 'disabled');
          }
        })();
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('span');
        incrementalDom.attr('class', 'lfr-btn-label');
        incrementalDom.elementOpenEnd();
        /** @desc  */

        var MSG_EXTERNAL_8640257554156088424 = Liferay.Language.get('save');
        incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_8640257554156088424));
        incrementalDom.elementClose('span');
        incrementalDom.elementClose('button');
        incrementalDom.elementOpenStart('button');
        incrementalDom.attr('class', 'btn btn-cancel btn-link');
        incrementalDom.attr('data-onclick', 'close_');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('span');
        incrementalDom.attr('class', 'lfr-btn-label');
        incrementalDom.elementOpenEnd();
        /** @desc  */

        var MSG_EXTERNAL_503445309622982213 = Liferay.Language.get('cancel');
        incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_503445309622982213));
        incrementalDom.elementClose('span');
        incrementalDom.elementClose('button');
        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');
      }

      exports.render = $render;

      if (goog.DEBUG) {
        $render.soyTemplateName = 'ImageEditor.render';
      }
      /**
       * @param {Object<string, *>=} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */

      function $tools(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'controls pt-2 text-center');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('ul');
        incrementalDom.attr('class', 'd-flex justify-content-center list-inline');
        incrementalDom.elementOpenEnd();
        var tool763List = opt_data.imageEditorCapabilities.tools;
        var tool763ListLen = tool763List.length;

        for (var tool763Index = 0; tool763Index < tool763ListLen; tool763Index++) {
          var tool763Data = tool763List[tool763Index];
          incrementalDom.elementOpenStart('li');
          incrementalDom.attr('class', opt_data.selectedTool == 'tool-' + tool763Index ? 'open' : '');
          incrementalDom.elementOpenEnd();
          $tool(soy.$$assignDefaults({
            tool: tool763Data,
            toolIndex: tool763Index
          }, opt_data), null, opt_ijData);
          incrementalDom.elementClose('li');
        }

        incrementalDom.elementClose('ul');
        incrementalDom.elementClose('div');
      }

      exports.tools = $tools;

      if (goog.DEBUG) {
        $tools.soyTemplateName = 'ImageEditor.tools';
      }
      /**
       * @param {Object<string, *>=} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */

      function $tool(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;

        if (opt_data.tool.controls.length > 1) {
          $tool_dropdown(opt_data, null, opt_ijData);
        } else {
          var control__soy776 = opt_data.tool.controls[0];
          incrementalDom.elementOpenStart('a');
          incrementalDom.attr('class', 'btn btn-monospaced');
          incrementalDom.attr('data-control', control__soy776.variant);
          incrementalDom.attr('data-onclick', 'requestImageEditorEditFilters');
          incrementalDom.attr('data-tool', 'tool-' + opt_data.toolIndex);
          incrementalDom.attr('href', 'javascript:;');
          incrementalDom.attr('title', opt_data.tool.title);
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('svg');
          incrementalDom.attr('class', 'lexicon-icon');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('use');
          incrementalDom.attr('xlink:href', opt_data.pathThemeImages + '/clay/icons.svg#' + opt_data.tool.icon);
          incrementalDom.elementOpenEnd();
          incrementalDom.elementClose('use');
          incrementalDom.elementClose('svg');
          incrementalDom.elementClose('a');
          $tool_control(soy.$$assignDefaults({
            control: control__soy776
          }, opt_data), null, opt_ijData);
        }
      }

      exports.tool = $tool;

      if (goog.DEBUG) {
        $tool.soyTemplateName = 'ImageEditor.tool';
      }
      /**
       * @param {Object<string, *>=} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */

      function $tool_dropdown(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        $templateAlias2({
          contentRenderer: 'item',
          data: {
            tool: 'tool-' + opt_data.toolIndex
          },
          events: {
            itemClicked: opt_data.requestImageEditorEdit
          },
          icon: opt_data.tool.icon,
          items: opt_data.tool.controls,
          preferredAlign: 'TopCenter',
          spritemap: opt_data.pathThemeImages + '/clay/icons.svg',
          style: 'link',
          triggerTitle: opt_data.tool.title,
          triggerClasses: 'btn btn-monospaced'
        }, null, opt_ijData);
        var control810List = opt_data.tool.controls;
        var control810ListLen = control810List.length;

        for (var control810Index = 0; control810Index < control810ListLen; control810Index++) {
          var control810Data = control810List[control810Index];
          $tool_control(soy.$$assignDefaults({
            control: control810Data
          }, opt_data), null, opt_ijData);
        }
      }

      exports.tool_dropdown = $tool_dropdown;

      if (goog.DEBUG) {
        $tool_dropdown.soyTemplateName = 'ImageEditor.tool_dropdown';
      }
      /**
       * @param {Object<string, *>=} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */

      function $tool_control(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'controls-container d-flex ' + (opt_data.selectedControl && opt_data.selectedControl.label == opt_data.control.label ? 'open' : ''));
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'col-3 col-md-2 mt-4');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('button');
        incrementalDom.attr('class', 'btn btn-link');
        incrementalDom.attr('data-onclick', 'accept');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('span');
        incrementalDom.attr('class', 'd-none d-sm-block');
        incrementalDom.elementOpenEnd();
        /** @desc  */

        var MSG_EXTERNAL_5695415716487602348 = Liferay.Language.get('apply');
        incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_5695415716487602348));
        incrementalDom.elementClose('span');
        incrementalDom.elementOpenStart('svg');
        incrementalDom.attr('class', 'd-sm-none lexicon-icon');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('use');
        incrementalDom.attr('xlink:href', opt_data.pathThemeImages + '/clay/icons.svg#check');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementClose('use');
        incrementalDom.elementClose('svg');
        incrementalDom.elementClose('button');
        incrementalDom.elementClose('div');
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'col-6 col-md-8 pt-sm-2 tool-controls');
        incrementalDom.elementOpenEnd();

        if (opt_data.selectedControl && opt_data.selectedControl.label == opt_data.control.label) {
          $active_controls(soy.$$assignDefaults({
            modulePath: opt_data.control.modulePath,
            variant: opt_data.control.variant
          }, opt_data), null, opt_ijData);
        }

        incrementalDom.elementClose('div');
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'col-3 col-md-2 mt-4');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('button');
        incrementalDom.attr('class', 'btn btn-link');
        incrementalDom.attr('data-onclick', 'discard');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('span');
        incrementalDom.attr('class', 'd-none d-sm-block');
        incrementalDom.elementOpenEnd();
        /** @desc  */

        var MSG_EXTERNAL_503445309622982213 = Liferay.Language.get('cancel');
        incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_503445309622982213));
        incrementalDom.elementClose('span');
        incrementalDom.elementOpenStart('svg');
        incrementalDom.attr('class', 'd-sm-none lexicon-icon');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('use');
        incrementalDom.attr('xlink:href', opt_data.pathThemeImages + '/clay/icons.svg#times');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementClose('use');
        incrementalDom.elementClose('svg');
        incrementalDom.elementClose('button');
        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');
      }

      exports.tool_control = $tool_control;

      if (goog.DEBUG) {
        $tool_control.soyTemplateName = 'ImageEditor.tool_control';
      }
      /**
       * @param {Object<string, *>=} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */

      function $active_controls(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        soy.$$getDelegateFn(soy.$$getDelTemplateId('ImageEditor.Controls.idom'), opt_data.variant, true)(soy.$$assignDefaults({
          ref: opt_data.id + '_selected_control_' + opt_data.variant
        }, opt_data), null, opt_ijData);
      }

      exports.active_controls = $active_controls;

      if (goog.DEBUG) {
        $active_controls.soyTemplateName = 'ImageEditor.active_controls';
      }
      /**
       * @param {Object<string, *>=} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */

      function __deltemplate_s843_266044fb(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
      }

      exports.__deltemplate_s843_266044fb = __deltemplate_s843_266044fb;

      if (goog.DEBUG) {
        __deltemplate_s843_266044fb.soyTemplateName = 'ImageEditor.__deltemplate_s843_266044fb';
      }

      soy.$$registerDelegateFn(soy.$$getDelTemplateId('ImageEditor.Controls.idom'), '', 0, __deltemplate_s843_266044fb);
      exports.render.params = ["history", "id", "image", "imageEditorCapabilities", "imageEditorReady", "pathThemeImages", "selectedControl", "selectedTool", "getImageEditorCanvas", "getImageEditorImageData", "requestImageEditorEdit", "requestImageEditorEditFilters", "requestImageEditorPreview"];
      exports.render.types = {
        "history": "any",
        "id": "any",
        "image": "any",
        "imageEditorCapabilities": "any",
        "imageEditorReady": "any",
        "pathThemeImages": "any",
        "selectedControl": "any",
        "selectedTool": "any",
        "getImageEditorCanvas": "any",
        "getImageEditorImageData": "any",
        "requestImageEditorEdit": "any",
        "requestImageEditorEditFilters": "any",
        "requestImageEditorPreview": "any"
      };
      exports.tools.params = ["imageEditorCapabilities", "selectedTool"];
      exports.tools.types = {
        "imageEditorCapabilities": "any",
        "selectedTool": "any"
      };
      exports.tool.params = ["pathThemeImages", "tool", "toolIndex"];
      exports.tool.types = {
        "pathThemeImages": "any",
        "tool": "any",
        "toolIndex": "any"
      };
      exports.tool_dropdown.params = ["pathThemeImages", "requestImageEditorEdit", "tool", "toolIndex"];
      exports.tool_dropdown.types = {
        "pathThemeImages": "any",
        "requestImageEditorEdit": "any",
        "tool": "any",
        "toolIndex": "any"
      };
      exports.tool_control.params = ["control", "pathThemeImages", "selectedControl"];
      exports.tool_control.types = {
        "control": "any",
        "pathThemeImages": "any",
        "selectedControl": "any"
      };
      exports.active_controls.params = ["id", "variant"];
      exports.active_controls.types = {
        "id": "any",
        "variant": "any"
      };
      exports.templates = templates = exports;
      return exports;
    });

    var ImageEditor = /*#__PURE__*/function (_Component) {
      _inherits(ImageEditor, _Component);

      function ImageEditor() {
        _classCallCheck(this, ImageEditor);

        return _possibleConstructorReturn(this, _getPrototypeOf(ImageEditor).apply(this, arguments));
      }

      return ImageEditor;
    }(_metalComponent.default);

    exports.ImageEditor = ImageEditor;

    _metalSoy.default.register(ImageEditor, templates);

    var _default = templates;
    /* jshint ignore:end */

    exports.default = _default;
    //# sourceMappingURL=ImageEditor.soy.js.map
  }
});
//# sourceMappingURL=ImageEditor.soy.js.map