import "../styles/reset.css";
import "./alert.less";
import { PropTypes as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__, TagThemeEnum as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_TagThemeEnum__, TagThemeType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_TagThemeType__, classes as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_classes__, withInstall as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstall__ } from "../shared";
import { createVNode as __WEBPACK_EXTERNAL_MODULE_vue_createVNode__, defineComponent as __WEBPACK_EXTERNAL_MODULE_vue_defineComponent__, reactive as __WEBPACK_EXTERNAL_MODULE_vue_reactive__ } from "vue";
import { usePrefix as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__ } from "../config-provider";
import { CloseLine as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_CloseLine__, InfoLine as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_InfoLine__ } from "../icon";

;// external "../shared"

;// external "vue"

;// ../../node_modules/@babel/runtime/helpers/esm/typeof.js
function _typeof(o) {
  "@babel/helpers - typeof";

  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
    return typeof o;
  } : function (o) {
    return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
  }, _typeof(o);
}

;// ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js

function toPrimitive(t, r) {
  if ("object" != _typeof(t) || !t) return t;
  var e = t[Symbol.toPrimitive];
  if (void 0 !== e) {
    var i = e.call(t, r || "default");
    if ("object" != _typeof(i)) return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t);
}

;// ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js


function toPropertyKey(t) {
  var i = toPrimitive(t, "string");
  return "symbol" == _typeof(i) ? i : i + "";
}

;// ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js

function _defineProperty(e, r, t) {
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[r] = t, e;
}

;// external "../config-provider"

;// external "../icon"

;// ../../packages/alert/src/alert.tsx


/*
 * Tencent is pleased to support the open source community by making
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
 *
 * Copyright (C) 2025 Tencent.  All rights reserved.
 *
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
 *
 * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
 *
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */




/* harmony default export */ const src_alert = (__WEBPACK_EXTERNAL_MODULE_vue_defineComponent__({
  name: 'Alert',
  props: {
    theme: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_TagThemeType__().def(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_TagThemeEnum__.INFO),
    title: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string,
    closable: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(false),
    closeText: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string,
    showIcon: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(true)
  },
  emits: {
    close: function close(event) {
      return event;
    }
  },
  setup: function setup(_props, context) {
    var state = __WEBPACK_EXTERNAL_MODULE_vue_reactive__({
      visible: true
    });
    var handleClose = function handleClose(event) {
      state.visible = false;
      context.emit('close', event);
    };
    return {
      state: state,
      handleClose: handleClose
    };
  },
  render: function render() {
    var _this = this,
      _this$$slots$icon,
      _this$$slots$icon2,
      _this$$slots,
      _this$$slots$default,
      _this$$slots2;
    if (!this.state.visible) {
      return null;
    }
    var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
      resolveClassName = _usePrefix.resolveClassName;
    var renderCloseText = Boolean(this.closeText);
    var closeButtonClasses = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_classes__(_defineProperty(_defineProperty(_defineProperty({}, resolveClassName('alert-close'), true), 'close-text', renderCloseText), resolveClassName('alert-close-icon'), !renderCloseText));
    var typeClass = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_classes__(_defineProperty(_defineProperty({}, resolveClassName('alert'), true), resolveClassName("alert-".concat(this.theme)), true));
    var defaultIcon = __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_InfoLine__, {
      "class": resolveClassName('alert-icon-info')
    }, null);
    var renderClose = function renderClose() {
      if (_this.$slots.close) {
        return _this.$slots.close();
      }
      return _this.closeText ? _this.closeText : __WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3_CloseLine__, null, null);
    };
    return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": typeClass
    }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": resolveClassName('alert-wraper')
    }, [this.showIcon && ((_this$$slots$icon = (_this$$slots$icon2 = (_this$$slots = this.$slots).icon) === null || _this$$slots$icon2 === void 0 ? void 0 : _this$$slots$icon2.call(_this$$slots)) !== null && _this$$slots$icon !== void 0 ? _this$$slots$icon : defaultIcon), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": resolveClassName('alert-content')
    }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": resolveClassName('alert-title')
    }, [this.$slots.title ? this.$slots.title() : this.title]), __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": resolveClassName('alert-description')
    }, [(_this$$slots$default = (_this$$slots2 = this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots2)])]), this.closable && __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": closeButtonClasses,
      "onClick": this.handleClose
    }, [renderClose()])])]);
  }
}));
;// ../../packages/alert/src/index.ts
/*
 * Tencent is pleased to support the open source community by making
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
 *
 * Copyright (C) 2025 Tencent.  All rights reserved.
 *
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
 *
 * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
 *
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */


var BkAlert = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstall__(src_alert);
/* harmony default export */ const src = (BkAlert);
export { src as default };
