/*!
 * KoliBri - The accessible HTML-Standard
 */
import{o as r,p as o,w as e}from"./prop.validators-9feb1d92.js";import{b as t}from"./common-54bf85ba.js";import{_ as s}from"./tslib.es6-1173d062.js";import{c as i}from"./clsx-09a06a12.js";import{h as n}from"./index-2ae1c631.js";import{K as a}from"./Alert-15d42d1c.js";function d(r){return Object.entries(r).reduce(((r,[s,e])=>{const t=s.startsWith("_")?s.slice(1):s;return Object.assign(Object.assign({},r),{[t]:e})}),{})}const l=(s,i)=>{r(i,(()=>{try{i=o(i)}catch(r){}e(s,"_msg",(r=>t(r)&&"string"==typeof(null==r?void 0:r._description)),new Set(["MsgPropType"]),i,{defaultValue:{_description:"",_type:"error"}})}))};function c(r){return!r||"error"===r._type&&!r._description}function u(r){if(r&&!c(r))return d(r)}function f(r,s){return Boolean((null==r?void 0:r.description)&&(null==r?void 0:r.description.length)>0)&&(!0===s||"error"!==(null==r?void 0:r.type))}const m=r=>{var{alert:e,msg:t,hideMsg:o,id:c,class:d}=r,l=s(r,["alert","msg","hideMsg","id","class"]);return n(a,Object.assign({id:`${c}-msg`,alert:e,type:"error",class:i("kol-form-field__msg",{"visually-hidden":!0===o},d)},t,l,{"aria-hidden":"true"}),(null==t?void 0:t.description)||void 0)},p=m;export{p as K,u as a,f as c,l as v};