/*!
 * KoliBri - The accessible HTML-Standard
 */
import{a as i}from"./tslib.es6-QNbPBOk5.js";import{h as e}from"./index-Brmny3Vg.js";import{I as t}from"./Input-Chj5JCQv.js";import{a as n}from"./dev.utils-HhhlYW_9.js";import{a as s}from"./FormFieldStateWrapper-DCXQnRBu.js";const r=t=>{var{id:s,suggestions:r}=t,a=i(t,["id","suggestions"]);if(!r){return null}return e("datalist",Object.assign({id:n(s,"list")},a),r.map((i=>e("option",{value:i}))))};function a(i,t,n){var a;const o=s(i);const f=[...o.ariaDescribedBy,...(a=t.ariaDescribedBy)!==null&&a!==void 0?a:[]];const l={id:i._id,hideLabel:i._hideLabel,label:i._label,disabled:i._disabled,name:i._name};if("_accessKey"in i)l.accessKey=i._accessKey;if("_type"in i)l.type=i._type;if("_value"in i)l.value=i._value;if("_required"in i)l.required=i._required;if("_maxLength"in i&&"_maxLengthBehavior"in i&&i._maxLengthBehavior==="hard")l.maxlength=i._maxLength;if("_placeholder"in i)l.placeholder=i._placeholder;if("_autoComplete"in i)l.autoComplete=i._autoComplete;if("_spellCheck"in i)l.spellcheck=i._spellCheck;if("_pattern"in i)l.pattern=i._pattern;if("_readOnly"in i)l.readonly=i._readOnly;if("_min"in i)l.min=i._min;if("_max"in i)l.max=i._max;if("_step"in i)l.step=i._step;if("_multiple"in i)l.multiple=i._multiple;if("_checked"in i)l.checked=i._checked;if("_indeterminate"in i)l.indeterminate=i._indeterminate;if("_touched"in i)l.touched=i._touched;if("_msg"in i)l.msg=i._msg;if("_shortKey"in i)l["aria-keyshortcuts"]=i._shortKey;if("_suggestions"in i&&!n){const t=Array.isArray(i._suggestions)&&i._suggestions.length>0;if(t){l.suggestions=e(r,{id:i._id,suggestions:i._suggestions})}}return Object.assign(Object.assign(Object.assign({},l),t),{ariaDescribedBy:f})}const o=n=>{var{state:s,customSuggestions:r}=n,o=i(n,["state","customSuggestions"]);return e(t,Object.assign({},a(s,o,r)))};export{o as I,r as S};
//# sourceMappingURL=InputStateWrapper-DA1rfFPc.js.map