@nocobase/plugin-gantt 2.1.0-alpha.10 → 2.1.0-alpha.11

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.
@@ -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("@ant-design/icons"),require("@formily/shared"),require("react"),require("antd"),require("antd-style"),require("@nocobase/utils/client"),require("lodash"),require("react-i18next"),require("@emotion/css"),require("@formily/antd-v5"),require("@formily/react"),require("@nocobase/flow-engine"),require("@nocobase/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-gantt",["@ant-design/icons","@formily/shared","react","antd","antd-style","@nocobase/utils/client","lodash","react-i18next","@emotion/css","@formily/antd-v5","@formily/react","@nocobase/flow-engine","@nocobase/client"],t):"object"==typeof exports?exports["@nocobase/plugin-gantt"]=t(require("@ant-design/icons"),require("@formily/shared"),require("react"),require("antd"),require("antd-style"),require("@nocobase/utils/client"),require("lodash"),require("react-i18next"),require("@emotion/css"),require("@formily/antd-v5"),require("@formily/react"),require("@nocobase/flow-engine"),require("@nocobase/client")):e["@nocobase/plugin-gantt"]=t(e["@ant-design/icons"],e["@formily/shared"],e.react,e.antd,e["antd-style"],e["@nocobase/utils/client"],e.lodash,e["react-i18next"],e["@emotion/css"],e["@formily/antd-v5"],e["@formily/react"],e["@nocobase/flow-engine"],e["@nocobase/client"])}(self,function(e,t,r,n,o,a,i,l,c,s,u,d,f){return function(){"use strict";var p,h={375:function(t){t.exports=e},477:function(e){e.exports=c},418:function(e){e.exports=s},230:function(e){e.exports=u},166:function(e){e.exports=t},342:function(e){e.exports=f},694:function(e){e.exports=d},768:function(e){e.exports=a},59:function(e){e.exports=n},235:function(e){e.exports=o},773:function(e){e.exports=i},155:function(e){e.exports=r},953:function(e){e.exports=l}},m={};function g(e){var t=m[e];if(void 0!==t)return t.exports;var r=m[e]={exports:{}};return h[e](r,r.exports,g),r.exports}g.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return g.d(t,{a:t}),t},g.d=function(e,t){for(var r in t)g.o(t,r)&&!g.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},g.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),g.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},g.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},g.g.importScripts&&(v=g.g.location+"");var v,b=g.g.document;if(!v&&b&&(b.currentScript&&"SCRIPT"===b.currentScript.tagName.toUpperCase()&&(v=b.currentScript.src),!v)){var y=b.getElementsByTagName("script");if(y.length)for(var x=y.length-1;x>-1&&(!v||!/^http(s?):/.test(v));)v=y[x--].src}if(!v)throw Error("Automatic publicPath is not supported in this browser");g.p=v.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var S={};return"/"!==(p=window.__webpack_public_path__||"/").charAt(p.length-1)&&(p+="/"),g.p=p+"static/plugins/@nocobase/plugin-gantt/dist/client/",!function(){g.r(S),g.d(S,{PluginGanttClient:function(){return rc},Gantt:function(){return re},default:function(){return rs}});var e,t=g(342),r=g(155),n=g.n(r),o=g(230),a=g(953);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}}(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.")}()}var c=(0,r.createContext)({});c.displayName="GanttBlockContext";var s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,c=arguments.length>7?arguments[7]:void 0;return e.forEach(function(e){var u,d,f=i(e),p=parseFloat((100*e[r.progress]).toFixed(2)),h=(0,t.getLabelFormatValue)(c,e[r.title]);e.children&&e.children.length?(n.push({start:new Date(null!=(u=e[r.start])?u:void 0),end:new Date(null!=(d=e[r.end])?d:void 0),name:h,id:e[l]+"",type:"project",progress:p>100?100:p||0,hideChildren:a,project:o,color:e.color,isDisabled:f}),s(e.children,r,n,e.id+"",a,i,l,c)):n.push({start:e[r.start]?new Date(e[r.start]):void 0,end:new Date(e[r.end]||e[r.start]),name:h,id:e[l]+"",type:r.end?"task":"milestone",progress:p>100?100:p||0,project:o,color:e.color,isDisabled:f})}),n},u=function(e){var r=e.fieldNames,a=e.timeRange,i=e.resource,l=(0,o.useField)(),s=(0,t.useBlockRequestContext)().service;return n().createElement(c.Provider,{value:{field:l,service:s,resource:i,fieldNames:r,timeRange:a}},e.children)},d=function(e){var r,o,a,i=(0,t.useCollectionManager_deprecated)(e.dataSource).getCollection(e.collection,e.dataSource),l={filter:null==(r=e.params)?void 0:r.filter,paginate:!1,sort:[(null==i?void 0:i.primaryKey)||"id"]};return n().createElement("div",{"aria-label":"block-item-gantt",role:"button"},n().createElement(t.TableBlockProvider,(o=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e),a=a={params:l},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(a)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(a,e))}),o),n().createElement(u,e)))},f=function(){return(0,r.useContext)(c)},p=function(){var e,n,o=f(),a=o.fieldNames,i=l((0,r.useState)([]),2),c=i[0],u=i[1],d=(0,t.useCollection_deprecated)(),p=d.getPrimaryKey,h=d.name,m=d.template,g=d.writableView,v=(0,t.useACLRoleContext)().parseAction,b=(0,t.useTableBlockContext)(),y=l((0,r.useState)(!1),2),x=y[0],S=y[1],w=p(),k=null==(e=(0,t.useCollection)().fields.find(function(e){return e.name===(null==a?void 0:a.title)}))?void 0:e.uiSchema,C=function(e){var t=null==e?void 0:e[w],r=v("".concat(h,":update"),{schema:{},recordPkValue:t});return"view"===m&&!g||!r};return(0,r.useEffect)(function(){var e;if(S(!0),!(null==o||null==(e=o.service)?void 0:e.loading)){var t,r=s(null==(t=o.service.data)?void 0:t.data,o.fieldNames,[],void 0,!1,C,w,k);u(r),S(!1),o.field.data=r,c.length>0&&b.setExpandFlag(!0)}},[null==o||null==(n=o.service)?void 0:n.loading]),{fieldNames:o.fieldNames,timeRange:o.timeRange,onExpanderClick:function(e){var t=o.field.data.map(function(t){return t.id===e.id?e:t});u(t),o.field.data=t},expandAndCollapseAll:function(e){var t,r=s(null==(t=o.service.data)?void 0:t.data,o.fieldNames,[],void 0,e,C,w,k);u(r),o.field.data=r},tasks:c,loading:x}},h=function(){return(0,a.useTranslation)("gantt")},m=function(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"string",n=(0,t.useCompile)(),o=(0,t.useCollection_deprecated)().fields;return null==o||null==(e=o.filter(function(e){return"string"==typeof r?e.type===r:r.includes(e.type)}))?void 0:e.map(function(e){var t;return{value:e.name,label:n(null==e||null==(t=e.uiSchema)?void 0:t.title)}})};function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b=new t.SchemaSettings({name:"GanttBlockSettings",items:[{name:"title",Component:t.SchemaSettingsBlockTitleItem},{name:"blockLinkageRules",Component:t.SchemaSettingsLinkageRules,useComponentProps:function(){return{collectionName:(0,t.useCollection_deprecated)().name,title:(0,(0,a.useTranslation)().t)("Block Linkage rules"),category:t.LinkageRuleCategory.block}}},{name:"titleField",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{},i=f().service,l=(0,o.useField)(),c=(0,t.useDesignable)().dn;return{title:r("Title field"),value:a.title,options:m("string"),onChange:function(e){var t,r=l.decoratorProps.fieldNames||{};r.title=e,l.decoratorProps.params=r,n["x-decorator-props"].params=r,n["x-decorator-props"].fieldNames=r,i.refresh(),c.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",l.decoratorProps),t)}),c.refresh()}}}},{name:"timeScale",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{},i=(0,o.useField)(),l=f().service,c=(0,t.useDesignable)().dn,s=(0,t.useCompile)();return{title:r("Time scale"),value:a.range||"day",options:[{label:s('{{t("Hour")}}'),value:"hour",color:"orange"},{label:s('{{t("Quarter of day")}}'),value:"quarterDay",color:"default"},{label:s('{{t("Half of day")}}'),value:"halfDay",color:"blue"},{label:s('{{t("Day")}}'),value:"day",color:"yellow"},{label:s('{{t("Week")}}'),value:"week",color:"pule"},{label:s('{{t("Month")}}'),value:"month",color:"green"},{label:s('{{t("QuarterYear")}}'),value:"quarterYear",color:"red"},{label:s('{{t("Year")}}'),value:"year",color:"green"}],onChange:function(e){var t,r=i.decoratorProps.fieldNames||{};r.range=e,i.decoratorProps.params=r,n["x-decorator-props"].params=r,n["x-decorator-props"].fieldNames=r,l.refresh(),c.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",i.decoratorProps),t)}),c.refresh()}}}},{name:"startDateField",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{},i=(0,o.useField)(),l=(0,t.useDesignable)().dn,c=f().service;return{title:r("Start date field"),value:a.start,options:m("date"),onChange:function(e){var t,r=i.decoratorProps.fieldNames||{};r.start=e,i.decoratorProps.fieldNames=r,n["x-decorator-props"].fieldNames=r,c.refresh(),l.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",i.decoratorProps),t)}),l.refresh()}}}},{name:"endDateField",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(0,o.useField)(),i=f().service,l=(0,t.useDesignable)().dn,c=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{};return{title:r("End date field"),value:c.end,options:m("date"),onChange:function(e){var t,r=a.decoratorProps.fieldNames||{};r.end=e,a.decoratorProps.fieldNames=r,n["x-decorator-props"].fieldNames=r,i.refresh(),l.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",a.decoratorProps),t)}),l.refresh()}}}},{name:"processField",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{},i=f().service,l=(0,t.useDesignable)().dn,c=(0,o.useField)();return{title:r("Progress field"),value:a.progress,options:m("float"),onChange:function(e){var t,r=c.decoratorProps.fieldNames||{};r.progress=e,c.decoratorProps.fieldNames=r,n["x-decorator-props"].fieldNames=r,i.refresh(),l.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",c.decoratorProps),t)}),l.refresh()}}}},{name:"dataScope",Component:t.SchemaSettingsDataScope,useComponentProps:function(){var e,r,n=(0,t.useCollection_deprecated)().name,a=(0,o.useFieldSchema)(),i=(0,t.useFormBlockContext)().form,l=(0,o.useField)(),c=(0,t.useDesignable)().dn;return{collectionName:n,defaultFilter:(null==a||null==(r=a["x-decorator-props"])||null==(e=r.params)?void 0:e.filter)||{},form:i,onSubmit:function(e){var r,n=e.filter;n=(0,t.removeNullCondition)(n);var o=l.decoratorProps.params||{};o.filter=n,l.decoratorProps.params=o,a["x-decorator-props"].params=o,c.emit("patch",{schema:(v(r={},"x-uid",a["x-uid"]),v(r,"x-decorator-props",a["x-decorator-props"]),r)})}}}},{name:"divider",type:"divider"},{name:"template",Component:t.SchemaSettingsTemplate,useComponentProps:function(){var e=(0,t.useCollection_deprecated)().name,r=(0,t.useBlockTemplateContext)().componentNamePrefix;return{componentName:"".concat(r,"Gantt"),collectionName:e}}},{name:"divider2",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]}),y=new t.SchemaSettings({name:"blockSettings:gantt",items:[{name:"title",Component:t.SchemaSettingsBlockTitleItem},{name:"blockLinkageRules",Component:t.SchemaSettingsLinkageRules,useComponentProps:function(){return{collectionName:(0,t.useCollection_deprecated)().name,title:(0,(0,a.useTranslation)().t)("Block Linkage rules"),category:t.LinkageRuleCategory.block}}},{name:"titleField",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{},i=f().service,l=(0,o.useField)(),c=(0,t.useDesignable)().dn;return{title:r("Title field"),value:a.title,options:m("string"),onChange:function(e){var t,r=l.decoratorProps.fieldNames||{};r.title=e,l.decoratorProps.params=r,n["x-decorator-props"].params=r,n["x-decorator-props"].fieldNames=r,i.refresh(),c.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",l.decoratorProps),t)}),c.refresh()}}}},{name:"timeScale",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{},i=(0,o.useField)(),l=f().service,c=(0,t.useDesignable)().dn,s=(0,t.useCompile)();return{title:r("Time scale"),value:a.range||"day",options:[{label:s('{{t("Hour")}}'),value:"hour",color:"orange"},{label:s('{{t("Quarter of day")}}'),value:"quarterDay",color:"default"},{label:s('{{t("Half of day")}}'),value:"halfDay",color:"blue"},{label:s('{{t("Day")}}'),value:"day",color:"yellow"},{label:s('{{t("Week")}}'),value:"week",color:"pule"},{label:s('{{t("Month")}}'),value:"month",color:"green"},{label:s('{{t("QuarterYear")}}'),value:"quarterYear",color:"red"},{label:s('{{t("Year")}}'),value:"year",color:"green"}],onChange:function(e){var t,r=i.decoratorProps.fieldNames||{};r.range=e,i.decoratorProps.params=r,n["x-decorator-props"].params=r,n["x-decorator-props"].fieldNames=r,l.refresh(),c.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",i.decoratorProps),t)}),c.refresh()}}}},{name:"startDateField",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{},i=(0,o.useField)(),l=(0,t.useDesignable)().dn,c=f().service;return{title:r("Start date field"),value:a.start,options:m(["date","datetime","dateOnly","datetimeNoTz"]),onChange:function(e){var t,r=i.decoratorProps.fieldNames||{};r.start=e,i.decoratorProps.fieldNames=r,n["x-decorator-props"].fieldNames=r,c.refresh(),l.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",i.decoratorProps),t)}),l.refresh()}}}},t.setDataLoadingModeSettingsItem,{name:"endDateField",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(0,o.useField)(),i=f().service,l=(0,t.useDesignable)().dn,c=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{};return{title:r("End date field"),value:c.end,options:m(["date","datetime","dateOnly","datetimeNoTz"]),onChange:function(e){var t,r=a.decoratorProps.fieldNames||{};r.end=e,a.decoratorProps.fieldNames=r,n["x-decorator-props"].fieldNames=r,i.refresh(),l.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",a.decoratorProps),t)}),l.refresh()}}}},{name:"processField",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{},i=f().service,l=(0,t.useDesignable)().dn,c=(0,o.useField)();return{title:r("Progress field"),value:a.progress,options:m("float"),onChange:function(e){var t,r=c.decoratorProps.fieldNames||{};r.progress=e,c.decoratorProps.fieldNames=r,n["x-decorator-props"].fieldNames=r,i.refresh(),l.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",c.decoratorProps),t)}),l.refresh()}}}},{name:"dataScope",Component:t.SchemaSettingsDataScope,useComponentProps:function(){var e,r,n=(0,t.useCollection)().name,a=(0,o.useFieldSchema)(),i=(0,t.useFormBlockContext)().form,l=(0,o.useField)(),c=(0,t.useDesignable)().dn;return{collectionName:n,defaultFilter:(null==a||null==(r=a["x-decorator-props"])||null==(e=r.params)?void 0:e.filter)||{},form:i,onSubmit:function(e){var r,n=e.filter;n=(0,t.removeNullCondition)(n);var o=l.decoratorProps.params||{};o.filter=n,l.decoratorProps.params=o,a["x-decorator-props"].params=o,c.emit("patch",{schema:(v(r={},"x-uid",a["x-uid"]),v(r,"x-decorator-props",a["x-decorator-props"]),r)})}}}},{name:"divider",type:"divider"},{name:"template",Component:t.SchemaSettingsTemplate,useComponentProps:function(){var e=(0,t.useCollection)().name,r=(0,t.useBlockTemplateContext)().componentNamePrefix;return{componentName:"".concat(r,"Gantt"),collectionName:e}}},{name:"divider2",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]});function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var w={title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{type:"item",name:"filter",title:"{{t('Filter')}}",Component:"FilterActionInitializer",schema:{"x-align":"left"}},{type:"item",title:"{{t('Add new')}}",name:"addNew",Component:"CreateActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:function(){return(0,t.useActionAvailable)("create")}},{type:"item",title:"{{t('Delete')}}",name:"delete",Component:"BulkDestroyActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider"},useVisible:function(){return(0,t.useActionAvailable)("destroyMany")}},{type:"item",title:"{{t('Refresh')}}",name:"refresh",Component:"RefreshActionInitializer",schema:{"x-align":"right"}},{name:"toggle",title:"{{t('Expand/Collapse')}}",Component:"ExpandableActionInitializer",schema:{"x-align":"right"},useVisible:function(){var e,r=(0,o.useFieldSchema)(),n=(0,t.useCollection)(),a=((null==r||null==(e=r.parent)?void 0:e["x-decorator-props"])||{}).treeTable;return n.tree&&a}},{name:"customRequest",title:'{{t("Custom request")}}',Component:"CustomRequestInitializer",schema:{"x-action":"customize:table:request:global"}}]},k=new t.CompatibleSchemaInitializer(x({name:"GanttActionInitializers"},w)),C=new t.CompatibleSchemaInitializer(x({name:"gantt:configureActions"},w),k),O=g(375),P=g(418),E=g(166),T=function(e){var t,r,n,o=e.collectionName,a=e.fieldNames,i=e.dataSource,l=e.association,c={type:"void","x-acl-action":"".concat(l||o,":list"),"x-decorator":"GanttBlockProvider","x-decorator-props":{collection:o,dataSource:i,action:"list",fieldNames:a,params:{paginate:!1}},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:gantt","x-component":"CardItem",properties:(t={},r=(0,E.uid)(),n={type:"void","x-component":"Gantt","x-use-component-props":"useGanttBlockProps",properties:{toolBar:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},"x-initializer":"gantt:configureActions",properties:{}},table:{type:"array","x-decorator":"div","x-decorator-props":{style:{float:"left",maxWidth:"35%"}},"x-initializer":"table:configureColumns","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},pagination:!1},properties:{actions:{type:"void",title:'{{ t("Actions") }}',"x-action-column":"actions","x-decorator":"TableV2.Column.ActionBar","x-component":"TableV2.Column","x-toolbar":"TableColumnSchemaToolbar","x-initializer":"table:configureItemActions","x-settings":"fieldSettings:TableColumn","x-toolbar-props":{initializer:"table:configureItemActions"},properties:{actions:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{split:"|"}}}}}},detail:{type:"void","x-component":"Gantt.Event",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-component-props":{className:"nb-action-popup"},title:'{{ t("View record") }}',properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:common:addBlock"}}}}}}}}}}},r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t)};return l&&(c["x-decorator-props"].association=l),c};function j(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function D(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){j(a,n,o,i,l,"next",e)}function l(e){j(a,n,o,i,l,"throw",e)}i(void 0)})}}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function N(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:c(0)}),l(i,"throw",{value:c(1)}),l(i,"return",{value:c(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function c(l){return function(c){var s=[l,c];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}var A=function(e){var r,o,a=e.filterCollections,i=e.onlyCurrentDataSource,l=e.hideSearch,c=e.createBlockSchema,s=e.showAssociationFields,u=(0,t.useSchemaInitializerItem)(),d=F().createGanttBlock;return n().createElement(t.DataBlockInitializer,(r=M({},u),o=o={componentType:"Gantt",icon:n().createElement(O.ProjectOutlined,{rotate:90}),onCreateBlockSchema:function(e){return D(function(){return N(this,function(t){return c?[2,c(e)]:(d(e),[2])})})()},onlyCurrentDataSource:i,hideSearch:l,filter:a,showAssociationFields:s},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r))},F=function(){var e=(0,t.useSchemaInitializer)().insert,i=(0,a.useTranslation)().t,l=(0,t.useCollectionManager_deprecated)().getCollectionFields,c=(0,r.useContext)(o.SchemaOptionsContext),s=(0,t.useGlobalTheme)().theme;return{createGanttBlock:function(r){var o=r.item;return D(function(){var r,a,u,d,f,p,h,m;return N(this,function(g){switch(g.label){case 0:return f=null==(d=l(o.name,o.dataSource))||null==(r=d.filter(function(e){return"string"===e.type}))?void 0:r.map(function(e){var t;return{label:null==e||null==(t=e.uiSchema)?void 0:t.title,value:e.name}}),p=null==d||null==(a=d.filter(function(e){return["date","datetime","dateOnly","datetimeNoTz"].includes(e.type)}))?void 0:a.map(function(e){var t;return{label:null==e||null==(t=e.uiSchema)?void 0:t.title,value:e.name}}),h=null==d||null==(u=d.filter(function(e){return"float"===e.type}))?void 0:u.map(function(e){var t;return{label:null==e||null==(t=e.uiSchema)?void 0:t.title,value:e.name}}),[4,(0,t.FormDialog)(i("Create gantt block"),function(){return n().createElement(t.SchemaComponentOptions,{scope:c.scope,components:M({},c.components)},n().createElement(P.FormLayout,{layout:"vertical"},n().createElement(t.SchemaComponent,{schema:{properties:{title:{title:i("Title field"),enum:f,required:!0,"x-component":"Select","x-decorator":"FormItem"},start:{title:i("Start date field"),enum:p,required:!0,default:"createdAt","x-component":"Select","x-decorator":"FormItem"},end:{title:i("End date field"),enum:p,required:!0,"x-component":"Select","x-decorator":"FormItem"},progress:{title:i("Progress field"),enum:h,"x-component":"Select","x-decorator":"FormItem"},range:{title:i("Time scale"),enum:[{label:'{{t("Hour")}}',value:"hour",color:"orange"},{label:'{{t("Quarter of day")}}',value:"quarterDay",color:"default"},{label:'{{t("Half of day")}}',value:"halfDay",color:"blue"},{label:'{{t("Day")}}',value:"day",color:"yellow"},{label:'{{t("Week")}}',value:"week",color:"pule"},{label:'{{t("Month")}}',value:"month",color:"green"},{label:'{{t("Year")}}',value:"year",color:"green"},{label:'{{t("QuarterYear")}}',value:"quarterYear",color:"red"}],default:"day","x-component":"Select","x-decorator":"FormItem"}}}})))},s).open({initialValues:{}})];case 1:return m=g.sent(),e(T({collectionName:o.name,dataSource:o.dataSource,fieldNames:M({},m)})),[2]}})})()}}},I=(0,g(694).observer)(function(e){var r=(0,t.useCollectionRecordData)(),o=(0,t.useCollection)();return n().createElement(t.PopupContextProvider,null,n().createElement(t.VariablePopupRecordProvider,{recordData:r,collection:o},e.children))},{displayName:"Event"}),B=g(477),R=g(59),H=g(773);function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function L(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 r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return z(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return z(e,t)}}(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.")}()}var G=function(e,t,r,n,o,a,i,l,c,s,u,d,f,p,h,m,g,v){var b=e.map(function(e,b){return Y(e,b,t,r,n,o,a,i,l,c,s,u,d,f,p,h,m,g,v)});return b=b.map(function(e){for(var t=function(t){var n=b.findIndex(function(e){return e.id===r[t]});-1!==n&&b[n].barChildren.push(e)},r=e.dependencies||[],n=0;n<r.length;n++)t(n);return e})},Y=function(e,t,r,n,o,a,i,l,c,s,u,d,f,p,h,m,g,v,b){var y;switch(e.type){case"milestone":y=X(e,t,r,n,o,a,i,l,v,b);break;case"project":y=_(e,t,r,n,o,.5*a,i,l,c,p,h,m,g);break;default:y=_(e,t,r,n,o,a,i,l,c,s,u,d,f)}return y},_=function(e,t,r,n,o,a,i,l,c,s,u,d,f){c?(h=V(e.start,r,n),p=V(e.end,r,n)):(p=U(e.start,r,n),h=U(e.end,r,n));var p,h,m=e.type;"task"===m&&h-p<2*l&&(m="smalltask",h=p>0?p+2*l:p);var g=q($(p,h,e.progress,c),2),v=g[0],b=g[1],y="project"===e.type?Q(t,o,a)+8:Q(t,o,a),x="project"===e.type?e.hideChildren:void 0,S=W({backgroundColor:d,backgroundSelectedColor:f,progressColor:s,progressSelectedColor:u},e.styles);return L(W({},e),{typeInternal:m,x1:p,x2:h,y:y,index:t,progressX:b,progressWidth:v,barCornerRadius:i,handleWidth:l,hideChildren:x,height:a,barChildren:[],styles:S})},X=function(e,t,r,n,o,a,i,l,c,s){var u=U(e.start,r,n),d=Q(t,o,a),f=u-.5*a,p=u+.5*a,h=a/1.414,m=W({backgroundColor:c,backgroundSelectedColor:s,progressColor:"",progressSelectedColor:""},e.styles);return L(W({},e),{end:e.start,x1:f,x2:p,y:d,index:t,progressX:0,progressWidth:0,barCornerRadius:i,handleWidth:l,typeInternal:e.type,progress:0,height:h,hideChildren:void 0,barChildren:[],styles:m})},U=function(e,t,r){var n,o,a,i=t.findIndex(function(t){return(null==t?void 0:t.getTime())>=(null==e?void 0:e.getTime())})-1,l=((null==e?void 0:e.getTime())-(null==(n=t[i])?void 0:n.getTime()))/((null==(o=t[i+1])?void 0:o.getTime())-(null==(a=t[i])?void 0:a.getTime())),c=i*r+l*r;return isNaN(c)?0:c},V=function(e,t,r){var n=U(e,t,r);return isNaN(n+=r)?0:n},Q=function(e,t,r){var n=e*t+(t-r)/2;return isNaN(n)?0:n},$=function(e,t,r,n){var o,a=(t-e)*r*.01;return o=n?t-a:e,[a,o]},K=function(e,t){if(e>=t.x2)return 100;if(e<=t.x1)return 0;var r=t.x2-t.x1;return Math.round((e-t.x1)*100/r)},J=function(e,t){if(e>=t.x2)return 0;if(e<=t.x1)return 100;var r=t.x2-t.x1;return Math.round((t.x2-e)*100/r)},Z=function(e,t,r){return[e-5,t+r,e+5,t+r,e,t+r-8.66].join(",")},ee=function(e,t,r){e>=r.x2-2*r.handleWidth&&(e=r.x2-2*r.handleWidth);var n=Math.round((e-r.x1)/t);return r.x1+n*t},et=function(e,t,r){e<=r.x1+2*r.handleWidth&&(e=r.x1+2*r.handleWidth);var n=Math.round((e-r.x2)/t);return r.x2+n*t},er=function(e,t,r){var n=Math.round((e-r.x1)/t),o=r.x1+n*t,a=o+r.x2-r.x1;return[o,a]},en=function(e,t,r,n,o){var a,i,l=new Date((e-t)/n*o+(null==r||null==(a=r.getTime)?void 0:a.call(r)));return new Date((null==l||null==(i=l.getTime)?void 0:i.call(l))+((null==l?void 0:l.getTimezoneOffset())-(null==r?void 0:r.getTimezoneOffset()))*6e4)},eo=function(e,t,r,n,o,a,i){return"milestone"===r.type?ei(e,t,r,n,o,a):ea(e,t,r,n,o,a,i)},ea=function(e,t,r,n,o,a,i){var l=W({},r),c=!1;switch(t){case"progress":if(i?l.progress=J(e,r):l.progress=K(e,r),c=l.progress!==r.progress){var s=q($(l.x1,l.x2,l.progress,i),2),u=s[0],d=s[1];l.progressWidth=u,l.progressX=d}break;case"start":var f=ee(e,n,r);if(l.x1=f,c=l.x1!==r.x1){i?l.end=en(f,r.x1,r.end,n,o):l.start=en(f,r.x1,r.start,n,o);var p=q($(l.x1,l.x2,l.progress,i),2),h=p[0],m=p[1];l.progressWidth=h,l.progressX=m}break;case"end":var g=et(e,n,r);if(l.x2=g,c=l.x2!==r.x2){i?l.start=en(g,r.x2,r.start,n,o):l.end=en(g,r.x2,r.end,n,o);var v=q($(l.x1,l.x2,l.progress,i),2),b=v[0],y=v[1];l.progressWidth=b,l.progressX=y}break;case"move":var x=q(er(e-a,n,r),2),S=x[0],w=x[1];if(c=S!==r.x1){l.start=en(S,r.x1,r.start,n,o),l.end=en(w,r.x2,r.end,n,o),l.x1=S,l.x2=w;var k=q($(l.x1,l.x2,l.progress,i),2),C=k[0],O=k[1];l.progressWidth=C,l.progressX=O}}return{isChanged:c,changedTask:l}},ei=function(e,t,r,n,o,a){var i=W({},r),l=!1;if("move"===t){var c=q(er(e-a,n,r),2),s=c[0],u=c[1];(l=s!==r.x1)&&(i.start=en(s,r.x1,r.start,n,o),i.end=i.start,i.x1=s,i.x2=u)}return{isChanged:l,changedTask:i}},el=((e={}).Hour="hour",e.QuarterDay="quarterDay",e.HalfDay="halfDay",e.Day="day",e.Week="week",e.Month="month",e.QuarterYear="quarterYear",e.Year="year",e);Intl.DateTimeFormat,Intl.DateTimeFormatOptions;var ec={},es=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=JSON.stringify([e,t]),n=ec[r];return n||(n=new Intl.DateTimeFormat(e,t),ec[r]=n),n},eu=function(e,t,r){return new Date(e.getFullYear()+("year"===r?t:0),e.getMonth()+("month"===r?t:0),e.getDate()+("day"===r?t:0),e.getHours()+("hour"===r?t:0),e.getMinutes()+("minute"===r?t:0),e.getSeconds()+("second"===r?t:0),e.getMilliseconds()+("millisecond"===r?t:0))},ed=function(e,t){var r=["millisecond","second","minute","hour","day","month","year"],n=function(e){var n=r.indexOf(t);return r.indexOf(e)<=n};return new Date(null==e?void 0:e.getFullYear(),n("year")?0:e.getMonth(),n("month")?1:e.getDate(),n("day")?0:e.getHours(),n("hour")?0:e.getMinutes(),n("minute")?0:e.getSeconds(),n("second")?0:e.getMilliseconds())},ef=function(e,t,r){var n=(null==(c=e[0])?void 0:c.start)||new Date,o=(null==(s=e[0])?void 0:s.start)||new Date,a=!0,i=!1,l=void 0;try{for(var c,s,u,d=e[Symbol.iterator]();!(a=(u=d.next()).done);a=!0){var f=u.value;f.start<n&&(n=f.start),f.end>o&&(o=f.end)}}catch(e){i=!0,l=e}finally{try{a||null==d.return||d.return()}finally{if(i)throw l}}switch(t){case el.Year:n=ed(n=eu(n,-1,"year"),"year"),o=ed(o=eu(o,1,"year"),"year");break;case el.QuarterYear:n=ed(n=eu(n,-3,"month"),"month"),o=ed(o=eu(o,3,"year"),"year");break;case el.Month:n=ed(n=eu(n,-1*r,"month"),"month"),o=ed(o=eu(o,1,"year"),"year");break;case el.Week:n=eu(eg(n=ed(n,"day")),-7*r,"day"),o=eu(o=ed(o,"day"),1.5,"month");break;case el.Day:n=eu(n=ed(n,"day"),-1*r,"day"),o=eu(o=ed(o,"day"),19,"day");break;case el.QuarterDay:n=eu(n=ed(n,"day"),-1*r,"day"),o=eu(o=ed(o,"day"),66,"hour");break;case el.HalfDay:n=eu(n=ed(n,"day"),-1*r,"day"),o=eu(o=ed(o,"day"),108,"hour");break;case el.Hour:n=eu(n=ed(n,"hour"),-1*r,"hour"),o=eu(o=ed(o,"day"),1,"day")}return[n,o]},ep=function(e,t,r){for(var n=new Date(e),o=[n];n<t;){switch(r){case el.Year:n=eu(n,1,"year");break;case el.QuarterYear:n=eu(n,3,"month");break;case el.Month:n=eu(n,1,"month");break;case el.Week:n=eu(n,7,"day");break;case el.Day:n=eu(n,1,"day");break;case el.HalfDay:n=eu(n,12,"hour");break;case el.QuarterDay:n=eu(n,6,"hour");break;case el.Hour:n=eu(n,1,"hour")}o.push(n)}return o},eh=function(e,t){var r=es(t,{month:"long"}).format(e);return r.replace(r[0],r[0].toLocaleUpperCase())},em=function(e,t,r){var n=es(t,{weekday:r}).format(e);return n.replace(n[0],n[0].toLocaleUpperCase())},eg=function(e){var t=e.getDay(),r=e.getDate()-t+(0===t?-6:1);return new Date(e.setDate(r))},ev=function(e){var t=new Date(e.valueOf()),r=(t.getDay()+6)%7;t.setDate(t.getDate()-r+3);var n=t.valueOf();t.setMonth(0,1),4!==t.getDay()&&t.setMonth(0,1+(4-t.getDay()+7)%7);var o=(1+Math.ceil((n-t.valueOf())/6048e5)).toString();return 1===o.length?"0".concat(o):o};function eb(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ey=function(e,t){var r=e.displayOrder||Number.MAX_VALUE,n=t.displayOrder||Number.MAX_VALUE;return r>n?1:r<n?-1:0},ex=function(e){var t;return isNaN(null==e||null==(t=e.getTime)?void 0:t.call(e))?0:e.getFullYear()+"/"+"".concat(e.getMonth()+1)+"/"+e.getDate()},eS=g(235);function ew(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ek(){var e=ew(["\n overflow: auto;\n position: absolute;\n bottom: -8px;\n max-width: 100%;\n scrollbarWidth: thin;\n height: 1.2rem;\n &::-webkit-scrollbar: { width: 8, height: 8 };\n &::-webkit-scrollbar-corner: { background: transparent };\n &::-webkit-scrollbar-track: { background: var(--colorBgScrollTrack) };\n &::-webkit-scrollbar-thumb: {\n background: var(--colorBgScrollBar);\n borderRadius: 4;\n };\n &::-webkit-scrollbar-thumb:hover: {\n background: var(--colorBgScrollBarHover);\n };\n &::-webkit-scrollbar-thumb:active: {\n background: var(--colorBgScrollBarActive)\n }\n "]);return ek=function(){return e},e}function eC(){var e=ew(["\n padding: 12px;\n background-color: ",";\n background-clip: padding-box;\n border-radius: ",";\n box-shadow: ",";\n b: {\n display: block;\n margin-bottom: ",";\n }\n .tooltipdefaultcontainerparagraph: {\n font-size: ",";\n margin-bottom: "," + ",";\n color: ",";\n }\n "]);return eC=function(){return e},e}function eO(){var e=ew(["\n position: absolute;\n display: flex;\n flexshrink: 0;\n pointerevents: none;\n webkittouchcallout: none;\n webkituserselect: none;\n mozuserselect: none;\n msuserselect: none;\n userselect: none;\n "]);return eO=function(){return e},e}function eP(){var e=ew(["\n visibility: hidden;\n position: absolute;\n display: flex;\n pointerevents: none;\n "]);return eP=function(){return e},e}function eE(){var e=ew(["\n .horizontalScroll: {\n height: 1\n }\n \n .verticalScroll: {\n overflow: hidden auto;\n width: 1rem;\n flexShrink: 0;\n scrollbarWidth: thin;\n &::-webkit-scrollbar: { width: 8, height: 8 };\n &::-webkit-scrollbar-corner: { background: transparent};\n &::-webkit-scrollbar-track: { background: var(--colorBgScrollTrack) };\n &::-webkit-scrollbar-thumb: {\n background: var(--colorBgScrollBar);\n borderRadius: 4;\n }\n &::-webkit-scrollbar-thumb:hover': {\n background: var(--colorBgScrollBarHover)\n }\n &::-webkit-scrollbar-thumb:active': {\n background: var(--colorBgScrollBarActive)\n },\n }\n }\n "]);return eE=function(){return e},e}var eT=(0,eS.createStyles)(function(e){var t=e.token,r=e.css;return{scrollWrapper:r(ek()),tooltipDefaultContainer:r(eC(),t.colorBgElevated,t.borderRadius,t.boxShadow,t.marginXS,t.fontSizeSM,t.marginXXS,t.marginXS-t.marginXXS,t.colorText),tooltipDetailsContainer:r(eO()),tooltipDetailsContainerHidden:r(eP()),nbGridOther:r(eE())}}),ej=function(e){var t=e.scroll,o=e.svgWidth,a=e.taskListWidth,i=e.rtl,l=e.onScroll,c=eT().styles,s=(0,r.useRef)(null);return(0,r.useEffect)(function(){s.current&&(s.current.scrollLeft=t)},[t]),n().createElement("div",{dir:"ltr",style:{margin:i?"0px ".concat(a,"px 0px 0px"):"0px 0px 0px ".concat(a,"px")},className:(0,B.cx)(c.nbGridOther,c.scrollWrapper,"gantt-horizontal-scoll"),onScroll:l,ref:s},n().createElement("div",{style:{width:o,height:1},className:"horizontalScroll"}))};function eD(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eD(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eD(e,t)}}(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.")}()}var eN=function(e){var t=e.task,o=e.rowHeight,a=e.rtl,i=e.svgContainerHeight,l=e.svgContainerWidth,c=e.scrollX,s=e.scrollY,u=e.arrowIndent,d=e.fontSize,f=e.fontFamily,p=e.headerHeight,h=e.taskListWidth,m=e.TooltipContent,g=eT().styles,v=(0,r.useRef)(null),b=eM((0,r.useState)(0),2),y=b[0],x=b[1],S=eM((0,r.useState)(0),2),w=S[0],k=S[1];return(0,r.useEffect)(function(){if(v.current){var e,r=1.1*v.current.offsetHeight,n=1.1*v.current.offsetWidth,d=t.index*o-s+p;a?((e=t.x1-1.5*u-n-c)<0&&(e=t.x2+1.5*u-c),n+e>l&&(e=l-n,d+=o)):(n+(e=t.x2+1.5*u+h-c)>h+l&&(e=t.x1+h-1.5*u-c-n),e<h&&(e=l+h-n,d+=o)),r+d-s>i-s&&(d=i-r),x(d),k(e)}},[v,t,u,c,s,p,h,o,i,l,a]),n().createElement("div",{ref:v,className:(0,B.cx)(w?g.tooltipDetailsContainer:g.tooltipDetailsContainerHidden,g.nbGridOther),style:{left:w,top:y}},n().createElement(m,{task:t,fontSize:d,fontFamily:f}))},eA=function(e){var t,r,o,a,i,l,c,s,u=e.task,d=e.fontSize,f=e.fontFamily,p=eT().styles;return n().createElement("div",{className:(0,B.cx)(p.nbGridOther,p.tooltipDefaultContainer),"aria-label":"nb-gantt-tooltip",style:{fontSize:d,fontFamily:f}},n().createElement("b",{style:{fontSize:d}},u.name,": ",ex(u.start)," ~ ",ex(u.end)),(null==(r=u.end)||null==(t=r.getTime)?void 0:t.call(r))-(null==(a=u.start)||null==(o=a.getTime)?void 0:o.call(a))!=0&&n().createElement("p",{className:"tooltipDefaultContainerParagraph"},"Duration: ".concat(Math.round(((null==(l=u.end)||null==(i=l.getTime)?void 0:i.call(l))-(null==(s=u.start)||null==(c=s.getTime)?void 0:c.call(s)))/864e5*10)/10||""," day(s)")),n().createElement("p",{className:"tooltipDefaultContainerParagraph"},!!u.progress&&"Progress: ".concat(u.progress,"%")))},eF=function(e){var t=e.scroll,o=e.ganttHeight,a=e.ganttFullHeight,i=e.headerHeight,l=e.rtl,c=e.onScroll,s=eT().styles,u=(0,r.useRef)(null);return(0,r.useEffect)(function(){u.current&&(u.current.scrollTop=t)},[t]),n().createElement("div",{style:{maxHeight:o,marginTop:i,marginLeft:l?"":"-1rem"},className:(0,B.cx)(s.nbGridOther,"verticalScroll"),onScroll:c,ref:u},n().createElement("div",{style:{height:a,width:1}}))},eI=function(e){var r=(0,o.useFieldSchema)().properties.detail;return r?n().createElement(t.NocoBaseRecursionField,{schema:r,name:r.name}):null};function eB(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function eR(){var e=eB(["\n overflow: hidden;\n font-size: 0;\n margin: 0;\n padding: 0;\n width: 100%;\n border-left: 2px solid ",";\n overflow-x: auto;\n .ganttheader: {\n border-bottom: 1px solid ",";\n font-weight: 700;\n }\n .ganttbody: {\n border-bottom: 1px solid ",";\n }\n "]);return eR=function(){return e},e}function eH(){var e=eB(["\n margin: 0;\n padding: 0;\n overflow: hidden;\n margin-bottom: -5px;\n "]);return eH=function(){return e},e}function ez(){var e=eB(["\n display: flex;\n padding: 0;\n margin: 0;\n liststyle: none;\n outline: none;\n position: relative;\n .gantt-horizontal-scoll: {\n display: none;\n }\n &:hover: {\n .gantt-horizontal-scoll: {\n display: block;\n }\n }\n "]);return ez=function(){return e},e}var eW=(0,t.createStyles)(function(e){var t=e.token,r=e.css;return{ganttverticalcontainer:r(eR(),t.colorBorderSecondary,t.colorBorderSecondary,t.colorBorderSecondary),horizontalcontainer:r(eH()),wrapper:r(ez())}});function eL(e,t){"string"==typeof(r=e)&&-1!==r.indexOf(".")&&1===parseFloat(r)&&(e="100%");var r,n,o="string"==typeof(n=e)&&-1!==n.indexOf("%");return(e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),o&&(e=parseInt(String(e*t),10)/100),1e-6>Math.abs(e-t))?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function eq(e){return Math.min(1,Math.max(0,e))}function eG(e){return(isNaN(e=parseFloat(e))||e<0||e>1)&&(e=1),e}function eY(e){return e<=1?"".concat(100*Number(e),"%"):e}function e_(e){return 1===e.length?"0"+e:String(e)}function eX(e,t,r){e=eL(e,255);var n=Math.max(e,t=eL(t,255),r=eL(r,255)),o=Math.min(e,t,r),a=0,i=0,l=(n+o)/2;if(n===o)i=0,a=0;else{var c=n-o;switch(i=l>.5?c/(2-n-o):c/(n+o),n){case e:a=(t-r)/c+6*(t<r);break;case t:a=(r-e)/c+2;break;case r:a=(e-t)/c+4}a/=6}return{h:a,s:i,l:l}}function eU(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+6*r*(t-e):r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function eV(e,t,r){e=eL(e,255);var n=Math.max(e,t=eL(t,255),r=eL(r,255)),o=Math.min(e,t,r),a=0,i=n-o;if(n===o)a=0;else{switch(n){case e:a=(t-r)/i+6*(t<r);break;case t:a=(r-e)/i+2;break;case r:a=(e-t)/i+4}a/=6}return{h:a,s:0===n?0:i/n,v:n}}function eQ(e,t,r,n){var o=[e_(Math.round(e).toString(16)),e_(Math.round(t).toString(16)),e_(Math.round(r).toString(16))];return n&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function e$(e){return parseInt(e,16)}var eK={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},eJ="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),eZ="[\\s|\\(]+(".concat(eJ,")[,|\\s]+(").concat(eJ,")[,|\\s]+(").concat(eJ,")\\s*\\)?"),e0="[\\s|\\(]+(".concat(eJ,")[,|\\s]+(").concat(eJ,")[,|\\s]+(").concat(eJ,")[,|\\s]+(").concat(eJ,")\\s*\\)?"),e1={CSS_UNIT:new RegExp(eJ),rgb:RegExp("rgb"+eZ),rgba:RegExp("rgba"+e0),hsl:RegExp("hsl"+eZ),hsla:RegExp("hsla"+e0),hsv:RegExp("hsv"+eZ),hsva:RegExp("hsva"+e0),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function e2(e){return!!e1.CSS_UNIT.exec(String(e))}var e5=function(){function e(t,r){if(void 0===t&&(t=""),void 0===r&&(r={}),t instanceof e)return t;"number"==typeof t&&(t={r:(k=t)>>16,g:(65280&k)>>8,b:255&k}),this.originalInput=t;var n,o,a,i,l,c,s,u,d,f,p,h,m,g,v,b,y,x,S,w,k,C,O=(g={r:0,g:0,b:0},v=1,b=null,y=null,x=null,S=!1,w=!1,"string"==typeof(n=t)&&(n=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(eK[e])e=eK[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var r=e1.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=e1.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=e1.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=e1.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=e1.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=e1.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=e1.hex8.exec(e))?{r:e$(r[1]),g:e$(r[2]),b:e$(r[3]),a:e$(r[4])/255,format:t?"name":"hex8"}:(r=e1.hex6.exec(e))?{r:e$(r[1]),g:e$(r[2]),b:e$(r[3]),format:t?"name":"hex"}:(r=e1.hex4.exec(e))?{r:e$(r[1]+r[1]),g:e$(r[2]+r[2]),b:e$(r[3]+r[3]),a:e$(r[4]+r[4])/255,format:t?"name":"hex8"}:!!(r=e1.hex3.exec(e))&&{r:e$(r[1]+r[1]),g:e$(r[2]+r[2]),b:e$(r[3]+r[3]),format:t?"name":"hex"}}(n)),"object"==typeof n&&(e2(n.r)&&e2(n.g)&&e2(n.b)?(o=n.r,a=n.g,i=n.b,g={r:255*eL(o,255),g:255*eL(a,255),b:255*eL(i,255)},S=!0,w="%"===String(n.r).substr(-1)?"prgb":"rgb"):e2(n.h)&&e2(n.s)&&e2(n.v)?(b=eY(n.s),y=eY(n.v),l=n.h,c=b,s=y,l=6*eL(l,360),c=eL(c,100),s=eL(s,100),u=Math.floor(l),d=l-u,f=s*(1-c),p=s*(1-d*c),h=s*(1-(1-d)*c),g={r:255*[s,p,f,f,h,s][m=u%6],g:255*[h,s,s,p,f,f][m],b:255*[f,f,h,s,s,p][m]},S=!0,w="hsv"):e2(n.h)&&e2(n.s)&&e2(n.l)&&(b=eY(n.s),x=eY(n.l),g=function(e,t,r){if(e=eL(e,360),t=eL(t,100),r=eL(r,100),0===t)o=r,a=r,n=r;else{var n,o,a,i=r<.5?r*(1+t):r+t-r*t,l=2*r-i;n=eU(l,i,e+1/3),o=eU(l,i,e),a=eU(l,i,e-1/3)}return{r:255*n,g:255*o,b:255*a}}(n.h,b,x),S=!0,w="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(v=n.a)),v=eG(v),{ok:S,format:n.format||w,r:Math.min(255,Math.max(g.r,0)),g:Math.min(255,Math.max(g.g,0)),b:Math.min(255,Math.max(g.b,0)),a:v});this.originalInput=t,this.r=O.r,this.g=O.g,this.b=O.b,this.a=O.a,this.roundA=Math.round(100*this.a)/100,this.format=null!=(C=r.format)?C:O.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=O.ok}return e.prototype.isDark=function(){return 128>this.getBrightness()},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t=e.r/255,r=e.g/255,n=e.b/255;return .2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=eG(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){return 0===this.toHsl().s},e.prototype.toHsv=function(){var e=eV(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=eV(this.r,this.g,this.b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.v);return 1===this.a?"hsv(".concat(t,", ").concat(r,"%, ").concat(n,"%)"):"hsva(".concat(t,", ").concat(r,"%, ").concat(n,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=eX(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=eX(this.r,this.g,this.b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.l);return 1===this.a?"hsl(".concat(t,", ").concat(r,"%, ").concat(n,"%)"):"hsla(".concat(t,", ").concat(r,"%, ").concat(n,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),eQ(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){var t,r,n,o,a,i;return void 0===e&&(e=!1),t=this.r,r=this.g,n=this.b,o=this.a,a=e,i=[e_(Math.round(t).toString(16)),e_(Math.round(r).toString(16)),e_(Math.round(n).toString(16)),e_(Math.round(255*parseFloat(o)).toString(16))],a&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toHexShortString=function(e){return void 0===e&&(e=!1),1===this.a?this.toHexString(e):this.toHex8String(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),r=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(t,", ").concat(r,")"):"rgba(".concat(e,", ").concat(t,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*eL(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*eL(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+eQ(this.r,this.g,this.b,!1),t=0,r=Object.entries(eK);t<r.length;t++){var n=r[t],o=n[0];if(e===n[1])return o}return!1},e.prototype.toString=function(e){var t=!!e;e=null!=e?e:this.format;var r=!1,n=this.a<1&&this.a>=0;return!t&&n&&(e.startsWith("hex")||"name"===e)?"name"===e&&0===this.a?this.toName():this.toRgbString():("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var r=this.toHsl();return r.l+=t/100,r.l=eq(r.l),new e(r)},e.prototype.brighten=function(t){void 0===t&&(t=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(-(t/100*255)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(-(t/100*255)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(-(t/100*255)))),new e(r)},e.prototype.darken=function(t){void 0===t&&(t=10);var r=this.toHsl();return r.l-=t/100,r.l=eq(r.l),new e(r)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var r=this.toHsl();return r.s-=t/100,r.s=eq(r.s),new e(r)},e.prototype.saturate=function(t){void 0===t&&(t=10);var r=this.toHsl();return r.s+=t/100,r.s=eq(r.s),new e(r)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var r=this.toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,new e(r)},e.prototype.mix=function(t,r){void 0===r&&(r=50);var n=this.toRgb(),o=new e(t).toRgb(),a=r/100;return new e({r:(o.r-n.r)*a+n.r,g:(o.g-n.g)*a+n.g,b:(o.b-n.b)*a+n.b,a:(o.a-n.a)*a+n.a})},e.prototype.analogous=function(t,r){void 0===t&&(t=6),void 0===r&&(r=30);var n=this.toHsl(),o=360/r,a=[this];for(n.h=(n.h-(o*t>>1)+720)%360;--t;)n.h=(n.h+o)%360,a.push(new e(n));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var r=this.toHsv(),n=r.h,o=r.s,a=r.v,i=[],l=1/t;t--;)i.push(new e({h:n,s:o,v:a})),a=(a+l)%1;return i},e.prototype.splitcomplement=function(){var t=this.toHsl(),r=t.h;return[this,new e({h:(r+72)%360,s:t.s,l:t.l}),new e({h:(r+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var r=this.toRgb(),n=new e(t).toRgb(),o=r.a+n.a*(1-r.a);return new e({r:(r.r*r.a+n.r*n.a*(1-r.a))/o,g:(r.g*r.a+n.g*n.a*(1-r.a))/o,b:(r.b*r.a+n.b*n.a*(1-r.a))/o,a:o})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var r=this.toHsl(),n=r.h,o=[this],a=360/t,i=1;i<t;i++)o.push(new e({h:(n+i*a)%360,s:r.s,l:r.l}));return o},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function e6(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function e3(){var e=e6(["\n color: ",";\n fill: ",";\n stroke-width: 1.4;\n background: ",";\n border-bottom: 1px solid ",";\n "]);return e3=function(){return e},e}function e8(){var e=e6(["\n font-size: 11px;\n "]);return e8=function(){return e},e}function e4(){var e=e6(["\n .calendarbottomtext: {\n textanchor: middle;\n fill: ",";\n webkittouchcallout: none;\n webkituserselect: none;\n mozuserselect: none;\n msuserselect: none;\n userselect: none;\n pointerevents: none;\n font-weight: 500;\n }\n .calendartoptick: {\n stroke: ",";\n stroke-width: 0;\n }\n .calendartoptext: {\n textanchor: middle;\n webkittouchcallout: none;\n webkituserselect: none;\n mozuserselect: none;\n msuserselect: none;\n userselect: none;\n pointerevents: none;\n font-weight: 500;\n fill: ",";\n }\n "]);return e4=function(){return e},e}var e9=(0,eS.createStyles)(function(e){var t=e.token,r=e.css,n=new e5(t.colorFillAlter).onBackground(t.colorBgContainer).toHexShortString();return{calendarheader:r(e3(),t.colorText,n,n,t.colorBorderSecondary),calendarBottomText:r(e8()),nbGanttCalendar:r(e4(),t.colorText,t.colorBorderSecondary,t.colorText)}}),e7=function(e){var t=e.value,r=e.x1Line,o=e.y1Line,a=e.y2Line,i=e.xText,l=e.yText;return n().createElement("g",{className:"calendarTop"},n().createElement("line",{x1:r,y1:o,x2:r,y2:a,className:(0,B.cx)("calendarTopTick"),key:t+"line"}),n().createElement("text",{key:t+"text",y:l,x:i,className:(0,B.cx)("calendarTopText")},t))};function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return te(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return te(e,t)}}(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.")}()}var tr=function(e){var t,r,o,a,i,l,c,s=e.dateSetup,u=e.locale,d=e.viewMode,f=e.rtl,p=e.headerHeight,h=e.columnWidth,m=e.fontFamily,g=e.fontSize,v=e9().styles,b=[],y=[];switch(s.viewMode){case el.Year:b=(t=tt(function(){for(var e=[],t=[],r=.5*p,o=0;o<s.dates.length;o++){var a=s.dates[o],i=a.getFullYear();if(t.push(n().createElement("text",{key:a.getTime(),y:.8*p,x:h*o+.5*h},i)),0===o||a.getFullYear()!==s.dates[o-1].getFullYear()){var l=a.getFullYear().toString(),c=void 0;c=f?(6+o+a.getFullYear()+1)*h:(6+o-a.getFullYear())*h,e.push(n().createElement(e7,{key:l,value:l,x1Line:h*o,y1Line:0,y2Line:p,xText:c,yText:.9*r}))}}return[e,t]}(),2))[0],y=t[1];break;case el.QuarterYear:b=(r=tt(function(){for(var e=[],t=[],r=.5*p,o=0;o<s.dates.length;o++){var a=s.dates[o],i="Q"+Math.floor((a.getMonth()+3)/3);if(t.push(n().createElement("text",{key:a.getTime(),y:.8*p,x:h*o+.5*h,className:v.calendarBottomText},i)),0===o||a.getFullYear()!==s.dates[o-1].getFullYear()){var l=a.getFullYear().toString(),c=void 0;c=f?(6+o+a.getMonth()+1)*h:(6+o-a.getMonth())*h,e.push(n().createElement(e7,{key:l,value:l,x1Line:h*o,y1Line:0,y2Line:r,xText:Math.abs(c)-200,yText:.9*r}))}}return[e,t]}(),2))[0],y=r[1];break;case el.Month:b=(o=tt(function(){for(var e=[],t=[],r=.5*p,o=0;o<s.dates.length;o++){var a=s.dates[o],i=eh(a,u);if(t.push(n().createElement("text",{key:i+a.getFullYear(),y:.8*p,x:h*o+.5*h,className:v.calendarBottomText},i)),0===o||a.getFullYear()!==s.dates[o-1].getFullYear()){var l=a.getFullYear().toString(),c=void 0;c=f?(6+o+a.getMonth()+1)*h:(6+o-a.getMonth())*h,e.push(n().createElement(e7,{key:l,value:l,x1Line:h*o,y1Line:0,y2Line:r,xText:c,yText:.9*r}))}}return[e,t]}(),2))[0],y=o[1];break;case el.Week:b=(a=tt(function(){for(var e=[],t=[],r=1,o=.5*p,a=s.dates,i=a.length-1;i>=0;i--){var l=a[i],c="";(0===i||l.getMonth()!==a[i-1].getMonth())&&(c="".concat(eh(l,u),", ").concat(l.getFullYear()));var d="W".concat(ev(l));t.push(n().createElement("text",{key:l.getTime(),y:.8*p,x:h*(i+ +f),className:v.calendarBottomText},d)),c&&(i!==a.length-1&&e.push(n().createElement(e7,{key:c,value:c,x1Line:h*i+r*h,y1Line:0,y2Line:o,xText:h*i+h*r*.5,yText:.9*o})),r=0),r++}return[e,t]}(),2))[0],y=a[1];break;case el.Day:b=(i=tt(function(){for(var e=[],t=[],r=.5*p,o=s.dates,a=0;a<o.length;a++){var i=o[a],l="".concat(i.getDate().toString());if(t.push(n().createElement("text",{key:i.getTime(),y:.8*p,x:h*a+.5*h,className:(0,B.cx)("calendarBottomText")},l)),a+1!==o.length&&i.getMonth()!==o[a+1].getMonth()){var c,d=eh(i,u);e.push(n().createElement(e7,{key:d+i.getFullYear(),value:d,x1Line:h*(a+1),y1Line:0,y2Line:r,xText:h*(a+1)-(c=i.getMonth(),new Date(i.getFullYear(),c+1,0).getDate()*h*.5),yText:.9*r}))}}return[e,t]}(),2))[0],y=i[1];break;case el.QuarterDay:case el.HalfDay:b=(l=tt(function(){for(var e=[],t=[],r=d===el.HalfDay?2:4,o=.5*p,a=s.dates,i=0;i<a.length;i++){var l=a[i],c=es(u,{hour:"numeric"}).format(l).replace("时","");if(t.push(n().createElement("text",{key:l.getTime(),y:.8*p,x:h*(i+ +f),className:(0,B.cx)("calendarBottomText"),fontFamily:m},c)),0===i||l.getDate()!==a[i-1].getDate()){var g="".concat(em(l,u,"short"),", ").concat(l.getDate()," ").concat(eh(l,u));e.push(n().createElement(e7,{key:g+l.getFullYear(),value:g,x1Line:h*i+r*h,y1Line:0,y2Line:o,xText:h*i+r*h*.5,yText:.9*o}))}}return[e,t]}(),2))[0],y=l[1];break;case el.Hour:b=(c=tt(function(){for(var e=[],t=[],r=.5*p,o=s.dates,a=0;a<o.length;a++){var i,l=o[a],c=null==(i=es(u,{hour:"numeric"}).format(l))?void 0:i.replace("时","");if(t.push(n().createElement("text",{key:l.getTime(),y:.8*p,x:h*(a+ +f),className:(0,B.cx)("calendarBottomText"),fontFamily:m},c)),0!==a&&l.getDate()!==o[a-1].getDate()){var d=o[a-1],g="".concat(em(d,u,"long"),", ").concat(d.getDate()," ").concat(eh(d,u)),v=(l.getHours()-24)/2;e.push(n().createElement(e7,{key:g+d.getFullYear(),value:g,x1Line:h*a,y1Line:0,y2Line:r,xText:h*(a+v),yText:.9*r}))}}return[e,t]}(),2))[0],y=c[1]}return n().createElement("g",{className:v.nbGanttCalendar,fontSize:g,fontFamily:m},n().createElement("rect",{x:0,y:0,width:h*s.dates.length,height:p,className:v.calendarheader}),y," ",b)},tn=g(768);function to(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ta(){var e=to(["\n fill: ",";\n "]);return ta=function(){return e},e}function ti(){var e=to(["\n fill: #e6f7ff;\n border-color: ",";\n "]);return ti=function(){return e},e}function tl(){var e=to(["\n .gridrowline: {\n stroke: ",";\n stroke-width: 0;\n border-bottom: 1px solid ",";\n }\n .gridtick: {\n stroke: ",";\n }\n "]);return tl=function(){return e},e}var tc=(0,eS.createStyles)(function(e){var t=e.token,r=e.css;return{gridRow:r(ta(),t.colorBgContainer),gridHeightRow:r(ti(),t.colorBorder),nbGridbody:r(tl(),t.colorBorderSecondary,t.colorBorderSecondary,t.colorBorderSecondary)}}),ts=[{id:(0,tn.uid)()},{id:(0,tn.uid)()},{id:(0,tn.uid)()}],tu=function(e){var t=e.tasks,r=e.dates,o=e.rowHeight,a=e.svgWidth,i=e.columnWidth,l=e.todayColor,c=e.rtl,s=e.selectedRowKeys,u=tc().styles,d=t.length?t:ts,f=0,p=[],h=[n().createElement("line",{key:"RowLineFirst",x:"0",y1:0,x2:a,y2:0,className:(0,B.cx)("gridRowLine")})],m=!0,g=!1,v=void 0;try{for(var b,y=d[Symbol.iterator]();!(m=(b=y.next()).done);m=!0){var x=b.value;p.push(n().createElement("rect",{key:"Row"+x.id,x:"0",y:f,width:a,height:o,className:(null==s?void 0:s.includes(+x.id))?u.gridHeightRow:u.gridRow})),h.push(n().createElement("line",{key:"RowLine"+x.id,x:"0",y1:f+o,x2:a,y2:f+o,className:(0,B.cx)("gridRowLine")})),f+=o}}catch(e){g=!0,v=e}finally{try{m||null==y.return||y.return()}finally{if(g)throw v}}for(var S=new Date,w=0,k=[],C=n().createElement("rect",null),O=0;O<r.length;O++){var P=r[O];k.push(n().createElement("line",{key:P.getTime(),x1:w,y1:0,x2:w,y2:f,className:(0,B.cx)("gridTick")})),(O+1!==r.length&&P.getTime()<S.getTime()&&r[O+1].getTime()>=S.getTime()||0!==O&&O+1===r.length&&P.getTime()<S.getTime()&&eu(P,P.getTime()-r[O-1].getTime(),"millisecond").getTime()>=S.getTime())&&(C=n().createElement("rect",{x:w,y:0,width:i,height:f,fill:l})),c&&O+1!==r.length&&P.getTime()>=S.getTime()&&r[O+1].getTime()<S.getTime()&&(C=n().createElement("rect",{x:w+i,y:0,width:i,height:f,fill:l})),w+=i}return n().createElement("g",{className:(0,B.cx)("gridBody",u.nbGridbody)},n().createElement("g",{className:"rows"},p),n().createElement("g",{className:"rowLines"},h),n().createElement("g",{className:"ticks"},k),n().createElement("g",{className:"today"},C))},td=function(e){return n().createElement("g",{className:"grid"},n().createElement(tu,e))};function tf(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tf(e,t)}}(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.")}()}var th=function(e){var t,r,o,a,i=e.taskFrom,l=e.taskTo,c=e.rowHeight,s=e.taskHeight,u=e.arrowIndent;return e.rtl?(t=(o=tp(tg(i,l,c,s,u),2))[0],r=o[1]):(t=(a=tp(tm(i,l,c,s,u),2))[0],r=a[1]),n().createElement("g",{className:"arrow"},n().createElement("path",{strokeWidth:"1.5",d:t,fill:"none"}),n().createElement("polygon",{points:r}))},tm=function(e,t,r,n,o){var a=e.index>t.index?-1:1,i=t.y+n/2,l=e.x2+2*o,c=l<t.x1?"":"H ".concat(t.x1-o),s=l>t.x1?o:t.x1-e.x2-o;return["M ".concat(e.x2," ").concat(e.y+n/2," \n h ").concat(o," \n v ").concat(a*r/2," \n ").concat(c,"\n V ").concat(i," \n h ").concat(s),"".concat(t.x1,",").concat(i," \n ").concat(t.x1-5,",").concat(i-5," \n ").concat(t.x1-5,",").concat(i+5)]},tg=function(e,t,r,n,o){var a=e.index>t.index?-1:1,i=t.y+n/2,l=e.x1-2*o,c=l>t.x2?"":"H ".concat(t.x2+o),s=l<t.x2?-o:t.x2-e.x1+o;return["M ".concat(e.x1," ").concat(e.y+n/2," \n h ").concat(-o," \n v ").concat(a*r/2," \n ").concat(c,"\n V ").concat(i," \n h ").concat(s),"".concat(t.x2,",").concat(i," \n ").concat(t.x2+5,",").concat(i+5," \n ").concat(t.x2+5,",").concat(i-5)]},tv=function(e){var t=e.x,r=e.y,o=e.width,a=e.height,i=e.barCornerRadius,l=e.onMouseDown;return n().createElement("rect",{x:t,y:r,width:o,height:a,className:"barHandle",role:"button",ry:i,rx:i,onMouseDown:l})};function tb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ty(){var e=tb(["\n cursor: pointer;\n outline: none;\n .barHandle {\n fill: #ddd;\n cursor: ew-resize;\n opacity: 0;\n // visibility: hidden;\n }\n &:hover .barHandle {\n visibility: visible;\n opacity: 1;\n }\n"]);return ty=function(){return e},e}function tx(){var e=tb(["\n user-select: none;\n stroke-width: 0;\n opacity: 0.6;\n"]);return tx=function(){return e},e}var tS=(0,B.css)(ty()),tw=(0,B.css)(tx()),tk=function(e){var t=e.x,r=e.y,o=e.color,a=e.width,i=e.height,l=e.isSelected,c=e.progressX,s=e.progressWidth,u=e.barCornerRadius,d=e.styles,f=e.onMouseDown;return n().createElement("g",{onMouseDown:f},n().createElement("rect",{x:t,width:a,y:r,height:i,ry:u,rx:u,fill:o||(l?d.backgroundSelectedColor:d.backgroundColor),className:(0,B.cx)(tw)}),n().createElement("rect",{x:c,width:s,y:r,height:i,ry:u,rx:u,fill:o||(l?d.progressSelectedColor:d.progressColor)}))},tC=function(e){var t=e.progressPoint,r=e.onMouseDown;return n().createElement("polygon",{className:"barHandle",points:t,onMouseDown:r})},tO=function(e){var t=e.task,r=e.isProgressChangeable,o=e.isDateChangeable,a=e.rtl,i=e.onEventStart,l=e.isSelected,c=Z(!a*t.progressWidth+t.progressX,t.y,t.height),s=t.height-2;return n().createElement("g",{className:(0,B.cx)(tS),"aria-label":"task-bar",tabIndex:0},n().createElement(tk,{x:t.x1,y:t.y,color:t.color,width:t.x2-t.x1,height:t.height,progressX:t.progressX,progressWidth:t.progressWidth,barCornerRadius:t.barCornerRadius,styles:t.styles,isSelected:l,onMouseDown:function(e){o&&i("move",t,e)}}),n().createElement("g",{className:"handleGroup"},o&&n().createElement("g",null,n().createElement(tv,{x:t.x1+1,y:t.y+1,width:t.handleWidth,height:s,barCornerRadius:t.barCornerRadius,onMouseDown:function(e){i("start",t,e)}}),n().createElement(tv,{x:t.x2-t.handleWidth-1,y:t.y+1,width:t.handleWidth,height:s,barCornerRadius:t.barCornerRadius,onMouseDown:function(e){i("end",t,e)}})),r&&n().createElement(tC,{progressPoint:c,onMouseDown:function(e){i("progress",t,e)}})))},tP=function(e){var t=e.task,r=e.isProgressChangeable,o=e.isDateChangeable,a=e.onEventStart,i=e.isSelected,l=Z(t.progressWidth+t.x1+10,t.y,t.height);return n().createElement("g",{className:(0,B.cx)(tS),tabIndex:0},n().createElement(tk,{x:t.x1,y:t.y,width:t.x2-t.x1,height:t.height,progressX:t.progressX,progressWidth:t.progressWidth,barCornerRadius:t.barCornerRadius,styles:t.styles,isSelected:i,onMouseDown:function(e){o&&a("move",t,e)}}),n().createElement("g",{className:"handleGroup"},r&&n().createElement(tC,{progressPoint:l,onMouseDown:function(e){a("progress",t,e)}})))};function tE(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function tT(){var e=tE(["\n cursor: pointer;\n outline: none;\n"]);return tT=function(){return e},e}function tj(){var e=tE(["\n user-select: none;\n"]);return tj=function(){return e},e}var tD=(0,B.css)(tT()),tM=(0,B.css)(tj()),tN=function(e){var t=e.task,r=e.isDateChangeable,o=e.onEventStart,a=e.isSelected,i="rotate(45 ".concat(t.x1+.356*t.height," \n ").concat(t.y+.85*t.height,")");return n().createElement("g",{tabIndex:0,className:(0,B.cx)(tD)},n().createElement("rect",{fill:a?t.styles.backgroundSelectedColor:t.styles.backgroundColor,x:t.x1,width:t.height,y:t.y,height:t.height,rx:t.barCornerRadius,ry:t.barCornerRadius,transform:i,className:(0,B.cx)(tM),onMouseDown:function(e){r&&o("move",t,e)}}))};function tA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function tF(){var e=tA(["\n cursor: pointer;\n outline: none;\n"]);return tF=function(){return e},e}function tI(){var e=tA(["\n user-select: none;\n opacity: 0.6;\n"]);return tI=function(){return e},e}function tB(){var e=tA(["\n user-select: none;\n"]);return tB=function(){return e},e}var tR=(0,B.css)(tF()),tH=(0,B.css)(tI());(0,B.css)(tB());var tz=function(e){var t=e.task,r=e.isSelected,o=r?t.styles.backgroundSelectedColor:t.styles.backgroundColor,a=r?t.styles.progressSelectedColor:t.styles.progressColor,i=t.x2-t.x1;return n().createElement("g",{tabIndex:0,className:(0,B.cx)(tR)},n().createElement("rect",{fill:t.color||o,x:t.x1,width:i,y:t.y,height:t.height,rx:t.barCornerRadius,ry:t.barCornerRadius,className:(0,B.cx)(tH)}),n().createElement("rect",{x:t.progressX,width:t.progressWidth,y:t.y,height:t.height,ry:t.barCornerRadius,rx:t.barCornerRadius,fill:t.color||a}))};function tW(){var e,t,r=(e=["\n .barLabel: {\n fill: ",",\n textAnchor: middle,\n font-weight: 400,\n dominantBaseline: central,\n WebkitTouchCallout: none,\n WebkitUserSelect: none,\n MozUserSelect: none,\n msUserSelect: none,\n userSelect: none,\n pointerEvents: none,\n },\n .projectLabel: {\n fill: #130d0d,\n fontWeight: 500,\n fontSize: 0.9em,\n dominantBaseline: central,\n WebkitTouchCallout: none,\n WebkitUserSelect: none,\n MozUserSelect: none,\n msUserSelect: none,\n userSelect: none,\n pointerEvents: none,\n },\n .barLabelOutside: {\n fill: ",",\n textAnchor: start,\n WebkitTouchCallout: none,\n WebkitUserSelect: none,\n MozUserSelect: none,\n msUserSelect: none,\n userSelect: none,\n pointerEvents: none,\n },\n }\n }"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return tW=function(){return r},r}var tL=(0,eS.createStyles)(function(e){var t=e.token;return{nbganttTaskitem:(0,e.css)(tW(),t.colorTextLightSolid,t.colorTextLabel)}});function tq(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tG(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tq(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tq(e,t)}}(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.")}()}var tY=function(e){var t,o,a=tL().styles,i=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e),l=i.task,c=i.arrowIndent,s=i.isDelete,u=i.taskHeight,d=i.isSelected,f=i.rtl,p=i.onEventStart,h=(0,r.useRef)(null),m=tG((0,r.useState)(n().createElement("div",null)),2),g=m[0],v=m[1],b=tG((0,r.useState)(!0),2),y=b[0],x=b[1],S="project"===l.typeInternal;return(0,r.useEffect)(function(){switch(l.typeInternal){case"milestone":v(n().createElement(tN,e));break;case"project":v(n().createElement(tz,e));break;case"smalltask":v(n().createElement(tP,e));break;default:v(n().createElement(tO,e))}},[l,d]),(0,r.useEffect)(function(){h.current&&x(h.current.getBBox().width<l.x2-l.x1)},[h,l]),n().createElement("g",{className:(0,B.cx)(a.nbganttTaskitem),onKeyDown:function(e){"Delete"===e.key&&s&&p("delete",l,e),e.stopPropagation()},onMouseEnter:function(e){p("mouseenter",l,e)},onMouseLeave:function(e){p("mouseleave",l,e)},onDoubleClick:function(e){p("dblclick",l,e)},onClick:function(e){p("click",l,e)},onFocus:function(){p("select",l)}},g,n().createElement("text",{x:S?l.x1:(t=l.x2-l.x1,o=l.barChildren.length>0,y?l.x1+.5*t:f&&h.current?l.x1-h.current.getBBox().width-c*o-.2*c:l.x1+t+c*o+.2*c),y:S?l.y-8:l.y+.65*u,className:S?(0,B.cx)("projectLabel"):y?(0,B.cx)("barLabel"):(0,B.cx)("barLabelOutside"),ref:h},S&&ex(l.start)&&ex(l.end)?"".concat(l.name,": ").concat(ex(l.start)," ~ ").concat(ex(l.end)):l.name))};function t_(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tX(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function tU(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){tX(a,n,o,i,l,"next",e)}function l(e){tX(a,n,o,i,l,"throw",e)}i(void 0)})}}function tV(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return t_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t_(e,t)}}(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 tQ(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:c(0)}),l(i,"throw",{value:c(1)}),l(i,"return",{value:c(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function c(l){return function(c){var s=[l,c];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}var t$=null,tK=null,tJ=function(e){var t,o=e.tasks,a=e.dates,i=e.ganttEvent,l=e.selectedTask,c=e.rowHeight,s=e.columnWidth,u=e.timeStep,d=e.svg,f=e.taskHeight,p=e.arrowColor,h=e.arrowIndent,m=e.fontFamily,g=e.fontSize,v=e.rtl,b=e.setGanttEvent,y=e.setFailedTask,x=e.setSelectedTask,S=e.onDateChange,w=e.onProgressChange,k=e.onDoubleClick,C=e.onClick,O=e.onDelete,P=null==d||null==(t=d.current)?void 0:t.createSVGPoint(),E=tV((0,r.useState)(0),2),T=E[0],j=E[1],D=tV((0,r.useState)(0),2),M=D[0],N=D[1],A=tV((0,r.useState)(!1),2),F=A[0],I=A[1];(0,r.useEffect)(function(){var e,t,r,n;j(u*s/((null==(e=a[1])?void 0:e.getTime())-(null==(t=a[0])?void 0:t.getTime())-(null==(r=a[1])?void 0:r.getTimezoneOffset())*6e4+(null==(n=a[0])?void 0:n.getTimezoneOffset())*6e4))},[s,a,u]),(0,r.useEffect)(function(){var e=function(e){return tU(function(){var t,r,n,o;return tQ(this,function(a){return i.changedTask&&P&&(null==d?void 0:d.current)&&(e.preventDefault(),P.x=e.clientX,n=(r=eo(P.matrixTransform(null==d||null==(t=d.current.getScreenCTM())?void 0:t.inverse()).x,i.action,i.changedTask,T,u,M,v)).isChanged,o=r.changedTask,n&&b({action:i.action,changedTask:o})),[2]})})()},t=function(r){return tU(function(){var n,o,a,l,c,s,f,p,h;return tQ(this,function(m){switch(m.label){case 0:if(o=i.action,a=i.originalSelectedTask,!(l=i.changedTask)||!P||!(null==d?void 0:d.current)||!a)return[2];if(r.preventDefault(),P.x=r.clientX,c=eo(P.matrixTransform(null==d||null==(n=d.current.getScreenCTM())?void 0:n.inverse()).x,o,l,T,u,M,v).changedTask,s=a.start!==c.start||a.end!==c.end||a.progress!==c.progress,d.current.removeEventListener("mousemove",e),d.current.removeEventListener("mouseup",t),b({action:""}),I(!1),f=!0,!(("move"===o||"end"===o||"start"===o)&&S&&s))return[3,5];m.label=1;case 1:return m.trys.push([1,3,,4]),[4,S(c,c.barChildren)];case 2:return void 0!==(p=m.sent())&&(f=p),[3,4];case 3:return m.sent(),f=!1,[3,4];case 4:return[3,9];case 5:if(!(w&&s))return[3,9];m.label=6;case 6:return m.trys.push([6,8,,9]),[4,w(c,c.barChildren)];case 7:return void 0!==(h=m.sent())&&(f=h),[3,9];case 8:return m.sent(),f=!1,[3,9];case 9:return f||y(a),[2]}})})()};!F&&("move"===i.action||"end"===i.action||"start"===i.action||"progress"===i.action)&&(null==d?void 0:d.current)&&(d.current.addEventListener("mousemove",e),d.current.addEventListener("mouseup",t),I(!0))},[i,T,M,w,u,S,d,F,P,v,y,b]);var B=function(e,t,r){return tU(function(){var n,o;return tQ(this,function(a){switch(a.label){case 0:if(r)return[3,1];return"select"===e&&x(t.id),[3,7];case 1:if(void 0===r.key)return[3,6];if("delete"!==e||!O)return[3,5];a.label=2;case 2:return a.trys.push([2,4,,5]),[4,O(t)];case 3:return void 0!==(n=a.sent())&&n&&b({action:e,changedTask:t}),[3,5];case 4:return console.error("Error on Delete. "+a.sent()),[3,5];case 5:return[3,7];case 6:if("mouseenter"===e)i.action||b({action:e,changedTask:t,originalSelectedTask:t});else if("mouseleave"===e)"mouseenter"===i.action&&setTimeout(function(){b({action:""})},300);else if("dblclick"===e)k&&k(t);else if("click"===e)"rect"===r.target.tagName&&C&&C(t);else if("move"===e){if(!(null==d?void 0:d.current)||!P)return[2];P.x=r.clientX,N(P.matrixTransform(null==(o=d.current.getScreenCTM())?void 0:o.inverse()).x-t.x1),b({action:e,changedTask:t,originalSelectedTask:t})}else b({action:e,changedTask:t,originalSelectedTask:t});a.label=7;case 7:return[2]}})})()},R=function(e,t,r){["click"].includes(e)?(["start","end","progress"].includes(t$)||tK&&tK!==t.start||B(e,t,r),t$=null,tK=null):(["move","select"].includes(e)?tK=t.start:(tK=t.start,t$=e),B(e,t,r))};return n().createElement("g",{className:"content"},n().createElement("g",{className:"arrows",fill:p,stroke:p},o.map(function(e){return e.barChildren.map(function(t){return n().createElement(th,{key:"Arrow from ".concat(e.id," to ").concat(o[t.index].id),taskFrom:e,taskTo:o[t.index],rowHeight:c,taskHeight:f,arrowIndent:h,rtl:v})})})),n().createElement("g",{className:"bar",fontFamily:m,fontSize:g},o.map(function(e){return n().createElement(tY,{task:e,arrowIndent:h,taskHeight:f,isProgressChangeable:!!w&&!e.isDisabled,isDateChangeable:!!S&&!e.isDisabled,isDelete:!e.isDisabled,onEventStart:R,key:e.id,isSelected:!!l&&e.id===l.id,rtl:v})})))},tZ=(0,r.forwardRef)(function(e,t){var o,a,i=e.gridProps,l=e.calendarProps,c=e.barProps,s=e.ganttHeight,u=e.scrollY,d=e.scrollX,f=(0,r.useRef)(null),p=(0,r.useRef)(null),h=(o=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},c),a=a={svg:f},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(a)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(a,e))}),o),m=eW().styles;return(0,r.useEffect)(function(){p.current&&(p.current.scrollTop=u)},[u]),(0,r.useEffect)(function(){t.current&&(t.current.scrollLeft=d)},[d]),n().createElement("div",{className:m.ganttverticalcontainer,ref:t,dir:"ltr"},n().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:i.svgWidth,height:l.headerHeight,fontFamily:c.fontFamily,className:"ganttHeader"},n().createElement(tr,l)),n().createElement(R.Spin,{spinning:null==c?void 0:c.loading},n().createElement("div",{ref:p,className:m.horizontalcontainer,style:s?{maxHeight:s,width:i.svgWidth}:{width:i.svgWidth}},n().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:i.svgWidth,height:c.rowHeight*c.tasks.length||166,fontFamily:c.fontFamily,ref:f,className:"ganttBody"},n().createElement(td,i),n().createElement(tJ,h)))))});function t0(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function t1(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function t2(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){t1(a,n,o,i,l,"next",e)}function l(e){t1(a,n,o,i,l,"throw",e)}i(void 0)})}}function t5(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t6(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||t3(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 t3(e,t){if(e){if("string"==typeof e)return t0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t0(e,t)}}function t8(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:c(0)}),l(i,"throw",{value:c(1)}),l(i,"return",{value:c(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function c(l){return function(c){var s=[l,c];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}function t4(){var e,t,r=(e=["\n .ant-table-container::after {\n box-shadow: none !important;\n }\n .ant-table-row {\n height: ","px;\n }\n .ant-table-thead {\n height: ","px;\n }\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return t4=function(){return r},r}tZ.displayName="TaskGantt";var t9=(0,H.debounce)(function(e,t,r,n,o){return t2(function(){var a;return t8(this,function(i){switch(i.label){case 0:return[4,t.update({filterByTk:e.id,values:(t5(a={},r.start,e.start),t5(a,r.end,e.end),a)})];case 1:return i.sent(),R.message.success(o("Saved successfully")),[4,null==n?void 0:n.refresh()];case 2:return i.sent(),[2]}})})()},300),t7=(0,H.debounce)(function(e,t,r,n,o){return t2(function(){return t8(this,function(a){switch(a.label){case 0:return[4,t.update({filterByTk:e.id,values:t5({},r.progress,e.progress/100)})];case 1:return a.sent(),R.message.success(o("Saved successfully")),[4,null==n?void 0:n.refresh()];case 2:return a.sent(),[2]}})})()},300),re=(0,t.withDynamicSchemaProps)(function(e){var i,l,c,s,u,d=eW().styles,p=(0,t.useToken)().token,h=null==(c=JSON.parse((0,t.useAPIClient)().auth.getOption("theme")))?void 0:c.uid,m=(0,t.useProps)(e),g=m.listCellWidth,v=void 0===g?"155px":g,b=m.ganttHeight,y=void 0===b?0:b,x=m.preStepsCount,S=void 0===x?1:x,w=m.barFill,k=void 0===w?60:w,C=m.barCornerRadius,O=void 0===C?p.borderRadiusXS:C,P=m.barProgressColor,E=void 0===P?p.colorPrimary:P,T=m.barProgressSelectedColor,j=void 0===T?p.colorPrimary:T,D=m.barBackgroundColor,M=void 0===D?p.colorPrimary:D,N=m.barBackgroundSelectedColor,A=void 0===N?p.colorPrimary:N,F=m.projectProgressColor,I=void 0===F?p.colorPrimary:F,H=m.projectProgressSelectedColor,z=void 0===H?p.colorPrimary:H,W=m.projectBackgroundColor,L=void 0===W?p.colorPrimary:W,q=m.projectBackgroundSelectedColor,Y=void 0===q?p.colorPrimary:q,_=m.milestoneBackgroundColor,X=void 0===_?"#f1c453":_,U=m.milestoneBackgroundSelectedColor,V=void 0===U?"#f29e4c":U,Q=m.rtl,$=void 0!==Q&&Q,K=m.handleWidth,J=void 0===K?8:K,Z=m.timeStep,ee=m.arrowColor,et=m.fontFamily,er=void 0===et?"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'":et,en=m.fontSize,eo=void 0===en?p.fontSize:en,ea=m.arrowIndent,ei=void 0===ea?20:ea,el=m.todayColor,ec=m.viewDate,es=m.TooltipContent,eu=m.onDoubleClick,ed=m.onDelete,eh=m.onSelect,em=m.onExpanderClick,eg=m.tasks,ev=m.expandAndCollapseAll,ex=m.fieldNames,eS=m.loading,ew=(0,t.useDesignable)().designable,ek=(null==h?void 0:h.includes("compact"))?45:ew?65:55,eC=(null==h?void 0:h.includes("compact"))?45:65,eO=f(),eP=(0,t.useCurrentAppInfo)(),eE=(0,a.useTranslation)().t,eT=null==(s=eP.data)?void 0:s.lang,eD=(0,t.useTableBlockContext)(),eM=(0,t.useBlockRequestContext)(),eB=eM.resource,eR=eM.service,eH=(0,o.useFieldSchema)(),ez=ex.range||"day",eL=(0,r.useRef)(null),eq=(0,r.useRef)(null),eG=(0,r.useRef)(null),eY=(0,r.useRef)(null),e_=t6((0,r.useState)(function(){var e=t6(ef(eg,ez,S),2);return{viewMode:ez,dates:ep(e[0],e[1],ez)}}),2),eX=e_[0],eU=e_[1],eV=t6((0,r.useState)(!1),2),eQ=eV[0],e$=eV[1],eK=(0,t.usePopupUtils)({setVisible:e$}).openPopup,eJ=t6((0,r.useState)({}),2),eZ=eJ[0],e0=eJ[1],e1=(0,t.useCollectionParentRecordData)(),e2=t6((0,r.useState)(void 0),2),e5=e2[0],e6=e2[1],e3=t6((0,r.useState)(0),2),e8=e3[0],e4=e3[1],e9=t6((0,r.useState)(0),2),e7=e9[0],te=e9[1],tt=t6((0,r.useState)(y),2),tr=tt[0],tn=tt[1],to=t6((0,r.useState)([]),2),ta=to[0],ti=to[1],tl=t6((0,r.useState)({action:""}),2),tc=tl[0],ts=tl[1],tu=(0,r.useMemo)(function(){return eC*k/100},[eC,k]),td=t6((0,r.useState)(),2),tf=td[0],tp=td[1],th=t6((0,r.useState)(null),2),tm=th[0],tg=th[1],tv=t6((0,r.useState)(0),2),tb=tv[0],ty=tv[1],tx=t6((0,r.useState)(-1),2),tS=tx[0],tw=tx[1],tk=t6((0,r.useState)(!1),2),tC=tk[0],tO=tk[1],tP=(i=eX.dates.length,(l=null==(u=eG.current)?void 0:u.clientWidth)/i>50?Math.floor(l/i)+20:60),tE=eX.dates.length*tP,tT=ta.length*eC,tj=eD.expandFlag,tD=t6((0,r.useState)([]),2),tM=tD[0],tN=tD[1];(0,r.useEffect)(function(){eD.field.onExpandClick=tA,eD.field.onRowSelect=tF},[]),(0,r.useEffect)(function(){null==ev||ev(!tj)},[tj]),(0,r.useEffect)(function(){var e=(e=em?function(e){var t=e.filter(function(e){return e.hideChildren&&"project"===e.type});if(t.length>0)for(var r=0;t.length>r;r++)!function(r){var n=t[r],o=function e(t,r){var n=[];n="project"!==r.type?t.filter(function(e){return e.dependencies&&-1!==e.dependencies.indexOf(r.id)}):t.filter(function(e){return e.project&&e.project===r.id});var o=[];return n.forEach(function(r){var n;o.push.apply(o,function(e){if(Array.isArray(e))return eb(e)}(n=e(t,r))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e){if(e){if("string"==typeof e)return eb(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 eb(e,void 0)}}(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}),n=n.concat(n,o)}(e,n);e=e.filter(function(e){return -1===o.indexOf(e)})}(r);return e}(eg):eg).sort(ey),t=t6(ef(e,ez,S),2),r=ep(t[0],t[1],ez);$&&(r=r.reverse(),-1===tS&&tw(r.length*tP)),eU({dates:r,viewMode:ez}),ti(G(e,r,tP,eC,tu,O,J,$,E,j,M,A,I,z,L,Y,X,V))},[eg,ez,S,eC,O,tP,tu,J,E,j,M,A,I,z,L,Y,X,V,$,tS]),(0,r.useEffect)(function(){if(ez===eX.viewMode&&(ec&&!e5||ec&&(null==e5?void 0:e5.valueOf())!==ec.valueOf())){var e=eX.dates,t=e.findIndex(function(t,r){return ec.valueOf()>=t.valueOf()&&r+1!==e.length&&ec.valueOf()<e[r+1].valueOf()});-1!==t&&(e6(ec),tw(tP*t))}},[ec,tP,eX.dates,eX.viewMode,ez,e5,e6]),(0,r.useEffect)(function(){var e=tc.changedTask,t=tc.action;if(e){if("delete"===t)ts({action:""}),ti(ta.filter(function(t){return t.id!==e.id}));else if("move"===t||"end"===t||"start"===t||"progress"===t){var r=ta.find(function(t){return t.id===e.id});r&&r.start&&r.end&&(r.start.getTime()!==e.start.getTime()||r.end.getTime()!==e.end.getTime()||r.progress!==e.progress)&&ti(ta.map(function(t){return t.id===e.id?e:t}))}}},[tc,ta]),(0,r.useEffect)(function(){tm&&(ti(ta.map(function(e){return e.id!==tm.id?e:tm})),tg(null))},[tm,ta]),(0,r.useEffect)(function(){v||e4(0),eq.current&&e4(eq.current.offsetWidth)},[eq,v]),(0,r.useEffect)(function(){eL.current&&te(eL.current.offsetWidth-e8)},[eL,e8]),(0,r.useEffect)(function(){y?tn(y+ek):tn(eg.length*eC+ek)},[y,eg,ek,eC]),(0,r.useEffect)(function(){var e,t=function(e){if(e.shiftKey||e.deltaX){var t=tS+(e.deltaX?e.deltaX:e.deltaY);t<0?t=0:t>tE&&(t=tE),tw(t),e.preventDefault()}else if(y){var r=tb+e.deltaY;r<0?r=0:r>tT-y&&(r=tT-y),r!==tb&&(ty(r),e.preventDefault())}tO(!0)};return null==(e=eL.current)||e.addEventListener("wheel",t,{passive:!1}),function(){var e;null==(e=eL.current)||e.removeEventListener("wheel",t)}},[eL,tb,tS,y,tE,$,tT]);var tA=function(e,t){var r,n,o,a=null==eO||null==(o=eO.field)?void 0:o.data.find(function(e){return e.id===t.id+""});em&&t.children.length&&em((r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){t5(e,t,r[t])})}return e}({},a),n=n={hideChildren:!e},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r))},tF=function(e){tN(e)},tI={columnWidth:tP,svgWidth:tE,tasks:eg,rowHeight:eC,dates:eX.dates,todayColor:void 0===el?"rgba(252, 248, 227, 0.5)":el,rtl:$,selectedRowKeys:tM},tB={tasks:ta,dates:eX.dates,ganttEvent:tc,selectedTask:tf,rowHeight:eC,taskHeight:tu,columnWidth:tP,arrowColor:void 0===ee?"grey":ee,timeStep:void 0===Z?3e5:Z,fontFamily:er,fontSize:eo,arrowIndent:ei,svgWidth:tE,rtl:$,setGanttEvent:ts,setFailedTask:tg,setSelectedTask:function(e){var t=ta.find(function(t){return t.id===e}),r=ta.find(function(e){return!!tf&&e.id===tf.id});eh&&(r&&eh(r,!1),t&&eh(t,!0)),tp(t)},onDateChange:function(e){return t2(function(){return t8(this,function(t){return t9(e,eB,ex,eR,eE),[2]})})()},onProgressChange:ex.progress&&function(e){return t2(function(){return t8(this,function(t){return t7(e,eB,ex,eR,eE),[2]})})()},onDoubleClick:eu,onClick:function(e){var t,r=function(e){return e.reduce(function(e,t){var n;return t.children?e.concat([t].concat(function(e){if(Array.isArray(e))return t0(e)}(n=r(t.children))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||t3(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())):e.concat(t)},[])},n=r(null==eR||null==(t=eR.data)?void 0:t.data),o=null==n?void 0:n.find(function(t){return t.id===+e.id});o&&(e0(o),eK({recordData:o,customActionSchema:eH.properties.detail}))},onDelete:ed,loading:eS};return n().createElement("div",{className:(0,B.cx)((0,B.css)(t4(),eC,ek)),ref:eY},n().createElement(t.PopupContextProvider,{visible:eQ,setVisible:e$},n().createElement(t.RecordProvider,{record:eZ,parent:e1},n().createElement(eI,null)),n().createElement(t.NocoBaseRecursionField,{name:"anctionBar",schema:eH.properties.toolBar}),n().createElement(t.NocoBaseRecursionField,{name:"table",schema:eH.properties.table}),n().createElement("div",{className:d.wrapper,onKeyDown:function(e){e.preventDefault();var t=tb,r=tS,n=!0;switch(e.key){case"Down":case"ArrowDown":t+=eC,n=!1;break;case"Up":case"ArrowUp":t-=eC,n=!1;break;case"Left":case"ArrowLeft":r-=tP;break;case"Right":case"ArrowRight":r+=tP}n?(r<0?r=0:r>tE&&(r=tE),tw(r)):(t<0?t=0:t>tT-y&&(t=tT-y),ty(t)),tO(!0)},tabIndex:0,ref:eL},n().createElement(tZ,{gridProps:tI,calendarProps:{dateSetup:eX,locale:eT,viewMode:ez,headerHeight:ek,columnWidth:tP,fontFamily:er,fontSize:eo,rtl:$},barProps:tB,ganttHeight:y,scrollY:tb,scrollX:tS,ref:eG}),tc.changedTask&&n().createElement(eN,{arrowIndent:ei,rowHeight:eC,svgContainerHeight:tr,svgContainerWidth:e7,fontFamily:er,fontSize:eo,scrollX:tS,scrollY:tb,task:tc.changedTask,headerHeight:ek,taskListWidth:e8,TooltipContent:void 0===es?eA:es,rtl:$,svgWidth:tE}),n().createElement(eF,{ganttFullHeight:tT,ganttHeight:y,headerHeight:ek,scroll:tb,onScroll:function(e){tb===e.currentTarget.scrollTop||tC?tO(!1):(ty(e.currentTarget.scrollTop),tO(!0))},rtl:$}),n().createElement(R.Spin,{spinning:eS,style:{visibility:"hidden"}},n().createElement(ej,{svgWidth:tE,taskListWidth:e8,scroll:tS,rtl:$,onScroll:function(e){tS===e.currentTarget.scrollLeft||tC?tO(!1):(tw(e.currentTarget.scrollLeft),tO(!0))}})))))});function rt(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function rr(e,t,r){return(rr=ri()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&ro(o,r.prototype),o}).apply(null,arguments)}function rn(e){return(rn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ro(e,t){return(ro=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ra(e){var t="function"==typeof Map?new Map:void 0;return(ra=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,r)}function r(){return rr(e,arguments,rn(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),ro(r,e)})(e)}function ri(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ri=function(){return!!e})()}re.ActionBar=t.ActionBar,re.ViewMode=el,re.Designer=function(){var e=(0,t.useCollection_deprecated)(),r=e.name,o=e.title,a=(0,t.useSchemaTemplate)();return n().createElement(t.GeneralSchemaDesigner,{schemaSettings:"blockSettings:gantt",template:a,title:o||r})},re.Event=I;var rl=n().memo(function(e){return n().createElement(t.SchemaComponentOptions,{components:{Gantt:re,GanttBlockInitializer:A,GanttBlockProvider:d},scope:{useGanttBlockProps:p}},e.children)});rl.displayName="GanttProvider";var rc=function(e){var i;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function l(){var e,t;if(!(this instanceof l))throw TypeError("Cannot call a class as a function");return e=l,t=arguments,e=rn(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,ri()?Reflect.construct(e,t||[],rn(this).constructor):e.apply(this,t))}return l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),e&&ro(l,e),i=[{key:"load",value:function(){var e;return(e=function(){var e;return function(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:c(0)}),l(i,"throw",{value:c(1)}),l(i,"return",{value:c(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function c(l){return function(c){var s=[l,c];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(i){return this.app.use(rl),this.app.schemaSettingsManager.add(b),this.app.schemaSettingsManager.add(y),this.app.schemaInitializerManager.add(k),this.app.schemaInitializerManager.add(C),null==(e=this.app.schemaInitializerManager.get("page:addBlock"))||e.add("dataBlocks.gantt",{title:"{{t('Gantt')}}",Component:"GanttBlockInitializer"}),this.app.schemaInitializerManager.addItem("popup:common:addBlock","dataBlocks.gantt",{title:"{{t('Gantt')}}",Component:"GanttBlockInitializer",useComponentProps:function(){var e,i,l,c,s,u=(e=(0,t.useSchemaInitializer)().insert,i=(0,a.useTranslation)().t,l=(0,r.useContext)(o.SchemaOptionsContext),c=(0,t.useGlobalTheme)().theme,s=(0,t.useCollectionManager_deprecated)().getCollectionFields,{createAssociationGanttBlock:function(r){var o=r.item;return D(function(){var r,a,u,d,f,p,h,m,g;return N(this,function(v){switch(v.label){case 0:return d=o.associationField,p=null==(f=s(o.name,o.dataSource))||null==(r=f.filter(function(e){return"string"===e.type}))?void 0:r.map(function(e){var t;return{label:null==e||null==(t=e.uiSchema)?void 0:t.title,value:e.name}}),h=null==f||null==(a=f.filter(function(e){return"date"===e.type}))?void 0:a.map(function(e){var t;return{label:null==e||null==(t=e.uiSchema)?void 0:t.title,value:e.name}}),m=null==f||null==(u=f.filter(function(e){return"float"===e.type}))?void 0:u.map(function(e){var t;return{label:null==e||null==(t=e.uiSchema)?void 0:t.title,value:e.name}}),[4,(0,t.FormDialog)(i("Create gantt block"),function(){return n().createElement(t.SchemaComponentOptions,{scope:l.scope,components:M({},l.components)},n().createElement(P.FormLayout,{layout:"vertical"},n().createElement(t.SchemaComponent,{schema:{properties:{title:{title:i("Title field"),enum:p,required:!0,"x-component":"Select","x-decorator":"FormItem"},start:{title:i("Start date field"),enum:h,required:!0,default:"createdAt","x-component":"Select","x-decorator":"FormItem"},end:{title:i("End date field"),enum:h,required:!0,"x-component":"Select","x-decorator":"FormItem"},progress:{title:i("Progress field"),enum:m,"x-component":"Select","x-decorator":"FormItem"},range:{title:i("Time scale"),enum:[{label:'{{t("Hour")}}',value:"hour",color:"orange"},{label:'{{t("Quarter of day")}}',value:"quarterDay",color:"default"},{label:'{{t("Half of day")}}',value:"halfDay",color:"blue"},{label:'{{t("Day")}}',value:"day",color:"yellow"},{label:'{{t("Week")}}',value:"week",color:"pule"},{label:'{{t("Month")}}',value:"month",color:"green"},{label:'{{t("Year")}}',value:"year",color:"green"},{label:'{{t("QuarterYear")}}',value:"quarterYear",color:"red"}],default:"day","x-component":"Select","x-decorator":"FormItem"}}}})))},c).open({initialValues:{}})];case 1:return g=v.sent(),e(T({association:"".concat(d.collectionName,".").concat(d.name),dataSource:o.dataSource,fieldNames:M({},g)})),[2]}})})()}}).createAssociationGanttBlock,d=F().createGanttBlock;return{onlyCurrentDataSource:!0,filterCollections:function(e){var t=e.associationField;return!!t&&["hasMany","belongsToMany"].includes(t.type)},createBlockSchema:function(e){var t=e.item;if(e.fromOthersInPopup)return d({item:t});u({item:t})},showAssociationFields:!0,hideSearch:!0}}}),this.app.addScopes({useGanttBlockProps:p}),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){rt(a,n,o,i,l,"next",e)}function l(e){rt(a,n,o,i,l,"throw",e)}i(void 0)})}).call(this)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(l.prototype,i),l}(ra(t.Plugin)),rs=rc}(),S}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@ant-design/icons"),require("@formily/shared"),require("react"),require("antd"),require("antd-style"),require("@nocobase/utils/client"),require("lodash"),require("react-i18next"),require("@emotion/css"),require("@formily/antd-v5"),require("@formily/react"),require("@nocobase/flow-engine"),require("@nocobase/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-gantt",["@ant-design/icons","@formily/shared","react","antd","antd-style","@nocobase/utils/client","lodash","react-i18next","@emotion/css","@formily/antd-v5","@formily/react","@nocobase/flow-engine","@nocobase/client"],t):"object"==typeof exports?exports["@nocobase/plugin-gantt"]=t(require("@ant-design/icons"),require("@formily/shared"),require("react"),require("antd"),require("antd-style"),require("@nocobase/utils/client"),require("lodash"),require("react-i18next"),require("@emotion/css"),require("@formily/antd-v5"),require("@formily/react"),require("@nocobase/flow-engine"),require("@nocobase/client")):e["@nocobase/plugin-gantt"]=t(e["@ant-design/icons"],e["@formily/shared"],e.react,e.antd,e["antd-style"],e["@nocobase/utils/client"],e.lodash,e["react-i18next"],e["@emotion/css"],e["@formily/antd-v5"],e["@formily/react"],e["@nocobase/flow-engine"],e["@nocobase/client"])}(self,function(e,t,r,n,o,a,i,l,c,s,u,d,f){return function(){"use strict";var p={375:function(t){t.exports=e},477:function(e){e.exports=c},418:function(e){e.exports=s},230:function(e){e.exports=u},166:function(e){e.exports=t},342:function(e){e.exports=f},694:function(e){e.exports=d},768:function(e){e.exports=a},59:function(e){e.exports=n},235:function(e){e.exports=o},773:function(e){e.exports=i},155:function(e){e.exports=r},953:function(e){e.exports=l}},h={};function m(e){var t=h[e];if(void 0!==t)return t.exports;var r=h[e]={exports:{}};return p[e](r,r.exports,m),r.exports}m.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return m.d(t,{a:t}),t},m.d=function(e,t){for(var r in t)m.o(t,r)&&!m.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},m.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),m.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},m.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},m.g.importScripts&&(g=m.g.location+"");var g,v=m.g.document;if(!g&&v&&(v.currentScript&&"SCRIPT"===v.currentScript.tagName.toUpperCase()&&(g=v.currentScript.src),!g)){var b=v.getElementsByTagName("script");if(b.length)for(var y=b.length-1;y>-1&&(!g||!/^http(s?):/.test(g));)g=b[y--].src}if(!g)throw Error("Automatic publicPath is not supported in this browser");m.p=g.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var x={},S=window.__nocobase_public_path__||"";if(!S&&window.location&&window.location.pathname){var w=window.location.pathname||"/",k=w.indexOf("/v2/");S=k>=0?w.slice(0,k+1):"/"}return S&&(S=S.replace(/\/v2\/?$/,"/")),S||(S="/"),"/"!==S.charAt(S.length-1)&&(S+="/"),m.p=S+"static/plugins/@nocobase/plugin-gantt/dist/client/",!function(){m.r(x),m.d(x,{PluginGanttClient:function(){return rc},Gantt:function(){return re},default:function(){return rs}});var e,t=m(342),r=m(155),n=m.n(r),o=m(230),a=m(953);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}}(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.")}()}var c=(0,r.createContext)({});c.displayName="GanttBlockContext";var s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=arguments.length>5?arguments[5]:void 0,l=arguments.length>6?arguments[6]:void 0,c=arguments.length>7?arguments[7]:void 0;return e.forEach(function(e){var u,d,f=i(e),p=parseFloat((100*e[r.progress]).toFixed(2)),h=(0,t.getLabelFormatValue)(c,e[r.title]);e.children&&e.children.length?(n.push({start:new Date(null!=(u=e[r.start])?u:void 0),end:new Date(null!=(d=e[r.end])?d:void 0),name:h,id:e[l]+"",type:"project",progress:p>100?100:p||0,hideChildren:a,project:o,color:e.color,isDisabled:f}),s(e.children,r,n,e.id+"",a,i,l,c)):n.push({start:e[r.start]?new Date(e[r.start]):void 0,end:new Date(e[r.end]||e[r.start]),name:h,id:e[l]+"",type:r.end?"task":"milestone",progress:p>100?100:p||0,project:o,color:e.color,isDisabled:f})}),n},u=function(e){var r=e.fieldNames,a=e.timeRange,i=e.resource,l=(0,o.useField)(),s=(0,t.useBlockRequestContext)().service;return n().createElement(c.Provider,{value:{field:l,service:s,resource:i,fieldNames:r,timeRange:a}},e.children)},d=function(e){var r,o,a,i=(0,t.useCollectionManager_deprecated)(e.dataSource).getCollection(e.collection,e.dataSource),l={filter:null==(r=e.params)?void 0:r.filter,paginate:!1,sort:[(null==i?void 0:i.primaryKey)||"id"]};return n().createElement("div",{"aria-label":"block-item-gantt",role:"button"},n().createElement(t.TableBlockProvider,(o=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e),a=a={params:l},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(a)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(a,e))}),o),n().createElement(u,e)))},f=function(){return(0,r.useContext)(c)},p=function(){var e,n,o=f(),a=o.fieldNames,i=l((0,r.useState)([]),2),c=i[0],u=i[1],d=(0,t.useCollection_deprecated)(),p=d.getPrimaryKey,h=d.name,m=d.template,g=d.writableView,v=(0,t.useACLRoleContext)().parseAction,b=(0,t.useTableBlockContext)(),y=l((0,r.useState)(!1),2),x=y[0],S=y[1],w=p(),k=null==(e=(0,t.useCollection)().fields.find(function(e){return e.name===(null==a?void 0:a.title)}))?void 0:e.uiSchema,C=function(e){var t=null==e?void 0:e[w],r=v("".concat(h,":update"),{schema:{},recordPkValue:t});return"view"===m&&!g||!r};return(0,r.useEffect)(function(){var e;if(S(!0),!(null==o||null==(e=o.service)?void 0:e.loading)){var t,r=s(null==(t=o.service.data)?void 0:t.data,o.fieldNames,[],void 0,!1,C,w,k);u(r),S(!1),o.field.data=r,c.length>0&&b.setExpandFlag(!0)}},[null==o||null==(n=o.service)?void 0:n.loading]),{fieldNames:o.fieldNames,timeRange:o.timeRange,onExpanderClick:function(e){var t=o.field.data.map(function(t){return t.id===e.id?e:t});u(t),o.field.data=t},expandAndCollapseAll:function(e){var t,r=s(null==(t=o.service.data)?void 0:t.data,o.fieldNames,[],void 0,e,C,w,k);u(r),o.field.data=r},tasks:c,loading:x}},h=function(){return(0,a.useTranslation)("gantt")},g=function(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"string",n=(0,t.useCompile)(),o=(0,t.useCollection_deprecated)().fields;return null==o||null==(e=o.filter(function(e){return"string"==typeof r?e.type===r:r.includes(e.type)}))?void 0:e.map(function(e){var t;return{value:e.name,label:n(null==e||null==(t=e.uiSchema)?void 0:t.title)}})};function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b=new t.SchemaSettings({name:"GanttBlockSettings",items:[{name:"title",Component:t.SchemaSettingsBlockTitleItem},{name:"blockLinkageRules",Component:t.SchemaSettingsLinkageRules,useComponentProps:function(){return{collectionName:(0,t.useCollection_deprecated)().name,title:(0,(0,a.useTranslation)().t)("Block Linkage rules"),category:t.LinkageRuleCategory.block}}},{name:"titleField",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{},i=f().service,l=(0,o.useField)(),c=(0,t.useDesignable)().dn;return{title:r("Title field"),value:a.title,options:g("string"),onChange:function(e){var t,r=l.decoratorProps.fieldNames||{};r.title=e,l.decoratorProps.params=r,n["x-decorator-props"].params=r,n["x-decorator-props"].fieldNames=r,i.refresh(),c.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",l.decoratorProps),t)}),c.refresh()}}}},{name:"timeScale",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{},i=(0,o.useField)(),l=f().service,c=(0,t.useDesignable)().dn,s=(0,t.useCompile)();return{title:r("Time scale"),value:a.range||"day",options:[{label:s('{{t("Hour")}}'),value:"hour",color:"orange"},{label:s('{{t("Quarter of day")}}'),value:"quarterDay",color:"default"},{label:s('{{t("Half of day")}}'),value:"halfDay",color:"blue"},{label:s('{{t("Day")}}'),value:"day",color:"yellow"},{label:s('{{t("Week")}}'),value:"week",color:"pule"},{label:s('{{t("Month")}}'),value:"month",color:"green"},{label:s('{{t("QuarterYear")}}'),value:"quarterYear",color:"red"},{label:s('{{t("Year")}}'),value:"year",color:"green"}],onChange:function(e){var t,r=i.decoratorProps.fieldNames||{};r.range=e,i.decoratorProps.params=r,n["x-decorator-props"].params=r,n["x-decorator-props"].fieldNames=r,l.refresh(),c.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",i.decoratorProps),t)}),c.refresh()}}}},{name:"startDateField",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{},i=(0,o.useField)(),l=(0,t.useDesignable)().dn,c=f().service;return{title:r("Start date field"),value:a.start,options:g("date"),onChange:function(e){var t,r=i.decoratorProps.fieldNames||{};r.start=e,i.decoratorProps.fieldNames=r,n["x-decorator-props"].fieldNames=r,c.refresh(),l.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",i.decoratorProps),t)}),l.refresh()}}}},{name:"endDateField",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(0,o.useField)(),i=f().service,l=(0,t.useDesignable)().dn,c=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{};return{title:r("End date field"),value:c.end,options:g("date"),onChange:function(e){var t,r=a.decoratorProps.fieldNames||{};r.end=e,a.decoratorProps.fieldNames=r,n["x-decorator-props"].fieldNames=r,i.refresh(),l.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",a.decoratorProps),t)}),l.refresh()}}}},{name:"processField",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{},i=f().service,l=(0,t.useDesignable)().dn,c=(0,o.useField)();return{title:r("Progress field"),value:a.progress,options:g("float"),onChange:function(e){var t,r=c.decoratorProps.fieldNames||{};r.progress=e,c.decoratorProps.fieldNames=r,n["x-decorator-props"].fieldNames=r,i.refresh(),l.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",c.decoratorProps),t)}),l.refresh()}}}},{name:"dataScope",Component:t.SchemaSettingsDataScope,useComponentProps:function(){var e,r,n=(0,t.useCollection_deprecated)().name,a=(0,o.useFieldSchema)(),i=(0,t.useFormBlockContext)().form,l=(0,o.useField)(),c=(0,t.useDesignable)().dn;return{collectionName:n,defaultFilter:(null==a||null==(r=a["x-decorator-props"])||null==(e=r.params)?void 0:e.filter)||{},form:i,onSubmit:function(e){var r,n=e.filter;n=(0,t.removeNullCondition)(n);var o=l.decoratorProps.params||{};o.filter=n,l.decoratorProps.params=o,a["x-decorator-props"].params=o,c.emit("patch",{schema:(v(r={},"x-uid",a["x-uid"]),v(r,"x-decorator-props",a["x-decorator-props"]),r)})}}}},{name:"divider",type:"divider"},{name:"template",Component:t.SchemaSettingsTemplate,useComponentProps:function(){var e=(0,t.useCollection_deprecated)().name,r=(0,t.useBlockTemplateContext)().componentNamePrefix;return{componentName:"".concat(r,"Gantt"),collectionName:e}}},{name:"divider2",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]}),y=new t.SchemaSettings({name:"blockSettings:gantt",items:[{name:"title",Component:t.SchemaSettingsBlockTitleItem},{name:"blockLinkageRules",Component:t.SchemaSettingsLinkageRules,useComponentProps:function(){return{collectionName:(0,t.useCollection_deprecated)().name,title:(0,(0,a.useTranslation)().t)("Block Linkage rules"),category:t.LinkageRuleCategory.block}}},{name:"titleField",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{},i=f().service,l=(0,o.useField)(),c=(0,t.useDesignable)().dn;return{title:r("Title field"),value:a.title,options:g("string"),onChange:function(e){var t,r=l.decoratorProps.fieldNames||{};r.title=e,l.decoratorProps.params=r,n["x-decorator-props"].params=r,n["x-decorator-props"].fieldNames=r,i.refresh(),c.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",l.decoratorProps),t)}),c.refresh()}}}},{name:"timeScale",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{},i=(0,o.useField)(),l=f().service,c=(0,t.useDesignable)().dn,s=(0,t.useCompile)();return{title:r("Time scale"),value:a.range||"day",options:[{label:s('{{t("Hour")}}'),value:"hour",color:"orange"},{label:s('{{t("Quarter of day")}}'),value:"quarterDay",color:"default"},{label:s('{{t("Half of day")}}'),value:"halfDay",color:"blue"},{label:s('{{t("Day")}}'),value:"day",color:"yellow"},{label:s('{{t("Week")}}'),value:"week",color:"pule"},{label:s('{{t("Month")}}'),value:"month",color:"green"},{label:s('{{t("QuarterYear")}}'),value:"quarterYear",color:"red"},{label:s('{{t("Year")}}'),value:"year",color:"green"}],onChange:function(e){var t,r=i.decoratorProps.fieldNames||{};r.range=e,i.decoratorProps.params=r,n["x-decorator-props"].params=r,n["x-decorator-props"].fieldNames=r,l.refresh(),c.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",i.decoratorProps),t)}),c.refresh()}}}},{name:"startDateField",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{},i=(0,o.useField)(),l=(0,t.useDesignable)().dn,c=f().service;return{title:r("Start date field"),value:a.start,options:g(["date","datetime","dateOnly","datetimeNoTz"]),onChange:function(e){var t,r=i.decoratorProps.fieldNames||{};r.start=e,i.decoratorProps.fieldNames=r,n["x-decorator-props"].fieldNames=r,c.refresh(),l.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",i.decoratorProps),t)}),l.refresh()}}}},t.setDataLoadingModeSettingsItem,{name:"endDateField",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(0,o.useField)(),i=f().service,l=(0,t.useDesignable)().dn,c=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{};return{title:r("End date field"),value:c.end,options:g(["date","datetime","dateOnly","datetimeNoTz"]),onChange:function(e){var t,r=a.decoratorProps.fieldNames||{};r.end=e,a.decoratorProps.fieldNames=r,n["x-decorator-props"].fieldNames=r,i.refresh(),l.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",a.decoratorProps),t)}),l.refresh()}}}},{name:"processField",Component:t.SchemaSettingsSelectItem,useComponentProps:function(){var e,r=h().t,n=(0,o.useFieldSchema)(),a=(null==n||null==(e=n["x-decorator-props"])?void 0:e.fieldNames)||{},i=f().service,l=(0,t.useDesignable)().dn,c=(0,o.useField)();return{title:r("Progress field"),value:a.progress,options:g("float"),onChange:function(e){var t,r=c.decoratorProps.fieldNames||{};r.progress=e,c.decoratorProps.fieldNames=r,n["x-decorator-props"].fieldNames=r,i.refresh(),l.emit("patch",{schema:(v(t={},"x-uid",n["x-uid"]),v(t,"x-decorator-props",c.decoratorProps),t)}),l.refresh()}}}},{name:"dataScope",Component:t.SchemaSettingsDataScope,useComponentProps:function(){var e,r,n=(0,t.useCollection)().name,a=(0,o.useFieldSchema)(),i=(0,t.useFormBlockContext)().form,l=(0,o.useField)(),c=(0,t.useDesignable)().dn;return{collectionName:n,defaultFilter:(null==a||null==(r=a["x-decorator-props"])||null==(e=r.params)?void 0:e.filter)||{},form:i,onSubmit:function(e){var r,n=e.filter;n=(0,t.removeNullCondition)(n);var o=l.decoratorProps.params||{};o.filter=n,l.decoratorProps.params=o,a["x-decorator-props"].params=o,c.emit("patch",{schema:(v(r={},"x-uid",a["x-uid"]),v(r,"x-decorator-props",a["x-decorator-props"]),r)})}}}},{name:"divider",type:"divider"},{name:"template",Component:t.SchemaSettingsTemplate,useComponentProps:function(){var e=(0,t.useCollection)().name,r=(0,t.useBlockTemplateContext)().componentNamePrefix;return{componentName:"".concat(r,"Gantt"),collectionName:e}}},{name:"divider2",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]});function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var w={title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{type:"item",name:"filter",title:"{{t('Filter')}}",Component:"FilterActionInitializer",schema:{"x-align":"left"}},{type:"item",title:"{{t('Add new')}}",name:"addNew",Component:"CreateActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible:function(){return(0,t.useActionAvailable)("create")}},{type:"item",title:"{{t('Delete')}}",name:"delete",Component:"BulkDestroyActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider"},useVisible:function(){return(0,t.useActionAvailable)("destroyMany")}},{type:"item",title:"{{t('Refresh')}}",name:"refresh",Component:"RefreshActionInitializer",schema:{"x-align":"right"}},{name:"toggle",title:"{{t('Expand/Collapse')}}",Component:"ExpandableActionInitializer",schema:{"x-align":"right"},useVisible:function(){var e,r=(0,o.useFieldSchema)(),n=(0,t.useCollection)(),a=((null==r||null==(e=r.parent)?void 0:e["x-decorator-props"])||{}).treeTable;return n.tree&&a}},{name:"customRequest",title:'{{t("Custom request")}}',Component:"CustomRequestInitializer",schema:{"x-action":"customize:table:request:global"}}]},k=new t.CompatibleSchemaInitializer(S({name:"GanttActionInitializers"},w)),C=new t.CompatibleSchemaInitializer(S({name:"gantt:configureActions"},w),k),O=m(375),P=m(418),E=m(166),T=function(e){var t,r,n,o=e.collectionName,a=e.fieldNames,i=e.dataSource,l=e.association,c={type:"void","x-acl-action":"".concat(l||o,":list"),"x-decorator":"GanttBlockProvider","x-decorator-props":{collection:o,dataSource:i,action:"list",fieldNames:a,params:{paginate:!1}},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:gantt","x-component":"CardItem",properties:(t={},r=(0,E.uid)(),n={type:"void","x-component":"Gantt","x-use-component-props":"useGanttBlockProps",properties:{toolBar:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:24}},"x-initializer":"gantt:configureActions",properties:{}},table:{type:"array","x-decorator":"div","x-decorator-props":{style:{float:"left",maxWidth:"35%"}},"x-initializer":"table:configureColumns","x-component":"TableV2","x-use-component-props":"useTableBlockProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"},pagination:!1},properties:{actions:{type:"void",title:'{{ t("Actions") }}',"x-action-column":"actions","x-decorator":"TableV2.Column.ActionBar","x-component":"TableV2.Column","x-toolbar":"TableColumnSchemaToolbar","x-initializer":"table:configureItemActions","x-settings":"fieldSettings:TableColumn","x-toolbar-props":{initializer:"table:configureItemActions"},properties:{actions:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{split:"|"}}}}}},detail:{type:"void","x-component":"Gantt.Event",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-component-props":{className:"nb-action-popup"},title:'{{ t("View record") }}',properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:common:addBlock"}}}}}}}}}}},r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t)};return l&&(c["x-decorator-props"].association=l),c};function j(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function D(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){j(a,n,o,i,l,"next",e)}function l(e){j(a,n,o,i,l,"throw",e)}i(void 0)})}}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function N(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:c(0)}),l(i,"throw",{value:c(1)}),l(i,"return",{value:c(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function c(l){return function(c){var s=[l,c];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}var A=function(e){var r,o,a=e.filterCollections,i=e.onlyCurrentDataSource,l=e.hideSearch,c=e.createBlockSchema,s=e.showAssociationFields,u=(0,t.useSchemaInitializerItem)(),d=F().createGanttBlock;return n().createElement(t.DataBlockInitializer,(r=M({},u),o=o={componentType:"Gantt",icon:n().createElement(O.ProjectOutlined,{rotate:90}),onCreateBlockSchema:function(e){return D(function(){return N(this,function(t){return c?[2,c(e)]:(d(e),[2])})})()},onlyCurrentDataSource:i,hideSearch:l,filter:a,showAssociationFields:s},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r))},F=function(){var e=(0,t.useSchemaInitializer)().insert,i=(0,a.useTranslation)().t,l=(0,t.useCollectionManager_deprecated)().getCollectionFields,c=(0,r.useContext)(o.SchemaOptionsContext),s=(0,t.useGlobalTheme)().theme;return{createGanttBlock:function(r){var o=r.item;return D(function(){var r,a,u,d,f,p,h,m;return N(this,function(g){switch(g.label){case 0:return f=null==(d=l(o.name,o.dataSource))||null==(r=d.filter(function(e){return"string"===e.type}))?void 0:r.map(function(e){var t;return{label:null==e||null==(t=e.uiSchema)?void 0:t.title,value:e.name}}),p=null==d||null==(a=d.filter(function(e){return["date","datetime","dateOnly","datetimeNoTz"].includes(e.type)}))?void 0:a.map(function(e){var t;return{label:null==e||null==(t=e.uiSchema)?void 0:t.title,value:e.name}}),h=null==d||null==(u=d.filter(function(e){return"float"===e.type}))?void 0:u.map(function(e){var t;return{label:null==e||null==(t=e.uiSchema)?void 0:t.title,value:e.name}}),[4,(0,t.FormDialog)(i("Create gantt block"),function(){return n().createElement(t.SchemaComponentOptions,{scope:c.scope,components:M({},c.components)},n().createElement(P.FormLayout,{layout:"vertical"},n().createElement(t.SchemaComponent,{schema:{properties:{title:{title:i("Title field"),enum:f,required:!0,"x-component":"Select","x-decorator":"FormItem"},start:{title:i("Start date field"),enum:p,required:!0,default:"createdAt","x-component":"Select","x-decorator":"FormItem"},end:{title:i("End date field"),enum:p,required:!0,"x-component":"Select","x-decorator":"FormItem"},progress:{title:i("Progress field"),enum:h,"x-component":"Select","x-decorator":"FormItem"},range:{title:i("Time scale"),enum:[{label:'{{t("Hour")}}',value:"hour",color:"orange"},{label:'{{t("Quarter of day")}}',value:"quarterDay",color:"default"},{label:'{{t("Half of day")}}',value:"halfDay",color:"blue"},{label:'{{t("Day")}}',value:"day",color:"yellow"},{label:'{{t("Week")}}',value:"week",color:"pule"},{label:'{{t("Month")}}',value:"month",color:"green"},{label:'{{t("Year")}}',value:"year",color:"green"},{label:'{{t("QuarterYear")}}',value:"quarterYear",color:"red"}],default:"day","x-component":"Select","x-decorator":"FormItem"}}}})))},s).open({initialValues:{}})];case 1:return m=g.sent(),e(T({collectionName:o.name,dataSource:o.dataSource,fieldNames:M({},m)})),[2]}})})()}}},I=(0,m(694).observer)(function(e){var r=(0,t.useCollectionRecordData)(),o=(0,t.useCollection)();return n().createElement(t.PopupContextProvider,null,n().createElement(t.VariablePopupRecordProvider,{recordData:r,collection:o},e.children))},{displayName:"Event"}),B=m(477),R=m(59),H=m(773);function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function L(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 r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return z(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return z(e,t)}}(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.")}()}var G=function(e,t,r,n,o,a,i,l,c,s,u,d,f,p,h,m,g,v){var b=e.map(function(e,b){return Y(e,b,t,r,n,o,a,i,l,c,s,u,d,f,p,h,m,g,v)});return b=b.map(function(e){for(var t=function(t){var n=b.findIndex(function(e){return e.id===r[t]});-1!==n&&b[n].barChildren.push(e)},r=e.dependencies||[],n=0;n<r.length;n++)t(n);return e})},Y=function(e,t,r,n,o,a,i,l,c,s,u,d,f,p,h,m,g,v,b){var y;switch(e.type){case"milestone":y=X(e,t,r,n,o,a,i,l,v,b);break;case"project":y=_(e,t,r,n,o,.5*a,i,l,c,p,h,m,g);break;default:y=_(e,t,r,n,o,a,i,l,c,s,u,d,f)}return y},_=function(e,t,r,n,o,a,i,l,c,s,u,d,f){c?(h=V(e.start,r,n),p=V(e.end,r,n)):(p=U(e.start,r,n),h=U(e.end,r,n));var p,h,m=e.type;"task"===m&&h-p<2*l&&(m="smalltask",h=p>0?p+2*l:p);var g=q($(p,h,e.progress,c),2),v=g[0],b=g[1],y="project"===e.type?Q(t,o,a)+8:Q(t,o,a),x="project"===e.type?e.hideChildren:void 0,S=W({backgroundColor:d,backgroundSelectedColor:f,progressColor:s,progressSelectedColor:u},e.styles);return L(W({},e),{typeInternal:m,x1:p,x2:h,y:y,index:t,progressX:b,progressWidth:v,barCornerRadius:i,handleWidth:l,hideChildren:x,height:a,barChildren:[],styles:S})},X=function(e,t,r,n,o,a,i,l,c,s){var u=U(e.start,r,n),d=Q(t,o,a),f=u-.5*a,p=u+.5*a,h=a/1.414,m=W({backgroundColor:c,backgroundSelectedColor:s,progressColor:"",progressSelectedColor:""},e.styles);return L(W({},e),{end:e.start,x1:f,x2:p,y:d,index:t,progressX:0,progressWidth:0,barCornerRadius:i,handleWidth:l,typeInternal:e.type,progress:0,height:h,hideChildren:void 0,barChildren:[],styles:m})},U=function(e,t,r){var n,o,a,i=t.findIndex(function(t){return(null==t?void 0:t.getTime())>=(null==e?void 0:e.getTime())})-1,l=((null==e?void 0:e.getTime())-(null==(n=t[i])?void 0:n.getTime()))/((null==(o=t[i+1])?void 0:o.getTime())-(null==(a=t[i])?void 0:a.getTime())),c=i*r+l*r;return isNaN(c)?0:c},V=function(e,t,r){var n=U(e,t,r);return isNaN(n+=r)?0:n},Q=function(e,t,r){var n=e*t+(t-r)/2;return isNaN(n)?0:n},$=function(e,t,r,n){var o,a=(t-e)*r*.01;return o=n?t-a:e,[a,o]},K=function(e,t){if(e>=t.x2)return 100;if(e<=t.x1)return 0;var r=t.x2-t.x1;return Math.round((e-t.x1)*100/r)},J=function(e,t){if(e>=t.x2)return 0;if(e<=t.x1)return 100;var r=t.x2-t.x1;return Math.round((t.x2-e)*100/r)},Z=function(e,t,r){return[e-5,t+r,e+5,t+r,e,t+r-8.66].join(",")},ee=function(e,t,r){e>=r.x2-2*r.handleWidth&&(e=r.x2-2*r.handleWidth);var n=Math.round((e-r.x1)/t);return r.x1+n*t},et=function(e,t,r){e<=r.x1+2*r.handleWidth&&(e=r.x1+2*r.handleWidth);var n=Math.round((e-r.x2)/t);return r.x2+n*t},er=function(e,t,r){var n=Math.round((e-r.x1)/t),o=r.x1+n*t,a=o+r.x2-r.x1;return[o,a]},en=function(e,t,r,n,o){var a,i,l=new Date((e-t)/n*o+(null==r||null==(a=r.getTime)?void 0:a.call(r)));return new Date((null==l||null==(i=l.getTime)?void 0:i.call(l))+((null==l?void 0:l.getTimezoneOffset())-(null==r?void 0:r.getTimezoneOffset()))*6e4)},eo=function(e,t,r,n,o,a,i){return"milestone"===r.type?ei(e,t,r,n,o,a):ea(e,t,r,n,o,a,i)},ea=function(e,t,r,n,o,a,i){var l=W({},r),c=!1;switch(t){case"progress":if(i?l.progress=J(e,r):l.progress=K(e,r),c=l.progress!==r.progress){var s=q($(l.x1,l.x2,l.progress,i),2),u=s[0],d=s[1];l.progressWidth=u,l.progressX=d}break;case"start":var f=ee(e,n,r);if(l.x1=f,c=l.x1!==r.x1){i?l.end=en(f,r.x1,r.end,n,o):l.start=en(f,r.x1,r.start,n,o);var p=q($(l.x1,l.x2,l.progress,i),2),h=p[0],m=p[1];l.progressWidth=h,l.progressX=m}break;case"end":var g=et(e,n,r);if(l.x2=g,c=l.x2!==r.x2){i?l.start=en(g,r.x2,r.start,n,o):l.end=en(g,r.x2,r.end,n,o);var v=q($(l.x1,l.x2,l.progress,i),2),b=v[0],y=v[1];l.progressWidth=b,l.progressX=y}break;case"move":var x=q(er(e-a,n,r),2),S=x[0],w=x[1];if(c=S!==r.x1){l.start=en(S,r.x1,r.start,n,o),l.end=en(w,r.x2,r.end,n,o),l.x1=S,l.x2=w;var k=q($(l.x1,l.x2,l.progress,i),2),C=k[0],O=k[1];l.progressWidth=C,l.progressX=O}}return{isChanged:c,changedTask:l}},ei=function(e,t,r,n,o,a){var i=W({},r),l=!1;if("move"===t){var c=q(er(e-a,n,r),2),s=c[0],u=c[1];(l=s!==r.x1)&&(i.start=en(s,r.x1,r.start,n,o),i.end=i.start,i.x1=s,i.x2=u)}return{isChanged:l,changedTask:i}},el=((e={}).Hour="hour",e.QuarterDay="quarterDay",e.HalfDay="halfDay",e.Day="day",e.Week="week",e.Month="month",e.QuarterYear="quarterYear",e.Year="year",e);Intl.DateTimeFormat,Intl.DateTimeFormatOptions;var ec={},es=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=JSON.stringify([e,t]),n=ec[r];return n||(n=new Intl.DateTimeFormat(e,t),ec[r]=n),n},eu=function(e,t,r){return new Date(e.getFullYear()+("year"===r?t:0),e.getMonth()+("month"===r?t:0),e.getDate()+("day"===r?t:0),e.getHours()+("hour"===r?t:0),e.getMinutes()+("minute"===r?t:0),e.getSeconds()+("second"===r?t:0),e.getMilliseconds()+("millisecond"===r?t:0))},ed=function(e,t){var r=["millisecond","second","minute","hour","day","month","year"],n=function(e){var n=r.indexOf(t);return r.indexOf(e)<=n};return new Date(null==e?void 0:e.getFullYear(),n("year")?0:e.getMonth(),n("month")?1:e.getDate(),n("day")?0:e.getHours(),n("hour")?0:e.getMinutes(),n("minute")?0:e.getSeconds(),n("second")?0:e.getMilliseconds())},ef=function(e,t,r){var n=(null==(c=e[0])?void 0:c.start)||new Date,o=(null==(s=e[0])?void 0:s.start)||new Date,a=!0,i=!1,l=void 0;try{for(var c,s,u,d=e[Symbol.iterator]();!(a=(u=d.next()).done);a=!0){var f=u.value;f.start<n&&(n=f.start),f.end>o&&(o=f.end)}}catch(e){i=!0,l=e}finally{try{a||null==d.return||d.return()}finally{if(i)throw l}}switch(t){case el.Year:n=ed(n=eu(n,-1,"year"),"year"),o=ed(o=eu(o,1,"year"),"year");break;case el.QuarterYear:n=ed(n=eu(n,-3,"month"),"month"),o=ed(o=eu(o,3,"year"),"year");break;case el.Month:n=ed(n=eu(n,-1*r,"month"),"month"),o=ed(o=eu(o,1,"year"),"year");break;case el.Week:n=eu(eg(n=ed(n,"day")),-7*r,"day"),o=eu(o=ed(o,"day"),1.5,"month");break;case el.Day:n=eu(n=ed(n,"day"),-1*r,"day"),o=eu(o=ed(o,"day"),19,"day");break;case el.QuarterDay:n=eu(n=ed(n,"day"),-1*r,"day"),o=eu(o=ed(o,"day"),66,"hour");break;case el.HalfDay:n=eu(n=ed(n,"day"),-1*r,"day"),o=eu(o=ed(o,"day"),108,"hour");break;case el.Hour:n=eu(n=ed(n,"hour"),-1*r,"hour"),o=eu(o=ed(o,"day"),1,"day")}return[n,o]},ep=function(e,t,r){for(var n=new Date(e),o=[n];n<t;){switch(r){case el.Year:n=eu(n,1,"year");break;case el.QuarterYear:n=eu(n,3,"month");break;case el.Month:n=eu(n,1,"month");break;case el.Week:n=eu(n,7,"day");break;case el.Day:n=eu(n,1,"day");break;case el.HalfDay:n=eu(n,12,"hour");break;case el.QuarterDay:n=eu(n,6,"hour");break;case el.Hour:n=eu(n,1,"hour")}o.push(n)}return o},eh=function(e,t){var r=es(t,{month:"long"}).format(e);return r.replace(r[0],r[0].toLocaleUpperCase())},em=function(e,t,r){var n=es(t,{weekday:r}).format(e);return n.replace(n[0],n[0].toLocaleUpperCase())},eg=function(e){var t=e.getDay(),r=e.getDate()-t+(0===t?-6:1);return new Date(e.setDate(r))},ev=function(e){var t=new Date(e.valueOf()),r=(t.getDay()+6)%7;t.setDate(t.getDate()-r+3);var n=t.valueOf();t.setMonth(0,1),4!==t.getDay()&&t.setMonth(0,1+(4-t.getDay()+7)%7);var o=(1+Math.ceil((n-t.valueOf())/6048e5)).toString();return 1===o.length?"0".concat(o):o};function eb(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ey=function(e,t){var r=e.displayOrder||Number.MAX_VALUE,n=t.displayOrder||Number.MAX_VALUE;return r>n?1:r<n?-1:0},ex=function(e){var t;return isNaN(null==e||null==(t=e.getTime)?void 0:t.call(e))?0:e.getFullYear()+"/"+"".concat(e.getMonth()+1)+"/"+e.getDate()},eS=m(235);function ew(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ek(){var e=ew(["\n overflow: auto;\n position: absolute;\n bottom: -8px;\n max-width: 100%;\n scrollbarWidth: thin;\n height: 1.2rem;\n &::-webkit-scrollbar: { width: 8, height: 8 };\n &::-webkit-scrollbar-corner: { background: transparent };\n &::-webkit-scrollbar-track: { background: var(--colorBgScrollTrack) };\n &::-webkit-scrollbar-thumb: {\n background: var(--colorBgScrollBar);\n borderRadius: 4;\n };\n &::-webkit-scrollbar-thumb:hover: {\n background: var(--colorBgScrollBarHover);\n };\n &::-webkit-scrollbar-thumb:active: {\n background: var(--colorBgScrollBarActive)\n }\n "]);return ek=function(){return e},e}function eC(){var e=ew(["\n padding: 12px;\n background-color: ",";\n background-clip: padding-box;\n border-radius: ",";\n box-shadow: ",";\n b: {\n display: block;\n margin-bottom: ",";\n }\n .tooltipdefaultcontainerparagraph: {\n font-size: ",";\n margin-bottom: "," + ",";\n color: ",";\n }\n "]);return eC=function(){return e},e}function eO(){var e=ew(["\n position: absolute;\n display: flex;\n flexshrink: 0;\n pointerevents: none;\n webkittouchcallout: none;\n webkituserselect: none;\n mozuserselect: none;\n msuserselect: none;\n userselect: none;\n "]);return eO=function(){return e},e}function eP(){var e=ew(["\n visibility: hidden;\n position: absolute;\n display: flex;\n pointerevents: none;\n "]);return eP=function(){return e},e}function eE(){var e=ew(["\n .horizontalScroll: {\n height: 1\n }\n \n .verticalScroll: {\n overflow: hidden auto;\n width: 1rem;\n flexShrink: 0;\n scrollbarWidth: thin;\n &::-webkit-scrollbar: { width: 8, height: 8 };\n &::-webkit-scrollbar-corner: { background: transparent};\n &::-webkit-scrollbar-track: { background: var(--colorBgScrollTrack) };\n &::-webkit-scrollbar-thumb: {\n background: var(--colorBgScrollBar);\n borderRadius: 4;\n }\n &::-webkit-scrollbar-thumb:hover': {\n background: var(--colorBgScrollBarHover)\n }\n &::-webkit-scrollbar-thumb:active': {\n background: var(--colorBgScrollBarActive)\n },\n }\n }\n "]);return eE=function(){return e},e}var eT=(0,eS.createStyles)(function(e){var t=e.token,r=e.css;return{scrollWrapper:r(ek()),tooltipDefaultContainer:r(eC(),t.colorBgElevated,t.borderRadius,t.boxShadow,t.marginXS,t.fontSizeSM,t.marginXXS,t.marginXS-t.marginXXS,t.colorText),tooltipDetailsContainer:r(eO()),tooltipDetailsContainerHidden:r(eP()),nbGridOther:r(eE())}}),ej=function(e){var t=e.scroll,o=e.svgWidth,a=e.taskListWidth,i=e.rtl,l=e.onScroll,c=eT().styles,s=(0,r.useRef)(null);return(0,r.useEffect)(function(){s.current&&(s.current.scrollLeft=t)},[t]),n().createElement("div",{dir:"ltr",style:{margin:i?"0px ".concat(a,"px 0px 0px"):"0px 0px 0px ".concat(a,"px")},className:(0,B.cx)(c.nbGridOther,c.scrollWrapper,"gantt-horizontal-scoll"),onScroll:l,ref:s},n().createElement("div",{style:{width:o,height:1},className:"horizontalScroll"}))};function eD(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eD(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eD(e,t)}}(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.")}()}var eN=function(e){var t=e.task,o=e.rowHeight,a=e.rtl,i=e.svgContainerHeight,l=e.svgContainerWidth,c=e.scrollX,s=e.scrollY,u=e.arrowIndent,d=e.fontSize,f=e.fontFamily,p=e.headerHeight,h=e.taskListWidth,m=e.TooltipContent,g=eT().styles,v=(0,r.useRef)(null),b=eM((0,r.useState)(0),2),y=b[0],x=b[1],S=eM((0,r.useState)(0),2),w=S[0],k=S[1];return(0,r.useEffect)(function(){if(v.current){var e,r=1.1*v.current.offsetHeight,n=1.1*v.current.offsetWidth,d=t.index*o-s+p;a?((e=t.x1-1.5*u-n-c)<0&&(e=t.x2+1.5*u-c),n+e>l&&(e=l-n,d+=o)):(n+(e=t.x2+1.5*u+h-c)>h+l&&(e=t.x1+h-1.5*u-c-n),e<h&&(e=l+h-n,d+=o)),r+d-s>i-s&&(d=i-r),x(d),k(e)}},[v,t,u,c,s,p,h,o,i,l,a]),n().createElement("div",{ref:v,className:(0,B.cx)(w?g.tooltipDetailsContainer:g.tooltipDetailsContainerHidden,g.nbGridOther),style:{left:w,top:y}},n().createElement(m,{task:t,fontSize:d,fontFamily:f}))},eA=function(e){var t,r,o,a,i,l,c,s,u=e.task,d=e.fontSize,f=e.fontFamily,p=eT().styles;return n().createElement("div",{className:(0,B.cx)(p.nbGridOther,p.tooltipDefaultContainer),"aria-label":"nb-gantt-tooltip",style:{fontSize:d,fontFamily:f}},n().createElement("b",{style:{fontSize:d}},u.name,": ",ex(u.start)," ~ ",ex(u.end)),(null==(r=u.end)||null==(t=r.getTime)?void 0:t.call(r))-(null==(a=u.start)||null==(o=a.getTime)?void 0:o.call(a))!=0&&n().createElement("p",{className:"tooltipDefaultContainerParagraph"},"Duration: ".concat(Math.round(((null==(l=u.end)||null==(i=l.getTime)?void 0:i.call(l))-(null==(s=u.start)||null==(c=s.getTime)?void 0:c.call(s)))/864e5*10)/10||""," day(s)")),n().createElement("p",{className:"tooltipDefaultContainerParagraph"},!!u.progress&&"Progress: ".concat(u.progress,"%")))},eF=function(e){var t=e.scroll,o=e.ganttHeight,a=e.ganttFullHeight,i=e.headerHeight,l=e.rtl,c=e.onScroll,s=eT().styles,u=(0,r.useRef)(null);return(0,r.useEffect)(function(){u.current&&(u.current.scrollTop=t)},[t]),n().createElement("div",{style:{maxHeight:o,marginTop:i,marginLeft:l?"":"-1rem"},className:(0,B.cx)(s.nbGridOther,"verticalScroll"),onScroll:c,ref:u},n().createElement("div",{style:{height:a,width:1}}))},eI=function(e){var r=(0,o.useFieldSchema)().properties.detail;return r?n().createElement(t.NocoBaseRecursionField,{schema:r,name:r.name}):null};function eB(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function eR(){var e=eB(["\n overflow: hidden;\n font-size: 0;\n margin: 0;\n padding: 0;\n width: 100%;\n border-left: 2px solid ",";\n overflow-x: auto;\n .ganttheader: {\n border-bottom: 1px solid ",";\n font-weight: 700;\n }\n .ganttbody: {\n border-bottom: 1px solid ",";\n }\n "]);return eR=function(){return e},e}function eH(){var e=eB(["\n margin: 0;\n padding: 0;\n overflow: hidden;\n margin-bottom: -5px;\n "]);return eH=function(){return e},e}function ez(){var e=eB(["\n display: flex;\n padding: 0;\n margin: 0;\n liststyle: none;\n outline: none;\n position: relative;\n .gantt-horizontal-scoll: {\n display: none;\n }\n &:hover: {\n .gantt-horizontal-scoll: {\n display: block;\n }\n }\n "]);return ez=function(){return e},e}var eW=(0,t.createStyles)(function(e){var t=e.token,r=e.css;return{ganttverticalcontainer:r(eR(),t.colorBorderSecondary,t.colorBorderSecondary,t.colorBorderSecondary),horizontalcontainer:r(eH()),wrapper:r(ez())}});function eL(e,t){"string"==typeof(r=e)&&-1!==r.indexOf(".")&&1===parseFloat(r)&&(e="100%");var r,n,o="string"==typeof(n=e)&&-1!==n.indexOf("%");return(e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),o&&(e=parseInt(String(e*t),10)/100),1e-6>Math.abs(e-t))?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function eq(e){return Math.min(1,Math.max(0,e))}function eG(e){return(isNaN(e=parseFloat(e))||e<0||e>1)&&(e=1),e}function eY(e){return e<=1?"".concat(100*Number(e),"%"):e}function e_(e){return 1===e.length?"0"+e:String(e)}function eX(e,t,r){e=eL(e,255);var n=Math.max(e,t=eL(t,255),r=eL(r,255)),o=Math.min(e,t,r),a=0,i=0,l=(n+o)/2;if(n===o)i=0,a=0;else{var c=n-o;switch(i=l>.5?c/(2-n-o):c/(n+o),n){case e:a=(t-r)/c+6*(t<r);break;case t:a=(r-e)/c+2;break;case r:a=(e-t)/c+4}a/=6}return{h:a,s:i,l:l}}function eU(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+6*r*(t-e):r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function eV(e,t,r){e=eL(e,255);var n=Math.max(e,t=eL(t,255),r=eL(r,255)),o=Math.min(e,t,r),a=0,i=n-o;if(n===o)a=0;else{switch(n){case e:a=(t-r)/i+6*(t<r);break;case t:a=(r-e)/i+2;break;case r:a=(e-t)/i+4}a/=6}return{h:a,s:0===n?0:i/n,v:n}}function eQ(e,t,r,n){var o=[e_(Math.round(e).toString(16)),e_(Math.round(t).toString(16)),e_(Math.round(r).toString(16))];return n&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function e$(e){return parseInt(e,16)}var eK={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},eJ="(?:".concat("[-\\+]?\\d*\\.\\d+%?",")|(?:").concat("[-\\+]?\\d+%?",")"),eZ="[\\s|\\(]+(".concat(eJ,")[,|\\s]+(").concat(eJ,")[,|\\s]+(").concat(eJ,")\\s*\\)?"),e0="[\\s|\\(]+(".concat(eJ,")[,|\\s]+(").concat(eJ,")[,|\\s]+(").concat(eJ,")[,|\\s]+(").concat(eJ,")\\s*\\)?"),e1={CSS_UNIT:new RegExp(eJ),rgb:RegExp("rgb"+eZ),rgba:RegExp("rgba"+e0),hsl:RegExp("hsl"+eZ),hsla:RegExp("hsla"+e0),hsv:RegExp("hsv"+eZ),hsva:RegExp("hsva"+e0),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function e2(e){return!!e1.CSS_UNIT.exec(String(e))}var e5=function(){function e(t,r){if(void 0===t&&(t=""),void 0===r&&(r={}),t instanceof e)return t;"number"==typeof t&&(t={r:(k=t)>>16,g:(65280&k)>>8,b:255&k}),this.originalInput=t;var n,o,a,i,l,c,s,u,d,f,p,h,m,g,v,b,y,x,S,w,k,C,O=(g={r:0,g:0,b:0},v=1,b=null,y=null,x=null,S=!1,w=!1,"string"==typeof(n=t)&&(n=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(eK[e])e=eK[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var r=e1.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=e1.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=e1.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=e1.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=e1.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=e1.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=e1.hex8.exec(e))?{r:e$(r[1]),g:e$(r[2]),b:e$(r[3]),a:e$(r[4])/255,format:t?"name":"hex8"}:(r=e1.hex6.exec(e))?{r:e$(r[1]),g:e$(r[2]),b:e$(r[3]),format:t?"name":"hex"}:(r=e1.hex4.exec(e))?{r:e$(r[1]+r[1]),g:e$(r[2]+r[2]),b:e$(r[3]+r[3]),a:e$(r[4]+r[4])/255,format:t?"name":"hex8"}:!!(r=e1.hex3.exec(e))&&{r:e$(r[1]+r[1]),g:e$(r[2]+r[2]),b:e$(r[3]+r[3]),format:t?"name":"hex"}}(n)),"object"==typeof n&&(e2(n.r)&&e2(n.g)&&e2(n.b)?(o=n.r,a=n.g,i=n.b,g={r:255*eL(o,255),g:255*eL(a,255),b:255*eL(i,255)},S=!0,w="%"===String(n.r).substr(-1)?"prgb":"rgb"):e2(n.h)&&e2(n.s)&&e2(n.v)?(b=eY(n.s),y=eY(n.v),l=n.h,c=b,s=y,l=6*eL(l,360),c=eL(c,100),s=eL(s,100),u=Math.floor(l),d=l-u,f=s*(1-c),p=s*(1-d*c),h=s*(1-(1-d)*c),g={r:255*[s,p,f,f,h,s][m=u%6],g:255*[h,s,s,p,f,f][m],b:255*[f,f,h,s,s,p][m]},S=!0,w="hsv"):e2(n.h)&&e2(n.s)&&e2(n.l)&&(b=eY(n.s),x=eY(n.l),g=function(e,t,r){if(e=eL(e,360),t=eL(t,100),r=eL(r,100),0===t)o=r,a=r,n=r;else{var n,o,a,i=r<.5?r*(1+t):r+t-r*t,l=2*r-i;n=eU(l,i,e+1/3),o=eU(l,i,e),a=eU(l,i,e-1/3)}return{r:255*n,g:255*o,b:255*a}}(n.h,b,x),S=!0,w="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(v=n.a)),v=eG(v),{ok:S,format:n.format||w,r:Math.min(255,Math.max(g.r,0)),g:Math.min(255,Math.max(g.g,0)),b:Math.min(255,Math.max(g.b,0)),a:v});this.originalInput=t,this.r=O.r,this.g=O.g,this.b=O.b,this.a=O.a,this.roundA=Math.round(100*this.a)/100,this.format=null!=(C=r.format)?C:O.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=O.ok}return e.prototype.isDark=function(){return 128>this.getBrightness()},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t=e.r/255,r=e.g/255,n=e.b/255;return .2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=eG(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){return 0===this.toHsl().s},e.prototype.toHsv=function(){var e=eV(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=eV(this.r,this.g,this.b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.v);return 1===this.a?"hsv(".concat(t,", ").concat(r,"%, ").concat(n,"%)"):"hsva(".concat(t,", ").concat(r,"%, ").concat(n,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=eX(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=eX(this.r,this.g,this.b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.l);return 1===this.a?"hsl(".concat(t,", ").concat(r,"%, ").concat(n,"%)"):"hsla(".concat(t,", ").concat(r,"%, ").concat(n,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),eQ(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){var t,r,n,o,a,i;return void 0===e&&(e=!1),t=this.r,r=this.g,n=this.b,o=this.a,a=e,i=[e_(Math.round(t).toString(16)),e_(Math.round(r).toString(16)),e_(Math.round(n).toString(16)),e_(Math.round(255*parseFloat(o)).toString(16))],a&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toHexShortString=function(e){return void 0===e&&(e=!1),1===this.a?this.toHexString(e):this.toHex8String(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),r=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(t,", ").concat(r,")"):"rgba(".concat(e,", ").concat(t,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*eL(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*eL(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+eQ(this.r,this.g,this.b,!1),t=0,r=Object.entries(eK);t<r.length;t++){var n=r[t],o=n[0];if(e===n[1])return o}return!1},e.prototype.toString=function(e){var t=!!e;e=null!=e?e:this.format;var r=!1,n=this.a<1&&this.a>=0;return!t&&n&&(e.startsWith("hex")||"name"===e)?"name"===e&&0===this.a?this.toName():this.toRgbString():("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var r=this.toHsl();return r.l+=t/100,r.l=eq(r.l),new e(r)},e.prototype.brighten=function(t){void 0===t&&(t=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(-(t/100*255)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(-(t/100*255)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(-(t/100*255)))),new e(r)},e.prototype.darken=function(t){void 0===t&&(t=10);var r=this.toHsl();return r.l-=t/100,r.l=eq(r.l),new e(r)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var r=this.toHsl();return r.s-=t/100,r.s=eq(r.s),new e(r)},e.prototype.saturate=function(t){void 0===t&&(t=10);var r=this.toHsl();return r.s+=t/100,r.s=eq(r.s),new e(r)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var r=this.toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,new e(r)},e.prototype.mix=function(t,r){void 0===r&&(r=50);var n=this.toRgb(),o=new e(t).toRgb(),a=r/100;return new e({r:(o.r-n.r)*a+n.r,g:(o.g-n.g)*a+n.g,b:(o.b-n.b)*a+n.b,a:(o.a-n.a)*a+n.a})},e.prototype.analogous=function(t,r){void 0===t&&(t=6),void 0===r&&(r=30);var n=this.toHsl(),o=360/r,a=[this];for(n.h=(n.h-(o*t>>1)+720)%360;--t;)n.h=(n.h+o)%360,a.push(new e(n));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var r=this.toHsv(),n=r.h,o=r.s,a=r.v,i=[],l=1/t;t--;)i.push(new e({h:n,s:o,v:a})),a=(a+l)%1;return i},e.prototype.splitcomplement=function(){var t=this.toHsl(),r=t.h;return[this,new e({h:(r+72)%360,s:t.s,l:t.l}),new e({h:(r+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var r=this.toRgb(),n=new e(t).toRgb(),o=r.a+n.a*(1-r.a);return new e({r:(r.r*r.a+n.r*n.a*(1-r.a))/o,g:(r.g*r.a+n.g*n.a*(1-r.a))/o,b:(r.b*r.a+n.b*n.a*(1-r.a))/o,a:o})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var r=this.toHsl(),n=r.h,o=[this],a=360/t,i=1;i<t;i++)o.push(new e({h:(n+i*a)%360,s:r.s,l:r.l}));return o},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function e6(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function e3(){var e=e6(["\n color: ",";\n fill: ",";\n stroke-width: 1.4;\n background: ",";\n border-bottom: 1px solid ",";\n "]);return e3=function(){return e},e}function e8(){var e=e6(["\n font-size: 11px;\n "]);return e8=function(){return e},e}function e4(){var e=e6(["\n .calendarbottomtext: {\n textanchor: middle;\n fill: ",";\n webkittouchcallout: none;\n webkituserselect: none;\n mozuserselect: none;\n msuserselect: none;\n userselect: none;\n pointerevents: none;\n font-weight: 500;\n }\n .calendartoptick: {\n stroke: ",";\n stroke-width: 0;\n }\n .calendartoptext: {\n textanchor: middle;\n webkittouchcallout: none;\n webkituserselect: none;\n mozuserselect: none;\n msuserselect: none;\n userselect: none;\n pointerevents: none;\n font-weight: 500;\n fill: ",";\n }\n "]);return e4=function(){return e},e}var e9=(0,eS.createStyles)(function(e){var t=e.token,r=e.css,n=new e5(t.colorFillAlter).onBackground(t.colorBgContainer).toHexShortString();return{calendarheader:r(e3(),t.colorText,n,n,t.colorBorderSecondary),calendarBottomText:r(e8()),nbGanttCalendar:r(e4(),t.colorText,t.colorBorderSecondary,t.colorText)}}),e7=function(e){var t=e.value,r=e.x1Line,o=e.y1Line,a=e.y2Line,i=e.xText,l=e.yText;return n().createElement("g",{className:"calendarTop"},n().createElement("line",{x1:r,y1:o,x2:r,y2:a,className:(0,B.cx)("calendarTopTick"),key:t+"line"}),n().createElement("text",{key:t+"text",y:l,x:i,className:(0,B.cx)("calendarTopText")},t))};function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return te(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return te(e,t)}}(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.")}()}var tr=function(e){var t,r,o,a,i,l,c,s=e.dateSetup,u=e.locale,d=e.viewMode,f=e.rtl,p=e.headerHeight,h=e.columnWidth,m=e.fontFamily,g=e.fontSize,v=e9().styles,b=[],y=[];switch(s.viewMode){case el.Year:b=(t=tt(function(){for(var e=[],t=[],r=.5*p,o=0;o<s.dates.length;o++){var a=s.dates[o],i=a.getFullYear();if(t.push(n().createElement("text",{key:a.getTime(),y:.8*p,x:h*o+.5*h},i)),0===o||a.getFullYear()!==s.dates[o-1].getFullYear()){var l=a.getFullYear().toString(),c=void 0;c=f?(6+o+a.getFullYear()+1)*h:(6+o-a.getFullYear())*h,e.push(n().createElement(e7,{key:l,value:l,x1Line:h*o,y1Line:0,y2Line:p,xText:c,yText:.9*r}))}}return[e,t]}(),2))[0],y=t[1];break;case el.QuarterYear:b=(r=tt(function(){for(var e=[],t=[],r=.5*p,o=0;o<s.dates.length;o++){var a=s.dates[o],i="Q"+Math.floor((a.getMonth()+3)/3);if(t.push(n().createElement("text",{key:a.getTime(),y:.8*p,x:h*o+.5*h,className:v.calendarBottomText},i)),0===o||a.getFullYear()!==s.dates[o-1].getFullYear()){var l=a.getFullYear().toString(),c=void 0;c=f?(6+o+a.getMonth()+1)*h:(6+o-a.getMonth())*h,e.push(n().createElement(e7,{key:l,value:l,x1Line:h*o,y1Line:0,y2Line:r,xText:Math.abs(c)-200,yText:.9*r}))}}return[e,t]}(),2))[0],y=r[1];break;case el.Month:b=(o=tt(function(){for(var e=[],t=[],r=.5*p,o=0;o<s.dates.length;o++){var a=s.dates[o],i=eh(a,u);if(t.push(n().createElement("text",{key:i+a.getFullYear(),y:.8*p,x:h*o+.5*h,className:v.calendarBottomText},i)),0===o||a.getFullYear()!==s.dates[o-1].getFullYear()){var l=a.getFullYear().toString(),c=void 0;c=f?(6+o+a.getMonth()+1)*h:(6+o-a.getMonth())*h,e.push(n().createElement(e7,{key:l,value:l,x1Line:h*o,y1Line:0,y2Line:r,xText:c,yText:.9*r}))}}return[e,t]}(),2))[0],y=o[1];break;case el.Week:b=(a=tt(function(){for(var e=[],t=[],r=1,o=.5*p,a=s.dates,i=a.length-1;i>=0;i--){var l=a[i],c="";(0===i||l.getMonth()!==a[i-1].getMonth())&&(c="".concat(eh(l,u),", ").concat(l.getFullYear()));var d="W".concat(ev(l));t.push(n().createElement("text",{key:l.getTime(),y:.8*p,x:h*(i+ +f),className:v.calendarBottomText},d)),c&&(i!==a.length-1&&e.push(n().createElement(e7,{key:c,value:c,x1Line:h*i+r*h,y1Line:0,y2Line:o,xText:h*i+h*r*.5,yText:.9*o})),r=0),r++}return[e,t]}(),2))[0],y=a[1];break;case el.Day:b=(i=tt(function(){for(var e=[],t=[],r=.5*p,o=s.dates,a=0;a<o.length;a++){var i=o[a],l="".concat(i.getDate().toString());if(t.push(n().createElement("text",{key:i.getTime(),y:.8*p,x:h*a+.5*h,className:(0,B.cx)("calendarBottomText")},l)),a+1!==o.length&&i.getMonth()!==o[a+1].getMonth()){var c,d=eh(i,u);e.push(n().createElement(e7,{key:d+i.getFullYear(),value:d,x1Line:h*(a+1),y1Line:0,y2Line:r,xText:h*(a+1)-(c=i.getMonth(),new Date(i.getFullYear(),c+1,0).getDate()*h*.5),yText:.9*r}))}}return[e,t]}(),2))[0],y=i[1];break;case el.QuarterDay:case el.HalfDay:b=(l=tt(function(){for(var e=[],t=[],r=d===el.HalfDay?2:4,o=.5*p,a=s.dates,i=0;i<a.length;i++){var l=a[i],c=es(u,{hour:"numeric"}).format(l).replace("时","");if(t.push(n().createElement("text",{key:l.getTime(),y:.8*p,x:h*(i+ +f),className:(0,B.cx)("calendarBottomText"),fontFamily:m},c)),0===i||l.getDate()!==a[i-1].getDate()){var g="".concat(em(l,u,"short"),", ").concat(l.getDate()," ").concat(eh(l,u));e.push(n().createElement(e7,{key:g+l.getFullYear(),value:g,x1Line:h*i+r*h,y1Line:0,y2Line:o,xText:h*i+r*h*.5,yText:.9*o}))}}return[e,t]}(),2))[0],y=l[1];break;case el.Hour:b=(c=tt(function(){for(var e=[],t=[],r=.5*p,o=s.dates,a=0;a<o.length;a++){var i,l=o[a],c=null==(i=es(u,{hour:"numeric"}).format(l))?void 0:i.replace("时","");if(t.push(n().createElement("text",{key:l.getTime(),y:.8*p,x:h*(a+ +f),className:(0,B.cx)("calendarBottomText"),fontFamily:m},c)),0!==a&&l.getDate()!==o[a-1].getDate()){var d=o[a-1],g="".concat(em(d,u,"long"),", ").concat(d.getDate()," ").concat(eh(d,u)),v=(l.getHours()-24)/2;e.push(n().createElement(e7,{key:g+d.getFullYear(),value:g,x1Line:h*a,y1Line:0,y2Line:r,xText:h*(a+v),yText:.9*r}))}}return[e,t]}(),2))[0],y=c[1]}return n().createElement("g",{className:v.nbGanttCalendar,fontSize:g,fontFamily:m},n().createElement("rect",{x:0,y:0,width:h*s.dates.length,height:p,className:v.calendarheader}),y," ",b)},tn=m(768);function to(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ta(){var e=to(["\n fill: ",";\n "]);return ta=function(){return e},e}function ti(){var e=to(["\n fill: #e6f7ff;\n border-color: ",";\n "]);return ti=function(){return e},e}function tl(){var e=to(["\n .gridrowline: {\n stroke: ",";\n stroke-width: 0;\n border-bottom: 1px solid ",";\n }\n .gridtick: {\n stroke: ",";\n }\n "]);return tl=function(){return e},e}var tc=(0,eS.createStyles)(function(e){var t=e.token,r=e.css;return{gridRow:r(ta(),t.colorBgContainer),gridHeightRow:r(ti(),t.colorBorder),nbGridbody:r(tl(),t.colorBorderSecondary,t.colorBorderSecondary,t.colorBorderSecondary)}}),ts=[{id:(0,tn.uid)()},{id:(0,tn.uid)()},{id:(0,tn.uid)()}],tu=function(e){var t=e.tasks,r=e.dates,o=e.rowHeight,a=e.svgWidth,i=e.columnWidth,l=e.todayColor,c=e.rtl,s=e.selectedRowKeys,u=tc().styles,d=t.length?t:ts,f=0,p=[],h=[n().createElement("line",{key:"RowLineFirst",x:"0",y1:0,x2:a,y2:0,className:(0,B.cx)("gridRowLine")})],m=!0,g=!1,v=void 0;try{for(var b,y=d[Symbol.iterator]();!(m=(b=y.next()).done);m=!0){var x=b.value;p.push(n().createElement("rect",{key:"Row"+x.id,x:"0",y:f,width:a,height:o,className:(null==s?void 0:s.includes(+x.id))?u.gridHeightRow:u.gridRow})),h.push(n().createElement("line",{key:"RowLine"+x.id,x:"0",y1:f+o,x2:a,y2:f+o,className:(0,B.cx)("gridRowLine")})),f+=o}}catch(e){g=!0,v=e}finally{try{m||null==y.return||y.return()}finally{if(g)throw v}}for(var S=new Date,w=0,k=[],C=n().createElement("rect",null),O=0;O<r.length;O++){var P=r[O];k.push(n().createElement("line",{key:P.getTime(),x1:w,y1:0,x2:w,y2:f,className:(0,B.cx)("gridTick")})),(O+1!==r.length&&P.getTime()<S.getTime()&&r[O+1].getTime()>=S.getTime()||0!==O&&O+1===r.length&&P.getTime()<S.getTime()&&eu(P,P.getTime()-r[O-1].getTime(),"millisecond").getTime()>=S.getTime())&&(C=n().createElement("rect",{x:w,y:0,width:i,height:f,fill:l})),c&&O+1!==r.length&&P.getTime()>=S.getTime()&&r[O+1].getTime()<S.getTime()&&(C=n().createElement("rect",{x:w+i,y:0,width:i,height:f,fill:l})),w+=i}return n().createElement("g",{className:(0,B.cx)("gridBody",u.nbGridbody)},n().createElement("g",{className:"rows"},p),n().createElement("g",{className:"rowLines"},h),n().createElement("g",{className:"ticks"},k),n().createElement("g",{className:"today"},C))},td=function(e){return n().createElement("g",{className:"grid"},n().createElement(tu,e))};function tf(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tf(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tf(e,t)}}(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.")}()}var th=function(e){var t,r,o,a,i=e.taskFrom,l=e.taskTo,c=e.rowHeight,s=e.taskHeight,u=e.arrowIndent;return e.rtl?(t=(o=tp(tg(i,l,c,s,u),2))[0],r=o[1]):(t=(a=tp(tm(i,l,c,s,u),2))[0],r=a[1]),n().createElement("g",{className:"arrow"},n().createElement("path",{strokeWidth:"1.5",d:t,fill:"none"}),n().createElement("polygon",{points:r}))},tm=function(e,t,r,n,o){var a=e.index>t.index?-1:1,i=t.y+n/2,l=e.x2+2*o,c=l<t.x1?"":"H ".concat(t.x1-o),s=l>t.x1?o:t.x1-e.x2-o;return["M ".concat(e.x2," ").concat(e.y+n/2," \n h ").concat(o," \n v ").concat(a*r/2," \n ").concat(c,"\n V ").concat(i," \n h ").concat(s),"".concat(t.x1,",").concat(i," \n ").concat(t.x1-5,",").concat(i-5," \n ").concat(t.x1-5,",").concat(i+5)]},tg=function(e,t,r,n,o){var a=e.index>t.index?-1:1,i=t.y+n/2,l=e.x1-2*o,c=l>t.x2?"":"H ".concat(t.x2+o),s=l<t.x2?-o:t.x2-e.x1+o;return["M ".concat(e.x1," ").concat(e.y+n/2," \n h ").concat(-o," \n v ").concat(a*r/2," \n ").concat(c,"\n V ").concat(i," \n h ").concat(s),"".concat(t.x2,",").concat(i," \n ").concat(t.x2+5,",").concat(i+5," \n ").concat(t.x2+5,",").concat(i-5)]},tv=function(e){var t=e.x,r=e.y,o=e.width,a=e.height,i=e.barCornerRadius,l=e.onMouseDown;return n().createElement("rect",{x:t,y:r,width:o,height:a,className:"barHandle",role:"button",ry:i,rx:i,onMouseDown:l})};function tb(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ty(){var e=tb(["\n cursor: pointer;\n outline: none;\n .barHandle {\n fill: #ddd;\n cursor: ew-resize;\n opacity: 0;\n // visibility: hidden;\n }\n &:hover .barHandle {\n visibility: visible;\n opacity: 1;\n }\n"]);return ty=function(){return e},e}function tx(){var e=tb(["\n user-select: none;\n stroke-width: 0;\n opacity: 0.6;\n"]);return tx=function(){return e},e}var tS=(0,B.css)(ty()),tw=(0,B.css)(tx()),tk=function(e){var t=e.x,r=e.y,o=e.color,a=e.width,i=e.height,l=e.isSelected,c=e.progressX,s=e.progressWidth,u=e.barCornerRadius,d=e.styles,f=e.onMouseDown;return n().createElement("g",{onMouseDown:f},n().createElement("rect",{x:t,width:a,y:r,height:i,ry:u,rx:u,fill:o||(l?d.backgroundSelectedColor:d.backgroundColor),className:(0,B.cx)(tw)}),n().createElement("rect",{x:c,width:s,y:r,height:i,ry:u,rx:u,fill:o||(l?d.progressSelectedColor:d.progressColor)}))},tC=function(e){var t=e.progressPoint,r=e.onMouseDown;return n().createElement("polygon",{className:"barHandle",points:t,onMouseDown:r})},tO=function(e){var t=e.task,r=e.isProgressChangeable,o=e.isDateChangeable,a=e.rtl,i=e.onEventStart,l=e.isSelected,c=Z(!a*t.progressWidth+t.progressX,t.y,t.height),s=t.height-2;return n().createElement("g",{className:(0,B.cx)(tS),"aria-label":"task-bar",tabIndex:0},n().createElement(tk,{x:t.x1,y:t.y,color:t.color,width:t.x2-t.x1,height:t.height,progressX:t.progressX,progressWidth:t.progressWidth,barCornerRadius:t.barCornerRadius,styles:t.styles,isSelected:l,onMouseDown:function(e){o&&i("move",t,e)}}),n().createElement("g",{className:"handleGroup"},o&&n().createElement("g",null,n().createElement(tv,{x:t.x1+1,y:t.y+1,width:t.handleWidth,height:s,barCornerRadius:t.barCornerRadius,onMouseDown:function(e){i("start",t,e)}}),n().createElement(tv,{x:t.x2-t.handleWidth-1,y:t.y+1,width:t.handleWidth,height:s,barCornerRadius:t.barCornerRadius,onMouseDown:function(e){i("end",t,e)}})),r&&n().createElement(tC,{progressPoint:c,onMouseDown:function(e){i("progress",t,e)}})))},tP=function(e){var t=e.task,r=e.isProgressChangeable,o=e.isDateChangeable,a=e.onEventStart,i=e.isSelected,l=Z(t.progressWidth+t.x1+10,t.y,t.height);return n().createElement("g",{className:(0,B.cx)(tS),tabIndex:0},n().createElement(tk,{x:t.x1,y:t.y,width:t.x2-t.x1,height:t.height,progressX:t.progressX,progressWidth:t.progressWidth,barCornerRadius:t.barCornerRadius,styles:t.styles,isSelected:i,onMouseDown:function(e){o&&a("move",t,e)}}),n().createElement("g",{className:"handleGroup"},r&&n().createElement(tC,{progressPoint:l,onMouseDown:function(e){a("progress",t,e)}})))};function tE(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function tT(){var e=tE(["\n cursor: pointer;\n outline: none;\n"]);return tT=function(){return e},e}function tj(){var e=tE(["\n user-select: none;\n"]);return tj=function(){return e},e}var tD=(0,B.css)(tT()),tM=(0,B.css)(tj()),tN=function(e){var t=e.task,r=e.isDateChangeable,o=e.onEventStart,a=e.isSelected,i="rotate(45 ".concat(t.x1+.356*t.height," \n ").concat(t.y+.85*t.height,")");return n().createElement("g",{tabIndex:0,className:(0,B.cx)(tD)},n().createElement("rect",{fill:a?t.styles.backgroundSelectedColor:t.styles.backgroundColor,x:t.x1,width:t.height,y:t.y,height:t.height,rx:t.barCornerRadius,ry:t.barCornerRadius,transform:i,className:(0,B.cx)(tM),onMouseDown:function(e){r&&o("move",t,e)}}))};function tA(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function tF(){var e=tA(["\n cursor: pointer;\n outline: none;\n"]);return tF=function(){return e},e}function tI(){var e=tA(["\n user-select: none;\n opacity: 0.6;\n"]);return tI=function(){return e},e}function tB(){var e=tA(["\n user-select: none;\n"]);return tB=function(){return e},e}var tR=(0,B.css)(tF()),tH=(0,B.css)(tI());(0,B.css)(tB());var tz=function(e){var t=e.task,r=e.isSelected,o=r?t.styles.backgroundSelectedColor:t.styles.backgroundColor,a=r?t.styles.progressSelectedColor:t.styles.progressColor,i=t.x2-t.x1;return n().createElement("g",{tabIndex:0,className:(0,B.cx)(tR)},n().createElement("rect",{fill:t.color||o,x:t.x1,width:i,y:t.y,height:t.height,rx:t.barCornerRadius,ry:t.barCornerRadius,className:(0,B.cx)(tH)}),n().createElement("rect",{x:t.progressX,width:t.progressWidth,y:t.y,height:t.height,ry:t.barCornerRadius,rx:t.barCornerRadius,fill:t.color||a}))};function tW(){var e,t,r=(e=["\n .barLabel: {\n fill: ",",\n textAnchor: middle,\n font-weight: 400,\n dominantBaseline: central,\n WebkitTouchCallout: none,\n WebkitUserSelect: none,\n MozUserSelect: none,\n msUserSelect: none,\n userSelect: none,\n pointerEvents: none,\n },\n .projectLabel: {\n fill: #130d0d,\n fontWeight: 500,\n fontSize: 0.9em,\n dominantBaseline: central,\n WebkitTouchCallout: none,\n WebkitUserSelect: none,\n MozUserSelect: none,\n msUserSelect: none,\n userSelect: none,\n pointerEvents: none,\n },\n .barLabelOutside: {\n fill: ",",\n textAnchor: start,\n WebkitTouchCallout: none,\n WebkitUserSelect: none,\n MozUserSelect: none,\n msUserSelect: none,\n userSelect: none,\n pointerEvents: none,\n },\n }\n }"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return tW=function(){return r},r}var tL=(0,eS.createStyles)(function(e){var t=e.token;return{nbganttTaskitem:(0,e.css)(tW(),t.colorTextLightSolid,t.colorTextLabel)}});function tq(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tG(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tq(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tq(e,t)}}(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.")}()}var tY=function(e){var t,o,a=tL().styles,i=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e),l=i.task,c=i.arrowIndent,s=i.isDelete,u=i.taskHeight,d=i.isSelected,f=i.rtl,p=i.onEventStart,h=(0,r.useRef)(null),m=tG((0,r.useState)(n().createElement("div",null)),2),g=m[0],v=m[1],b=tG((0,r.useState)(!0),2),y=b[0],x=b[1],S="project"===l.typeInternal;return(0,r.useEffect)(function(){switch(l.typeInternal){case"milestone":v(n().createElement(tN,e));break;case"project":v(n().createElement(tz,e));break;case"smalltask":v(n().createElement(tP,e));break;default:v(n().createElement(tO,e))}},[l,d]),(0,r.useEffect)(function(){h.current&&x(h.current.getBBox().width<l.x2-l.x1)},[h,l]),n().createElement("g",{className:(0,B.cx)(a.nbganttTaskitem),onKeyDown:function(e){"Delete"===e.key&&s&&p("delete",l,e),e.stopPropagation()},onMouseEnter:function(e){p("mouseenter",l,e)},onMouseLeave:function(e){p("mouseleave",l,e)},onDoubleClick:function(e){p("dblclick",l,e)},onClick:function(e){p("click",l,e)},onFocus:function(){p("select",l)}},g,n().createElement("text",{x:S?l.x1:(t=l.x2-l.x1,o=l.barChildren.length>0,y?l.x1+.5*t:f&&h.current?l.x1-h.current.getBBox().width-c*o-.2*c:l.x1+t+c*o+.2*c),y:S?l.y-8:l.y+.65*u,className:S?(0,B.cx)("projectLabel"):y?(0,B.cx)("barLabel"):(0,B.cx)("barLabelOutside"),ref:h},S&&ex(l.start)&&ex(l.end)?"".concat(l.name,": ").concat(ex(l.start)," ~ ").concat(ex(l.end)):l.name))};function t_(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tX(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function tU(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){tX(a,n,o,i,l,"next",e)}function l(e){tX(a,n,o,i,l,"throw",e)}i(void 0)})}}function tV(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return t_(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t_(e,t)}}(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 tQ(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:c(0)}),l(i,"throw",{value:c(1)}),l(i,"return",{value:c(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function c(l){return function(c){var s=[l,c];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}var t$=null,tK=null,tJ=function(e){var t,o=e.tasks,a=e.dates,i=e.ganttEvent,l=e.selectedTask,c=e.rowHeight,s=e.columnWidth,u=e.timeStep,d=e.svg,f=e.taskHeight,p=e.arrowColor,h=e.arrowIndent,m=e.fontFamily,g=e.fontSize,v=e.rtl,b=e.setGanttEvent,y=e.setFailedTask,x=e.setSelectedTask,S=e.onDateChange,w=e.onProgressChange,k=e.onDoubleClick,C=e.onClick,O=e.onDelete,P=null==d||null==(t=d.current)?void 0:t.createSVGPoint(),E=tV((0,r.useState)(0),2),T=E[0],j=E[1],D=tV((0,r.useState)(0),2),M=D[0],N=D[1],A=tV((0,r.useState)(!1),2),F=A[0],I=A[1];(0,r.useEffect)(function(){var e,t,r,n;j(u*s/((null==(e=a[1])?void 0:e.getTime())-(null==(t=a[0])?void 0:t.getTime())-(null==(r=a[1])?void 0:r.getTimezoneOffset())*6e4+(null==(n=a[0])?void 0:n.getTimezoneOffset())*6e4))},[s,a,u]),(0,r.useEffect)(function(){var e=function(e){return tU(function(){var t,r,n,o;return tQ(this,function(a){return i.changedTask&&P&&(null==d?void 0:d.current)&&(e.preventDefault(),P.x=e.clientX,n=(r=eo(P.matrixTransform(null==d||null==(t=d.current.getScreenCTM())?void 0:t.inverse()).x,i.action,i.changedTask,T,u,M,v)).isChanged,o=r.changedTask,n&&b({action:i.action,changedTask:o})),[2]})})()},t=function(r){return tU(function(){var n,o,a,l,c,s,f,p,h;return tQ(this,function(m){switch(m.label){case 0:if(o=i.action,a=i.originalSelectedTask,!(l=i.changedTask)||!P||!(null==d?void 0:d.current)||!a)return[2];if(r.preventDefault(),P.x=r.clientX,c=eo(P.matrixTransform(null==d||null==(n=d.current.getScreenCTM())?void 0:n.inverse()).x,o,l,T,u,M,v).changedTask,s=a.start!==c.start||a.end!==c.end||a.progress!==c.progress,d.current.removeEventListener("mousemove",e),d.current.removeEventListener("mouseup",t),b({action:""}),I(!1),f=!0,!(("move"===o||"end"===o||"start"===o)&&S&&s))return[3,5];m.label=1;case 1:return m.trys.push([1,3,,4]),[4,S(c,c.barChildren)];case 2:return void 0!==(p=m.sent())&&(f=p),[3,4];case 3:return m.sent(),f=!1,[3,4];case 4:return[3,9];case 5:if(!(w&&s))return[3,9];m.label=6;case 6:return m.trys.push([6,8,,9]),[4,w(c,c.barChildren)];case 7:return void 0!==(h=m.sent())&&(f=h),[3,9];case 8:return m.sent(),f=!1,[3,9];case 9:return f||y(a),[2]}})})()};!F&&("move"===i.action||"end"===i.action||"start"===i.action||"progress"===i.action)&&(null==d?void 0:d.current)&&(d.current.addEventListener("mousemove",e),d.current.addEventListener("mouseup",t),I(!0))},[i,T,M,w,u,S,d,F,P,v,y,b]);var B=function(e,t,r){return tU(function(){var n,o;return tQ(this,function(a){switch(a.label){case 0:if(r)return[3,1];return"select"===e&&x(t.id),[3,7];case 1:if(void 0===r.key)return[3,6];if("delete"!==e||!O)return[3,5];a.label=2;case 2:return a.trys.push([2,4,,5]),[4,O(t)];case 3:return void 0!==(n=a.sent())&&n&&b({action:e,changedTask:t}),[3,5];case 4:return console.error("Error on Delete. "+a.sent()),[3,5];case 5:return[3,7];case 6:if("mouseenter"===e)i.action||b({action:e,changedTask:t,originalSelectedTask:t});else if("mouseleave"===e)"mouseenter"===i.action&&setTimeout(function(){b({action:""})},300);else if("dblclick"===e)k&&k(t);else if("click"===e)"rect"===r.target.tagName&&C&&C(t);else if("move"===e){if(!(null==d?void 0:d.current)||!P)return[2];P.x=r.clientX,N(P.matrixTransform(null==(o=d.current.getScreenCTM())?void 0:o.inverse()).x-t.x1),b({action:e,changedTask:t,originalSelectedTask:t})}else b({action:e,changedTask:t,originalSelectedTask:t});a.label=7;case 7:return[2]}})})()},R=function(e,t,r){["click"].includes(e)?(["start","end","progress"].includes(t$)||tK&&tK!==t.start||B(e,t,r),t$=null,tK=null):(["move","select"].includes(e)?tK=t.start:(tK=t.start,t$=e),B(e,t,r))};return n().createElement("g",{className:"content"},n().createElement("g",{className:"arrows",fill:p,stroke:p},o.map(function(e){return e.barChildren.map(function(t){return n().createElement(th,{key:"Arrow from ".concat(e.id," to ").concat(o[t.index].id),taskFrom:e,taskTo:o[t.index],rowHeight:c,taskHeight:f,arrowIndent:h,rtl:v})})})),n().createElement("g",{className:"bar",fontFamily:m,fontSize:g},o.map(function(e){return n().createElement(tY,{task:e,arrowIndent:h,taskHeight:f,isProgressChangeable:!!w&&!e.isDisabled,isDateChangeable:!!S&&!e.isDisabled,isDelete:!e.isDisabled,onEventStart:R,key:e.id,isSelected:!!l&&e.id===l.id,rtl:v})})))},tZ=(0,r.forwardRef)(function(e,t){var o,a,i=e.gridProps,l=e.calendarProps,c=e.barProps,s=e.ganttHeight,u=e.scrollY,d=e.scrollX,f=(0,r.useRef)(null),p=(0,r.useRef)(null),h=(o=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},c),a=a={svg:f},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(a)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(a,e))}),o),m=eW().styles;return(0,r.useEffect)(function(){p.current&&(p.current.scrollTop=u)},[u]),(0,r.useEffect)(function(){t.current&&(t.current.scrollLeft=d)},[d]),n().createElement("div",{className:m.ganttverticalcontainer,ref:t,dir:"ltr"},n().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:i.svgWidth,height:l.headerHeight,fontFamily:c.fontFamily,className:"ganttHeader"},n().createElement(tr,l)),n().createElement(R.Spin,{spinning:null==c?void 0:c.loading},n().createElement("div",{ref:p,className:m.horizontalcontainer,style:s?{maxHeight:s,width:i.svgWidth}:{width:i.svgWidth}},n().createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:i.svgWidth,height:c.rowHeight*c.tasks.length||166,fontFamily:c.fontFamily,ref:f,className:"ganttBody"},n().createElement(td,i),n().createElement(tJ,h)))))});function t0(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function t1(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function t2(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){t1(a,n,o,i,l,"next",e)}function l(e){t1(a,n,o,i,l,"throw",e)}i(void 0)})}}function t5(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t6(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(l)throw n}}return a}}(e,t)||t3(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 t3(e,t){if(e){if("string"==typeof e)return t0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t0(e,t)}}function t8(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:c(0)}),l(i,"throw",{value:c(1)}),l(i,"return",{value:c(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function c(l){return function(c){var s=[l,c];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}function t4(){var e,t,r=(e=["\n .ant-table-container::after {\n box-shadow: none !important;\n }\n .ant-table-row {\n height: ","px;\n }\n .ant-table-thead {\n height: ","px;\n }\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return t4=function(){return r},r}tZ.displayName="TaskGantt";var t9=(0,H.debounce)(function(e,t,r,n,o){return t2(function(){var a;return t8(this,function(i){switch(i.label){case 0:return[4,t.update({filterByTk:e.id,values:(t5(a={},r.start,e.start),t5(a,r.end,e.end),a)})];case 1:return i.sent(),R.message.success(o("Saved successfully")),[4,null==n?void 0:n.refresh()];case 2:return i.sent(),[2]}})})()},300),t7=(0,H.debounce)(function(e,t,r,n,o){return t2(function(){return t8(this,function(a){switch(a.label){case 0:return[4,t.update({filterByTk:e.id,values:t5({},r.progress,e.progress/100)})];case 1:return a.sent(),R.message.success(o("Saved successfully")),[4,null==n?void 0:n.refresh()];case 2:return a.sent(),[2]}})})()},300),re=(0,t.withDynamicSchemaProps)(function(e){var i,l,c,s,u,d=eW().styles,p=(0,t.useToken)().token,h=null==(c=JSON.parse((0,t.useAPIClient)().auth.getOption("theme")))?void 0:c.uid,m=(0,t.useProps)(e),g=m.listCellWidth,v=void 0===g?"155px":g,b=m.ganttHeight,y=void 0===b?0:b,x=m.preStepsCount,S=void 0===x?1:x,w=m.barFill,k=void 0===w?60:w,C=m.barCornerRadius,O=void 0===C?p.borderRadiusXS:C,P=m.barProgressColor,E=void 0===P?p.colorPrimary:P,T=m.barProgressSelectedColor,j=void 0===T?p.colorPrimary:T,D=m.barBackgroundColor,M=void 0===D?p.colorPrimary:D,N=m.barBackgroundSelectedColor,A=void 0===N?p.colorPrimary:N,F=m.projectProgressColor,I=void 0===F?p.colorPrimary:F,H=m.projectProgressSelectedColor,z=void 0===H?p.colorPrimary:H,W=m.projectBackgroundColor,L=void 0===W?p.colorPrimary:W,q=m.projectBackgroundSelectedColor,Y=void 0===q?p.colorPrimary:q,_=m.milestoneBackgroundColor,X=void 0===_?"#f1c453":_,U=m.milestoneBackgroundSelectedColor,V=void 0===U?"#f29e4c":U,Q=m.rtl,$=void 0!==Q&&Q,K=m.handleWidth,J=void 0===K?8:K,Z=m.timeStep,ee=m.arrowColor,et=m.fontFamily,er=void 0===et?"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'":et,en=m.fontSize,eo=void 0===en?p.fontSize:en,ea=m.arrowIndent,ei=void 0===ea?20:ea,el=m.todayColor,ec=m.viewDate,es=m.TooltipContent,eu=m.onDoubleClick,ed=m.onDelete,eh=m.onSelect,em=m.onExpanderClick,eg=m.tasks,ev=m.expandAndCollapseAll,ex=m.fieldNames,eS=m.loading,ew=(0,t.useDesignable)().designable,ek=(null==h?void 0:h.includes("compact"))?45:ew?65:55,eC=(null==h?void 0:h.includes("compact"))?45:65,eO=f(),eP=(0,t.useCurrentAppInfo)(),eE=(0,a.useTranslation)().t,eT=null==(s=eP.data)?void 0:s.lang,eD=(0,t.useTableBlockContext)(),eM=(0,t.useBlockRequestContext)(),eB=eM.resource,eR=eM.service,eH=(0,o.useFieldSchema)(),ez=ex.range||"day",eL=(0,r.useRef)(null),eq=(0,r.useRef)(null),eG=(0,r.useRef)(null),eY=(0,r.useRef)(null),e_=t6((0,r.useState)(function(){var e=t6(ef(eg,ez,S),2);return{viewMode:ez,dates:ep(e[0],e[1],ez)}}),2),eX=e_[0],eU=e_[1],eV=t6((0,r.useState)(!1),2),eQ=eV[0],e$=eV[1],eK=(0,t.usePopupUtils)({setVisible:e$}).openPopup,eJ=t6((0,r.useState)({}),2),eZ=eJ[0],e0=eJ[1],e1=(0,t.useCollectionParentRecordData)(),e2=t6((0,r.useState)(void 0),2),e5=e2[0],e6=e2[1],e3=t6((0,r.useState)(0),2),e8=e3[0],e4=e3[1],e9=t6((0,r.useState)(0),2),e7=e9[0],te=e9[1],tt=t6((0,r.useState)(y),2),tr=tt[0],tn=tt[1],to=t6((0,r.useState)([]),2),ta=to[0],ti=to[1],tl=t6((0,r.useState)({action:""}),2),tc=tl[0],ts=tl[1],tu=(0,r.useMemo)(function(){return eC*k/100},[eC,k]),td=t6((0,r.useState)(),2),tf=td[0],tp=td[1],th=t6((0,r.useState)(null),2),tm=th[0],tg=th[1],tv=t6((0,r.useState)(0),2),tb=tv[0],ty=tv[1],tx=t6((0,r.useState)(-1),2),tS=tx[0],tw=tx[1],tk=t6((0,r.useState)(!1),2),tC=tk[0],tO=tk[1],tP=(i=eX.dates.length,(l=null==(u=eG.current)?void 0:u.clientWidth)/i>50?Math.floor(l/i)+20:60),tE=eX.dates.length*tP,tT=ta.length*eC,tj=eD.expandFlag,tD=t6((0,r.useState)([]),2),tM=tD[0],tN=tD[1];(0,r.useEffect)(function(){eD.field.onExpandClick=tA,eD.field.onRowSelect=tF},[]),(0,r.useEffect)(function(){null==ev||ev(!tj)},[tj]),(0,r.useEffect)(function(){var e=(e=em?function(e){var t=e.filter(function(e){return e.hideChildren&&"project"===e.type});if(t.length>0)for(var r=0;t.length>r;r++)!function(r){var n=t[r],o=function e(t,r){var n=[];n="project"!==r.type?t.filter(function(e){return e.dependencies&&-1!==e.dependencies.indexOf(r.id)}):t.filter(function(e){return e.project&&e.project===r.id});var o=[];return n.forEach(function(r){var n;o.push.apply(o,function(e){if(Array.isArray(e))return eb(e)}(n=e(t,r))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e){if(e){if("string"==typeof e)return eb(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 eb(e,void 0)}}(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}),n=n.concat(n,o)}(e,n);e=e.filter(function(e){return -1===o.indexOf(e)})}(r);return e}(eg):eg).sort(ey),t=t6(ef(e,ez,S),2),r=ep(t[0],t[1],ez);$&&(r=r.reverse(),-1===tS&&tw(r.length*tP)),eU({dates:r,viewMode:ez}),ti(G(e,r,tP,eC,tu,O,J,$,E,j,M,A,I,z,L,Y,X,V))},[eg,ez,S,eC,O,tP,tu,J,E,j,M,A,I,z,L,Y,X,V,$,tS]),(0,r.useEffect)(function(){if(ez===eX.viewMode&&(ec&&!e5||ec&&(null==e5?void 0:e5.valueOf())!==ec.valueOf())){var e=eX.dates,t=e.findIndex(function(t,r){return ec.valueOf()>=t.valueOf()&&r+1!==e.length&&ec.valueOf()<e[r+1].valueOf()});-1!==t&&(e6(ec),tw(tP*t))}},[ec,tP,eX.dates,eX.viewMode,ez,e5,e6]),(0,r.useEffect)(function(){var e=tc.changedTask,t=tc.action;if(e){if("delete"===t)ts({action:""}),ti(ta.filter(function(t){return t.id!==e.id}));else if("move"===t||"end"===t||"start"===t||"progress"===t){var r=ta.find(function(t){return t.id===e.id});r&&r.start&&r.end&&(r.start.getTime()!==e.start.getTime()||r.end.getTime()!==e.end.getTime()||r.progress!==e.progress)&&ti(ta.map(function(t){return t.id===e.id?e:t}))}}},[tc,ta]),(0,r.useEffect)(function(){tm&&(ti(ta.map(function(e){return e.id!==tm.id?e:tm})),tg(null))},[tm,ta]),(0,r.useEffect)(function(){v||e4(0),eq.current&&e4(eq.current.offsetWidth)},[eq,v]),(0,r.useEffect)(function(){eL.current&&te(eL.current.offsetWidth-e8)},[eL,e8]),(0,r.useEffect)(function(){y?tn(y+ek):tn(eg.length*eC+ek)},[y,eg,ek,eC]),(0,r.useEffect)(function(){var e,t=function(e){if(e.shiftKey||e.deltaX){var t=tS+(e.deltaX?e.deltaX:e.deltaY);t<0?t=0:t>tE&&(t=tE),tw(t),e.preventDefault()}else if(y){var r=tb+e.deltaY;r<0?r=0:r>tT-y&&(r=tT-y),r!==tb&&(ty(r),e.preventDefault())}tO(!0)};return null==(e=eL.current)||e.addEventListener("wheel",t,{passive:!1}),function(){var e;null==(e=eL.current)||e.removeEventListener("wheel",t)}},[eL,tb,tS,y,tE,$,tT]);var tA=function(e,t){var r,n,o,a=null==eO||null==(o=eO.field)?void 0:o.data.find(function(e){return e.id===t.id+""});em&&t.children.length&&em((r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){t5(e,t,r[t])})}return e}({},a),n=n={hideChildren:!e},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r))},tF=function(e){tN(e)},tI={columnWidth:tP,svgWidth:tE,tasks:eg,rowHeight:eC,dates:eX.dates,todayColor:void 0===el?"rgba(252, 248, 227, 0.5)":el,rtl:$,selectedRowKeys:tM},tB={tasks:ta,dates:eX.dates,ganttEvent:tc,selectedTask:tf,rowHeight:eC,taskHeight:tu,columnWidth:tP,arrowColor:void 0===ee?"grey":ee,timeStep:void 0===Z?3e5:Z,fontFamily:er,fontSize:eo,arrowIndent:ei,svgWidth:tE,rtl:$,setGanttEvent:ts,setFailedTask:tg,setSelectedTask:function(e){var t=ta.find(function(t){return t.id===e}),r=ta.find(function(e){return!!tf&&e.id===tf.id});eh&&(r&&eh(r,!1),t&&eh(t,!0)),tp(t)},onDateChange:function(e){return t2(function(){return t8(this,function(t){return t9(e,eB,ex,eR,eE),[2]})})()},onProgressChange:ex.progress&&function(e){return t2(function(){return t8(this,function(t){return t7(e,eB,ex,eR,eE),[2]})})()},onDoubleClick:eu,onClick:function(e){var t,r=function(e){return e.reduce(function(e,t){var n;return t.children?e.concat([t].concat(function(e){if(Array.isArray(e))return t0(e)}(n=r(t.children))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||t3(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())):e.concat(t)},[])},n=r(null==eR||null==(t=eR.data)?void 0:t.data),o=null==n?void 0:n.find(function(t){return t.id===+e.id});o&&(e0(o),eK({recordData:o,customActionSchema:eH.properties.detail}))},onDelete:ed,loading:eS};return n().createElement("div",{className:(0,B.cx)((0,B.css)(t4(),eC,ek)),ref:eY},n().createElement(t.PopupContextProvider,{visible:eQ,setVisible:e$},n().createElement(t.RecordProvider,{record:eZ,parent:e1},n().createElement(eI,null)),n().createElement(t.NocoBaseRecursionField,{name:"anctionBar",schema:eH.properties.toolBar}),n().createElement(t.NocoBaseRecursionField,{name:"table",schema:eH.properties.table}),n().createElement("div",{className:d.wrapper,onKeyDown:function(e){e.preventDefault();var t=tb,r=tS,n=!0;switch(e.key){case"Down":case"ArrowDown":t+=eC,n=!1;break;case"Up":case"ArrowUp":t-=eC,n=!1;break;case"Left":case"ArrowLeft":r-=tP;break;case"Right":case"ArrowRight":r+=tP}n?(r<0?r=0:r>tE&&(r=tE),tw(r)):(t<0?t=0:t>tT-y&&(t=tT-y),ty(t)),tO(!0)},tabIndex:0,ref:eL},n().createElement(tZ,{gridProps:tI,calendarProps:{dateSetup:eX,locale:eT,viewMode:ez,headerHeight:ek,columnWidth:tP,fontFamily:er,fontSize:eo,rtl:$},barProps:tB,ganttHeight:y,scrollY:tb,scrollX:tS,ref:eG}),tc.changedTask&&n().createElement(eN,{arrowIndent:ei,rowHeight:eC,svgContainerHeight:tr,svgContainerWidth:e7,fontFamily:er,fontSize:eo,scrollX:tS,scrollY:tb,task:tc.changedTask,headerHeight:ek,taskListWidth:e8,TooltipContent:void 0===es?eA:es,rtl:$,svgWidth:tE}),n().createElement(eF,{ganttFullHeight:tT,ganttHeight:y,headerHeight:ek,scroll:tb,onScroll:function(e){tb===e.currentTarget.scrollTop||tC?tO(!1):(ty(e.currentTarget.scrollTop),tO(!0))},rtl:$}),n().createElement(R.Spin,{spinning:eS,style:{visibility:"hidden"}},n().createElement(ej,{svgWidth:tE,taskListWidth:e8,scroll:tS,rtl:$,onScroll:function(e){tS===e.currentTarget.scrollLeft||tC?tO(!1):(tw(e.currentTarget.scrollLeft),tO(!0))}})))))});function rt(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function rr(e,t,r){return(rr=ri()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&ro(o,r.prototype),o}).apply(null,arguments)}function rn(e){return(rn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ro(e,t){return(ro=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ra(e){var t="function"==typeof Map?new Map:void 0;return(ra=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,r)}function r(){return rr(e,arguments,rn(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),ro(r,e)})(e)}function ri(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ri=function(){return!!e})()}re.ActionBar=t.ActionBar,re.ViewMode=el,re.Designer=function(){var e=(0,t.useCollection_deprecated)(),r=e.name,o=e.title,a=(0,t.useSchemaTemplate)();return n().createElement(t.GeneralSchemaDesigner,{schemaSettings:"blockSettings:gantt",template:a,title:o||r})},re.Event=I;var rl=n().memo(function(e){return n().createElement(t.SchemaComponentOptions,{components:{Gantt:re,GanttBlockInitializer:A,GanttBlockProvider:d},scope:{useGanttBlockProps:p}},e.children)});rl.displayName="GanttProvider";var rc=function(e){var i;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function l(){var e,t;if(!(this instanceof l))throw TypeError("Cannot call a class as a function");return e=l,t=arguments,e=rn(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,ri()?Reflect.construct(e,t||[],rn(this).constructor):e.apply(this,t))}return l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),e&&ro(l,e),i=[{key:"load",value:function(){var e;return(e=function(){var e;return function(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:c(0)}),l(i,"throw",{value:c(1)}),l(i,"return",{value:c(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function c(l){return function(c){var s=[l,c];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(i){return this.app.use(rl),this.app.schemaSettingsManager.add(b),this.app.schemaSettingsManager.add(y),this.app.schemaInitializerManager.add(k),this.app.schemaInitializerManager.add(C),null==(e=this.app.schemaInitializerManager.get("page:addBlock"))||e.add("dataBlocks.gantt",{title:"{{t('Gantt')}}",Component:"GanttBlockInitializer"}),this.app.schemaInitializerManager.addItem("popup:common:addBlock","dataBlocks.gantt",{title:"{{t('Gantt')}}",Component:"GanttBlockInitializer",useComponentProps:function(){var e,i,l,c,s,u=(e=(0,t.useSchemaInitializer)().insert,i=(0,a.useTranslation)().t,l=(0,r.useContext)(o.SchemaOptionsContext),c=(0,t.useGlobalTheme)().theme,s=(0,t.useCollectionManager_deprecated)().getCollectionFields,{createAssociationGanttBlock:function(r){var o=r.item;return D(function(){var r,a,u,d,f,p,h,m,g;return N(this,function(v){switch(v.label){case 0:return d=o.associationField,p=null==(f=s(o.name,o.dataSource))||null==(r=f.filter(function(e){return"string"===e.type}))?void 0:r.map(function(e){var t;return{label:null==e||null==(t=e.uiSchema)?void 0:t.title,value:e.name}}),h=null==f||null==(a=f.filter(function(e){return"date"===e.type}))?void 0:a.map(function(e){var t;return{label:null==e||null==(t=e.uiSchema)?void 0:t.title,value:e.name}}),m=null==f||null==(u=f.filter(function(e){return"float"===e.type}))?void 0:u.map(function(e){var t;return{label:null==e||null==(t=e.uiSchema)?void 0:t.title,value:e.name}}),[4,(0,t.FormDialog)(i("Create gantt block"),function(){return n().createElement(t.SchemaComponentOptions,{scope:l.scope,components:M({},l.components)},n().createElement(P.FormLayout,{layout:"vertical"},n().createElement(t.SchemaComponent,{schema:{properties:{title:{title:i("Title field"),enum:p,required:!0,"x-component":"Select","x-decorator":"FormItem"},start:{title:i("Start date field"),enum:h,required:!0,default:"createdAt","x-component":"Select","x-decorator":"FormItem"},end:{title:i("End date field"),enum:h,required:!0,"x-component":"Select","x-decorator":"FormItem"},progress:{title:i("Progress field"),enum:m,"x-component":"Select","x-decorator":"FormItem"},range:{title:i("Time scale"),enum:[{label:'{{t("Hour")}}',value:"hour",color:"orange"},{label:'{{t("Quarter of day")}}',value:"quarterDay",color:"default"},{label:'{{t("Half of day")}}',value:"halfDay",color:"blue"},{label:'{{t("Day")}}',value:"day",color:"yellow"},{label:'{{t("Week")}}',value:"week",color:"pule"},{label:'{{t("Month")}}',value:"month",color:"green"},{label:'{{t("Year")}}',value:"year",color:"green"},{label:'{{t("QuarterYear")}}',value:"quarterYear",color:"red"}],default:"day","x-component":"Select","x-decorator":"FormItem"}}}})))},c).open({initialValues:{}})];case 1:return g=v.sent(),e(T({association:"".concat(d.collectionName,".").concat(d.name),dataSource:o.dataSource,fieldNames:M({},g)})),[2]}})})()}}).createAssociationGanttBlock,d=F().createGanttBlock;return{onlyCurrentDataSource:!0,filterCollections:function(e){var t=e.associationField;return!!t&&["hasMany","belongsToMany"].includes(t.type)},createBlockSchema:function(e){var t=e.item;if(e.fromOthersInPopup)return d({item:t});u({item:t})},showAssociationFields:!0,hideSearch:!0}}}),this.app.addScopes({useGanttBlockProps:p}),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){rt(a,n,o,i,l,"next",e)}function l(e){rt(a,n,o,i,l,"throw",e)}i(void 0)})}).call(this)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(l.prototype,i),l}(ra(t.Plugin)),rs=rc}(),x}()});
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.0-alpha.10",
11
+ "@nocobase/client": "2.1.0-alpha.11",
12
12
  "react": "18.2.0",
13
13
  "@formily/react": "2.3.7",
14
14
  "react-i18next": "11.18.6",
@@ -16,11 +16,11 @@ module.exports = {
16
16
  "@formily/antd-v5": "1.2.3",
17
17
  "lodash": "4.17.21",
18
18
  "@formily/shared": "2.3.7",
19
- "@nocobase/server": "2.1.0-alpha.10",
20
- "@nocobase/test": "2.1.0-alpha.10",
19
+ "@nocobase/server": "2.1.0-alpha.11",
20
+ "@nocobase/test": "2.1.0-alpha.11",
21
21
  "@emotion/css": "11.13.0",
22
22
  "antd-style": "3.7.1",
23
- "@nocobase/flow-engine": "2.1.0-alpha.10",
24
- "@nocobase/utils": "2.1.0-alpha.10",
23
+ "@nocobase/flow-engine": "2.1.0-alpha.11",
24
+ "@nocobase/utils": "2.1.0-alpha.11",
25
25
  "antd": "5.24.2"
26
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-gantt",
3
- "version": "2.1.0-alpha.10",
3
+ "version": "2.1.0-alpha.11",
4
4
  "displayName": "Block: Gantt",
5
5
  "displayName.ru-RU": "Блок: Диаграмма Ганта",
6
6
  "displayName.zh-CN": "区块:甘特图",
@@ -20,7 +20,7 @@
20
20
  "@nocobase/server": "2.x",
21
21
  "@nocobase/test": "2.x"
22
22
  },
23
- "gitHead": "ce790d46c0a5768ca9618c7d0d77ab8300de75c8",
23
+ "gitHead": "bb96d633a6371afb586072ff516bd0613c757db0",
24
24
  "keywords": [
25
25
  "Blocks"
26
26
  ]