Liferay.Loader.define("portal-workflow-kaleo-designer-web@5.0.85/designer/js/definition-builder/diagram-builder/components/sidebar/sections/assignments/SourceCode",["module","exports","require","liferay!frontend-js-react-web$react","../../../../DiagramBuilderContext","../shared-components/BaseSourceCode"],(function(e,t,r){var n;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),a=r("../../../../DiagramBuilderContext"),i=(n=r("../shared-components/BaseSourceCode"))&&n.__esModule?n:{default:n};function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function u(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 s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var l=()=>{var e,t,r,n;const{selectedItem:c,setSelectedItem:u}=(0,o.useContext)(a.DiagramBuilderContext),d=null===(e=c.data)||void 0===e||null===(t=e.assignments)||void 0===t?void 0:t.script,l=null===(r=c.data)||void 0===r||null===(n=r.assignments)||void 0===n?void 0:n.scriptLanguage;return o.default.createElement(i.default,{scriptSourceCode:d,updateSelectedItem:e=>{""!==e.getData().trim()&&u((t=>s(s({},t),{},{data:s(s({},t.data),{},{assignments:{assignmentType:["scriptedAssignment"],script:[e.getData()],scriptLanguage:l}})})))}})};t.default=l}}));
//# sourceMappingURL=SourceCode.js.map