text: define(["exports", "../../../../../lit/index.js", "../../core/utils/HAXCMSThemeParts.js", "../../core/utils/HAXCMSI18NMixin.js", "../../../../simple-icon/lib/simple-icons.js", "../../../../simple-icon/lib/simple-icon-button.js", "../../../../simple-tooltip/simple-tooltip.js"], function (_exports, _index, _HAXCMSThemeParts, _HAXCMSI18NMixin2, _simpleIcons, _simpleIconButton, _simpleTooltip) {
    "use strict";
  
    Object.defineProperty(_exports, "__esModule", {
      value: true
    });
    _exports.SiteRSSButton = void 0;
  
    var _templateObject_20559b90941811ec8d52c707f928eca0, _templateObject2_20559b90941811ec8d52c707f928eca0;
  
    function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
  
    function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { babelHelpers.defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
  
    function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = babelHelpers.getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = babelHelpers.getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return babelHelpers.possibleConstructorReturn(this, result); }; }
  
    function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  
    /**
     * `site-rss-button`
     * `A button that references RSS feeds in a standards based way`
     *
    
     */
    var SiteRSSButton = /*#__PURE__*/function (_HAXCMSI18NMixin) {
      babelHelpers.inherits(SiteRSSButton, _HAXCMSI18NMixin);
  
      var _super = _createSuper(SiteRSSButton);
  
      function SiteRSSButton() {
        var _this;
  
        babelHelpers.classCallCheck(this, SiteRSSButton);
        _this = _super.call(this);
        _this.t = {
          rssFeed: "RSS Feed",
          atomFeed: "ATOM Feed"
        };
        _this._link = {
          title: _this.t.rssFeed
        };
        _this.type = "rss";
        _this.raised = false;
        _this.position = "bottom";
        return _this;
      } // render function
  
  
      babelHelpers.createClass(SiteRSSButton, [{
        key: "render",
        value: function render() {
          return (0, _index.html)(_templateObject_20559b90941811ec8d52c707f928eca0 || (_templateObject_20559b90941811ec8d52c707f928eca0 = babelHelpers.taggedTemplateLiteral(["\n      <a\n        ?disabled=\"", "\"\n        tabindex=\"-1\"\n        href=\"", "\"\n        .id=\"btn", "\"\n        target=\"_blank\"\n        rel=\"noopener noreferrer\"\n        .part=\"", "\"\n      >\n        <simple-icon-button-lite\n          icon=\"", "\"\n          label=\"", "\"\n          @click=\"", "\"\n          ?disabled=\"", "\"\n          .part=\"", "\"\n        ></simple-icon-button-lite>\n      </a>\n      <simple-tooltip\n        .for=\"btn", "\"\n        position=\"", "\"\n        offset=\"14\"\n      >\n        ", "\n      </simple-tooltip>\n    "])), this.disabled, this.href, this.type, this.editMode ? "edit-mode-active" : "", this.icon, this._link.title, this.print, this.disabled, this.editMode ? "edit-mode-active" : "", this.type, this.position, this._link.title);
        }
        /**
         * Mix in an opened status
         */
  
      }, {
        key: "updated",
        value: function updated(changedProperties) {
          var _this2 = this;
  
          if (babelHelpers.get(babelHelpers.getPrototypeOf(SiteRSSButton.prototype), "updated", this)) {
            babelHelpers.get(babelHelpers.getPrototypeOf(SiteRSSButton.prototype), "updated", this).call(this, changedProperties);
          }
  
          changedProperties.forEach(function (oldValue, propName) {
            if (propName == "type") {
              _this2._generateLink(_this2[propName]);
            }
  
            if (propName == "t") {
              _this2._generateLink(_this2.type);
            }
          });
        }
        /**
         * Generate a link when we get a new type.
         */
  
      }, {
        key: "_generateLink",
        value: function _generateLink(newValue) {
          // remove existing if this is moving around
          if (this._link && this._link.href) {
            document.head.removeChild(this._link);
          }
  
          if (newValue) {
            var link = document.createElement("link");
            link.rel = "alternate";
  
            if (newValue === "rss") {
              link.href = "rss.xml";
              link.title = this.t.rssFeed;
              link.type = "application/rss+xml";
              this.icon = "communication:rss-feed";
            } else if (newValue === "atom") {
              link.href = "atom.xml";
              link.title = this.t.atomFeed;
              link.type = "application/atom+xml";
              this.icon = "communication:rss-feed";
            }
  
            this.href = link.href;
            document.head.appendChild(link);
            this._link = link;
          }
        }
      }], [{
        key: "styles",
        get:
        /**
         * LitElement constructable styles enhancement
         */
        function get() {
          return [].concat(babelHelpers.toConsumableArray(babelHelpers.get(babelHelpers.getPrototypeOf(SiteRSSButton), "styles", this)), [(0, _index.css)(_templateObject2_20559b90941811ec8d52c707f928eca0 || (_templateObject2_20559b90941811ec8d52c707f928eca0 = babelHelpers.taggedTemplateLiteral(["\n        :host {\n          display: inline-flex;\n          color: var(--site-rss-button-color, inherit);\n        }\n        a {\n          text-decoration: var(--site-rss-text-decoration);\n          outline: none;\n          color: var(--site-rss-button-color, inherit);\n        }\n        simple-icon-button-lite {\n          color: var(--site-rss-button-color, inherit);\n        }\n        simple-tooltip {\n          --simple-tooltip-background: var(\n            --haxcms-tooltip-background-color,\n            #000000\n          );\n          --simple-tooltip-opacity: 1;\n          --simple-tooltip-text-color: var(--haxcms-tooltip-color, #ffffff);\n          --simple-tooltip-delay-in: 0;\n          --simple-tooltip-border-radius: 0;\n        }\n      "])))]);
        }
        /**
         * Store the tag name to make it easier to obtain directly.
         */
  
      }, {
        key: "tag",
        get: function get() {
          return "site-rss-button";
        }
      }, {
        key: "properties",
        get: function get() {
          return _objectSpread(_objectSpread({}, babelHelpers.get(babelHelpers.getPrototypeOf(SiteRSSButton), "properties", this)), {}, {
            disabled: {
              type: Boolean,
              reflect: true
            },
            _link: {
              type: Object
            },
            href: {
              type: String
            },
            icon: {
              type: String
            },
            type: {
              type: String
            },
            position: {
              type: String
            }
          });
        }
      }]);
      return SiteRSSButton;
    }((0, _HAXCMSI18NMixin2.HAXCMSI18NMixin)((0, _HAXCMSThemeParts.HAXCMSThemeParts)(_index.LitElement)));
  
    _exports.SiteRSSButton = SiteRSSButton;
    window.customElements.define(SiteRSSButton.tag, SiteRSSButton);
  });