/*!
 * KoliBri - The accessible HTML-Standard
 */
import{_ as __rest}from"./tslib.es6.js";import{h}from"@stencil/core/internal/client";import{c as clsx}from"./clsx.js";import{t as translate}from"./i18n2.js";import{c as KolIconTag,a as KolButtonWcTag}from"./component-names.js";import{K as KolHeadingFc}from"./Heading.js";const Icon=({ariaLabel:l,icon:o})=>h(KolIconTag,{class:"kol-alert__heading-icon",_label:l,_icons:o}),AlertIcon=({type:l,label:o})=>{switch(l){case"error":return h(Icon,{ariaLabel:translate("kol-error"),icon:"codicon codicon-error",label:o});case"info":return h(Icon,{ariaLabel:translate("kol-info"),icon:"codicon codicon-info",label:o});case"warning":return h(Icon,{ariaLabel:translate("kol-warning"),icon:"codicon codicon-warning",label:o});case"success":return h(Icon,{ariaLabel:translate("kol-success"),icon:"codicon codicon-pass",label:o});default:return h(Icon,{ariaLabel:translate("kol-message"),icon:"codicon codicon-comment",label:o})}},AlertIcon$1=AlertIcon,KolAlertFc=(l,o)=>{var a,e;const{class:t={},type:n="default",variant:c="msg",label:r,hasCloser:i,alert:s,onAlertTimeout:d,onCloserClick:_,level:v}=l,b=__rest(l,["class","type","variant","label","hasCloser","alert","onAlertTimeout","onCloserClick","level"]);s&&((null===(a=navigator.userActivation)||void 0===a?void 0:a.hasBeenActive)&&(null===(e=null===navigator||void 0===navigator?void 0:navigator.vibrate)||void 0===e||e.call(navigator,[100,75,100,75,100])),setTimeout((()=>{null==d||d()}),1e4));const u=Object.assign({class:clsx("kol-alert",`kol-alert--${n}`,`kol-alert--${c}`,{"kol-alert--hasCloser":!!i},t),role:s?"alert":void 0},b);return h("div",Object.assign({},u),h("div",{class:"kol-alert__container"},h(AlertIcon$1,{label:r,type:n}),h("div",{class:"kol-alert__container-content"},r?h(KolHeadingFc,{class:"kol-alert__heading",level:v},r):null,"msg"===c&&h("div",{class:"kol-alert__content"},o)),i&&h(KolButtonWcTag,{class:"kol-alert__close-button close","data-testid":"alert-close-button",_ariaDescription:(null==r?void 0:r.trim())||"",_hideLabel:!0,_icons:{left:{icon:"codicon codicon-close"}},_label:translate("kol-close-alert"),_on:{onClick:_},_tooltipAlign:"left"})),"card"===c&&h("div",{class:"kol-alert__content"},o))},KolAlertFc$1=KolAlertFc;export{KolAlertFc$1 as K};