Liferay.Loader.define("portal-workflow-kaleo-designer-web@5.0.85/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 n=d(r("@frontend-taglib-clay$clayui/button")),a=u(r("@frontend-taglib-clay$clayui/layout")),l=u(r("@frontend-taglib-clay$clayui/link")),o=d(r("liferay!frontend-js-react-web$react")),i=r("../../../../../DiagramBuilderContext"),c=u(r("../../../SidebarPanel"));function u(e){return e&&e.__esModule?e:{default:e}}function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=s();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 l=n?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}function f(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 y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){p(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b=({actionData:e,setContentName:t})=>{var r,u;const{selectedItem:s,setSelectedItem:d}=(0,o.useContext)(i.DiagramBuilderContext),[f,p]=(0,o.useState)(null==s||null===(r=s.data.taskTimers)||void 0===r||null===(u=r.reassignments)||void 0===u?void 0:u.script),b=Liferay.Language.get("add-source-code"),g="".concat(Liferay.Language.get("source-code")," (").concat(Liferay.Language.get("groovy"),")"),m=()=>t("scripted-reassignment");return(0,o.useEffect)((()=>{p(null==e?void 0:e.script)}),[e]),o.default.createElement(c.default,{panelTitle:g},f?o.default.createElement(a.default.ContentCol,{className:"current-node-data-area",float:!0},o.default.createElement(a.default.Row,{className:"current-node-data-row",justify:"between"},o.default.createElement(l.default,{button:!1,className:"truncate-container",displayType:"secondary",href:"#",onClick:m},o.default.createElement("span",null,Liferay.Language.get("script"))),o.default.createElement(n.ClayButtonWithIcon,{className:"delete-button text-secondary trash-button",displayType:"unstyled",onClick:()=>{d((e=>y(y({},e),{},{data:y(y({},e.data),{},{reassignments:null})})))},symbol:"trash"}))):o.default.createElement(n.default,{displayType:"secondary",onClick:m},b.toUpperCase()))};t.default=b}}));
//# sourceMappingURL=ScriptedReassignment.js.map