Liferay.Loader.define("dynamic-data-mapping-form-web@4.0.84/admin/js/pages/RuleEditor.es",["module","exports","require","./RuleEditor.scss","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","data-engine-taglib","liferay!frontend-js-react-web$react"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.RuleEditor=function(t){var r;let{onCancel:u,onSave:i,rule:f}=t,s=p(t,["onCancel","onSave","rule"]);const[y,b]=(0,o.useState)(!0);return o.default.createElement(a.default,{className:"form-rule-builder",onSubmit:e=>e.preventDefault()},o.default.createElement("div",{className:"form-rule-builder-header"},o.default.createElement("h2",{className:"text-default"},Liferay.Language.get("rule")),o.default.createElement("h4",{className:"text-default"},Liferay.Language.get("define-condition-and-action-to-change-fields-and-elements-on-the-form"))),o.default.createElement(l.RuleEditor,c({onChange:t=>{let{logicalOperator:r}=t,n=p(t,["logicalOperator"]);e.rule=d(d({},n),{},{"logical-operator":r})},onValidator:e=>b(!e),rule:null!==(r=e.rule)&&void 0!==r?r:f},s)),o.default.createElement("div",{className:"form-rule-builder-footer"},o.default.createElement(n.default.Group,{spaced:!0},o.default.createElement(n.default,{disabled:y,displayType:"primary",onClick:()=>{i(e.rule),e.rule=void 0}},Liferay.Language.get("save")),o.default.createElement(n.default,{displayType:"secondary",onClick:()=>{e.rule=void 0,u()}},Liferay.Language.get("cancel")))))},r("./RuleEditor.scss");var n=i(r("@frontend-taglib-clay$clayui/button")),a=i(r("@frontend-taglib-clay$clayui/form")),l=r("data-engine-taglib"),o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();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]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}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 d(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){s(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 s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const e={rule:void 0}}}));
//# sourceMappingURL=RuleEditor.es.js.map