Liferay.Loader.define("@liferay/object-web@1.0.153/js/components/StateManager/StateDefinition",["module","exports","require","@liferay/object-js-components-web","liferay!frontend-js-react-web$react","./StateDefinition.scss"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function StateDefinition({currentKey:e,disabled:t,index:r,initialValues:i,setValues:o,stateName:c,values:l}){const[s,f]=(0,a.useState)(i.map((({checked:e,key:t,name:r})=>({checked:e,label:r,value:t}))));return(0,a.useEffect)((()=>{var t,r;const n=null===(t=l.objectFieldSettings)||void 0===t?void 0:t.find((({name:e})=>"stateFlow"===e)),a=null===(r=l.objectFieldSettings)||void 0===r?void 0:r.indexOf(n),i=n.value,c=i.objectStates,f=c.find((t=>t.key===e)),u=c.indexOf(f),d=s.filter((e=>e.checked)).map((({value:e})=>({key:e}))),b=[...c];b[u]=_objectSpread(_objectSpread({},f),{},{objectStateTransitions:d}),i.objectStates=b;const p=l.objectFieldSettings;p[a].value=i,o({objectFieldSettings:p})}),[s]),a.default.createElement("div",{className:"lfr-objects__state-definition-card-state"},a.default.createElement("div",{className:"lfr-objects__state-definition-card-state-name"},0===r&&a.default.createElement("label",null,Liferay.Language.get("state-name")),a.default.createElement(n.Card,{title:c,viewMode:"no-children"})),a.default.createElement("div",{className:"lfr-objects__state-definition-card-state-next-status"},0===r&&a.default.createElement("label",null,Liferay.Language.get("next-status")),a.default.createElement(n.MultipleSelect,{disabled:t,options:s,selectAllOption:!0,setOptions:f})))};var n=r("@liferay/object-js-components-web"),a=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=n?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r("./StateDefinition.scss")}}));
//# sourceMappingURL=StateDefinition.js.map