import { r as registerInstance, h as h$1 } from './index-38ad4957.js';
import { n as h } from './dom-context-hooks.module-50442785.js';
import { g as getEnvironmentSDK } from './index.module-b23fdad8.js';
import './JSS-67b5cff8.js';
import './mixins-f750863a.js';
import { C as CloseButtonView } from './sqm-close-button-view-fd9012e7.js';

const CloseButton = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    /**
     * @uiName Color
     * @uiWidget color
     * @uiType string
     */
    this.color = "#000000";
    h(this);
  }
  disconnectedCallback() { }
  render() {
    var _a;
    const sdk = getEnvironmentSDK();
    const isPopup = sdk.type === "SquatchJS2" &&
      ((_a = sdk.widgetIdent) === null || _a === void 0 ? void 0 : _a.engagementMedium) === "POPUP";
    if (!isPopup)
      return h$1("div", { style: { display: "none" } });
    const onClick = () => {
      var _a, _b;
      if (sdk.type === "SquatchJS2") {
        (_b = (_a = sdk.api).close) === null || _b === void 0 ? void 0 : _b.call(_a);
      }
    };
    return h$1(CloseButtonView, { onClick: onClick, color: this.color });
  }
};

export { CloseButton as sqm_close_button };
