/*!
 * KoliBri - The accessible HTML-Standard
 */
import{_ as o}from"./tslib.es6-CxX45GIN.js";import{h as l,F as e}from"./index-C_yiBYg2.js";import{c as t}from"./clsx-eK3rPvPS.js";import"./common-Dd0zJQbD.js";import{b as i,s as r}from"./reuse-CX4AQDkS.js";import{a as s,K as n,b as a,c as d}from"./FormFieldStateWrapper-Cj4-CJCr.js";const c=(e,s)=>{var{class:i}=e,r=o(e,["class"]);return l("div",Object.assign({class:t("kol-field-control__input",i)},r),s)},b=(b,p)=>{const{class:f,id:h,disabled:u,label:_,hideLabel:g,labelAlign:y,renderNoTooltip:m,hint:C,renderNoHint:j,tooltipAlign:K,accessKey:k,shortKey:P,msg:v,touched:B,required:O,readonly:A,fieldControlInputProps:N,fieldControlLabelProps:q,fieldControlTooltipProps:x,fieldControlHintProps:L}=b,T=o(b,["class","id","disabled","label","hideLabel","labelAlign","renderNoTooltip","hint","renderNoHint","tooltipAlign","accessKey","shortKey","msg","touched","required","readonly","fieldControlInputProps","fieldControlLabelProps","fieldControlTooltipProps","fieldControlHintProps"]),F=!j,H=!m,S=d(v,B),D=r(_),I=H&&!D&&g,J=i(k,P),Q="string"==typeof v?"error":null==v?void 0:v._type,X=[l(e,null,l(c,Object.assign({},N),p),I&&l(s,Object.assign({},x||{},{id:h,label:_,align:K,badgeText:J}))),l(n,Object.assign({},q||{},{id:h,baseClassName:"kol-field-control",class:t(null==q?void 0:q.class,{"kol-field-control__label--visually-hidden":Boolean(g)}),hasExpertSlot:D,label:_,accessKey:k,shortKey:P}))];"left"===y&&X.reverse();const $={"kol-field-control--disabled":Boolean(u),"kol-field-control--required":Boolean(O),"kol-field-control--touched":Boolean(B),"kol-field-control--hide-label":Boolean(g),"kol-field-control--read-only":Boolean(A),[`kol-field-control--${Q||"error"}`]:Boolean(S),[`kol-field-control--label-align-${y}`]:Boolean(y)};return l("div",Object.assign({class:t("kol-field-control",$,f)},T),X,F&&l(a,Object.assign({},L||{},{baseClassName:"kol-field-control",id:h,hint:C})))};function f(l){const e={id:l._id,disabled:l._disabled,msg: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),"_accessKey"in l&&(e.accessKey=l._accessKey),"_shortKey"in l&&(e.shortKey=l._shortKey),e}const p=(e,s)=>{var{state:i}=e,r=o(e,["state"]);return l(b,Object.assign({},f(i),r),s)};export{p as F};