Liferay.Loader.define("portal-workflow-kaleo-designer-web@5.0.85/designer/js/definition-builder/diagram-builder/components/sidebar/sections/timers/TimerDuration",["module","exports","require","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../SidebarPanel","./TimerFields"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r("@frontend-taglib-clay$clayui/form"),n=c(r("@frontend-taglib-clay$clayui/icon")),l=(c(r("liferay!frontend-js-react-web$prop-types")),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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=a?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(r,n,l):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"))),i=c(r("../../SidebarPanel")),o=c(r("./TimerFields"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function c(e){return e&&e.__esModule?e:{default:e}}var d=({duration:e,durationScale:t,recurrence:r,recurrenceScale:u,selectedItem:c,setTimerSections:d,timerIdentifier:f,timersIndex:s})=>{const[m,g]=(0,l.useState)(!!r&&!!u);return l.default.createElement(i.default,{panelTitle:Liferay.Language.get("duration")},l.default.createElement(o.default,{durationScaleValue:t,durationValue:e,selectedItem:c,setTimerSections:d,timerIdentifier:f,timersIndex:s}),l.default.createElement("div",{className:"timers-duration-toggle"},l.default.createElement(a.ClayToggle,{label:Liferay.Language.get("recurrence"),onToggle:()=>{m?(g(!1),d((e=>{const t=[...e];return delete t[s].recurrence,delete t[s].recurrenceScale,t}))):g(!0)},toggled:m}),l.default.createElement("span",{className:"ml-2",title:Liferay.Language.get("repeat-the-action-at-a-given-duration-until-the-workflow-task-is-completed")},l.default.createElement(n.default,{className:"text-muted",symbol:"question-circle-full"}))),m&&l.default.createElement(o.default,{durationScaleValue:u,durationValue:r,recurrence:!0,scaleHelpText:Liferay.Language.get("recurrence"),selectedItem:c,setTimerSections:d,timerIdentifier:f,timersIndex:s}))};t.default=d}}));
//# sourceMappingURL=TimerDuration.js.map