Liferay.Loader.define("portal-workflow-kaleo-designer-web@5.0.92/designer/js/definition-builder/diagram-builder/components/sidebar/sections/timers/select-reassignment/ScriptedReassignment",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/layout","@frontend-taglib-clay$clayui/link","liferay!frontend-js-react-web$react","../../../../../DiagramBuilderContext","../../../SidebarPanel"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=_interopRequireWildcard(r("@frontend-taglib-clay$clayui/button")),n=_interopRequireDefault(r("@frontend-taglib-clay$clayui/layout")),i=_interopRequireDefault(r("@frontend-taglib-clay$clayui/link")),o=_interopRequireWildcard(r("liferay!frontend-js-react-web$react")),l=r("../../../../../DiagramBuilderContext"),c=_interopRequireDefault(r("../../../SidebarPanel"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=a?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}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}var _default=({actionData:e,setContentName:t})=>{var r,u;const{selectedItem:d,setSelectedItem:s}=(0,o.useContext)(l.DiagramBuilderContext),[f,p]=(0,o.useState)(null==d||null===(r=d.data.taskTimers)||void 0===r||null===(u=r.reassignments)||void 0===u?void 0:u.script),y=Liferay.Language.get("add-source-code"),b="".concat(Liferay.Language.get("source-code")," (").concat(Liferay.Language.get("groovy"),")"),goToEditor=()=>t("scripted-reassignment");return(0,o.useEffect)((()=>{p(null==e?void 0:e.script)}),[e]),o.default.createElement(c.default,{panelTitle:b},f?o.default.createElement(n.default.ContentCol,{className:"current-node-data-area",float:!0},o.default.createElement(n.default.Row,{className:"current-node-data-row",justify:"between"},o.default.createElement(i.default,{button:!1,className:"truncate-container",displayType:"secondary",href:"#",onClick:goToEditor},o.default.createElement("span",null,Liferay.Language.get("script"))),o.default.createElement(a.ClayButtonWithIcon,{className:"delete-button text-secondary trash-button",displayType:"unstyled",onClick:()=>{s((e=>_objectSpread(_objectSpread({},e),{},{data:_objectSpread(_objectSpread({},e.data),{},{reassignments:null})})))},symbol:"trash"}))):o.default.createElement(a.default,{displayType:"secondary",onClick:goToEditor},y.toUpperCase()))};t.default=_default}}));
//# sourceMappingURL=ScriptedReassignment.js.map