import{__awaiter,__generator}from"tslib";import{r as registerInstance,h,H as Host,g as getElement}from"./index-853c3f3f.js";import{i as inheritAttributes}from"./attributes-56afda45.js";import{B as BEM}from"./bem-1b28532d.js";import{d as defaultConfig}from"./initialize-ac68e3e3.js";import{L as ListenToConfig}from"./config.decorator-54721e29.js";import{i as i18nBalClose}from"./bal-close.i18n-26da072a.js";import"./browser-9199b5e2.js";import"./log-01623e2c.js";import"./icons.constant-0d61e703.js";import"./index-8b8ed6bd.js";var balCloseCss=".bal-close__button--inverted:focus-visible:not(:active),.bal-close__button:focus-visible:not(:active){-webkit-box-shadow:var(--bal-focus-shadow) !important;box-shadow:var(--bal-focus-shadow) !important}:root{--bal-close-background:var(--bal-color-transparent);--bal-close-background-focus-visible:var(--bal-form-field-control-background);--bal-close-background-focus-inverted-focus-visible:var(--bal-form-field-control-background);--bal-close-border-radius:var(--bal-radius-rounded)}.bal-close{position:static;display:inline-block}.bal-close__button{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-moz-appearance:none;-webkit-appearance:none;background-color:var(--bal-close-background);border:none;border-radius:var(--bal-close-border-radius);cursor:pointer;pointer-events:auto;display:inline-block;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;font-size:0;outline:none;position:relative;vertical-align:top;padding:.313rem}.bal-close__button:hover{background:rgba(0,7,57,.1)}.bal-close__button:focus-visible:not(:active){background:var(--bal-close-background-focus-visible)}.bal-close__button:active{background:rgba(0,7,57,.3)}.bal-close__button--inverted:hover{background:rgba(255,255,255,.3)}.bal-close__button--inverted:focus-visible:not(:active){background:var(--bal-close-background-focus-inverted-focus-visible)}.bal-close__button--inverted:active{background:rgba(255,255,255,.5)}.bal-close__button--size-small{padding:.25rem}.bal-close__button--size-medium{padding:.531rem}";var __decorate=undefined&&undefined.__decorate||function(e,t,o,i){var s=arguments.length,n=s<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")n=Reflect.decorate(e,t,o,i);else for(var r=e.length-1;r>=0;r--)if(a=e[r])n=(s<3?a(n):s>3?a(t,o,n):a(t,o))||n;return s>3&&n&&Object.defineProperty(t,o,n),n};var Close=function(){function e(e){registerInstance(this,e);this.inheritedAttributes={};this.language=defaultConfig.language;this.region=defaultConfig.region;this.size="";this.inverted=false}e.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAttributes(this.el,["tabindex"])};e.prototype.configChanged=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.language=e.language;this.region=e.region;return[2]}))}))};e.prototype.render=function(){var e=BEM.block("close");var t=e.element("button");var o=t.element("icon");var i=i18nBalClose[this.language].close;return h(Host,{class:Object.assign({},e.class())},h("button",Object.assign({type:"button","aria-label":i,title:i,class:Object.assign(Object.assign(Object.assign({},t.class()),t.modifier("inverted").class(this.inverted)),t.modifier("size-".concat(this.size)).class(this.size!=="")),"data-testid":"bal-close"},this.inheritedAttributes),h("bal-icon",{name:"close",size:this.size==="small"?"x-small":this.size==="medium"?"medium":"small",inverted:this.inverted,class:Object.assign({},o.class())})))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();__decorate([ListenToConfig()],Close.prototype,"configChanged",null);Close.style={css:balCloseCss};export{Close as bal_close};