"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),g=require("react"),d=require("semantic-ui-react"),p=require("../reducers/data.js"),f=require("../../redux/hooks.js"),h=m=>{const{parent:x,editing:j=!1,unique:C,"data-label":r,"data-group":o,"data-app":s,"data-measures-groups":n}=m;let e;const i=f.useAppDispatch(),c=f.useAppSelector(a=>a.getIn(["data","measures",s,o])),l={onReset:p.cleanMeasures,onChange:p.setMeasures};if(n instanceof String||typeof n=="string"?e=JSON.parse(decodeURIComponent(n)):e=n,g.useEffect(()=>{e&&e[s]&&e[s].forEach(a=>{a.defaultSelected&&i(l.onChange({app:s,group:o,mGroup:a}))})},[]),e&&e[s]){const a=e[s];return t.jsxs(d.Container,{className:"measures group",fluid:!0,children:[r&&t.jsx("span",{children:r}),a.map(u=>t.jsxs("div",{className:"inputs lists",onClick:q=>i(l.onChange({app:s,group:o,mGroup:u})),children:[t.jsx("input",{readOnly:!0,checked:!!(c&&c.idx==u.idx),type:"radio"}),t.jsx("span",{children:u.label})]},u.idx))]})}else return t.jsx(d.Container,{className:"measures group",fluid:!0,children:r&&t.jsx("span",{children:r})})};exports.default=h;
