"use strict";var b=Object.create;var s=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var _=Object.getPrototypeOf;var N=Object.prototype.hasOwnProperty;var n=(r,e)=>s(r,"name",{value:e,configurable:true});var F=(r,e)=>{for(var o in e)s(r,o,{get:e[o],enumerable:true})};var t=(r,e,o,i)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let a of h(e))if(!N.call(r,a)&&a!==o)s(r,a,{get:()=>e[a],enumerable:!(i=v(e,a))||i.enumerable})}return r};var f=(r,e,o)=>(o=r!=null?b(_(r)):{},t(e||!r||!r.__esModule?s(o,"default",{value:r,enumerable:true}):o,r));var $=r=>t(s({},"__esModule",{value:true}),r);var z={};F(z,{default:()=>g});module.exports=$(z);var l=require("react/jsx-runtime");var m=f(require("classnames"));var u=require("mobx-react");var c=require("react");var p=f(require("./error"));class d extends c.Component{inputElement=null;componentDidMount(){if(this.props.focus){this.focus()}}focus(){this.inputElement.focus()}render(){const{field:e,className:o,showLabel:i=true}=this.props;return(0,l.jsxs)("div",{className:(0,m.default)({"franz-form__field":true,"has-error":e.error,[`${o}`]:o}),children:[e.label&&i&&(0,l.jsx)("label",{className:"franz-form__label",htmlFor:e.name,children:e.label}),(0,l.jsx)("div",{className:"franz-form__radio-wrapper",children:e.options?.map(a=>(0,l.jsxs)("label",{htmlFor:`${e.id}-${a.value}`,className:(0,m.default)({"franz-form__radio":true,"is-selected":e.value===a.value}),children:[(0,l.jsx)("input",{id:`${e.id}-${a.value}`,type:"radio",name:"type",value:a.value,onChange:e.onChange,checked:e.value===a.value}),a.label]},a.value))}),e.error&&(0,l.jsx)(p.default,{message:e.error})]})}}n(d,"Radio");var g=(0,u.observer)(d);
