/*!
 * KoliBri - The accessible HTML-Standard
 */
import{_ as __rest}from"./tslib.es6.js";import{h}from"@stencil/core/internal/client";import{g as getRenderStates}from"./getRenderStates.js";import{K as KolInputFc}from"./Input.js";import{c as convertMsgToInternMsg}from"./FormFieldMsg.js";const SuggestionsFc=e=>{var{id:t,suggestions:s}=e,n=__rest(e,["id","suggestions"]);return s?h("datalist",Object.assign({id:`${t}-list`},n),s.map((e=>h("option",{value:e})))):null},KolSuggestionsFc=SuggestionsFc;function getInputProps(e,t){const{ariaDescribedBy:s}=getRenderStates(e),n={id:e._id,hideLabel:e._hideLabel,label:e._label,accessKey:e._accessKey,disabled:e._disabled,name:e._name,ariaDescribedBy:s};if("_type"in e&&(n.type=e._type),"_value"in e&&(n.value=e._value),"_required"in e&&(n.required=e._required),"_maxLength"in e&&(n.maxlength=e._maxLength),"_placeholder"in e&&(n.placeholder=e._placeholder),"_autoComplete"in e&&(n.autoComplete=e._autoComplete),"_spellCheck"in e&&(n.spellcheck=e._spellCheck),"_pattern"in e&&(n.pattern=e._pattern),"_readOnly"in e&&(n.readonly=e._readOnly),"_min"in e&&(n.min=e._min),"_max"in e&&(n.max=e._max),"_step"in e&&(n.step=e._step),"_multiple"in e&&(n.multiple=e._multiple),"_checked"in e&&(n.checked=e._checked),"_indeterminate"in e&&(n.indeterminate=e._indeterminate),"_touched"in e&&(n.touched=e._touched),"_msg"in e&&(n.msg=convertMsgToInternMsg(e._msg)),"_suggestions"in e&&!t){Array.isArray(e._suggestions)&&e._suggestions.length>0&&(n.suggestions=h(KolSuggestionsFc,{id:e._id,suggestions:e._suggestions}))}return n}const InputStateWrapper=e=>{var{state:t,customSuggestions:s}=e,n=__rest(e,["state","customSuggestions"]);return h(KolInputFc,Object.assign({},getInputProps(t,s),n))},KolInputStateWrapperFc=InputStateWrapper;export{KolInputStateWrapperFc as K,KolSuggestionsFc as a};