Liferay.Loader.define("layout-seo-web@1.0.53/js/seo/seo.es", ['module', 'exports', 'require', 'frontend-js-web', './PreviewSeoEvents.es'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = _default;

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

    var _PreviewSeoEvents = require("./PreviewSeoEvents.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.
     */
    function _default(_ref) {
      var namespace = _ref.namespace;
      var canonicalURLEnabledCheck = document.getElementById("".concat(namespace, "canonicalURLEnabled"));
      var canonicalURLField = document.getElementById("".concat(namespace, "canonicalURL"));
      var canonicalURLFieldDefaultLocale = document.getElementById("".concat(namespace, "canonicalURL_").concat(Liferay.ThemeDisplay.getLanguageId()));
      var canonicalURLAlert = document.getElementById("".concat(namespace, "canonicalURLAlert"));
      canonicalURLEnabledCheck.addEventListener('click', function (event) {
        var disabled = !event.target.checked;
        canonicalURLAlert.classList.toggle('hide');
        (0, _frontendJsWeb.toggleDisabled)(canonicalURLField, disabled);
        (0, _frontendJsWeb.toggleDisabled)(canonicalURLFieldDefaultLocale, disabled);
        (0, _PreviewSeoEvents.previewSeoFireChange)(namespace, {
          disabled: disabled,
          type: 'url',
          value: canonicalURLField.value
        });
      });
    }
    //# sourceMappingURL=seo.es.js.map
  }
});
//# sourceMappingURL=seo.es.js.map