/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */

"use strict";(self.webpackChunk_nocobase_plugin_workflow_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["159"],{2066:function(e,r,n){n.d(r,{CalculationFieldset:function(){return p}});var t=n(9155),o=n.n(t),a=n(2059),l=n(8275),i=n(9785),u=n(3210),c=n(5606),s=n(9488);function f(e,r,n,t,o,a,l){try{var i=e[a](l),u=i.value}catch(e){n(e);return}i.done?r(u):Promise.resolve(u).then(t,o)}function p(){var e,r=(0,s.kj)(),n=null!=(e=a.Form.useWatch(["config","engine"]))?e:"formula.js";return o().createElement(o().Fragment,null,o().createElement(a.Form.Item,{name:["config","engine"],label:r("Calculation engine"),rules:[{required:!0}],initialValue:"formula.js"},o().createElement(i.$,{options:(0,l.getOptions)()})),o().createElement(a.Form.Item,{name:["config","expression"],label:r("Calculation expression"),dependencies:[["config","engine"]],validateTrigger:["onChange","onBlur"],rules:[{required:!0},{validator:function(e,t){var o;return(o=function(){var e,o;return function(e,r){var n,t,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:u(0)}),i(l,"throw",{value:u(1)}),i(l,"return",{value:u(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(a=0)),a;)try{if(n=1,t&&(o=2&c[0]?t.return:c[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,c[1])).done)return o;switch(t=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,t=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=r.call(e,a)}catch(e){c=[6,e],t=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(a){if(!t||!(e=l.evaluators.get(n)))return[2];o=String(t).trim().replace(/{{([^{}]+)}}/g,' "1" ');try{e.evaluate(o)}catch(e){throw Error(r("Expression syntax error"))}return[2]})},function(){var e=this,r=arguments;return new Promise(function(n,t){var a=o.apply(e,r);function l(e){f(a,n,t,l,i,"next",e)}function i(e){f(a,n,t,l,i,"throw",e)}l(void 0)})})()}}],extra:(0,u.s)(n,r)},o().createElement(c.M,null)))}}}]);