@nocobase/plugin-workflow-cc 3.0.0-alpha.1 → 3.0.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client-v2/index.js +1 -1
- package/dist/client-v2/tasks.d.ts +1 -1
- package/dist/externalVersion.js +11 -11
- package/package.json +2 -2
package/dist/client-v2/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ahooks"),require("react-i18next"),require("@nocobase/plugin-notification-manager/client-v2"),require("@nocobase/client-v2"),require("react-router-dom"),require("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-cc/client-v2",["ahooks","react-i18next","@nocobase/plugin-notification-manager/client-v2","@nocobase/client-v2","react-router-dom","react","antd","@nocobase/plugin-workflow/client-v2","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-cc/client-v2"]=t(require("ahooks"),require("react-i18next"),require("@nocobase/plugin-notification-manager/client-v2"),require("@nocobase/client-v2"),require("react-router-dom"),require("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-workflow-cc/client-v2"]=t(e.ahooks,e["react-i18next"],e["@nocobase/plugin-notification-manager/client-v2"],e["@nocobase/client-v2"],e["react-router-dom"],e.react,e.antd,e["@nocobase/plugin-workflow/client-v2"],e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i,a,l,c,u){return function(){"use strict";var s,f,d,p={325:function(e,t,n){n.d(t,{V:function(){return a}});var r=n(155),o=n(770);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,o.y)();return(0,r.useMemo)(function(){if(!e)return[];var r,o,a,l,c,u=null==(c=n.getTrigger(e.type))||null==(l=c.useTempAssociationSource)?void 0:l.call(c,e.config,e),s=u||"string"!=typeof(a=null==(r=e)||null==(o=r.config)?void 0:o.collection)||!a||(null==r?void 0:r.id)==null?null:{collection:a,nodeId:r.id,nodeKey:"workflow",nodeType:"workflow"},f=t.map(function(e){var t,r;return null==(r=n.getInstruction(e.type))||null==(t=r.useTempAssociationSource)?void 0:t.call(r,e)}).filter(Boolean);return u||s?[u||s].concat(function(e){if(Array.isArray(e))return i(e)}(f)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(f)||function(e){if(e){if("string"==typeof e)return i(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(e,void 0)}}(f)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):f},[t,e,n])}},488:function(e,t,n){n.d(t,{CU:function(){return i},MZ:function(){return a},kj:function(){return l}});var r=n(694);function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}n(953);var i="@nocobase/plugin-workflow-cc";function a(e,t){return(0,r.tExpr)(e,o({ns:i},t))}function l(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,o({ns:[i,"client"],nsMode:"fallback"},n))}}},813:function(e,t,n){function r(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var a=e.apply(t,n);function l(e){r(a,o,i,l,c,"next",e)}function c(e){r(a,o,i,l,c,"throw",e)}l(void 0)})}}function i(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}n.d(t,{W:function(){return u}});var a=new WeakSet,l="__workflowCcModelLoadersRegistered__";function c(e){return o(function(){return i(this,function(t){return[2,e()]})})()}function u(e){a.has(e)||e[l]||"function"!=typeof e.registerModelLoaders||(e.registerModelLoaders({CCChildPageModel:{extends:"ChildPageModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("458").then(n.bind(n,401))];case 1:return[2,e.sent().CCChildPageModel]}})})()})}},CCChildPageTabModel:{extends:"ChildPageTabModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("458").then(n.bind(n,401))];case 1:return[2,e.sent().CCChildPageTabModel]}})})()})}},CCBlockGridModel:{extends:"BlockGridModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("746").then(n.bind(n,561))];case 1:return[2,e.sent().CCBlockGridModel]}})})()})}},CCTriggerBlockGridModel:{extends:"BlockGridModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("86").then(n.bind(n,29))];case 1:return[2,e.sent().CCTriggerBlockGridModel]}})})()})}},CCTaskCardDetailsModel:{extends:"DetailsBlockModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("164").then(n.bind(n,303))];case 1:return[2,e.sent().CCTaskCardDetailsModel]}})})()})}},CCTaskCardGridModel:{extends:"DetailsGridModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("352").then(n.bind(n,923))];case 1:return[2,e.sent().CCTaskCardGridModel]}})})()})}},CCTaskCardDetailsItemModel:{extends:"DetailsItemModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("437").then(n.bind(n,628))];case 1:return[2,e.sent().CCTaskCardDetailsItemModel]}})})()})}},CCTaskCardDetailsAssociationFieldGroupModel:{extends:"DetailsAssociationFieldGroupModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("486").then(n.bind(n,429))];case 1:return[2,e.sent().CCTaskCardDetailsAssociationFieldGroupModel]}})})()})}}}),a.add(e),e[l]=!0)}},92:function(e,t,n){n.d(t,{o:function(){return a}});var r=n(694),o=n(358),i=[{name:"workflowCcTasks",dataCategory:"business",filterTargetKey:"id",simplePaginate:!0,dumpRules:{group:"log"},migrationRules:["schema-only"],shared:!0,createdAt:!0,updatedAt:!0,fields:[{type:"snowflakeId",name:"id",primaryKey:!0,allowNull:!1},{type:"belongsTo",name:"job",target:"jobs",foreignKey:"jobId",primaryKey:!1},{type:"belongsTo",name:"user",target:"users",foreignKey:"userId",primaryKey:!1},{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:'{{t("Task title", { ns: "'.concat(o.CU,'" })}}'),"x-component":"Input"}},{type:"belongsTo",name:"execution",onDelete:"CASCADE"},{type:"belongsTo",name:"node",target:"flow_nodes",uiSchema:{type:"object",title:'{{t("CC node", { ns: "'.concat(o.CU,'" })}}')}},{type:"belongsTo",name:"workflow",target:"workflows",foreignKey:"workflowId",onDelete:"CASCADE",interface:"m2o",uiSchema:{type:"object",title:'{{t("Workflow", { ns: "workflow" })}}',"x-component":"AssociationField","x-component-props":{fieldNames:{label:"title",value:"id"}}}},{type:"integer",name:"status",interface:"select",uiSchema:{type:"number",title:'{{t("Status", { ns: "'.concat(o.CU,'" })}}'),"x-component":"Select",enum:[{label:'{{t("Unread", { ns: "'.concat(o.CU,'" })}}'),value:0,color:"gold"},{label:'{{t("Read", { ns: "'.concat(o.CU,'" })}}'),value:1,color:"green"}]},defaultValue:0},{type:"date",name:"readAt",interface:"datetime",uiSchema:{type:"string",title:'{{t("Read at", { ns: "'.concat(o.CU,'" })}}'),"x-component":"DatePicker","x-component-props":{showTime:!0}}},{type:"date",name:"createdAt",interface:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at", { ns: "'.concat(o.CU,'" })}}'),"x-component":"DatePicker","x-component-props":{showTime:!0}}},{type:"date",name:"updatedAt",interface:"updatedAt",uiSchema:{type:"datetime",title:'{{t("Updated at", { ns: "'.concat(o.CU,'" })}}'),"x-component":"DatePicker","x-component-props":{showTime:!0}}}]},{name:"flow_nodes",dataCategory:"system",shared:!0,fields:[{name:"id",type:"snowflakeId",primaryKey:!0,allowNull:!1},{type:"uid",name:"key"},{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}},{name:"workflow",type:"belongsTo",target:"workflows"},{name:"upstream",type:"belongsTo",target:"flow_nodes"},{name:"downstream",type:"belongsTo",target:"flow_nodes"},{type:"string",name:"type"},{type:"json",name:"config",defaultValue:{}}]},{name:"workflows",dataCategory:"system",shared:!0,fields:[{name:"id",type:"snowflakeId",primaryKey:!0,allowNull:!1,interface:"id",uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-read-pretty":!0}},{name:"key",type:"uid"},{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:'{{t("Name")}}',"x-component":"Input",required:!0}},{type:"string",name:"type"},{type:"jsonb",name:"config",defaultValue:{}},{type:"boolean",name:"enabled",defaultValue:!1}]}];function a(e){var t,n,o=null==(n=e.dataSourceManager)||null==(t=n.getDataSource)?void 0:t.call(n,"main");o&&i.forEach(function(e){var t,n,i;null!=(t=o.getCollection)&&t.call(o,e.name)||o.addCollection(new r.Collection((n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),i=i={hidden:!0},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}),n)))})}},770:function(e,t,n){n.d(t,{y:function(){return c}});var r=n(694),o=n(197),i=n(155);function a(e,t){try{var n;return null==e||null==(n=e.get)?void 0:n.call(e,t)}catch(e){return}}function l(e){var t,n,r=null==e||null==(n=e.context)||null==(t=n.app)?void 0:t.pm,i=[a(r,"workflow"),a(r,"@nocobase/plugin-workflow"),a(r,o.PluginWorkflowClientV2)];return i.filter(function(e,t){return e&&i.indexOf(e)===t})}function c(){var e=(0,r.useFlowEngine)();return(0,i.useMemo)(function(){return{getInstruction:function(t){return function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=l(e)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var c=i.value,u=function(e,t){var n,r,o,i;return null!=(n=null==(r=e.getInstruction)?void 0:r.call(e,t))?n:null==(i=e.instructions)||null==(o=i.get)?void 0:o.call(i,t)}(c,t);if(u)return u}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}}(e,t)},getTrigger:function(t){return function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=l(e)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var c=i.value,u=function(e,t){var n,r,o,i;return null!=(n=null==(r=e.getTriggerOptions)?void 0:r.call(e,t))?n:null==(i=e.triggers)||null==(o=i.get)?void 0:o.call(i,t)}(c,t);if(u)return u}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}}(e,t)}}},[e])}},358:function(e,t,n){n.d(t,{CU:function(){return r},Rr:function(){return i},wl:function(){return o}});var r="@nocobase/plugin-workflow-cc",o="cc",i={UNREAD:0,READ:1}},375:function(e){e.exports=c},485:function(e){e.exports=r},694:function(e){e.exports=u},341:function(e){e.exports=n},197:function(e){e.exports=l},625:function(t){t.exports=e},59:function(e){e.exports=a},155:function(e){e.exports=i},953:function(e){e.exports=t},442:function(e){e.exports=o}},y={};function b(e){var t=y[e];if(void 0!==t)return t.exports;var n=y[e]={exports:{}};return p[e](n,n.exports,b),n.exports}b.m=p,b.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(t,{a:t}),t},b.d=function(e,t){for(var n in t)b.o(t,n)&&!b.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},b.f={},b.e=function(e){return Promise.all(Object.keys(b.f).reduce(function(t,n){return b.f[n](e,t),t},[]))},b.u=function(e){return""+e+"."+({164:"e2c25964de2486b9",352:"a8dbaca3691905cb",437:"cbf01251aba7d74f",458:"51f1362d12aefe62",486:"d0a505ec5bea795c",679:"1a40558fb0f1c4e6",746:"b0fb6ac7c4f7e83b",86:"f7881bb89e51a4b6"})[e]+".js"},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),b.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},g={},b.l=function(e,t,n,r){if(g[e])return void g[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),l=0;l<a.length;l++){var c=a[l];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="@nocobase/plugin-workflow-cc/client-v2:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,b.nc&&o.setAttribute("nonce",b.nc),o.setAttribute("data-rspack","@nocobase/plugin-workflow-cc/client-v2:"+n),o.src=e),g[e]=[t];var u=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=g[e];if(delete g[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),i&&document.head.appendChild(o)},b.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.g.importScripts&&(v=b.g.location+"");var g,v,w=b.g.document;if(!v&&w&&(w.currentScript&&"SCRIPT"===w.currentScript.tagName.toUpperCase()&&(v=w.currentScript.src),!v)){var m=w.getElementsByTagName("script");if(m.length)for(var h=m.length-1;h>-1&&(!v||!/^http(s?):/.test(v));)v=m[h--].src}if(!v)throw Error("Automatic publicPath is not supported in this browser");b.p=v.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s={889:0},b.f.j=function(e,t){var n=b.o(s,e)?s[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=s[e]=[t,r]});t.push(n[2]=r);var o=b.p+b.u(e),i=Error();b.l(o,function(t){if(b.o(s,e)&&(0!==(n=s[e])&&(s[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},f=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],l=0;if(o.some(function(e){return 0!==s[e]})){for(n in i)b.o(i,n)&&(b.m[n]=i[n]);a&&a(b)}for(e&&e(t);l<o.length;l++)r=o[l],b.o(s,r)&&s[r]&&s[r][0](),s[r]=0},(d=self.webpackChunk_nocobase_plugin_workflow_cc_client_v2=self.webpackChunk_nocobase_plugin_workflow_cc_client_v2||[]).forEach(f.bind(null,0)),d.push=f.bind(null,d.push.bind(d));var k={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-workflow-cc/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-workflow-cc/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",l=a.indexOf(i);e=l>=0?a.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-workflow-cc/dist/client-v2/"}b.p=e}(),!function(){b.r(k),b.d(k,{PluginWorkflowCCClientV2:function(){return es},default:function(){return ef}});var e,t=b(485),n=b(197),r=b(358),o=b(813),i=b(375),a=b(155),l=b.n(a),c=b(488);function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}var p=function(e){return'{{t("'.concat(e,'", { ns: "').concat(c.CU,'" })}}')},y=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=s(t),u(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,d()?Reflect.construct(t,r||[],s(this).constructor):t.apply(this,r)),"title",p("CC")),u(e,"type","cc"),u(e,"group","manual"),u(e,"description",p("Provide a CC (carbon copy) feature in workflows to send approvals, or any other type of information to specified users.")),u(e,"icon",l().createElement(i.EyeOutlined,null)),u(e,"FieldsetLoader",function(){return b.e("679").then(b.bind(b,482)).then(function(e){return{default:e.CCFieldset}})}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&f(n,e),t=[{key:"createDefaultConfig",value:function(){return{}}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(n.Instruction),g=b(694),v=b(625),w=b(59),m=b(442);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function C(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function x(e){var n,r=e.enableUIConfiguration,o=void 0!==r&&r,i=e.mapModel,c=void 0===i?function(e){return e}:i,u=e.onModelLoaded,s=e.reloadKey,f=e.uid,d=e.useCache,p=function(e){if(Array.isArray(e))return e}(n=(0,a.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(n)||function(e){if(e){if("string"==typeof e)return h(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,2)}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),y=p[0],b=p[1],v=(0,g.useFlowEngine)(),w=(0,g.useFlowViewContext)(),m=(0,a.useRef)(u),k=(0,a.useRef)(c),x=(0,a.useRef)(null),S=(0,a.useRef)(o);return(0,a.useEffect)(function(){m.current=u},[u]),(0,a.useEffect)(function(){k.current=c},[c]),(0,a.useEffect)(function(){var e,t=!1;return(e=function(){var e,n;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:if(!f)return t||b(null),[2];return[4,v.loadModel({uid:f})];case 1:if(!(e=r.sent()))return t||b(null),[2];return e=k.current?k.current(e):e,w&&e.context.addDelegate(w),e.context.defineProperty("flowSettingsEnabled",{value:S.current}),x.current=e,t||(b(e),null==(n=m.current)||n.call(m,e)),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){C(i,r,o,a,l,"next",e)}function l(e){C(i,r,o,a,l,"throw",e)}a(void 0)})})(),function(){t=!0}},[v,s,f,w]),(0,a.useEffect)(function(){S.current=o,x.current&&x.current.context.defineProperty("flowSettingsEnabled",{value:o})},[o]),l().createElement(g.FlowModelRenderer,{fallback:l().createElement(t.SkeletonFallback,null),hideRemoveInSettings:!0,model:y,showFlowSettings:!1,useCache:void 0!==d&&d})}var S=b(325),O=b(92),j=b(770);function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function P(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function A(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){P(i,r,o,a,l,"next",e)}function l(e){P(i,r,o,a,l,"throw",e)}a(void 0)})}}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){T(e,t,n[t])})}return e}function R(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||I(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function I(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(e,t)}}function F(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var U=["node.id","node.title","node.updatedAt","node.config","workflow.id","workflow.title","workflow.enabled","workflow.config","workflow.nodes","workflow.nodes.title","workflow.nodes.key","workflow.nodes.config","execution.id","execution.status"],L=["node","job","workflow","workflow.nodes","execution","execution.jobs"],B="workflowCcTasksFilter",G={$and:[{title:{$includes:""}},{"workflow.title":{$includes:""}}]},N=(T(e={},n.TASK_STATUS.PENDING,{filter:{status:r.Rr.UNREAD}}),T(e,n.TASK_STATUS.COMPLETED,{filter:{status:r.Rr.READ}}),e);function q(e){return!!e&&(void 0===e?"undefined":D(e))==="object"&&!Array.isArray(e)}function W(e,t){return t.split(".").reduce(function(e,t){return q(e)?e[t]:void 0},e)}function $(e,t){var n=W(e,t);if(null!=n)return String(n)}function K(e,t){var n=W(e,t);return q(n)?n:void 0}function V(e){return!q(e)||function e(t){return null==t||""===t||(Array.isArray(t)?t.every(e):(void 0===t?"undefined":D(t))==="object"&&Object.values(t).every(e))}(e)}function z(){if(!("u"<typeof window)){var e=new URLSearchParams(window.location.search).get(B);if(e)try{var t=JSON.parse(e);return q(t)&&!V(t)?t:void 0}catch(e){return}}}function H(e){return String(e).padStart(2,"0")}function X(e){var t="string"==typeof e||"number"==typeof e?String(e):void 0;if(!t)return"-";var n=new Date(t);return Number.isNaN(n.getTime())?t:"".concat(n.getFullYear(),"-").concat(H(n.getMonth()+1),"-").concat(H(n.getDate())," ").concat(H(n.getHours()),":").concat(H(n.getMinutes()),":").concat(H(n.getSeconds()))}function J(e){var t,n=K(e,"workflow"),r=K(e,"node"),o=Array.isArray(t=W(e,"workflow.nodes"))?t.filter(q):[],i=(0,a.useMemo)(function(){return function e(t,n){if(!t||!n.length)return[];var r,o=t.upstreamId,i=n.find(function(e){return e.id===o});return i?[i].concat(function(e){if(Array.isArray(e))return E(e)}(r=e(i,n))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||I(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):[]}(r,o)},[r,o]),l=(0,S.V)(n,i);return{availableUpstreams:i,node:r,nodes:o,tempAssociationSources:l,trigger:(0,j.y)().getTrigger(null==n?void 0:n.type),workflow:n}}function Y(e){var t=e.record,n=(0,c.kj)();return l().createElement(w.Tag,{color:t.status===r.Rr.READ?"green":"gold"},n(t.status===r.Rr.READ?"Read":"Unread"))}function Z(){var e,t,r,o=(0,n.useWorkflowTaskRecord)().record,i=(0,c.kj)(),a=w.theme.useToken().token,u=null!=(e=null!=(t=null!=(r=$(o,"title"))?r:$(o,"node.title"))?t:$(o,"workflow.title"))?e:i("CC"),s=$(o,"workflow.title");return l().createElement(w.Card,{hoverable:!0,size:"small",title:u,extra:s,style:{width:"100%"},styles:{body:{padding:a.paddingSM},extra:{color:a.colorTextDescription},header:{minHeight:a.controlHeightLG,paddingInline:a.paddingSM}}},l().createElement(w.Descriptions,{column:1,styles:{label:{width:"6em"}},items:[{key:"createdAt",label:i("Created at"),children:X(o.createdAt)},{key:"status",label:i("Status"),children:l().createElement(Y,{record:o})}]}))}function Q(){var e=(0,n.useWorkflowTaskRecord)(),t=e.record,o=e.refresh,i=e.openRecord,u=(0,g.useFlowContext)(),s=w.App.useApp().message,f=(0,c.kj)(),d=t.status,p=d===r.Rr.READ?"unread":"read",y=d===r.Rr.READ?f("Mark as unread"):f("Mark as read"),b=d===r.Rr.READ?"default":"primary",m=(0,a.useRef)(!1),h=_((0,a.useState)(!1),2),k=h[0],C=h[1],x=(0,v.useMemoizedFn)(function(){return A(function(){var e,n,a;return F(this,function(l){switch(l.label){case 0:if(m.current||null==(e=t.id))return[2];m.current=!0,C(!0),l.label=1;case 1:return l.trys.push([1,4,5,6]),[4,null==u||null==(n=(a=u.api.resource("workflowCcTasks"))[p])?void 0:n.call(a,{filterByTk:e})];case 2:return l.sent(),null==i||i(R(M({},t),{status:d===r.Rr.READ?r.Rr.UNREAD:r.Rr.READ})),[4,null==o?void 0:o()];case 3:return l.sent(),[3,6];case 4:return console.error("Failed to update workflow CC task status",l.sent()),s.error(f("Load failed")),[3,6];case 5:return m.current=!1,C(!1),[7];case 6:return[2]}})})()});return l().createElement(w.Button,{type:b,loading:k,disabled:k,onClick:x},y)}function ee(){var e,t,r,o=(0,n.useWorkflowTaskRecord)().record,i=(0,c.kj)();return l().createElement(w.Flex,{vertical:!0,gap:"middle"},l().createElement(w.Descriptions,{column:1,bordered:!0,items:[{key:"workflow",label:i("Workflow"),children:null!=(e=$(o,"workflow.title"))?e:"-"},{key:"node",label:i("CC node"),children:null!=(t=$(o,"node.title"))?t:"-"},{key:"status",label:i("Status"),children:l().createElement(Y,{record:o})},{key:"execution",label:i("Execution"),children:null!=(r=$(o,"execution.id"))?r:"-"},{key:"createdAt",label:i("Created at"),children:X(o.createdAt)},{key:"updatedAt",label:i("Updated at"),children:X(o.updatedAt)},{key:"readAt",label:i("Read at"),children:X(o.readAt)}]}),l().createElement(w.Flex,{justify:"end"},l().createElement(Q,null)))}function et(e){var t=w.theme.useToken().token;return(0,a.useMemo)(function(){return e?{style:{height:28,minWidth:44,paddingInline:t.paddingSM-t.lineWidth}}:{}},[e,t.lineWidth,t.paddingSM])}function en(e){var n,r,o,i,u,s,f=e.onlyIcon,d=(0,c.kj)(),p=(0,m.useNavigate)(),y=(0,m.useLocation)(),b=(n=(0,g.useFlowEngine)(),r=(0,v.useMemoizedFn)(function(){var e,t,r,o;return null==(o=n.dataSourceManager)||null==(r=o.getDataSource)||null==(t=r.call(o,"main"))||null==(e=t.getCollection)?void 0:e.call(t,"workflowCcTasks")}),i=(o=_((0,a.useState)(function(){return r()}),2))[0],u=o[1],(0,a.useEffect)(function(){(0,O.o)(n),u(r())},[n,r]),i),h=d("Filter"),k=null!=(s=z())?s:G,C=et(f),x=(0,v.useMemoizedFn)(function(e){return A(function(){return F(this,function(t){var n,r,o;return p((r=new URLSearchParams(y.search),V(e)?r.delete(B):r.set(B,JSON.stringify(e)),o=r.toString(),"".concat(y.pathname).concat(o?"?".concat(o):"").concat(null!=(n=y.hash)?n:"")),{replace:!0}),[2]})})()}),S=l().createElement(t.CollectionFilter,{key:y.search||"empty-filter",collection:b,initialValue:k,onChange:x,t:d,filterableFieldNames:["title","workflow"],buttonText:f?"":void 0,showCount:!1,popoverMinWidth:f?288:void 0,popoverProps:f?{placement:"bottomRight",styles:{body:{maxWidth:"calc(100vw - 32px)",overflowX:"auto",width:312}}}:void 0,buttonProps:M({"aria-label":f?h:void 0},C)});return f?l().createElement(w.Tooltip,{title:h},S):S}var er={key:r.wl,title:'{{t("CC to me", { ns: "'.concat(c.CU,'" })}}'),collection:"workflowCcTasks",action:"listMine",useActionParams:function(e){var t,n,r,o=null!=(r=N[e])?r:{},i=(t=o.filter,n=z(),V(t)?null!=n?n:{}:V(n)?null!=t?t:{}:{$and:[t,n]});return R(M({},o),{filter:i,appends:U,except:["workflow.options","execution.context","execution.output"]})},Actions:function(e){var t,o=e.onlyIcon,u=e.reload,s=(0,g.useFlowContext)(),f=(0,n.getWorkflowTaskRegistry)(s),d=(0,n.useWorkflowTaskCounts)(s,f),p=d.counts,y=d.reload,b=w.App.useApp().message,m=(0,c.kj)(),h=et(o),k=_((0,a.useState)(!1),2),C=k[0],x=k[1],S=_((0,a.useState)(!1),2),O=S[0],j=S[1],E=(0,a.useRef)(!1),P=null==(t=p[r.wl])?void 0:t.pending,T=O||C||0===P;(0,a.useEffect)(function(){"number"==typeof P&&P>0&&x(!1)},[P]);var R=(0,v.useMemoizedFn)(function(){return A(function(){return F(this,function(e){switch(e.label){case 0:if(e.trys.push([0,5,,6]),!u)return[3,2];return[4,u()];case 1:return e.sent(),[3,4];case 2:return[4,y()];case 3:e.sent(),e.label=4;case 4:return[3,6];case 5:return console.error("Failed to refresh workflow CC tasks",e.sent()),b.error(m("Load failed")),[3,6];case 6:return[2]}})})()}),D=(0,v.useMemoizedFn)(function(){return A(function(){var e,t;return F(this,function(n){switch(n.label){case 0:if(E.current||T)return[2];E.current=!0,j(!0),n.label=1;case 1:return n.trys.push([1,7,8,9]),[4,null==s||null==(e=(t=s.api.resource("workflowCcTasks")).read)?void 0:e.call(t)];case 2:if(n.sent(),x(!0),!u)return[3,4];return[4,u()];case 3:return n.sent(),[3,6];case 4:return[4,y()];case 5:n.sent(),n.label=6;case 6:return[3,9];case 7:return console.error("Failed to mark workflow CC tasks as read",n.sent()),b.error(m("Load failed")),[3,9];case 8:return E.current=!1,j(!1),[7];case 9:return[2]}})})()}),I=l().createElement(w.Button,M({icon:l().createElement(i.ReloadOutlined,null),onClick:R,"aria-label":m("Refresh")},h),o?null:m("Refresh")),U=l().createElement(w.Button,M({icon:l().createElement(i.CheckOutlined,null),onClick:D,"aria-label":m("Mark all as read"),disabled:T,loading:O},h),o?null:m("Mark all as read"));return l().createElement(w.Space,{size:"small",wrap:!0},o?l().createElement(w.Tooltip,{title:m("Refresh")},I):I,l().createElement(en,{onlyIcon:o}),o?l().createElement(w.Tooltip,{title:m("Mark all as read")},U):U)},Item:function(){var e=(0,n.useWorkflowTaskRecord)().record,t=J(e),r=t.nodes,o=t.tempAssociationSources,i=t.workflow,c=$(e,"node.config.taskCardUid"),u=$(e,"node.updatedAt"),s=(0,a.useCallback)(function(t){t.getCurrentRecord=function(){return e},t.context.defineProperty("workflow",{get:function(){return i},cache:!1}),t.context.defineProperty("nodes",{get:function(){return r},cache:!1}),t.context.defineProperty("tempAssociationSources",{get:function(){return o},cache:!1})},[r,e,o,i]),f=(0,a.useCallback)(function(e){return e.clone()},[]);return c?l().createElement(x,{uid:c,onModelLoaded:s,mapModel:f,reloadKey:u}):l().createElement(Z,null)},Detail:function(){var e=(0,n.useWorkflowTaskRecord)().record,r=J(e),o=r.availableUpstreams,i=r.node,c=r.nodes,u=r.tempAssociationSources,s=r.trigger,f=r.workflow,d=$(e,"node.config.ccUid"),p=(0,a.useRef)(e);p.current=e;var y=(0,a.useCallback)(function(t){t.getCurrentRecord=function(){return p.current},t.context.defineProperty("flowSettingsEnabled",{value:!1}),t.context.defineProperty("disableBlockGridPadding",{value:!0}),t.context.defineProperty("record",{get:function(){return p.current},cache:!1}),t.context.defineProperty("workflowCcTaskRecord",{get:function(){return p.current},cache:!1}),t.context.defineProperty("view",{value:{inputArgs:{availableUpstreams:o,flowContext:{execution:K(e,"execution"),nodes:c,workflow:f},node:i,trigger:s}}}),t.context.defineProperty("workflow",{value:f}),t.context.defineProperty("nodes",{value:c}),t.context.defineProperty("tempAssociationSources",{value:u,cache:!1})},[o,i,c,e,u,s,f]);return d&&i&&f?K(e,"job")||Array.isArray(W(e,"execution.jobs"))?l().createElement(w.Flex,{"data-testid":"workflow-cc-detail-content",vertical:!0,gap:0,style:{gap:0}},l().createElement(x,{uid:d,onModelLoaded:y}),l().createElement(w.Flex,{justify:"end"},l().createElement(Q,null))):l().createElement(t.SkeletonFallback,null):l().createElement(ee,null)},DetailModal:function(e){var t=e.children,n=e.mobile,r=e.onClose,o=e.record,i=e.title,a=w.theme.useToken().token;return l().createElement(w.Modal,{open:!!o,title:i,footer:null,width:"80vw",onCancel:r,destroyOnClose:!0,styles:{body:{background:a.colorBgLayout,maxHeight:n?"calc(100dvh - ".concat(2*a.sizeXXL,"px)"):void 0,overflow:"auto",padding:"0 ".concat(a.paddingLG,"px ").concat(a.paddingLG,"px")},content:{background:a.colorBgLayout,overflow:"hidden",padding:0},header:{background:a.colorBgLayout,marginBottom:0,padding:"".concat(a.paddingContentVerticalLG,"px ").concat(a.paddingLG,"px ").concat(a.paddingContentVertical,"px")}}},t)},getPopupRecord:function(e,t){var n=t.params;return A(function(){var t,r;return F(this,function(o){return[2,null==(t=(r=e.resource("workflowCcTasks")).get)?void 0:t.call(r,R(M({},n),{appends:L}))]})})()}};function eo(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function ei(e,t,n){return(ei=eu()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&el(o,n.prototype),o}).apply(null,arguments)}function ea(e){return(ea=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function el(e,t){return(el=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ec(e){var t="function"==typeof Map?new Map:void 0;return(ec=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return ei(e,arguments,ea(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),el(n,e)})(e)}function eu(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eu=function(){return!!e})()}var es=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(){var e,t;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return e=i,t=arguments,e=ea(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,eu()?Reflect.construct(e,t||[],ea(this).constructor):e.apply(this,t))}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&el(i,e),t=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){return this.registerCollections(),this.registerModelLoaders(),this.registerWorkflowExtensions(),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){eo(i,r,o,a,l,"next",e)}function l(e){eo(i,r,o,a,l,"throw",e)}a(void 0)})}).call(this)}},{key:"registerCollections",value:function(){(0,O.o)(this.flowEngine)}},{key:"registerModelLoaders",value:function(){(0,o.W)(this.flowEngine)}},{key:"registerWorkflowExtensions",value:function(){var e,t,o,i=null!=(e=this.app.pm.get(n.PluginWorkflowClientV2))?e:this.app.pm.get("workflow");null==i||null==(t=i.registerInstruction)||t.call(i,"cc",y),null==i||null==(o=i.registerTaskType)||o.call(i,r.wl,er)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(i.prototype,t),i}(ec(t.Plugin)),ef=es}(),k}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ahooks"),require("react-i18next"),require("@nocobase/plugin-notification-manager/client-v2"),require("@nocobase/client-v2"),require("react-router-dom"),require("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-cc/client-v2",["ahooks","react-i18next","@nocobase/plugin-notification-manager/client-v2","@nocobase/client-v2","react-router-dom","react","antd","@nocobase/plugin-workflow/client-v2","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-cc/client-v2"]=t(require("ahooks"),require("react-i18next"),require("@nocobase/plugin-notification-manager/client-v2"),require("@nocobase/client-v2"),require("react-router-dom"),require("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-workflow-cc/client-v2"]=t(e.ahooks,e["react-i18next"],e["@nocobase/plugin-notification-manager/client-v2"],e["@nocobase/client-v2"],e["react-router-dom"],e.react,e.antd,e["@nocobase/plugin-workflow/client-v2"],e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i,a,l,c,u){return function(){"use strict";var s,f,d,p={325:function(e,t,n){n.d(t,{V:function(){return a}});var r=n(155),o=n(770);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,o.y)();return(0,r.useMemo)(function(){if(!e)return[];var r,o,a,l,c,u=null==(c=n.getTrigger(e.type))||null==(l=c.useTempAssociationSource)?void 0:l.call(c,e.config,e),s=u||"string"!=typeof(a=null==(r=e)||null==(o=r.config)?void 0:o.collection)||!a||(null==r?void 0:r.id)==null?null:{collection:a,nodeId:r.id,nodeKey:"workflow",nodeType:"workflow"},f=t.map(function(e){var t,r;return null==(r=n.getInstruction(e.type))||null==(t=r.useTempAssociationSource)?void 0:t.call(r,e)}).filter(Boolean);return u||s?[u||s].concat(function(e){if(Array.isArray(e))return i(e)}(f)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(f)||function(e){if(e){if("string"==typeof e)return i(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(e,void 0)}}(f)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):f},[t,e,n])}},488:function(e,t,n){n.d(t,{CU:function(){return i},MZ:function(){return a},kj:function(){return l}});var r=n(694);function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}n(953);var i="@nocobase/plugin-workflow-cc";function a(e,t){return(0,r.tExpr)(e,o({ns:i},t))}function l(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,o({ns:[i,"client"],nsMode:"fallback"},n))}}},813:function(e,t,n){function r(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var a=e.apply(t,n);function l(e){r(a,o,i,l,c,"next",e)}function c(e){r(a,o,i,l,c,"throw",e)}l(void 0)})}}function i(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}n.d(t,{W:function(){return u}});var a=new WeakSet,l="__workflowCcModelLoadersRegistered__";function c(e){return o(function(){return i(this,function(t){return[2,e()]})})()}function u(e){a.has(e)||e[l]||"function"!=typeof e.registerModelLoaders||(e.registerModelLoaders({CCChildPageModel:{extends:"ChildPageModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("458").then(n.bind(n,401))];case 1:return[2,e.sent().CCChildPageModel]}})})()})}},CCChildPageTabModel:{extends:"ChildPageTabModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("458").then(n.bind(n,401))];case 1:return[2,e.sent().CCChildPageTabModel]}})})()})}},CCBlockGridModel:{extends:"BlockGridModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("746").then(n.bind(n,561))];case 1:return[2,e.sent().CCBlockGridModel]}})})()})}},CCTriggerBlockGridModel:{extends:"BlockGridModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("86").then(n.bind(n,29))];case 1:return[2,e.sent().CCTriggerBlockGridModel]}})})()})}},CCTaskCardDetailsModel:{extends:"DetailsBlockModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("164").then(n.bind(n,303))];case 1:return[2,e.sent().CCTaskCardDetailsModel]}})})()})}},CCTaskCardGridModel:{extends:"DetailsGridModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("352").then(n.bind(n,923))];case 1:return[2,e.sent().CCTaskCardGridModel]}})})()})}},CCTaskCardDetailsItemModel:{extends:"DetailsItemModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("437").then(n.bind(n,628))];case 1:return[2,e.sent().CCTaskCardDetailsItemModel]}})})()})}},CCTaskCardDetailsAssociationFieldGroupModel:{extends:"DetailsAssociationFieldGroupModel",loader:function(){return c(function(){return o(function(){return i(this,function(e){switch(e.label){case 0:return[4,n.e("486").then(n.bind(n,429))];case 1:return[2,e.sent().CCTaskCardDetailsAssociationFieldGroupModel]}})})()})}}}),a.add(e),e[l]=!0)}},92:function(e,t,n){n.d(t,{o:function(){return a}});var r=n(694),o=n(358),i=[{name:"workflowCcTasks",dataCategory:"business",filterTargetKey:"id",simplePaginate:!0,dumpRules:{group:"log"},migrationRules:["schema-only"],shared:!0,createdAt:!0,updatedAt:!0,fields:[{type:"snowflakeId",name:"id",primaryKey:!0,allowNull:!1},{type:"belongsTo",name:"job",target:"jobs",foreignKey:"jobId",primaryKey:!1},{type:"belongsTo",name:"user",target:"users",foreignKey:"userId",primaryKey:!1},{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:'{{t("Task title", { ns: "'.concat(o.CU,'" })}}'),"x-component":"Input"}},{type:"belongsTo",name:"execution",onDelete:"CASCADE"},{type:"belongsTo",name:"node",target:"flow_nodes",uiSchema:{type:"object",title:'{{t("CC node", { ns: "'.concat(o.CU,'" })}}')}},{type:"belongsTo",name:"workflow",target:"workflows",foreignKey:"workflowId",onDelete:"CASCADE",interface:"m2o",uiSchema:{type:"object",title:'{{t("Workflow", { ns: "workflow" })}}',"x-component":"AssociationField","x-component-props":{fieldNames:{label:"title",value:"id"}}}},{type:"integer",name:"status",interface:"select",uiSchema:{type:"number",title:'{{t("Status", { ns: "'.concat(o.CU,'" })}}'),"x-component":"Select",enum:[{label:'{{t("Unread", { ns: "'.concat(o.CU,'" })}}'),value:0,color:"gold"},{label:'{{t("Read", { ns: "'.concat(o.CU,'" })}}'),value:1,color:"green"}]},defaultValue:0},{type:"date",name:"readAt",interface:"datetime",uiSchema:{type:"string",title:'{{t("Read at", { ns: "'.concat(o.CU,'" })}}'),"x-component":"DatePicker","x-component-props":{showTime:!0}}},{type:"date",name:"createdAt",interface:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at", { ns: "'.concat(o.CU,'" })}}'),"x-component":"DatePicker","x-component-props":{showTime:!0}}},{type:"date",name:"updatedAt",interface:"updatedAt",uiSchema:{type:"datetime",title:'{{t("Updated at", { ns: "'.concat(o.CU,'" })}}'),"x-component":"DatePicker","x-component-props":{showTime:!0}}}]},{name:"flow_nodes",dataCategory:"system",shared:!0,fields:[{name:"id",type:"snowflakeId",primaryKey:!0,allowNull:!1},{type:"uid",name:"key"},{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:'{{t("Title")}}',"x-component":"Input"}},{name:"workflow",type:"belongsTo",target:"workflows"},{name:"upstream",type:"belongsTo",target:"flow_nodes"},{name:"downstream",type:"belongsTo",target:"flow_nodes"},{type:"string",name:"type"},{type:"json",name:"config",defaultValue:{}}]},{name:"workflows",dataCategory:"system",shared:!0,fields:[{name:"id",type:"snowflakeId",primaryKey:!0,allowNull:!1,interface:"id",uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-read-pretty":!0}},{name:"key",type:"uid"},{type:"string",name:"title",interface:"input",uiSchema:{type:"string",title:'{{t("Name")}}',"x-component":"Input",required:!0}},{type:"string",name:"type"},{type:"jsonb",name:"config",defaultValue:{}},{type:"boolean",name:"enabled",defaultValue:!1}]}];function a(e){var t,n,o=null==(n=e.dataSourceManager)||null==(t=n.getDataSource)?void 0:t.call(n,"main");o&&i.forEach(function(e){var t,n,i;null!=(t=o.getCollection)&&t.call(o,e.name)||o.addCollection(new r.Collection((n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),i=i={hidden:!0},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}),n)))})}},770:function(e,t,n){n.d(t,{y:function(){return c}});var r=n(694),o=n(197),i=n(155);function a(e,t){try{var n;return null==e||null==(n=e.get)?void 0:n.call(e,t)}catch(e){return}}function l(e){var t,n,r=null==e||null==(n=e.context)||null==(t=n.app)?void 0:t.pm,i=[a(r,"workflow"),a(r,"@nocobase/plugin-workflow"),a(r,o.PluginWorkflowClientV2)];return i.filter(function(e,t){return e&&i.indexOf(e)===t})}function c(){var e=(0,r.useFlowEngine)();return(0,i.useMemo)(function(){return{getInstruction:function(t){return function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=l(e)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var c=i.value,u=function(e,t){var n,r,o,i;return null!=(n=null==(r=e.getInstruction)?void 0:r.call(e,t))?n:null==(i=e.instructions)||null==(o=i.get)?void 0:o.call(i,t)}(c,t);if(u)return u}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}}(e,t)},getTrigger:function(t){return function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=l(e)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var c=i.value,u=function(e,t){var n,r,o,i;return null!=(n=null==(r=e.getTriggerOptions)?void 0:r.call(e,t))?n:null==(i=e.triggers)||null==(o=i.get)?void 0:o.call(i,t)}(c,t);if(u)return u}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}}(e,t)}}},[e])}},358:function(e,t,n){n.d(t,{CU:function(){return r},Rr:function(){return i},wl:function(){return o}});var r="@nocobase/plugin-workflow-cc",o="cc",i={UNREAD:0,READ:1}},375:function(e){e.exports=c},485:function(e){e.exports=r},694:function(e){e.exports=u},341:function(e){e.exports=n},197:function(e){e.exports=l},625:function(t){t.exports=e},59:function(e){e.exports=a},155:function(e){e.exports=i},953:function(e){e.exports=t},442:function(e){e.exports=o}},y={};function b(e){var t=y[e];if(void 0!==t)return t.exports;var n=y[e]={exports:{}};return p[e](n,n.exports,b),n.exports}b.m=p,b.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(t,{a:t}),t},b.d=function(e,t){for(var n in t)b.o(t,n)&&!b.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},b.f={},b.e=function(e){return Promise.all(Object.keys(b.f).reduce(function(t,n){return b.f[n](e,t),t},[]))},b.u=function(e){return""+e+"."+({164:"e2c25964de2486b9",352:"a8dbaca3691905cb",437:"cbf01251aba7d74f",458:"51f1362d12aefe62",486:"d0a505ec5bea795c",679:"1a40558fb0f1c4e6",746:"b0fb6ac7c4f7e83b",86:"f7881bb89e51a4b6"})[e]+".js"},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),b.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},g={},b.l=function(e,t,n,r){if(g[e])return void g[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),l=0;l<a.length;l++){var c=a[l];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="@nocobase/plugin-workflow-cc/client-v2:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,b.nc&&o.setAttribute("nonce",b.nc),o.setAttribute("data-rspack","@nocobase/plugin-workflow-cc/client-v2:"+n),o.src=e),g[e]=[t];var u=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=g[e];if(delete g[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),i&&document.head.appendChild(o)},b.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.g.importScripts&&(w=b.g.location+"");var g,w,v=b.g.document;if(!w&&v&&(v.currentScript&&"SCRIPT"===v.currentScript.tagName.toUpperCase()&&(w=v.currentScript.src),!w)){var m=v.getElementsByTagName("script");if(m.length)for(var h=m.length-1;h>-1&&(!w||!/^http(s?):/.test(w));)w=m[h--].src}if(!w)throw Error("Automatic publicPath is not supported in this browser");b.p=w.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s={889:0},b.f.j=function(e,t){var n=b.o(s,e)?s[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=s[e]=[t,r]});t.push(n[2]=r);var o=b.p+b.u(e),i=Error();b.l(o,function(t){if(b.o(s,e)&&(0!==(n=s[e])&&(s[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},f=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],l=0;if(o.some(function(e){return 0!==s[e]})){for(n in i)b.o(i,n)&&(b.m[n]=i[n]);a&&a(b)}for(e&&e(t);l<o.length;l++)r=o[l],b.o(s,r)&&s[r]&&s[r][0](),s[r]=0},(d=self.webpackChunk_nocobase_plugin_workflow_cc_client_v2=self.webpackChunk_nocobase_plugin_workflow_cc_client_v2||[]).forEach(f.bind(null,0)),d.push=f.bind(null,d.push.bind(d));var k={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-workflow-cc/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-workflow-cc/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",l=a.indexOf(i);e=l>=0?a.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-workflow-cc/dist/client-v2/"}b.p=e}(),!function(){b.r(k),b.d(k,{PluginWorkflowCCClientV2:function(){return ef},default:function(){return ed}});var e,t=b(485),n=b(197),r=b(358),o=b(813),i=b(375),a=b(155),l=b.n(a),c=b(488);function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}var p=function(e){return'{{t("'.concat(e,'", { ns: "').concat(c.CU,'" })}}')},y=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=s(t),u(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,d()?Reflect.construct(t,r||[],s(this).constructor):t.apply(this,r)),"title",p("CC")),u(e,"type","cc"),u(e,"group","manual"),u(e,"description",p("Provide a CC (carbon copy) feature in workflows to send approvals, or any other type of information to specified users.")),u(e,"icon",l().createElement(i.EyeOutlined,null)),u(e,"FieldsetLoader",function(){return b.e("679").then(b.bind(b,482)).then(function(e){return{default:e.CCFieldset}})}),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&f(n,e),t=[{key:"createDefaultConfig",value:function(){return{}}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(n.Instruction),g=b(694),w=b(625),v=b(59),m=b(442);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function C(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function x(e){var n,r=e.enableUIConfiguration,o=void 0!==r&&r,i=e.mapModel,c=void 0===i?function(e){return e}:i,u=e.onModelLoaded,s=e.reloadKey,f=e.uid,d=e.useCache,p=function(e){if(Array.isArray(e))return e}(n=(0,a.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(n)||function(e){if(e){if("string"==typeof e)return h(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,2)}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),y=p[0],b=p[1],w=(0,g.useFlowEngine)(),v=(0,g.useFlowViewContext)(),m=(0,a.useRef)(u),k=(0,a.useRef)(c),x=(0,a.useRef)(null),S=(0,a.useRef)(o);return(0,a.useEffect)(function(){m.current=u},[u]),(0,a.useEffect)(function(){k.current=c},[c]),(0,a.useEffect)(function(){var e,t=!1;return(e=function(){var e,n;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:if(!f)return t||b(null),[2];return[4,w.loadModel({uid:f})];case 1:if(!(e=r.sent()))return t||b(null),[2];return e=k.current?k.current(e):e,v&&e.context.addDelegate(v),e.context.defineProperty("flowSettingsEnabled",{value:S.current}),x.current=e,t||(b(e),null==(n=m.current)||n.call(m,e)),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){C(i,r,o,a,l,"next",e)}function l(e){C(i,r,o,a,l,"throw",e)}a(void 0)})})(),function(){t=!0}},[w,s,f,v]),(0,a.useEffect)(function(){S.current=o,x.current&&x.current.context.defineProperty("flowSettingsEnabled",{value:o})},[o]),l().createElement(g.FlowModelRenderer,{fallback:l().createElement(t.SkeletonFallback,null),hideRemoveInSettings:!0,model:y,showFlowSettings:!1,useCache:void 0!==d&&d})}var S=b(325),O=b(92),j=b(770);function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function P(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function A(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){P(i,r,o,a,l,"next",e)}function l(e){P(i,r,o,a,l,"throw",e)}a(void 0)})}}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){T(e,t,n[t])})}return e}function R(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||I(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function I(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(e,t)}}function F(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}var U=["node.id","node.title","node.updatedAt","node.config","workflow.id","workflow.title","workflow.enabled","workflow.config","workflow.nodes","workflow.nodes.title","workflow.nodes.key","workflow.nodes.config","execution.id","execution.status"],L=["node","job","workflow","workflow.nodes","execution","execution.jobs"],B="workflowCcTasksFilter",G={$and:[{title:{$includes:""}}]},N=(T(e={},n.TASK_STATUS.PENDING,{filter:{status:r.Rr.UNREAD}}),T(e,n.TASK_STATUS.COMPLETED,{filter:{status:r.Rr.READ}}),e);function q(e){return!!e&&(void 0===e?"undefined":D(e))==="object"&&!Array.isArray(e)}function W(e,t){return t.split(".").reduce(function(e,t){return q(e)?e[t]:void 0},e)}function K(e,t){var n=W(e,t);if(null!=n)return String(n)}function $(e,t){var n=W(e,t);return q(n)?n:void 0}function V(e){return!q(e)||function e(t){return null==t||""===t||(Array.isArray(t)?t.every(e):(void 0===t?"undefined":D(t))==="object"&&Object.values(t).every(e))}(e)}function z(){if(!("u"<typeof window)){var e=new URLSearchParams(window.location.search).get(B);if(e)try{var t=JSON.parse(e);return q(t)&&!V(t)?t:void 0}catch(e){return}}}function H(e,t){return V(e)?null!=t?t:{}:V(t)?null!=e?e:{}:{$and:[e,t]}}function X(e){return String(e).padStart(2,"0")}function J(e){var t="string"==typeof e||"number"==typeof e?String(e):void 0;if(!t)return"-";var n=new Date(t);return Number.isNaN(n.getTime())?t:"".concat(n.getFullYear(),"-").concat(X(n.getMonth()+1),"-").concat(X(n.getDate())," ").concat(X(n.getHours()),":").concat(X(n.getMinutes()),":").concat(X(n.getSeconds()))}function Y(e){var t,n=$(e,"workflow"),r=$(e,"node"),o=Array.isArray(t=W(e,"workflow.nodes"))?t.filter(q):[],i=(0,a.useMemo)(function(){return function e(t,n){if(!t||!n.length)return[];var r,o=t.upstreamId,i=n.find(function(e){return e.id===o});return i?[i].concat(function(e){if(Array.isArray(e))return E(e)}(r=e(i,n))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||I(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):[]}(r,o)},[r,o]),l=(0,S.V)(n,i);return{availableUpstreams:i,node:r,nodes:o,tempAssociationSources:l,trigger:(0,j.y)().getTrigger(null==n?void 0:n.type),workflow:n}}function Z(e){var t=e.record,n=(0,c.kj)();return l().createElement(v.Tag,{color:t.status===r.Rr.READ?"green":"gold"},n(t.status===r.Rr.READ?"Read":"Unread"))}function Q(){var e,t,r,o=(0,n.useWorkflowTaskRecord)().record,i=(0,c.kj)(),a=v.theme.useToken().token,u=null!=(e=null!=(t=null!=(r=K(o,"title"))?r:K(o,"node.title"))?t:K(o,"workflow.title"))?e:i("CC"),s=K(o,"workflow.title");return l().createElement(v.Card,{hoverable:!0,size:"small",title:u,extra:s,style:{width:"100%"},styles:{body:{padding:a.paddingSM},extra:{color:a.colorTextDescription},header:{minHeight:a.controlHeightLG,paddingInline:a.paddingSM}}},l().createElement(v.Descriptions,{column:1,styles:{label:{width:"6em"}},items:[{key:"createdAt",label:i("Created at"),children:J(o.createdAt)},{key:"status",label:i("Status"),children:l().createElement(Z,{record:o})}]}))}function ee(){var e=(0,n.useWorkflowTaskRecord)(),t=e.record,o=e.refresh,i=e.openRecord,u=(0,g.useFlowContext)(),s=v.App.useApp().message,f=(0,c.kj)(),d=t.status,p=d===r.Rr.READ?"unread":"read",y=d===r.Rr.READ?f("Mark as unread"):f("Mark as read"),b=d===r.Rr.READ?"default":"primary",m=(0,a.useRef)(!1),h=_((0,a.useState)(!1),2),k=h[0],C=h[1],x=(0,w.useMemoizedFn)(function(){return A(function(){var e,n,a;return F(this,function(l){switch(l.label){case 0:if(m.current||null==(e=t.id))return[2];m.current=!0,C(!0),l.label=1;case 1:return l.trys.push([1,4,5,6]),[4,null==u||null==(n=(a=u.api.resource("workflowCcTasks"))[p])?void 0:n.call(a,{filterByTk:e})];case 2:return l.sent(),null==i||i(R(M({},t),{status:d===r.Rr.READ?r.Rr.UNREAD:r.Rr.READ})),[4,null==o?void 0:o()];case 3:return l.sent(),[3,6];case 4:return console.error("Failed to update workflow CC task status",l.sent()),s.error(f("Load failed")),[3,6];case 5:return m.current=!1,C(!1),[7];case 6:return[2]}})})()});return l().createElement(v.Button,{type:b,loading:k,disabled:k,onClick:x},y)}function et(){var e,t,r,o=(0,n.useWorkflowTaskRecord)().record,i=(0,c.kj)();return l().createElement(v.Flex,{vertical:!0,gap:"middle"},l().createElement(v.Descriptions,{column:1,bordered:!0,items:[{key:"workflow",label:i("Workflow"),children:null!=(e=K(o,"workflow.title"))?e:"-"},{key:"node",label:i("CC node"),children:null!=(t=K(o,"node.title"))?t:"-"},{key:"status",label:i("Status"),children:l().createElement(Z,{record:o})},{key:"execution",label:i("Execution"),children:null!=(r=K(o,"execution.id"))?r:"-"},{key:"createdAt",label:i("Created at"),children:J(o.createdAt)},{key:"updatedAt",label:i("Updated at"),children:J(o.updatedAt)},{key:"readAt",label:i("Read at"),children:J(o.readAt)}]}),l().createElement(v.Flex,{justify:"end"},l().createElement(ee,null)))}function en(e){var t=v.theme.useToken().token;return(0,a.useMemo)(function(){return e?{style:{height:28,minWidth:44,paddingInline:t.paddingSM-t.lineWidth}}:{}},[e,t.lineWidth,t.paddingSM])}function er(e){var n,r,o,i,u,s,f=e.onlyIcon,d=(0,c.kj)(),p=(0,m.useNavigate)(),y=(0,m.useLocation)(),b=(n=(0,g.useFlowEngine)(),r=(0,w.useMemoizedFn)(function(){var e,t,r,o;return null==(o=n.dataSourceManager)||null==(r=o.getDataSource)||null==(t=r.call(o,"main"))||null==(e=t.getCollection)?void 0:e.call(t,"workflowCcTasks")}),i=(o=_((0,a.useState)(function(){return r()}),2))[0],u=o[1],(0,a.useEffect)(function(){(0,O.o)(n),u(r())},[n,r]),i),h=d("Filter"),k=null!=(s=z())?s:G,C=en(f),x=(0,w.useMemoizedFn)(function(e){return A(function(){return F(this,function(t){var n,r,o;return p((r=new URLSearchParams(y.search),V(e)?r.delete(B):r.set(B,JSON.stringify(e)),o=r.toString(),"".concat(y.pathname).concat(o?"?".concat(o):"").concat(null!=(n=y.hash)?n:"")),{replace:!0}),[2]})})()}),S=l().createElement(t.CollectionFilter,{key:y.search||"empty-filter",collection:b,initialValue:k,onChange:x,t:d,filterableFieldNames:["title"],buttonText:f?"":void 0,showCount:!1,popoverMinWidth:f?288:void 0,popoverProps:f?{placement:"bottomRight",styles:{body:{maxWidth:"calc(100vw - 32px)",overflowX:"auto",width:312}}}:void 0,buttonProps:M({"aria-label":f?h:void 0},C)});return f?l().createElement(v.Tooltip,{title:h},S):S}var eo={key:r.wl,title:'{{t("CC to me", { ns: "'.concat(c.CU,'" })}}'),collection:"workflowCcTasks",action:"listMine",useActionParams:function(e,t){var n,r=null!=(n=N[e])?n:{},o=H(H(r.filter,t?{"workflow.key":t}:void 0),z());return R(M({},r),{filter:o,appends:U,except:["workflow.options","execution.context","execution.output"]})},Actions:function(e){var t,o=e.onlyIcon,u=e.reload,s=e.workflowKey,f=e.workflowPendingCount,d=(0,g.useFlowContext)(),p=(0,n.getWorkflowTaskRegistry)(d),y=(0,n.useWorkflowTaskCounts)(d,p),b=y.counts,m=y.reload,h=v.App.useApp().message,k=(0,c.kj)(),C=en(o),x=_((0,a.useState)(!1),2),S=x[0],O=x[1],j=_((0,a.useState)(!1),2),E=j[0],P=j[1],T=(0,a.useRef)(!1),R=null!=f?f:null==(t=b[r.wl])?void 0:t.pending,D=E||S||0===R;(0,a.useEffect)(function(){"number"==typeof R&&R>0&&O(!1)},[R]);var I=(0,w.useMemoizedFn)(function(){return A(function(){return F(this,function(e){switch(e.label){case 0:if(e.trys.push([0,5,,6]),!u)return[3,2];return[4,u()];case 1:return e.sent(),[3,4];case 2:return[4,m()];case 3:e.sent(),e.label=4;case 4:return[3,6];case 5:return console.error("Failed to refresh workflow CC tasks",e.sent()),h.error(k("Load failed")),[3,6];case 6:return[2]}})})()}),U=(0,w.useMemoizedFn)(function(){return A(function(){var e,t;return F(this,function(n){switch(n.label){case 0:if(T.current||D)return[2];T.current=!0,P(!0),n.label=1;case 1:return n.trys.push([1,7,8,9]),[4,null==d||null==(e=(t=d.api.resource("workflowCcTasks")).read)?void 0:e.call(t,M({},s?{filter:{"workflow.key":s}}:{}))];case 2:if(n.sent(),O(!0),!u)return[3,4];return[4,u()];case 3:return n.sent(),[3,6];case 4:return[4,m()];case 5:n.sent(),n.label=6;case 6:return[3,9];case 7:return console.error("Failed to mark workflow CC tasks as read",n.sent()),h.error(k("Load failed")),[3,9];case 8:return T.current=!1,P(!1),[7];case 9:return[2]}})})()}),L=l().createElement(v.Button,M({icon:l().createElement(i.ReloadOutlined,null),onClick:I,"aria-label":k("Refresh")},C),o?null:k("Refresh")),B=l().createElement(v.Button,M({icon:l().createElement(i.CheckOutlined,null),onClick:U,"aria-label":k("Mark all as read"),disabled:D,loading:E},C),o?null:k("Mark all as read"));return l().createElement(v.Space,{size:"small",wrap:!0},o?l().createElement(v.Tooltip,{title:k("Refresh")},L):L,l().createElement(er,{onlyIcon:o}),o?l().createElement(v.Tooltip,{title:k("Mark all as read")},B):B)},Item:function(){var e=(0,n.useWorkflowTaskRecord)().record,t=Y(e),r=t.nodes,o=t.tempAssociationSources,i=t.workflow,c=K(e,"node.config.taskCardUid"),u=K(e,"node.updatedAt"),s=(0,a.useCallback)(function(t){t.getCurrentRecord=function(){return e},t.context.defineProperty("workflow",{get:function(){return i},cache:!1}),t.context.defineProperty("nodes",{get:function(){return r},cache:!1}),t.context.defineProperty("tempAssociationSources",{get:function(){return o},cache:!1})},[r,e,o,i]),f=(0,a.useCallback)(function(e){return e.clone()},[]);return c?l().createElement(x,{uid:c,onModelLoaded:s,mapModel:f,reloadKey:u}):l().createElement(Q,null)},Detail:function(){var e=(0,n.useWorkflowTaskRecord)().record,r=Y(e),o=r.availableUpstreams,i=r.node,c=r.nodes,u=r.tempAssociationSources,s=r.trigger,f=r.workflow,d=K(e,"node.config.ccUid"),p=(0,a.useRef)(e);p.current=e;var y=(0,a.useCallback)(function(t){t.getCurrentRecord=function(){return p.current},t.context.defineProperty("flowSettingsEnabled",{value:!1}),t.context.defineProperty("disableBlockGridPadding",{value:!0}),t.context.defineProperty("record",{get:function(){return p.current},cache:!1}),t.context.defineProperty("workflowCcTaskRecord",{get:function(){return p.current},cache:!1}),t.context.defineProperty("view",{value:{inputArgs:{availableUpstreams:o,flowContext:{execution:$(e,"execution"),nodes:c,workflow:f},node:i,trigger:s}}}),t.context.defineProperty("workflow",{value:f}),t.context.defineProperty("nodes",{value:c}),t.context.defineProperty("tempAssociationSources",{value:u,cache:!1})},[o,i,c,e,u,s,f]);return d&&i&&f?$(e,"job")||Array.isArray(W(e,"execution.jobs"))?l().createElement(v.Flex,{"data-testid":"workflow-cc-detail-content",vertical:!0,gap:0,style:{gap:0}},l().createElement(x,{uid:d,onModelLoaded:y}),l().createElement(v.Flex,{justify:"end"},l().createElement(ee,null))):l().createElement(t.SkeletonFallback,null):l().createElement(et,null)},DetailModal:function(e){var t=e.children,n=e.mobile,r=e.onClose,o=e.record,i=e.title,a=v.theme.useToken().token;return l().createElement(v.Modal,{open:!!o,title:i,footer:null,width:"80vw",onCancel:r,destroyOnClose:!0,styles:{body:{background:a.colorBgLayout,maxHeight:n?"calc(100dvh - ".concat(2*a.sizeXXL,"px)"):void 0,overflow:"auto",padding:"0 ".concat(a.paddingLG,"px ").concat(a.paddingLG,"px")},content:{background:a.colorBgLayout,overflow:"hidden",padding:0},header:{background:a.colorBgLayout,marginBottom:0,padding:"".concat(a.paddingContentVerticalLG,"px ").concat(a.paddingLG,"px ").concat(a.paddingContentVertical,"px")}}},t)},getPopupRecord:function(e,t){var n=t.params;return A(function(){var t,r;return F(this,function(o){return[2,null==(t=(r=e.resource("workflowCcTasks")).get)?void 0:t.call(r,R(M({},n),{appends:L}))]})})()}};function ei(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){n(e);return}l.done?t(c):Promise.resolve(c).then(r,o)}function ea(e,t,n){return(ea=es()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&ec(o,n.prototype),o}).apply(null,arguments)}function el(e){return(el=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ec(e,t){return(ec=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eu(e){var t="function"==typeof Map?new Map:void 0;return(eu=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return ea(e,arguments,el(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ec(n,e)})(e)}function es(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(es=function(){return!!e})()}var ef=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(){var e,t;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return e=i,t=arguments,e=el(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,es()?Reflect.construct(e,t||[],el(this).constructor):e.apply(this,t))}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&ec(i,e),t=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:c(0)}),l(a,"throw",{value:c(1)}),l(a,"return",{value:c(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function c(l){return function(c){var u=[l,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){return this.registerCollections(),this.registerModelLoaders(),this.registerWorkflowExtensions(),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ei(i,r,o,a,l,"next",e)}function l(e){ei(i,r,o,a,l,"throw",e)}a(void 0)})}).call(this)}},{key:"registerCollections",value:function(){(0,O.o)(this.flowEngine)}},{key:"registerModelLoaders",value:function(){(0,o.W)(this.flowEngine)}},{key:"registerWorkflowExtensions",value:function(){var e,t,o,i=null!=(e=this.app.pm.get(n.PluginWorkflowClientV2))?e:this.app.pm.get("workflow");null==i||null==(t=i.registerInstruction)||t.call(i,"cc",y),null==i||null==(o=i.registerTaskType)||o.call(i,r.wl,eo)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(i.prototype,t),i}(eu(t.Plugin)),ed=ef}(),k}()});
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { type TaskTypeOptions, type WorkflowTaskStatus } from '@nocobase/plugin-workflow/client-v2';
|
|
10
|
-
export declare function useCcTaskActionParams(status: WorkflowTaskStatus): {
|
|
10
|
+
export declare function useCcTaskActionParams(status: WorkflowTaskStatus, workflowKey?: string): {
|
|
11
11
|
filter: Record<string, unknown>;
|
|
12
12
|
appends: string[];
|
|
13
13
|
except: string[];
|
package/dist/externalVersion.js
CHANGED
|
@@ -9,22 +9,22 @@
|
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"react": "18.2.0",
|
|
12
|
-
"@nocobase/client": "3.0.0-alpha.
|
|
13
|
-
"@nocobase/plugin-workflow": "3.0.0-alpha.
|
|
12
|
+
"@nocobase/client": "3.0.0-alpha.12",
|
|
13
|
+
"@nocobase/plugin-workflow": "3.0.0-alpha.12",
|
|
14
14
|
"react-i18next": "11.18.6",
|
|
15
15
|
"antd-style": "3.7.1",
|
|
16
16
|
"antd": "5.24.2",
|
|
17
17
|
"react-router-dom": "6.30.1",
|
|
18
18
|
"lodash": "4.18.1",
|
|
19
|
-
"@nocobase/flow-engine": "3.0.0-alpha.
|
|
20
|
-
"@nocobase/client-v2": "3.0.0-alpha.
|
|
19
|
+
"@nocobase/flow-engine": "3.0.0-alpha.12",
|
|
20
|
+
"@nocobase/client-v2": "3.0.0-alpha.12",
|
|
21
21
|
"@ant-design/icons": "5.6.1",
|
|
22
22
|
"ahooks": "3.7.8",
|
|
23
|
-
"@nocobase/utils": "3.0.0-alpha.
|
|
24
|
-
"@nocobase/plugin-ui-schema-storage": "3.0.0-alpha.
|
|
25
|
-
"@nocobase/actions": "3.0.0-alpha.
|
|
26
|
-
"@nocobase/server": "3.0.0-alpha.
|
|
27
|
-
"@nocobase/database": "3.0.0-alpha.
|
|
28
|
-
"@nocobase/data-source-manager": "3.0.0-alpha.
|
|
29
|
-
"@nocobase/plugin-notification-manager": "3.0.0-alpha.
|
|
23
|
+
"@nocobase/utils": "3.0.0-alpha.12",
|
|
24
|
+
"@nocobase/plugin-ui-schema-storage": "3.0.0-alpha.12",
|
|
25
|
+
"@nocobase/actions": "3.0.0-alpha.12",
|
|
26
|
+
"@nocobase/server": "3.0.0-alpha.12",
|
|
27
|
+
"@nocobase/database": "3.0.0-alpha.12",
|
|
28
|
+
"@nocobase/data-source-manager": "3.0.0-alpha.12",
|
|
29
|
+
"@nocobase/plugin-notification-manager": "3.0.0-alpha.12"
|
|
30
30
|
};
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/workflow-cc",
|
|
11
11
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/workflow-cc",
|
|
12
12
|
"license": "Apache-2.0",
|
|
13
|
-
"version": "3.0.0-alpha.
|
|
13
|
+
"version": "3.0.0-alpha.12",
|
|
14
14
|
"main": "dist/server/index.js",
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@nocobase/actions": "2.x",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"keywords": [
|
|
31
31
|
"Workflow"
|
|
32
32
|
],
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "2ba035885741a9977d76bbabf8f2caf44b199139"
|
|
34
34
|
}
|