/*!
 * KoliBri - The accessible HTML-Standard
 */
"use strict";const tslib_es6=require("./tslib.es6-5e301284.js"),index=require("./index-87a7393a.js"),clsx=require("./clsx-dd4d6dd1.js"),getRenderStates=require("./getRenderStates-02094cdf.js"),reuse=require("./reuse-8cfefa9b.js"),FormFieldMsg=require("./FormFieldMsg-227128fb.js"),InputContainer=(e,l)=>{var{class:o}=e,r=tslib_es6.__rest(e,["class"]);return index.h("div",Object.assign({class:clsx.clsx("kol-field-control__input",o)},r),l)},KolFieldControlFc=(e,l)=>{const{class:o,id:r,disabled:t,label:i,hideLabel:s,labelAlign:n,renderNoTooltip:d,hint:a,renderNoHint:c,tooltipAlign:b,accessKey:g,shortKey:u,msg:p,touched:h,required:F,readonly:_,fieldControlInputProps:f,fieldControlLabelProps:C,fieldControlTooltipProps:x,fieldControlHintProps:K}=e,y=tslib_es6.__rest(e,["class","id","disabled","label","hideLabel","labelAlign","renderNoTooltip","hint","renderNoHint","tooltipAlign","accessKey","shortKey","msg","touched","required","readonly","fieldControlInputProps","fieldControlLabelProps","fieldControlTooltipProps","fieldControlHintProps"]),j=!c,k=!d,S=FormFieldMsg.checkHasError(p,h),q=reuse.showExpertSlot(i),m=k&&!q&&s,P=reuse.buildBadgeTextString(g,u),v=[index.h(index.Fragment,null,index.h(InputContainer,Object.assign({},f),l),m&&index.h(getRenderStates.KolFieldControlTooltipFc,Object.assign({},x||{},{id:r,label:i,hideLabel:s,align:b,badgeText:P}))),index.h(getRenderStates.KolFieldControlLabelFc,Object.assign({},C||{},{id:r,baseClassName:"kol-field-control",class:clsx.clsx(null==C?void 0:C.class,{"kol-field-control__label--visually-hidden":Boolean(s)}),hasExpertSlot:q,label:i,accessKey:g,shortKey:u}))];"left"===n&&v.reverse();const B={"kol-field-control--disabled":Boolean(t),"kol-field-control--required":Boolean(F),"kol-field-control--touched":Boolean(h),"kol-field-control--hide-label":Boolean(s),"kol-field-control--read-only":Boolean(_),[`kol-field-control--${(null==p?void 0:p.type)||"error"}`]:Boolean(S),[`kol-field-control--label-align-${n}`]:Boolean(n)};return index.h("div",Object.assign({class:clsx.clsx("kol-field-control",B,o)},y),v,j&&index.h(getRenderStates.KolFieldControlHintFc,Object.assign({},K||{},{baseClassName:"kol-field-control",id:r,hint:a})))},KolFieldControlFc$1=KolFieldControlFc;function getFieldControlProps(e){const l={accessKey:e._accessKey,shortKey:e._shortKey,id:e._id,disabled:e._disabled,msg:FormFieldMsg.convertMsgToInternMsg(e._msg),hint:e._hint,label:e._label,hideLabel:e._hideLabel,touched:e._touched};return"_required"in e&&(l.required=e._required),"_readOnly"in e&&(l.readonly=e._readOnly),"_labelAlign"in e&&(l.labelAlign=e._labelAlign),l}const FieldControlStateWrapper=(e,l)=>{var{state:o}=e,r=tslib_es6.__rest(e,["state"]);return index.h(KolFieldControlFc$1,Object.assign({},getFieldControlProps(o),r),l)},KolFieldControlStateWrapperFc=FieldControlStateWrapper;exports.KolFieldControlStateWrapperFc=KolFieldControlStateWrapperFc;