/*!
 * KoliBri - The accessible HTML-Standard
 */
import{_ as o}from"./tslib.es6-1173d062.js";import{h as l,F as e}from"./index-91489a9f.js";import{c as t}from"./clsx-09a06a12.js";import{a as s,b as i,c as n}from"./getRenderStates-a7a33541.js";import{s as r,b as a}from"./reuse-32931294.js";import{c as d,a as c}from"./FormFieldMsg-1ed3f51d.js";const b=(e,s)=>{var{class:a}=e,i=o(e,["class"]);return l("div",Object.assign({class:t("kol-field-control__input",a)},i),s)},f=(c,f)=>{const{class:p,id:h,disabled:u,label:g,hideLabel:m,labelAlign:_,renderNoTooltip:y,hint:j,renderNoHint:k,tooltipAlign:K,accessKey:C,shortKey:O,msg:v,touched:B,required:P,readonly:A,fieldControlInputProps:L,fieldControlLabelProps:q,fieldControlTooltipProps:N,fieldControlHintProps:x}=c,T=o(c,["class","id","disabled","label","hideLabel","labelAlign","renderNoTooltip","hint","renderNoHint","tooltipAlign","accessKey","shortKey","msg","touched","required","readonly","fieldControlInputProps","fieldControlLabelProps","fieldControlTooltipProps","fieldControlHintProps"]),H=!k,F=!y,I=d(v,B),S=r(g),$=F&&!S&&m,E=a(C,O),M=[l(e,null,l(b,Object.assign({},L),f),$&&l(s,Object.assign({},N||{},{id:h,label:g,hideLabel:m,align:K,badgeText:E}))),l(i,Object.assign({},q||{},{id:h,baseClassName:"kol-field-control",class:t(null==q?void 0:q.class,{"kol-field-control__label--visually-hidden":Boolean(m)}),hasExpertSlot:S,label:g,accessKey:C,shortKey:O}))];"left"===_&&M.reverse();const R={"kol-field-control--disabled":Boolean(u),"kol-field-control--required":Boolean(P),"kol-field-control--touched":Boolean(B),"kol-field-control--hide-label":Boolean(m),"kol-field-control--read-only":Boolean(A),[`kol-field-control--${(null==v?void 0:v.type)||"error"}`]:Boolean(I),[`kol-field-control--label-align-${_}`]:Boolean(_)};return l("div",Object.assign({class:t("kol-field-control",R,p)},T),M,H&&l(n,Object.assign({},x||{},{baseClassName:"kol-field-control",id:h,hint:j})))},p=f;function u(l){const e={accessKey:l._accessKey,shortKey:l._shortKey,id:l._id,disabled:l._disabled,msg:c(l._msg),hint:l._hint,label:l._label,hideLabel:l._hideLabel,touched:l._touched};return"_required"in l&&(e.required=l._required),"_readOnly"in l&&(e.readonly=l._readOnly),"_labelAlign"in l&&(e.labelAlign=l._labelAlign),e}const h=(e,s)=>{var{state:a}=e,i=o(e,["state"]);return l(p,Object.assign({},u(a),i),s)},m=h;export{m as K};