flowcore-fn 10.3.1 → 10.3.4

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.
@@ -4741,7 +4741,7 @@ import Swal9 from "sweetalert2";
4741
4741
 
4742
4742
  // src/components/WorkFlowTransition/AddWorkFlowTransitionModal.js
4743
4743
  import React20, { useEffect as useEffect14, useState as useState15 } from "react";
4744
- import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
4744
+ import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
4745
4745
  var rowsFrom = (response) => {
4746
4746
  var _a, _b, _c, _d, _e, _f, _g;
4747
4747
  const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
@@ -4757,21 +4757,24 @@ var lookupEndpoint = (name, fallback) => {
4757
4757
  }
4758
4758
  };
4759
4759
  function AddWorkTransitionStepModal({ onClose, onSave, editData }) {
4760
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
4760
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K;
4761
4761
  const [formData, setFormData] = useState15({
4762
4762
  workflowTypeId: String((_b = (_a = editData == null ? void 0 : editData.workflowTypeId) != null ? _a : editData == null ? void 0 : editData.WorkflowTypeId) != null ? _b : ""),
4763
4763
  workflow: String((_d = (_c = editData == null ? void 0 : editData.workflowId) != null ? _c : editData == null ? void 0 : editData.WorkflowId) != null ? _d : ""),
4764
4764
  fromStep: String((_h = (_g = (_f = (_e = editData == null ? void 0 : editData.fromWorkflowStepId) != null ? _e : editData == null ? void 0 : editData.FromWorkflowStepId) != null ? _f : editData == null ? void 0 : editData.fromStepId) != null ? _g : editData == null ? void 0 : editData.FromStepId) != null ? _h : ""),
4765
4765
  toStep: String((_l = (_k = (_j = (_i = editData == null ? void 0 : editData.toWorkflowStepId) != null ? _i : editData == null ? void 0 : editData.ToWorkflowStepId) != null ? _j : editData == null ? void 0 : editData.toStepId) != null ? _k : editData == null ? void 0 : editData.ToStepId) != null ? _l : ""),
4766
- actionCode: (_n = (_m = editData == null ? void 0 : editData.actionCode) != null ? _m : editData == null ? void 0 : editData.ActionCode) != null ? _n : "",
4767
- actionName: (_p = (_o = editData == null ? void 0 : editData.actionName) != null ? _o : editData == null ? void 0 : editData.ActionName) != null ? _p : "",
4768
- sequenceNo: String((_r = (_q = editData == null ? void 0 : editData.sequenceNo) != null ? _q : editData == null ? void 0 : editData.SequenceNo) != null ? _r : "1"),
4769
- isDefault: Boolean((_t = (_s = editData == null ? void 0 : editData.isDefault) != null ? _s : editData == null ? void 0 : editData.IsDefault) != null ? _t : false),
4770
- requireComment: Boolean((_v = (_u = editData == null ? void 0 : editData.requireComment) != null ? _u : editData == null ? void 0 : editData.RequireComment) != null ? _v : false),
4771
- status: ((_x = (_w = editData == null ? void 0 : editData.isActive) != null ? _w : editData == null ? void 0 : editData.IsActive) != null ? _x : true) ? "active" : "inactive"
4766
+ returnToApplicant: Boolean((_s = (_o = (_n = (_m = editData == null ? void 0 : editData.isReturnToApplicant) != null ? _m : editData == null ? void 0 : editData.IsReturnToApplicant) != null ? _n : editData == null ? void 0 : editData.returnToApplicant) != null ? _o : editData == null ? void 0 : editData.ReturnToApplicant) != null ? _s : Number((_r = (_q = (_p = editData == null ? void 0 : editData.toWorkflowStepId) != null ? _p : editData == null ? void 0 : editData.ToWorkflowStepId) != null ? _q : editData == null ? void 0 : editData.toStepId) != null ? _r : editData == null ? void 0 : editData.ToStepId) === 0),
4767
+ actionCode: (_u = (_t = editData == null ? void 0 : editData.actionCode) != null ? _t : editData == null ? void 0 : editData.ActionCode) != null ? _u : "",
4768
+ actionName: (_w = (_v = editData == null ? void 0 : editData.actionName) != null ? _v : editData == null ? void 0 : editData.ActionName) != null ? _w : "",
4769
+ isDefault: Boolean((_y = (_x = editData == null ? void 0 : editData.isDefault) != null ? _x : editData == null ? void 0 : editData.IsDefault) != null ? _y : false),
4770
+ requireComment: Boolean((_A = (_z = editData == null ? void 0 : editData.requireComment) != null ? _z : editData == null ? void 0 : editData.RequireComment) != null ? _A : false),
4771
+ status: ((_C = (_B = editData == null ? void 0 : editData.isActive) != null ? _B : editData == null ? void 0 : editData.IsActive) != null ? _C : true) ? "active" : "inactive"
4772
4772
  });
4773
4773
  const [errors, setErrors] = useState15({});
4774
4774
  const [isSubmitting, setIsSubmitting] = useState15(false);
4775
+ const [availableActions, setAvailableActions] = useState15([]);
4776
+ const [loadingActions, setLoadingActions] = useState15(false);
4777
+ const [actionFetchError, setActionFetchError] = useState15("");
4775
4778
  const [workflowTypes, setWorkflowTypes] = useState15([]);
4776
4779
  const [loadingWorkflowTypes, setLoadingWorkflowTypes] = useState15(false);
4777
4780
  const [workflowTypeFetchError, setWorkflowTypeFetchError] = useState15("");
@@ -4852,19 +4855,19 @@ function AddWorkTransitionStepModal({ onClose, onSave, editData }) {
4852
4855
  };
4853
4856
  }, [formData.workflowTypeId]);
4854
4857
  useEffect14(() => {
4855
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2, _x2;
4858
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2, _x2, _y2, _z2, _A2, _B2, _C2;
4856
4859
  if (editData) {
4857
4860
  setFormData({
4858
4861
  workflowTypeId: String((_b2 = (_a2 = editData == null ? void 0 : editData.workflowTypeId) != null ? _a2 : editData == null ? void 0 : editData.WorkflowTypeId) != null ? _b2 : ""),
4859
4862
  workflow: String((_d2 = (_c2 = editData == null ? void 0 : editData.workflowId) != null ? _c2 : editData == null ? void 0 : editData.WorkflowId) != null ? _d2 : ""),
4860
4863
  fromStep: String((_h2 = (_g2 = (_f2 = (_e2 = editData == null ? void 0 : editData.fromWorkflowStepId) != null ? _e2 : editData == null ? void 0 : editData.FromWorkflowStepId) != null ? _f2 : editData == null ? void 0 : editData.fromStepId) != null ? _g2 : editData == null ? void 0 : editData.FromStepId) != null ? _h2 : ""),
4861
4864
  toStep: String((_l2 = (_k2 = (_j2 = (_i2 = editData == null ? void 0 : editData.toWorkflowStepId) != null ? _i2 : editData == null ? void 0 : editData.ToWorkflowStepId) != null ? _j2 : editData == null ? void 0 : editData.toStepId) != null ? _k2 : editData == null ? void 0 : editData.ToStepId) != null ? _l2 : ""),
4862
- actionCode: (_n2 = (_m2 = editData == null ? void 0 : editData.actionCode) != null ? _m2 : editData == null ? void 0 : editData.ActionCode) != null ? _n2 : "",
4863
- actionName: (_p2 = (_o2 = editData == null ? void 0 : editData.actionName) != null ? _o2 : editData == null ? void 0 : editData.ActionName) != null ? _p2 : "",
4864
- sequenceNo: String((_r2 = (_q2 = editData == null ? void 0 : editData.sequenceNo) != null ? _q2 : editData == null ? void 0 : editData.SequenceNo) != null ? _r2 : "1"),
4865
- isDefault: Boolean((_t2 = (_s2 = editData == null ? void 0 : editData.isDefault) != null ? _s2 : editData == null ? void 0 : editData.IsDefault) != null ? _t2 : false),
4866
- requireComment: Boolean((_v2 = (_u2 = editData == null ? void 0 : editData.requireComment) != null ? _u2 : editData == null ? void 0 : editData.RequireComment) != null ? _v2 : false),
4867
- status: ((_x2 = (_w2 = editData == null ? void 0 : editData.isActive) != null ? _w2 : editData == null ? void 0 : editData.IsActive) != null ? _x2 : true) ? "active" : "inactive"
4865
+ returnToApplicant: Boolean((_s2 = (_o2 = (_n2 = (_m2 = editData == null ? void 0 : editData.isReturnToApplicant) != null ? _m2 : editData == null ? void 0 : editData.IsReturnToApplicant) != null ? _n2 : editData == null ? void 0 : editData.returnToApplicant) != null ? _o2 : editData == null ? void 0 : editData.ReturnToApplicant) != null ? _s2 : Number((_r2 = (_q2 = (_p2 = editData == null ? void 0 : editData.toWorkflowStepId) != null ? _p2 : editData == null ? void 0 : editData.ToWorkflowStepId) != null ? _q2 : editData == null ? void 0 : editData.toStepId) != null ? _r2 : editData == null ? void 0 : editData.ToStepId) === 0),
4866
+ actionCode: (_u2 = (_t2 = editData == null ? void 0 : editData.actionCode) != null ? _t2 : editData == null ? void 0 : editData.ActionCode) != null ? _u2 : "",
4867
+ actionName: (_w2 = (_v2 = editData == null ? void 0 : editData.actionName) != null ? _v2 : editData == null ? void 0 : editData.ActionName) != null ? _w2 : "",
4868
+ isDefault: Boolean((_y2 = (_x2 = editData == null ? void 0 : editData.isDefault) != null ? _x2 : editData == null ? void 0 : editData.IsDefault) != null ? _y2 : false),
4869
+ requireComment: Boolean((_A2 = (_z2 = editData == null ? void 0 : editData.requireComment) != null ? _z2 : editData == null ? void 0 : editData.RequireComment) != null ? _A2 : false),
4870
+ status: ((_C2 = (_B2 = editData == null ? void 0 : editData.isActive) != null ? _B2 : editData == null ? void 0 : editData.IsActive) != null ? _C2 : true) ? "active" : "inactive"
4868
4871
  });
4869
4872
  setErrors({});
4870
4873
  }
@@ -4921,6 +4924,60 @@ function AddWorkTransitionStepModal({ onClose, onSave, editData }) {
4921
4924
  active = false;
4922
4925
  };
4923
4926
  }, [formData.workflow]);
4927
+ useEffect14(() => {
4928
+ if (!formData.fromStep) {
4929
+ setAvailableActions([]);
4930
+ setActionFetchError("");
4931
+ setLoadingActions(false);
4932
+ setFormData((current) => __spreadProps(__spreadValues({}, current), { actionCode: "", actionName: "" }));
4933
+ return void 0;
4934
+ }
4935
+ let active = true;
4936
+ const loadActions = async () => {
4937
+ var _a2, _b2, _c2, _d2, _e2, _f2;
4938
+ setAvailableActions([]);
4939
+ setActionFetchError("");
4940
+ setLoadingActions(true);
4941
+ try {
4942
+ const flowCore = (_b2 = (_a2 = getApiEndpoints()) == null ? void 0 : _a2.flowCore) != null ? _b2 : {};
4943
+ const endpoint2 = (_d2 = (_c2 = flowCore.inbox) == null ? void 0 : _c2.GetPermisiionLabelWithCodeAll) != null ? _d2 : "/api/flowcore/StepPermission/GetByWorkflowStepId";
4944
+ const url = typeof endpoint2 === "function" ? endpoint2() : String(endpoint2);
4945
+ const actions = rowsFrom(
4946
+ await getApiService().get(url)
4947
+ ).map(({ name }) => ({ name })).filter((action) => action.name);
4948
+ if (!active) return;
4949
+ setAvailableActions(actions);
4950
+ setFormData((current) => {
4951
+ var _a3, _b3;
4952
+ const currentActionValues = [current.actionCode, current.actionName].filter(Boolean).map((value) => String(value).trim().toUpperCase());
4953
+ const selectedAction = actions.find((action) => {
4954
+ const actionName = String(action.name).trim().toUpperCase();
4955
+ return currentActionValues.includes(actionName);
4956
+ });
4957
+ const defaultAction = selectedAction != null ? selectedAction : !editData ? actions[0] : null;
4958
+ return __spreadProps(__spreadValues({}, current), {
4959
+ actionCode: (_a3 = defaultAction == null ? void 0 : defaultAction.name) != null ? _a3 : current.actionCode,
4960
+ actionName: (_b3 = defaultAction == null ? void 0 : defaultAction.name) != null ? _b3 : current.actionName
4961
+ });
4962
+ });
4963
+ if (actions.length === 0) {
4964
+ setActionFetchError("No actions are available for the selected From Step.");
4965
+ }
4966
+ } catch (error) {
4967
+ if (active) {
4968
+ setActionFetchError(
4969
+ ((_f2 = (_e2 = error == null ? void 0 : error.response) == null ? void 0 : _e2.data) == null ? void 0 : _f2.message) || (error == null ? void 0 : error.message) || "Unable to load actions for the selected From Step."
4970
+ );
4971
+ }
4972
+ } finally {
4973
+ if (active) setLoadingActions(false);
4974
+ }
4975
+ };
4976
+ loadActions();
4977
+ return () => {
4978
+ active = false;
4979
+ };
4980
+ }, [formData.fromStep]);
4924
4981
  useEffect14(() => {
4925
4982
  const handleKeyDown = (e) => {
4926
4983
  if (e.key === "Escape") {
@@ -4934,10 +4991,23 @@ function AddWorkTransitionStepModal({ onClose, onSave, editData }) {
4934
4991
  const filteredSteps = workflowSteps;
4935
4992
  const handleChange = (field, value) => {
4936
4993
  let sanitized = value;
4937
- if (field === "actionCode" && typeof value === "string") {
4938
- sanitized = value.toUpperCase().replace(/[^A-Z0-9_-]/g, "");
4939
- } else if (field === "sequenceNo" && typeof value === "string") {
4940
- sanitized = value.replace(/^-+/, "");
4994
+ if (field === "returnToApplicant") {
4995
+ setFormData((prev) => __spreadProps(__spreadValues({}, prev), {
4996
+ returnToApplicant: Boolean(value),
4997
+ toStep: value ? "0" : prev.toStep === "0" ? "" : prev.toStep
4998
+ }));
4999
+ if (errors.toStep) setErrors((prev) => __spreadProps(__spreadValues({}, prev), { toStep: "" }));
5000
+ return;
5001
+ }
5002
+ if (field === "fromStep") {
5003
+ setFormData((prev) => __spreadProps(__spreadValues({}, prev), {
5004
+ fromStep: sanitized,
5005
+ actionCode: "",
5006
+ actionName: ""
5007
+ }));
5008
+ if (errors.fromStep) setErrors((prev) => __spreadProps(__spreadValues({}, prev), { fromStep: "" }));
5009
+ if (errors.actionName) setErrors((prev) => __spreadProps(__spreadValues({}, prev), { actionName: "" }));
5010
+ return;
4941
5011
  }
4942
5012
  if (field === "workflowTypeId") {
4943
5013
  setFormData((prev) => {
@@ -4997,11 +5067,9 @@ function AddWorkTransitionStepModal({ onClose, onSave, editData }) {
4997
5067
  if (!formData.workflowTypeId) newErrors.workflowTypeId = "Workflow Type is required.";
4998
5068
  if (!formData.workflow) newErrors.workflow = "Workflow is required.";
4999
5069
  if (!formData.fromStep) newErrors.fromStep = "From Step is required.";
5000
- if (!formData.toStep) newErrors.toStep = "To Step is required.";
5001
- if (!formData.actionCode.trim()) newErrors.actionCode = "Action Code is required.";
5002
- if (!formData.actionName.trim()) newErrors.actionName = "Action Name is required.";
5003
- if (!formData.sequenceNo || isNaN(Number(formData.sequenceNo)) || Number(formData.sequenceNo) <= 0) {
5004
- newErrors.sequenceNo = "Sequence number must be at least 1.";
5070
+ if (!formData.returnToApplicant && !formData.toStep) newErrors.toStep = "To Step is required.";
5071
+ if (!formData.actionCode.trim() || !formData.actionName.trim()) {
5072
+ newErrors.actionName = "Action Name is required.";
5005
5073
  }
5006
5074
  setErrors(newErrors);
5007
5075
  return Object.keys(newErrors).length === 0;
@@ -5016,10 +5084,10 @@ function AddWorkTransitionStepModal({ onClose, onSave, editData }) {
5016
5084
  workflowTypeId: Number(formData.workflowTypeId) || 0,
5017
5085
  workflowId: Number(formData.workflow),
5018
5086
  fromWorkflowStepId: Number(formData.fromStep),
5019
- toWorkflowStepId: Number(formData.toStep),
5020
- actionCode: formData.actionCode.trim().toUpperCase(),
5087
+ toWorkflowStepId: formData.returnToApplicant ? 0 : Number(formData.toStep),
5088
+ actionCode: formData.actionCode.trim(),
5021
5089
  actionName: formData.actionName.trim(),
5022
- sequenceNo: Number(formData.sequenceNo) || 1,
5090
+ isReturnToApplicant: Boolean(formData.returnToApplicant),
5023
5091
  isDefault: Boolean(formData.isDefault),
5024
5092
  requireComment: Boolean(formData.requireComment),
5025
5093
  isActive: formData.status === "active",
@@ -5028,10 +5096,10 @@ function AddWorkTransitionStepModal({ onClose, onSave, editData }) {
5028
5096
  workflowTypeId: Number(formData.workflowTypeId) || 0,
5029
5097
  workflowId: Number(formData.workflow),
5030
5098
  fromWorkflowStepId: Number(formData.fromStep),
5031
- toWorkflowStepId: Number(formData.toStep),
5032
- actionCode: formData.actionCode.trim().toUpperCase(),
5099
+ toWorkflowStepId: formData.returnToApplicant ? 0 : Number(formData.toStep),
5100
+ actionCode: formData.actionCode.trim(),
5033
5101
  actionName: formData.actionName.trim(),
5034
- sequenceNo: Number(formData.sequenceNo) || 1,
5102
+ isReturnToApplicant: Boolean(formData.returnToApplicant),
5035
5103
  isDefault: Boolean(formData.isDefault),
5036
5104
  requireComment: Boolean(formData.requireComment),
5037
5105
  isActive: formData.status === "active",
@@ -5045,6 +5113,16 @@ function AddWorkTransitionStepModal({ onClose, onSave, editData }) {
5045
5113
  }
5046
5114
  };
5047
5115
  const inputCls = (hasErr) => `fc:w-full fc:p-2.5 fc:pl-9 fc:rounded-xl fc:text-xs fc:border fc:bg-white focus:fc:outline-none focus:fc:ring-2 focus:fc:ring-indigo-500/20 focus:fc:border-indigo-500 fc:text-slate-700 fc:transition-all ${hasErr ? "fc:border-red-500 fc:text-slate-800" : "fc:border-slate-200 hover:fc:border-slate-300"}`;
5116
+ const inputStyle = (hasErr) => ({
5117
+ width: "100%",
5118
+ height: 42,
5119
+ boxSizing: "border-box",
5120
+ padding: "0 36px",
5121
+ border: `1px solid ${hasErr ? "#ef4444" : "#cbd5e1"}`,
5122
+ borderRadius: 10,
5123
+ backgroundColor: "#fff",
5124
+ color: "#334155"
5125
+ });
5048
5126
  return /* @__PURE__ */ jsxs19("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:p-4", children: [
5049
5127
  /* @__PURE__ */ jsx20(
5050
5128
  "div",
@@ -5053,411 +5131,410 @@ function AddWorkTransitionStepModal({ onClose, onSave, editData }) {
5053
5131
  onClick: onClose
5054
5132
  }
5055
5133
  ),
5056
- /* @__PURE__ */ jsxs19("div", { className: "fc:relative fc:w-full fc:max-w-4xl fc:bg-white fc:rounded-3xl fc:flex fc:flex-col fc:z-10 fc:max-h-[92vh] fc:overflow-hidden fc:animate-in fc:fade-in fc:zoom-in-95 fc:slide-in-from-bottom-4 fc:duration-300 fc:ring-1 fc:ring-slate-900/5", children: [
5057
- /* @__PURE__ */ jsxs19("div", { className: "fc:flex fc:justify-between fc:items-center fc:px-8 fc:py-6 fc:border-b fc:border-slate-100 fc:bg-gradient-to-r fc:from-white fc:via-slate-50/50 fc:to-white", children: [
5058
- /* @__PURE__ */ jsxs19("div", { className: "fc:flex fc:items-center fc:gap-4", children: [
5059
- /* @__PURE__ */ jsx20("div", { className: "fc:w-12 fc:h-12 fc:bg-indigo-50 fc:text-indigo-600 fc:rounded-2xl fc:flex fc:items-center fc:justify-center fc:shadow-inner", children: /* @__PURE__ */ jsx20("svg", { className: "fc:w-6 fc:h-6", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" }) }) }),
5060
- /* @__PURE__ */ jsxs19("div", { children: [
5061
- /* @__PURE__ */ jsx20("h2", { className: "fc:text-xl fc:font-extrabold fc:text-slate-800 fc:tracking-tight", children: editData ? "Edit Workflow Transition" : "Add Workflow Transition" }),
5062
- /* @__PURE__ */ jsx20("p", { className: "fc:text-xs fc:text-slate-400 fc:mt-0.5 fc:font-medium", children: editData ? "Update workflow transition details and routing" : "Create a new workflow transition and configure its details" })
5063
- ] })
5064
- ] }),
5065
- /* @__PURE__ */ jsx20(
5066
- "button",
5067
- {
5068
- type: "button",
5069
- onClick: onClose,
5070
- className: "fc:group fc:text-slate-400 hover:fc:text-slate-700 hover:fc:bg-slate-100/80 active:fc:scale-95 fc:p-2.5 fc:rounded-full fc:transition-all fc:duration-200",
5071
- "aria-label": "Close",
5072
- children: /* @__PURE__ */ jsx20("svg", { className: "fc:w-5 fc:h-5 fc:transition-transform fc:duration-200 group-hover:fc:rotate-90", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) })
5073
- }
5074
- )
5075
- ] }),
5076
- /* @__PURE__ */ jsxs19("form", { onSubmit: handleSubmit, className: "fc:flex fc:flex-col fc:flex-1 fc:overflow-hidden", children: [
5077
- /* @__PURE__ */ jsxs19("div", { className: "fc:p-8 fc:space-y-8 fc:overflow-y-auto fc:max-h-[calc(92vh-170px)] fc:bg-slate-50/40", children: [
5078
- /* @__PURE__ */ jsxs19("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-200/70 fc:duration-300 fc:space-y-5", children: [
5079
- /* @__PURE__ */ jsxs19("div", { className: "fc:flex fc:items-center fc:gap-2.5 fc:text-indigo-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-100 fc:pb-3", children: [
5080
- /* @__PURE__ */ jsx20("div", { className: "fc:p-1.5 fc:bg-indigo-50 fc:rounded-lg", children: /* @__PURE__ */ jsx20("svg", { className: "fc:w-4 fc:h-4", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }) }),
5081
- /* @__PURE__ */ jsx20("span", { children: "Workflow Transition Information" })
5082
- ] }),
5083
- /* @__PURE__ */ jsxs19("div", { className: "fc:grid fc:grid-cols-2 md:fc:grid-cols-2 fc:gap-5", children: [
5084
- /* @__PURE__ */ jsxs19("div", { children: [
5085
- /* @__PURE__ */ jsxs19("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
5086
- "Workflow Type ",
5087
- /* @__PURE__ */ jsx20("span", { className: "fc:text-red-500", children: "*" })
5134
+ /* @__PURE__ */ jsxs19(
5135
+ "div",
5136
+ {
5137
+ className: "fc:relative fc:w-full fc:max-w-4xl fc:bg-white fc:rounded-3xl fc:flex fc:flex-col fc:z-10 fc:max-h-[92vh] fc:overflow-hidden fc:animate-in fc:fade-in fc:zoom-in-95 fc:slide-in-from-bottom-4 fc:duration-300 fc:ring-1 fc:ring-slate-900/5",
5138
+ style: { width: "min(840px, calc(100vw - 24px))", maxHeight: "min(700px, calc(100vh - 24px))", boxShadow: "0 24px 64px rgba(15, 23, 42, 0.22)" },
5139
+ children: [
5140
+ /* @__PURE__ */ jsxs19(
5141
+ "div",
5142
+ {
5143
+ className: "fc:flex fc:justify-between fc:items-center fc:px-8 fc:py-6 fc:border-b fc:border-slate-100 fc:bg-gradient-to-r fc:from-white fc:via-slate-50/50 fc:to-white",
5144
+ style: { flexShrink: 0, padding: "12px 20px" },
5145
+ children: [
5146
+ /* @__PURE__ */ jsxs19("div", { className: "fc:flex fc:items-center fc:gap-4", children: [
5147
+ /* @__PURE__ */ jsx20("div", { className: "fc:w-12 fc:h-12 fc:bg-indigo-50 fc:text-indigo-600 fc:rounded-2xl fc:flex fc:items-center fc:justify-center fc:shadow-inner", children: /* @__PURE__ */ jsx20("svg", { className: "fc:w-6 fc:h-6", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" }) }) }),
5148
+ /* @__PURE__ */ jsxs19("div", { children: [
5149
+ /* @__PURE__ */ jsx20("h2", { className: "fc:text-xl fc:font-extrabold fc:text-slate-800 fc:tracking-tight", children: editData ? "Edit Workflow Transition" : "Add Workflow Transition" }),
5150
+ /* @__PURE__ */ jsx20("p", { className: "fc:text-xs fc:text-slate-400 fc:mt-0.5 fc:font-medium", children: editData ? "Update workflow transition details and routing" : "Create a new workflow transition and configure its details" })
5151
+ ] })
5088
5152
  ] }),
5089
- /* @__PURE__ */ jsxs19("div", { className: "fc:relative", children: [
5153
+ /* @__PURE__ */ jsx20(
5154
+ "button",
5155
+ {
5156
+ type: "button",
5157
+ onClick: onClose,
5158
+ className: "fc:group fc:text-slate-400 hover:fc:text-slate-700 hover:fc:bg-slate-100/80 active:fc:scale-95 fc:p-2.5 fc:rounded-full fc:transition-all fc:duration-200",
5159
+ "aria-label": "Close",
5160
+ children: /* @__PURE__ */ jsx20("svg", { className: "fc:w-5 fc:h-5 fc:transition-transform fc:duration-200 group-hover:fc:rotate-90", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) })
5161
+ }
5162
+ )
5163
+ ]
5164
+ }
5165
+ ),
5166
+ /* @__PURE__ */ jsxs19("form", { onSubmit: handleSubmit, className: "fc:flex fc:flex-col fc:flex-1 fc:overflow-hidden", children: [
5167
+ /* @__PURE__ */ jsxs19(
5168
+ "div",
5169
+ {
5170
+ className: "fc:flex fc:flex-col fc:overflow-y-auto fc:bg-slate-50/40",
5171
+ style: { flex: "1 1 auto", minHeight: 0, padding: "14px 20px", gap: 12 },
5172
+ children: [
5090
5173
  /* @__PURE__ */ jsxs19(
5091
- "select",
5174
+ "div",
5092
5175
  {
5093
- value: formData.workflowTypeId,
5094
- onChange: (e) => handleChange("workflowTypeId", e.target.value),
5095
- disabled: loadingWorkflowTypes,
5096
- className: inputCls(errors.workflowTypeId),
5176
+ className: "fc:bg-white fc:rounded-2xl fc:border fc:border-slate-200/70 fc:duration-300",
5177
+ style: { display: "flex", flexDirection: "column", gap: 12, padding: 16, borderRadius: 14 },
5097
5178
  children: [
5098
- /* @__PURE__ */ jsx20("option", { value: "", children: loadingWorkflowTypes ? "Loading workflow types..." : "Select Workflow Type" }),
5099
- formData.workflowTypeId && !workflowTypes.some(
5100
- (t) => {
5101
- var _a2, _b2;
5102
- return String((_b2 = (_a2 = t.workflowTypeId) != null ? _a2 : t.WorkflowTypeId) != null ? _b2 : t.id) === String(formData.workflowTypeId);
5179
+ /* @__PURE__ */ jsxs19("div", { className: "fc:flex fc:items-center fc:gap-2.5 fc:text-indigo-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-100 fc:pb-3", children: [
5180
+ /* @__PURE__ */ jsx20("div", { className: "fc:p-1.5 fc:bg-indigo-50 fc:rounded-lg", children: /* @__PURE__ */ jsx20("svg", { className: "fc:w-4 fc:h-4", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }) }),
5181
+ /* @__PURE__ */ jsx20("span", { children: "Workflow Transition Information" })
5182
+ ] }),
5183
+ /* @__PURE__ */ jsxs19("div", { className: "fc:grid fc:grid-cols-2 md:fc:grid-cols-2 fc:gap-5", children: [
5184
+ /* @__PURE__ */ jsxs19("div", { children: [
5185
+ /* @__PURE__ */ jsxs19("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
5186
+ "Workflow Type ",
5187
+ /* @__PURE__ */ jsx20("span", { className: "fc:text-red-500", children: "*" })
5188
+ ] }),
5189
+ /* @__PURE__ */ jsxs19("div", { className: "fc:relative", children: [
5190
+ /* @__PURE__ */ jsxs19(
5191
+ "select",
5192
+ {
5193
+ value: formData.workflowTypeId,
5194
+ onChange: (e) => handleChange("workflowTypeId", e.target.value),
5195
+ disabled: loadingWorkflowTypes,
5196
+ className: inputCls(errors.workflowTypeId),
5197
+ style: inputStyle(errors.workflowTypeId),
5198
+ children: [
5199
+ /* @__PURE__ */ jsx20("option", { value: "", children: loadingWorkflowTypes ? "Loading workflow types..." : "Select Workflow Type" }),
5200
+ formData.workflowTypeId && !workflowTypes.some(
5201
+ (t) => {
5202
+ var _a2, _b2;
5203
+ return String((_b2 = (_a2 = t.workflowTypeId) != null ? _a2 : t.WorkflowTypeId) != null ? _b2 : t.id) === String(formData.workflowTypeId);
5204
+ }
5205
+ ) && /* @__PURE__ */ jsx20("option", { value: formData.workflowTypeId, children: (_E = (_D = editData == null ? void 0 : editData.workflowTypeName) != null ? _D : editData == null ? void 0 : editData.WorkflowTypeName) != null ? _E : `Type ${formData.workflowTypeId}` }),
5206
+ workflowTypes.map((type) => {
5207
+ var _a2, _b2, _c2, _d2, _e2, _f2;
5208
+ const id = (_b2 = (_a2 = type.workflowTypeId) != null ? _a2 : type.WorkflowTypeId) != null ? _b2 : type.id;
5209
+ const label = (_f2 = (_e2 = (_d2 = (_c2 = type.workflowTypeName) != null ? _c2 : type.WorkflowTypeName) != null ? _d2 : type.name) != null ? _e2 : type.typeName) != null ? _f2 : `Type ${id}`;
5210
+ return /* @__PURE__ */ jsx20("option", { value: String(id), children: label }, id);
5211
+ })
5212
+ ]
5213
+ }
5214
+ ),
5215
+ /* @__PURE__ */ jsx20("svg", { className: "fc:w-4 fc:h-4 fc:text-slate-400 fc:absolute fc:left-3 fc:top-3 pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" }) })
5216
+ ] }),
5217
+ workflowTypeFetchError && /* @__PURE__ */ jsx20("p", { className: "fc:text-amber-600 fc:text-[11px] fc:mt-1 fc:font-medium", children: workflowTypeFetchError }),
5218
+ errors.workflowTypeId && /* @__PURE__ */ jsx20("p", { className: "fc:text-red-500 fc:text-[11px] fc:mt-1 fc:font-medium", children: errors.workflowTypeId })
5219
+ ] }),
5220
+ /* @__PURE__ */ jsxs19("div", { children: [
5221
+ /* @__PURE__ */ jsxs19("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
5222
+ "Workflow ",
5223
+ /* @__PURE__ */ jsx20("span", { className: "fc:text-red-500", children: "*" })
5224
+ ] }),
5225
+ /* @__PURE__ */ jsxs19("div", { className: "fc:relative", children: [
5226
+ /* @__PURE__ */ jsxs19(
5227
+ "select",
5228
+ {
5229
+ value: formData.workflow,
5230
+ onChange: (e) => handleChange("workflow", e.target.value),
5231
+ disabled: loadingWorkflows,
5232
+ className: inputCls(errors.workflow),
5233
+ style: inputStyle(errors.workflow),
5234
+ children: [
5235
+ /* @__PURE__ */ jsx20("option", { value: "", children: loadingWorkflows ? "Loading workflows..." : !formData.workflowTypeId ? "Select Workflow Type first" : filteredWorkflows.length === 0 ? "No workflows found for this type" : "Select Workflow" }),
5236
+ formData.workflow && !filteredWorkflows.some(
5237
+ (w) => {
5238
+ var _a2, _b2;
5239
+ return String((_b2 = (_a2 = w.workflowId) != null ? _a2 : w.WorkflowId) != null ? _b2 : w.id) === String(formData.workflow);
5240
+ }
5241
+ ) && /* @__PURE__ */ jsx20("option", { value: formData.workflow, children: (_G = (_F = editData == null ? void 0 : editData.workflowName) != null ? _F : editData == null ? void 0 : editData.WorkflowName) != null ? _G : `Workflow ${formData.workflow}` }),
5242
+ filteredWorkflows.map((workflow) => {
5243
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
5244
+ const id = (_b2 = (_a2 = workflow.workflowId) != null ? _a2 : workflow.WorkflowId) != null ? _b2 : workflow.id;
5245
+ const name = (_h2 = (_g2 = (_f2 = (_e2 = (_d2 = (_c2 = workflow.workflowName) != null ? _c2 : workflow.WorkflowName) != null ? _d2 : workflow.name) != null ? _e2 : workflow.Name) != null ? _f2 : workflow.workflowCode) != null ? _g2 : workflow.WorkflowCode) != null ? _h2 : `Workflow ${id}`;
5246
+ return /* @__PURE__ */ jsx20("option", { value: String(id), children: name }, id);
5247
+ })
5248
+ ]
5249
+ }
5250
+ ),
5251
+ /* @__PURE__ */ jsx20("svg", { className: "fc:w-4 fc:h-4 fc:text-slate-400 fc:absolute fc:left-3 fc:top-3 pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) })
5252
+ ] }),
5253
+ workflowFetchError && /* @__PURE__ */ jsx20("p", { className: "fc:text-amber-600 fc:text-[11px] fc:mt-1 fc:font-medium", children: workflowFetchError }),
5254
+ errors.workflow && /* @__PURE__ */ jsx20("p", { className: "fc:text-red-500 fc:text-[11px] fc:mt-1 fc:font-medium", children: errors.workflow })
5255
+ ] })
5256
+ ] }),
5257
+ /* @__PURE__ */ jsxs19(
5258
+ "div",
5259
+ {
5260
+ className: "fc:grid fc:gap-3",
5261
+ style: {
5262
+ display: "grid",
5263
+ gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 300px), 1fr))",
5264
+ alignItems: "end",
5265
+ gap: 12
5266
+ },
5267
+ children: [
5268
+ /* @__PURE__ */ jsxs19("div", { children: [
5269
+ /* @__PURE__ */ jsxs19("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
5270
+ "From Step ",
5271
+ /* @__PURE__ */ jsx20("span", { className: "fc:text-red-500", children: "*" })
5272
+ ] }),
5273
+ /* @__PURE__ */ jsxs19("div", { className: "fc:relative", children: [
5274
+ /* @__PURE__ */ jsxs19(
5275
+ "select",
5276
+ {
5277
+ value: formData.fromStep,
5278
+ onChange: (e) => handleChange("fromStep", e.target.value),
5279
+ disabled: loadingWorkflowSteps,
5280
+ className: inputCls(errors.fromStep),
5281
+ style: inputStyle(errors.fromStep),
5282
+ children: [
5283
+ /* @__PURE__ */ jsx20("option", { value: "", children: loadingWorkflowSteps ? "Loading steps..." : !formData.workflow ? "Select Workflow first" : filteredSteps.length === 0 ? "No steps found for this workflow" : "Select From Step" }),
5284
+ formData.fromStep && !filteredSteps.some(
5285
+ (s) => {
5286
+ var _a2, _b2;
5287
+ return String((_b2 = (_a2 = s.workflowStepId) != null ? _a2 : s.WorkflowStepId) != null ? _b2 : s.id) === String(formData.fromStep);
5288
+ }
5289
+ ) && /* @__PURE__ */ jsx20("option", { value: formData.fromStep, children: (_I = (_H = editData == null ? void 0 : editData.fromStepName) != null ? _H : editData == null ? void 0 : editData.FromStepName) != null ? _I : `Step ${formData.fromStep}` }),
5290
+ filteredSteps.map((step) => {
5291
+ var _a2, _b2, _c2, _d2, _e2;
5292
+ const id = (_b2 = (_a2 = step.workflowStepId) != null ? _a2 : step.WorkflowStepId) != null ? _b2 : step.id;
5293
+ const name = (_d2 = (_c2 = step.stepName) != null ? _c2 : step.StepName) != null ? _d2 : `Step ${id}`;
5294
+ const code = (_e2 = step.stepCode) != null ? _e2 : step.StepCode;
5295
+ return /* @__PURE__ */ jsxs19("option", { value: String(id), children: [
5296
+ name,
5297
+ " ",
5298
+ code ? `(${code})` : ""
5299
+ ] }, id);
5300
+ })
5301
+ ]
5302
+ }
5303
+ ),
5304
+ /* @__PURE__ */ jsx20("svg", { className: "fc:w-4 fc:h-4 fc:text-slate-400 fc:absolute fc:left-3 fc:top-3 pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 15l-3-3m0 0l3-3m-3 3h8M3 12a9 9 0 1118 0 9 9 0 01-18 0z" }) })
5305
+ ] }),
5306
+ workflowStepFetchError && /* @__PURE__ */ jsx20("p", { className: "fc:text-amber-600 fc:text-[11px] fc:mt-1 fc:font-medium", children: workflowStepFetchError }),
5307
+ errors.fromStep && /* @__PURE__ */ jsx20("p", { className: "fc:text-red-500 fc:text-[11px] fc:mt-1 fc:font-medium", children: errors.fromStep })
5308
+ ] }),
5309
+ /* @__PURE__ */ jsx20("div", { style: { display: "flex", alignItems: "end", minWidth: 0 }, children: /* @__PURE__ */ jsxs19(
5310
+ "label",
5311
+ {
5312
+ className: "fc:text-xs fc:font-semibold fc:text-slate-700",
5313
+ style: { display: "flex", width: "100%", minHeight: 42, alignItems: "center", gap: 9, margin: 0, padding: "0 11px", border: "1px solid #cbd5e1", borderRadius: 10, background: "#f8fafc", cursor: "pointer" },
5314
+ children: [
5315
+ /* @__PURE__ */ jsx20(
5316
+ "input",
5317
+ {
5318
+ type: "checkbox",
5319
+ checked: formData.returnToApplicant,
5320
+ onChange: (event) => handleChange("returnToApplicant", event.target.checked),
5321
+ className: "fc:h-4 fc:w-4 fc:rounded fc:border-slate-300 fc:text-indigo-600 focus:fc:ring-indigo-500",
5322
+ style: { width: 16, height: 16, margin: 0, accentColor: "#4f46e5", flexShrink: 0 }
5323
+ }
5324
+ ),
5325
+ /* @__PURE__ */ jsx20("span", { style: { lineHeight: 1.25 }, children: "Return to Applicant" })
5326
+ ]
5327
+ }
5328
+ ) }),
5329
+ /* @__PURE__ */ jsx20("div", { style: { display: formData.returnToApplicant ? "none" : "block", minWidth: 0 }, children: !formData.returnToApplicant && /* @__PURE__ */ jsxs19(Fragment4, { children: [
5330
+ /* @__PURE__ */ jsxs19("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
5331
+ "To Step ",
5332
+ /* @__PURE__ */ jsx20("span", { className: "fc:text-red-500", children: "*" })
5333
+ ] }),
5334
+ /* @__PURE__ */ jsxs19("div", { className: "fc:relative", children: [
5335
+ /* @__PURE__ */ jsxs19(
5336
+ "select",
5337
+ {
5338
+ value: formData.toStep,
5339
+ onChange: (e) => handleChange("toStep", e.target.value),
5340
+ disabled: loadingWorkflowSteps,
5341
+ className: inputCls(errors.toStep),
5342
+ style: inputStyle(errors.toStep),
5343
+ children: [
5344
+ /* @__PURE__ */ jsx20("option", { value: "", children: loadingWorkflowSteps ? "Loading steps..." : !formData.workflow ? "Select Workflow first" : filteredSteps.length === 0 ? "No steps found for this workflow" : "Select To Step" }),
5345
+ formData.toStep && !filteredSteps.some(
5346
+ (s) => {
5347
+ var _a2, _b2;
5348
+ return String((_b2 = (_a2 = s.workflowStepId) != null ? _a2 : s.WorkflowStepId) != null ? _b2 : s.id) === String(formData.toStep);
5349
+ }
5350
+ ) && /* @__PURE__ */ jsx20("option", { value: formData.toStep, children: (_K = (_J = editData == null ? void 0 : editData.toStepName) != null ? _J : editData == null ? void 0 : editData.ToStepName) != null ? _K : `Step ${formData.toStep}` }),
5351
+ filteredSteps.map((step) => {
5352
+ var _a2, _b2, _c2, _d2, _e2;
5353
+ const id = (_b2 = (_a2 = step.workflowStepId) != null ? _a2 : step.WorkflowStepId) != null ? _b2 : step.id;
5354
+ const name = (_d2 = (_c2 = step.stepName) != null ? _c2 : step.StepName) != null ? _d2 : `Step ${id}`;
5355
+ const code = (_e2 = step.stepCode) != null ? _e2 : step.StepCode;
5356
+ return /* @__PURE__ */ jsxs19("option", { value: String(id), children: [
5357
+ name,
5358
+ " ",
5359
+ code ? `(${code})` : ""
5360
+ ] }, id);
5361
+ })
5362
+ ]
5363
+ }
5364
+ ),
5365
+ /* @__PURE__ */ jsx20("svg", { className: "fc:w-4 fc:h-4 fc:text-slate-400 fc:absolute fc:left-3 fc:top-3 pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 9l3 3m0 0l-3 3m3-3H8m13 0a9 9 0 11-18 0 9 9 0 0118 0z" }) })
5366
+ ] }),
5367
+ workflowStepFetchError && /* @__PURE__ */ jsx20("p", { className: "fc:text-amber-600 fc:text-[11px] fc:mt-1 fc:font-medium", children: workflowStepFetchError }),
5368
+ errors.toStep && /* @__PURE__ */ jsx20("p", { className: "fc:text-red-500 fc:text-[11px] fc:mt-1 fc:font-medium", children: errors.toStep })
5369
+ ] }) }),
5370
+ /* @__PURE__ */ jsxs19("div", { style: { minWidth: 0 }, children: [
5371
+ /* @__PURE__ */ jsxs19("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
5372
+ "Action Name ",
5373
+ /* @__PURE__ */ jsx20("span", { className: "fc:text-red-500", children: "*" })
5374
+ ] }),
5375
+ /* @__PURE__ */ jsxs19("div", { className: "fc:relative", children: [
5376
+ /* @__PURE__ */ jsxs19(
5377
+ "select",
5378
+ {
5379
+ value: formData.actionCode,
5380
+ onChange: (event) => {
5381
+ const selectedAction = availableActions.find(
5382
+ (action) => action.name === event.target.value
5383
+ );
5384
+ setFormData((current) => {
5385
+ var _a2, _b2;
5386
+ return __spreadProps(__spreadValues({}, current), {
5387
+ actionCode: (_a2 = selectedAction == null ? void 0 : selectedAction.name) != null ? _a2 : "",
5388
+ actionName: (_b2 = selectedAction == null ? void 0 : selectedAction.name) != null ? _b2 : ""
5389
+ });
5390
+ });
5391
+ if (errors.actionCode || errors.actionName) {
5392
+ setErrors((current) => __spreadProps(__spreadValues({}, current), {
5393
+ actionCode: "",
5394
+ actionName: ""
5395
+ }));
5396
+ }
5397
+ },
5398
+ disabled: loadingActions || !formData.fromStep || availableActions.length === 0,
5399
+ className: inputCls(errors.actionCode || errors.actionName),
5400
+ style: inputStyle(errors.actionCode || errors.actionName),
5401
+ children: [
5402
+ /* @__PURE__ */ jsx20("option", { value: "", children: loadingActions ? "Loading actions..." : !formData.fromStep ? "Select From Step first" : availableActions.length === 0 ? "No actions available" : "Select Action" }),
5403
+ formData.actionCode && !availableActions.some(
5404
+ (action) => action.name === formData.actionCode
5405
+ ) && /* @__PURE__ */ jsx20("option", { value: formData.actionCode, children: formData.actionName || formData.actionCode }),
5406
+ availableActions.map((action) => /* @__PURE__ */ jsx20("option", { value: action.name, children: action.name }, action.name))
5407
+ ]
5408
+ }
5409
+ ),
5410
+ /* @__PURE__ */ jsx20("svg", { className: "fc:w-4 fc:h-4 fc:text-slate-400 fc:absolute fc:left-3 fc:top-3 pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M7 7h10M7 12h10M7 17h5" }) })
5411
+ ] }),
5412
+ errors.actionName && /* @__PURE__ */ jsx20("p", { className: "fc:text-red-500 fc:text-[11px] fc:mt-1 fc:font-medium", children: errors.actionName }),
5413
+ actionFetchError && /* @__PURE__ */ jsx20("p", { className: "fc:text-amber-600 fc:text-[11px] fc:mt-1 fc:font-medium", children: actionFetchError })
5414
+ ] })
5415
+ ]
5103
5416
  }
5104
- ) && /* @__PURE__ */ jsx20("option", { value: formData.workflowTypeId, children: (_z = (_y = editData == null ? void 0 : editData.workflowTypeName) != null ? _y : editData == null ? void 0 : editData.WorkflowTypeName) != null ? _z : `Type ${formData.workflowTypeId}` }),
5105
- workflowTypes.map((type) => {
5106
- var _a2, _b2, _c2, _d2, _e2, _f2;
5107
- const id = (_b2 = (_a2 = type.workflowTypeId) != null ? _a2 : type.WorkflowTypeId) != null ? _b2 : type.id;
5108
- const label = (_f2 = (_e2 = (_d2 = (_c2 = type.workflowTypeName) != null ? _c2 : type.WorkflowTypeName) != null ? _d2 : type.name) != null ? _e2 : type.typeName) != null ? _f2 : `Type ${id}`;
5109
- return /* @__PURE__ */ jsx20("option", { value: String(id), children: label }, id);
5110
- })
5417
+ )
5111
5418
  ]
5112
5419
  }
5113
5420
  ),
5114
- /* @__PURE__ */ jsx20("svg", { className: "fc:w-4 fc:h-4 fc:text-slate-400 fc:absolute fc:left-3 fc:top-3 pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" }) })
5115
- ] }),
5116
- workflowTypeFetchError && /* @__PURE__ */ jsx20("p", { className: "fc:text-amber-600 fc:text-[11px] fc:mt-1 fc:font-medium", children: workflowTypeFetchError }),
5117
- errors.workflowTypeId && /* @__PURE__ */ jsx20("p", { className: "fc:text-red-500 fc:text-[11px] fc:mt-1 fc:font-medium", children: errors.workflowTypeId })
5118
- ] }),
5119
- /* @__PURE__ */ jsxs19("div", { children: [
5120
- /* @__PURE__ */ jsxs19("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
5121
- "Workflow ",
5122
- /* @__PURE__ */ jsx20("span", { className: "fc:text-red-500", children: "*" })
5123
- ] }),
5124
- /* @__PURE__ */ jsxs19("div", { className: "fc:relative", children: [
5125
5421
  /* @__PURE__ */ jsxs19(
5126
- "select",
5422
+ "div",
5127
5423
  {
5128
- value: formData.workflow,
5129
- onChange: (e) => handleChange("workflow", e.target.value),
5130
- disabled: loadingWorkflows,
5131
- className: inputCls(errors.workflow),
5424
+ className: "fc:bg-white fc:rounded-2xl fc:border fc:border-slate-200/70",
5425
+ style: { display: "flex", flexDirection: "column", gap: 12, padding: 16, borderRadius: 14 },
5132
5426
  children: [
5133
- /* @__PURE__ */ jsx20("option", { value: "", children: loadingWorkflows ? "Loading workflows..." : !formData.workflowTypeId ? "Select Workflow Type first" : filteredWorkflows.length === 0 ? "No workflows found for this type" : "Select Workflow" }),
5134
- formData.workflow && !filteredWorkflows.some(
5135
- (w) => {
5136
- var _a2, _b2;
5137
- return String((_b2 = (_a2 = w.workflowId) != null ? _a2 : w.WorkflowId) != null ? _b2 : w.id) === String(formData.workflow);
5138
- }
5139
- ) && /* @__PURE__ */ jsx20("option", { value: formData.workflow, children: (_B = (_A = editData == null ? void 0 : editData.workflowName) != null ? _A : editData == null ? void 0 : editData.WorkflowName) != null ? _B : `Workflow ${formData.workflow}` }),
5140
- filteredWorkflows.map((workflow) => {
5141
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
5142
- const id = (_b2 = (_a2 = workflow.workflowId) != null ? _a2 : workflow.WorkflowId) != null ? _b2 : workflow.id;
5143
- const name = (_h2 = (_g2 = (_f2 = (_e2 = (_d2 = (_c2 = workflow.workflowName) != null ? _c2 : workflow.WorkflowName) != null ? _d2 : workflow.name) != null ? _e2 : workflow.Name) != null ? _f2 : workflow.workflowCode) != null ? _g2 : workflow.WorkflowCode) != null ? _h2 : `Workflow ${id}`;
5144
- return /* @__PURE__ */ jsx20("option", { value: String(id), children: name }, id);
5145
- })
5427
+ /* @__PURE__ */ jsx20("div", { className: "fc:flex fc:items-center fc:gap-2.5 fc:text-indigo-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-100 fc:pb-3", children: /* @__PURE__ */ jsx20("span", { children: "Status & Settings" }) }),
5428
+ /* @__PURE__ */ jsxs19("div", { className: "fc:grid fc:grid-cols-2 fc:gap-3", children: [
5429
+ /* @__PURE__ */ jsxs19(
5430
+ "label",
5431
+ {
5432
+ className: "fc:text-xs fc:font-semibold fc:text-slate-700",
5433
+ style: { display: "flex", minHeight: 42, alignItems: "center", gap: 9, padding: "0 11px", border: "1px solid #cbd5e1", borderRadius: 10, background: "#f8fafc", cursor: "pointer" },
5434
+ children: [
5435
+ /* @__PURE__ */ jsx20(
5436
+ "input",
5437
+ {
5438
+ type: "checkbox",
5439
+ checked: formData.isDefault,
5440
+ onChange: (event) => handleChange("isDefault", event.target.checked),
5441
+ style: { width: 16, height: 16, margin: 0, accentColor: "#4f46e5" }
5442
+ }
5443
+ ),
5444
+ "Is Default"
5445
+ ]
5446
+ }
5447
+ ),
5448
+ /* @__PURE__ */ jsxs19(
5449
+ "label",
5450
+ {
5451
+ className: "fc:text-xs fc:font-semibold fc:text-slate-700",
5452
+ style: { display: "flex", minHeight: 42, alignItems: "center", gap: 9, padding: "0 11px", border: "1px solid #cbd5e1", borderRadius: 10, background: "#f8fafc", cursor: "pointer" },
5453
+ children: [
5454
+ /* @__PURE__ */ jsx20(
5455
+ "input",
5456
+ {
5457
+ type: "checkbox",
5458
+ checked: formData.requireComment,
5459
+ onChange: (event) => handleChange("requireComment", event.target.checked),
5460
+ style: { width: 16, height: 16, margin: 0, accentColor: "#4f46e5" }
5461
+ }
5462
+ ),
5463
+ "Require Comment"
5464
+ ]
5465
+ }
5466
+ ),
5467
+ /* @__PURE__ */ jsxs19("div", { children: [
5468
+ /* @__PURE__ */ jsx20("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: "Status" }),
5469
+ /* @__PURE__ */ jsxs19(
5470
+ "select",
5471
+ {
5472
+ value: formData.status,
5473
+ onChange: (event) => handleChange("status", event.target.value),
5474
+ className: inputCls(false),
5475
+ style: __spreadProps(__spreadValues({}, inputStyle(false)), { padding: "0 12px" }),
5476
+ children: [
5477
+ /* @__PURE__ */ jsx20("option", { value: "active", children: "Active" }),
5478
+ /* @__PURE__ */ jsx20("option", { value: "inactive", children: "Inactive" })
5479
+ ]
5480
+ }
5481
+ )
5482
+ ] })
5483
+ ] })
5146
5484
  ]
5147
5485
  }
5148
- ),
5149
- /* @__PURE__ */ jsx20("svg", { className: "fc:w-4 fc:h-4 fc:text-slate-400 fc:absolute fc:left-3 fc:top-3 pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) })
5150
- ] }),
5151
- workflowFetchError && /* @__PURE__ */ jsx20("p", { className: "fc:text-amber-600 fc:text-[11px] fc:mt-1 fc:font-medium", children: workflowFetchError }),
5152
- errors.workflow && /* @__PURE__ */ jsx20("p", { className: "fc:text-red-500 fc:text-[11px] fc:mt-1 fc:font-medium", children: errors.workflow })
5153
- ] })
5154
- ] }),
5155
- /* @__PURE__ */ jsxs19("div", { className: "fc:grid fc:grid-cols-2 md:fc:grid-cols-2 fc:gap-5", children: [
5156
- /* @__PURE__ */ jsxs19("div", { children: [
5157
- /* @__PURE__ */ jsxs19("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
5158
- "From Step ",
5159
- /* @__PURE__ */ jsx20("span", { className: "fc:text-red-500", children: "*" })
5160
- ] }),
5161
- /* @__PURE__ */ jsxs19("div", { className: "fc:relative", children: [
5486
+ )
5487
+ ]
5488
+ }
5489
+ ),
5490
+ /* @__PURE__ */ jsxs19(
5491
+ "div",
5492
+ {
5493
+ className: "fc:bg-white fc:border-t fc:border-slate-100 fc:flex fc:items-center fc:justify-end fc:gap-3 fc:px-8",
5494
+ style: { flexShrink: 0, padding: "10px 20px" },
5495
+ children: [
5162
5496
  /* @__PURE__ */ jsxs19(
5163
- "select",
5497
+ "button",
5164
5498
  {
5165
- value: formData.fromStep,
5166
- onChange: (e) => handleChange("fromStep", e.target.value),
5167
- disabled: loadingWorkflowSteps,
5168
- className: inputCls(errors.fromStep),
5499
+ type: "button",
5500
+ onClick: onClose,
5501
+ className: "fc:px-6 fc:py-2.5 fc:border fc:border-slate-200 fc:text-slate-600 fc:text-xs fc:font-bold fc:rounded-xl hover:fc:bg-slate-50 active:fc:scale-95 fc:transition-all fc:duration-200 fc:flex fc:items-center fc:gap-2",
5169
5502
  children: [
5170
- /* @__PURE__ */ jsx20("option", { value: "", children: loadingWorkflowSteps ? "Loading steps..." : !formData.workflow ? "Select Workflow first" : filteredSteps.length === 0 ? "No steps found for this workflow" : "Select From Step" }),
5171
- formData.fromStep && !filteredSteps.some(
5172
- (s) => {
5173
- var _a2, _b2;
5174
- return String((_b2 = (_a2 = s.workflowStepId) != null ? _a2 : s.WorkflowStepId) != null ? _b2 : s.id) === String(formData.fromStep);
5175
- }
5176
- ) && /* @__PURE__ */ jsx20("option", { value: formData.fromStep, children: (_D = (_C = editData == null ? void 0 : editData.fromStepName) != null ? _C : editData == null ? void 0 : editData.FromStepName) != null ? _D : `Step ${formData.fromStep}` }),
5177
- filteredSteps.map((step) => {
5178
- var _a2, _b2, _c2, _d2, _e2;
5179
- const id = (_b2 = (_a2 = step.workflowStepId) != null ? _a2 : step.WorkflowStepId) != null ? _b2 : step.id;
5180
- const name = (_d2 = (_c2 = step.stepName) != null ? _c2 : step.StepName) != null ? _d2 : `Step ${id}`;
5181
- const code = (_e2 = step.stepCode) != null ? _e2 : step.StepCode;
5182
- return /* @__PURE__ */ jsxs19("option", { value: String(id), children: [
5183
- name,
5184
- " ",
5185
- code ? `(${code})` : ""
5186
- ] }, id);
5187
- })
5503
+ /* @__PURE__ */ jsx20("svg", { className: "fc:w-3.5 fc:h-3.5", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }),
5504
+ "Cancel"
5188
5505
  ]
5189
5506
  }
5190
5507
  ),
5191
- /* @__PURE__ */ jsx20("svg", { className: "fc:w-4 fc:h-4 fc:text-slate-400 fc:absolute fc:left-3 fc:top-3 pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 15l-3-3m0 0l3-3m-3 3h8M3 12a9 9 0 1118 0 9 9 0 01-18 0z" }) })
5192
- ] }),
5193
- workflowStepFetchError && /* @__PURE__ */ jsx20("p", { className: "fc:text-amber-600 fc:text-[11px] fc:mt-1 fc:font-medium", children: workflowStepFetchError }),
5194
- errors.fromStep && /* @__PURE__ */ jsx20("p", { className: "fc:text-red-500 fc:text-[11px] fc:mt-1 fc:font-medium", children: errors.fromStep })
5195
- ] }),
5196
- /* @__PURE__ */ jsxs19("div", { children: [
5197
- /* @__PURE__ */ jsxs19("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
5198
- "To Step ",
5199
- /* @__PURE__ */ jsx20("span", { className: "fc:text-red-500", children: "*" })
5200
- ] }),
5201
- /* @__PURE__ */ jsxs19("div", { className: "fc:relative", children: [
5202
5508
  /* @__PURE__ */ jsxs19(
5203
- "select",
5509
+ "button",
5204
5510
  {
5205
- value: formData.toStep,
5206
- onChange: (e) => handleChange("toStep", e.target.value),
5207
- disabled: loadingWorkflowSteps,
5208
- className: inputCls(errors.toStep),
5511
+ type: "submit",
5512
+ disabled: isSubmitting,
5513
+ className: "fc:group fc:relative fc:px-6 fc:py-2.5 fc:bg-indigo-600 hover:fc:bg-indigo-700 active:fc:scale-95 fc:text-white fc:text-xs fc:font-bold fc:rounded-xl fc:transition-all fc:duration-200 fc:flex fc:items-center fc:gap-2 disabled:fc:opacity-60 disabled:fc:cursor-not-allowed",
5209
5514
  children: [
5210
- /* @__PURE__ */ jsx20("option", { value: "", children: loadingWorkflowSteps ? "Loading steps..." : !formData.workflow ? "Select Workflow first" : filteredSteps.length === 0 ? "No steps found for this workflow" : "Select To Step" }),
5211
- formData.toStep && !filteredSteps.some(
5212
- (s) => {
5213
- var _a2, _b2;
5214
- return String((_b2 = (_a2 = s.workflowStepId) != null ? _a2 : s.WorkflowStepId) != null ? _b2 : s.id) === String(formData.toStep);
5215
- }
5216
- ) && /* @__PURE__ */ jsx20("option", { value: formData.toStep, children: (_F = (_E = editData == null ? void 0 : editData.toStepName) != null ? _E : editData == null ? void 0 : editData.ToStepName) != null ? _F : `Step ${formData.toStep}` }),
5217
- filteredSteps.map((step) => {
5218
- var _a2, _b2, _c2, _d2, _e2;
5219
- const id = (_b2 = (_a2 = step.workflowStepId) != null ? _a2 : step.WorkflowStepId) != null ? _b2 : step.id;
5220
- const name = (_d2 = (_c2 = step.stepName) != null ? _c2 : step.StepName) != null ? _d2 : `Step ${id}`;
5221
- const code = (_e2 = step.stepCode) != null ? _e2 : step.StepCode;
5222
- return /* @__PURE__ */ jsxs19("option", { value: String(id), children: [
5223
- name,
5224
- " ",
5225
- code ? `(${code})` : ""
5226
- ] }, id);
5227
- })
5515
+ /* @__PURE__ */ jsx20("svg", { className: "fc:w-3.5 fc:h-3.5 fc:transition-transform fc:duration-200 group-hover:fc:scale-110", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4" }) }),
5516
+ isSubmitting ? "Saving..." : editData ? "Update Transition" : "Save Transition"
5228
5517
  ]
5229
5518
  }
5230
- ),
5231
- /* @__PURE__ */ jsx20("svg", { className: "fc:w-4 fc:h-4 fc:text-slate-400 fc:absolute fc:left-3 fc:top-3 pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 9l3 3m0 0l-3 3m3-3H8m13 0a9 9 0 11-18 0 9 9 0 0118 0z" }) })
5232
- ] }),
5233
- workflowStepFetchError && /* @__PURE__ */ jsx20("p", { className: "fc:text-amber-600 fc:text-[11px] fc:mt-1 fc:font-medium", children: workflowStepFetchError }),
5234
- errors.toStep && /* @__PURE__ */ jsx20("p", { className: "fc:text-red-500 fc:text-[11px] fc:mt-1 fc:font-medium", children: errors.toStep })
5235
- ] })
5236
- ] }),
5237
- /* @__PURE__ */ jsxs19("div", { className: "fc:grid fc:grid-cols-3 md:fc:grid-cols-3 fc:gap-5", children: [
5238
- /* @__PURE__ */ jsxs19("div", { children: [
5239
- /* @__PURE__ */ jsxs19("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
5240
- "Action Code ",
5241
- /* @__PURE__ */ jsx20("span", { className: "fc:text-red-500", children: "*" })
5242
- ] }),
5243
- /* @__PURE__ */ jsxs19("div", { className: "fc:relative", children: [
5244
- /* @__PURE__ */ jsx20(
5245
- "input",
5246
- {
5247
- type: "text",
5248
- placeholder: "Enter Action Code",
5249
- value: formData.actionCode,
5250
- onChange: (e) => handleChange("actionCode", e.target.value),
5251
- className: `${inputCls(errors.actionCode)} uppercase`
5252
- }
5253
- ),
5254
- /* @__PURE__ */ jsx20("svg", { className: "fc:w-4 fc:h-4 fc:text-slate-400 fc:absolute fc:left-3 fc:top-3 pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" }) })
5255
- ] }),
5256
- errors.actionCode && /* @__PURE__ */ jsx20("p", { className: "fc:text-red-500 fc:text-[11px] fc:mt-1 fc:font-medium", children: errors.actionCode })
5257
- ] }),
5258
- /* @__PURE__ */ jsxs19("div", { children: [
5259
- /* @__PURE__ */ jsxs19("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
5260
- "Action Name ",
5261
- /* @__PURE__ */ jsx20("span", { className: "fc:text-red-500", children: "*" })
5262
- ] }),
5263
- /* @__PURE__ */ jsxs19("div", { className: "fc:relative", children: [
5264
- /* @__PURE__ */ jsx20(
5265
- "input",
5266
- {
5267
- type: "text",
5268
- placeholder: "Enter Action Name",
5269
- value: formData.actionName,
5270
- onChange: (e) => handleChange("actionName", e.target.value),
5271
- className: inputCls(errors.actionName)
5272
- }
5273
- ),
5274
- /* @__PURE__ */ jsx20("svg", { className: "fc:w-4 fc:h-4 fc:text-slate-400 fc:absolute fc:left-3 fc:top-3 pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M7 7h10M7 12h10M7 17h5" }) })
5275
- ] }),
5276
- errors.actionName && /* @__PURE__ */ jsx20("p", { className: "fc:text-red-500 fc:text-[11px] fc:mt-1 fc:font-medium", children: errors.actionName })
5277
- ] }),
5278
- /* @__PURE__ */ jsxs19("div", { children: [
5279
- /* @__PURE__ */ jsxs19("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
5280
- "Sequence No ",
5281
- /* @__PURE__ */ jsx20("span", { className: "fc:text-red-500", children: "*" })
5282
- ] }),
5283
- /* @__PURE__ */ jsxs19("div", { className: "fc:relative", children: [
5284
- /* @__PURE__ */ jsx20(
5285
- "input",
5286
- {
5287
- type: "number",
5288
- min: "1",
5289
- placeholder: "Enter Sequence No",
5290
- value: formData.sequenceNo,
5291
- onChange: (e) => handleChange("sequenceNo", e.target.value),
5292
- className: inputCls(errors.sequenceNo)
5293
- }
5294
- ),
5295
- /* @__PURE__ */ jsx20("svg", { className: "fc:w-4 fc:h-4 fc:text-slate-400 fc:absolute fc:left-3 fc:top-3 pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M7 20l4-16m2 16l4-16M6 9h14M4 15h14" }) })
5296
- ] }),
5297
- errors.sequenceNo && /* @__PURE__ */ jsx20("p", { className: "fc:text-red-500 fc:text-[11px] fc:mt-1 fc:font-medium", children: errors.sequenceNo })
5298
- ] })
5299
- ] })
5300
- ] }),
5301
- /* @__PURE__ */ jsxs19("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-200/70 fc:transition-shadow fc:duration-300 fc:space-y-5", children: [
5302
- /* @__PURE__ */ jsxs19("div", { className: "fc:flex fc:items-center fc:gap-2.5 fc:text-indigo-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-100 fc:pb-3", children: [
5303
- /* @__PURE__ */ jsx20("div", { className: "fc:p-1.5 fc:bg-indigo-50 fc:rounded-lg", children: /* @__PURE__ */ jsxs19("svg", { className: "fc:w-4 fc:h-4", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: [
5304
- /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }),
5305
- /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" })
5306
- ] }) }),
5307
- /* @__PURE__ */ jsx20("span", { children: "Status & Settings" })
5308
- ] }),
5309
- /* @__PURE__ */ jsxs19("div", { className: "fc:grid fc:grid-cols-2 md:fc:grid-cols-2 fc:gap-5", children: [
5310
- /* @__PURE__ */ jsxs19(
5311
- "div",
5312
- {
5313
- onClick: () => handleChange("isDefault", !formData.isDefault),
5314
- className: `fc:flex fc:items-center fc:justify-between fc:p-4 fc:rounded-2xl fc:border fc:cursor-pointer fc:transition-all fc:duration-200 fc:select-none hover:fc:shadow-sm active:fc:scale-[0.99] ${formData.isDefault ? "fc:border-indigo-500 fc:bg-indigo-50/40 " : "fc:border-slate-200/80 fc:bg-slate-50/50 hover:fc:bg-slate-100/50"}`,
5315
- children: [
5316
- /* @__PURE__ */ jsxs19("div", { className: "fc:flex fc:items-center fc:gap-3", children: [
5317
- /* @__PURE__ */ jsx20("div", { className: `fc:w-8 fc:h-8 fc:rounded-xl fc:flex fc:items-center fc:justify-center fc:transition-all fc:duration-200 ${formData.isDefault ? "fc:bg-indigo-600 fc:text-white fc:shadow-indigo-500/20" : "fc:bg-indigo-50 fc:text-indigo-600"}`, children: /* @__PURE__ */ jsx20("svg", { className: "fc:w-4 fc:h-4", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z" }) }) }),
5318
- /* @__PURE__ */ jsxs19("div", { children: [
5319
- /* @__PURE__ */ jsx20("p", { className: "fc:text-xs fc:font-bold fc:text-slate-700", children: "Is Default" }),
5320
- /* @__PURE__ */ jsx20("p", { className: "fc:text-[10px] fc:text-slate-400", children: "Set this action as default transition" })
5321
- ] })
5322
- ] }),
5323
- /* @__PURE__ */ jsx20(
5324
- "div",
5325
- {
5326
- className: `fc:w-11 fc:h-6 fc:rounded-full fc:p-1 fc:transition-colors fc:duration-300 fc:ease-in-out ${formData.isDefault ? "fc:bg-indigo-600" : "fc:bg-slate-300"}`,
5327
- children: /* @__PURE__ */ jsx20(
5328
- "div",
5329
- {
5330
- className: `fc:w-4 fc:h-4 fc:rounded-full fc:bg-white fc:transform fc:transition-transform fc:duration-300 fc:ease-in-out ${formData.isDefault ? "fc:translate-x-5" : "fc:translate-x-0"}`
5331
- }
5332
- )
5333
- }
5334
- )
5335
- ]
5336
- }
5337
- ),
5338
- /* @__PURE__ */ jsxs19(
5339
- "div",
5340
- {
5341
- onClick: () => handleChange("requireComment", !formData.requireComment),
5342
- className: `fc:flex fc:items-center fc:justify-between fc:p-4 fc:rounded-2xl fc:border fc:cursor-pointer fc:transition-all fc:duration-200 fc:select-none hover:fc:shadow-sm active:fc:scale-[0.99] ${formData.requireComment ? "fc:border-indigo-500 fc:bg-indigo-50/40 " : "fc:border-slate-200/80 fc:bg-slate-50/50 hover:fc:bg-slate-100/50"}`,
5343
- children: [
5344
- /* @__PURE__ */ jsxs19("div", { className: "fc:flex fc:items-center fc:gap-3", children: [
5345
- /* @__PURE__ */ jsx20("div", { className: `fc:w-8 fc:h-8 fc:rounded-xl fc:flex fc:items-center fc:justify-center fc:transition-all fc:duration-200 ${formData.requireComment ? "fc:bg-indigo-600 fc:text-white fc:shadow-indigo-500/20" : "fc:bg-indigo-50 fc:text-indigo-600"}`, children: /* @__PURE__ */ jsx20("svg", { className: "fc:w-4 fc:h-4", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }),
5346
- /* @__PURE__ */ jsxs19("div", { children: [
5347
- /* @__PURE__ */ jsx20("p", { className: "fc:text-xs fc:font-bold fc:text-slate-700", children: "Require Comment" }),
5348
- /* @__PURE__ */ jsx20("p", { className: "fc:text-[10px] fc:text-slate-400", children: "Mandatory user remarks on transition" })
5349
- ] })
5350
- ] }),
5351
- /* @__PURE__ */ jsx20(
5352
- "div",
5353
- {
5354
- className: `fc:w-11 fc:h-6 fc:rounded-full fc:p-1 fc:transition-colors fc:duration-300 fc:ease-in-out ${formData.requireComment ? "fc:bg-indigo-600" : "fc:bg-slate-300"}`,
5355
- children: /* @__PURE__ */ jsx20(
5356
- "div",
5357
- {
5358
- className: `fc:w-4 fc:h-4 fc:rounded-full fc:bg-white fc:transform fc:transition-transform fc:duration-300 fc:ease-in-out ${formData.requireComment ? "fc:translate-x-5" : "fc:translate-x-0"}`
5359
- }
5360
- )
5361
- }
5362
- )
5363
- ]
5364
- }
5365
- )
5366
- ] }),
5367
- /* @__PURE__ */ jsxs19("div", { children: [
5368
- /* @__PURE__ */ jsx20("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-2.5", children: "Status" }),
5369
- /* @__PURE__ */ jsxs19("div", { className: "fc:grid fc:grid-cols-2 fc:gap-4", children: [
5370
- /* @__PURE__ */ jsxs19(
5371
- "div",
5372
- {
5373
- onClick: () => handleChange("status", "active"),
5374
- className: `fc:flex fc:items-center fc:justify-between fc:p-3.5 fc:rounded-xl fc:border fc:cursor-pointer fc:transition-all fc:duration-200 active:fc:scale-[0.99] ${formData.status === "active" ? "fc:border-emerald-500 fc:bg-emerald-50/30 fc:ring-2 fc:ring-emerald-500/10 " : "fc:border-slate-200 fc:bg-white hover:fc:bg-slate-50"}`,
5375
- children: [
5376
- /* @__PURE__ */ jsxs19("div", { className: "fc:flex fc:items-center fc:gap-2.5", children: [
5377
- /* @__PURE__ */ jsxs19("span", { className: "fc:relative fc:flex fc:h-2.5 fc:w-2.5", children: [
5378
- formData.status === "active" && /* @__PURE__ */ jsx20("span", { className: "fc:animate-ping fc:absolute fc:inline-flex fc:h-full fc:w-full fc:rounded-full fc:bg-emerald-400 fc:opacity-75" }),
5379
- /* @__PURE__ */ jsx20("span", { className: "fc:relative fc:inline-flex fc:rounded-full fc:h-2.5 fc:w-2.5 fc:bg-emerald-500" })
5380
- ] }),
5381
- /* @__PURE__ */ jsxs19("div", { children: [
5382
- /* @__PURE__ */ jsx20("p", { className: "fc:text-xs fc:font-bold fc:text-slate-800", children: "Active" }),
5383
- /* @__PURE__ */ jsx20("p", { className: "fc:text-[10px] fc:text-slate-400", children: "Ready to execute in workflows" })
5384
- ] })
5385
- ] }),
5386
- /* @__PURE__ */ jsx20(
5387
- "div",
5388
- {
5389
- className: `fc:w-4 fc:h-4 fc:rounded-full fc:border fc:flex fc:items-center fc:justify-center fc:transition-all fc:duration-200 ${formData.status === "active" ? "fc:border-emerald-500 fc:bg-emerald-500 fc:scale-110" : "fc:border-slate-300"}`,
5390
- children: formData.status === "active" && /* @__PURE__ */ jsx20("svg", { className: "fc:w-2.5 fc:h-2.5 fc:text-white", fill: "none", stroke: "currentColor", strokeWidth: "3", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) })
5391
- }
5392
- )
5393
- ]
5394
- }
5395
- ),
5396
- /* @__PURE__ */ jsxs19(
5397
- "div",
5398
- {
5399
- onClick: () => handleChange("status", "inactive"),
5400
- className: `fc:flex fc:items-center fc:justify-between fc:p-3.5 fc:rounded-xl fc:border fc:cursor-pointer fc:transition-all fc:duration-200 active:fc:scale-[0.99] ${formData.status === "inactive" ? "fc:border-slate-400 fc:bg-slate-100/60 fc:ring-2 fc:ring-slate-400/10 " : "fc:border-slate-200 fc:bg-white hover:fc:bg-slate-50"}`,
5401
- children: [
5402
- /* @__PURE__ */ jsxs19("div", { className: "fc:flex fc:items-center fc:gap-2.5", children: [
5403
- /* @__PURE__ */ jsx20("span", { className: "fc:w-2.5 fc:h-2.5 fc:rounded-full fc:bg-slate-400" }),
5404
- /* @__PURE__ */ jsxs19("div", { children: [
5405
- /* @__PURE__ */ jsx20("p", { className: "fc:text-xs fc:font-bold fc:text-slate-800", children: "Inactive" }),
5406
- /* @__PURE__ */ jsx20("p", { className: "fc:text-[10px] fc:text-slate-400", children: "Disabled for processing" })
5407
- ] })
5408
- ] }),
5409
- /* @__PURE__ */ jsx20(
5410
- "div",
5411
- {
5412
- className: `fc:w-4 fc:h-4 fc:rounded-full fc:border fc:flex fc:items-center fc:justify-center fc:transition-all fc:duration-200 ${formData.status === "inactive" ? "fc:border-slate-500 fc:bg-slate-500 fc:scale-110" : "fc:border-slate-300"}`,
5413
- children: formData.status === "inactive" && /* @__PURE__ */ jsx20("svg", { className: "fc:w-2.5 fc:h-2.5 fc:text-white", fill: "none", stroke: "currentColor", strokeWidth: "3", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) })
5414
- }
5415
- )
5416
- ]
5417
- }
5418
- )
5419
- ] })
5420
- ] })
5519
+ )
5520
+ ]
5521
+ }
5522
+ )
5421
5523
  ] })
5422
- ] }),
5423
- /* @__PURE__ */ jsxs19("div", { className: "fc:p-5 fc:bg-white fc:border-t fc:border-slate-100 fc:flex fc:items-center fc:justify-end fc:gap-3 fc:px-8", children: [
5424
- /* @__PURE__ */ jsxs19(
5425
- "button",
5426
- {
5427
- type: "button",
5428
- onClick: onClose,
5429
- className: "fc:px-6 fc:py-2.5 fc:border fc:border-slate-200 fc:text-slate-600 fc:text-xs fc:font-bold fc:rounded-xl hover:fc:bg-slate-50 active:fc:scale-95 fc:transition-all fc:duration-200 fc:flex fc:items-center fc:gap-2",
5430
- children: [
5431
- /* @__PURE__ */ jsx20("svg", { className: "fc:w-3.5 fc:h-3.5", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }),
5432
- "Cancel"
5433
- ]
5434
- }
5435
- ),
5436
- /* @__PURE__ */ jsxs19(
5437
- "button",
5438
- {
5439
- type: "submit",
5440
- disabled: isSubmitting,
5441
- className: "fc:group fc:relative fc:px-6 fc:py-2.5 fc:bg-indigo-600 hover:fc:bg-indigo-700 active:fc:scale-95 fc:text-white fc:text-xs fc:font-bold fc:rounded-xl fc:transition-all fc:duration-200 fc:flex fc:items-center fc:gap-2 disabled:fc:opacity-60 disabled:fc:cursor-not-allowed",
5442
- children: [
5443
- /* @__PURE__ */ jsx20("svg", { className: "fc:w-3.5 fc:h-3.5 fc:transition-transform fc:duration-200 group-hover:fc:scale-110", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4" }) }),
5444
- isSubmitting ? "Saving..." : editData ? "Update Transition" : "Save Transition"
5445
- ]
5446
- }
5447
- )
5448
- ] })
5449
- ] })
5450
- ] })
5524
+ ]
5525
+ }
5526
+ )
5451
5527
  ] });
5452
5528
  }
5453
5529
 
5454
5530
  // src/components/WorkFlowTransition/Transitiontable.js
5455
- import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
5531
+ import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
5456
5532
  var PATHS = {
5457
5533
  create: "/api/flowcore/WorkflowTransition/Create",
5458
5534
  update: "/api/flowcore/WorkflowTransition/Update",
5459
5535
  getById: "/api/flowcore/WorkflowTransition/GetById",
5460
- getList: "/api/flowcore/WorkflowTransition/GetList"
5536
+ getList: "/api/flowcore/WorkflowTransition/GetList",
5537
+ delete: "/api/flowcore/WorkflowTransition/Delete"
5461
5538
  };
5462
5539
  var getRows = (response) => {
5463
5540
  var _a, _b, _c, _d, _e, _f, _g;
@@ -5479,16 +5556,22 @@ var getByIdUrl = (id) => {
5479
5556
  return typeof endpoint2 === "function" ? endpoint2(id) : `${endpoint2}/${id}`;
5480
5557
  };
5481
5558
  var normalise = (item) => {
5482
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
5559
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M;
5483
5560
  return __spreadProps(__spreadValues({}, item), {
5484
5561
  transitionId: (_b = (_a = item.transitionId) != null ? _a : item.TransitionId) != null ? _b : item.id,
5485
5562
  workflowTypeId: (_f = (_e = (_c = item.workflowTypeId) != null ? _c : item.WorkflowTypeId) != null ? _e : (_d = item.workflowType) == null ? void 0 : _d.workflowTypeId) != null ? _f : "",
5486
5563
  workflowId: (_h = (_g = item.workflowId) != null ? _g : item.WorkflowId) != null ? _h : "",
5487
- fromWorkflowStepId: (_l = (_k = (_j = (_i = item.fromWorkflowStepId) != null ? _i : item.FromWorkflowStepId) != null ? _j : item.fromStepId) != null ? _k : item.FromStepId) != null ? _l : "",
5488
- toWorkflowStepId: (_p = (_o = (_n = (_m = item.toWorkflowStepId) != null ? _m : item.ToWorkflowStepId) != null ? _n : item.toStepId) != null ? _o : item.ToStepId) != null ? _p : "",
5489
- actionCode: (_r = (_q = item.actionCode) != null ? _q : item.ActionCode) != null ? _r : "",
5490
- actionName: (_t = (_s = item.actionName) != null ? _s : item.ActionName) != null ? _t : "",
5491
- isActive: (_v = (_u = item.isActive) != null ? _u : item.IsActive) != null ? _v : true
5564
+ workflowName: (_j = (_i = item.workflowName) != null ? _i : item.WorkflowName) != null ? _j : "",
5565
+ fromWorkflowStepId: (_n = (_m = (_l = (_k = item.fromWorkflowStepId) != null ? _k : item.FromWorkflowStepId) != null ? _l : item.fromStepId) != null ? _m : item.FromStepId) != null ? _n : "",
5566
+ fromStepName: (_p = (_o = item.fromStepName) != null ? _o : item.FromStepName) != null ? _p : "",
5567
+ toWorkflowStepId: (_t = (_s = (_r = (_q = item.toWorkflowStepId) != null ? _q : item.ToWorkflowStepId) != null ? _r : item.toStepId) != null ? _s : item.ToStepId) != null ? _t : "",
5568
+ toStepName: (_v = (_u = item.toStepName) != null ? _u : item.ToStepName) != null ? _v : "",
5569
+ actionCode: (_x = (_w = item.actionCode) != null ? _w : item.ActionCode) != null ? _x : "",
5570
+ actionName: (_z = (_y = item.actionName) != null ? _y : item.ActionName) != null ? _z : "",
5571
+ isReturnToApplicant: (_G = (_C = (_B = (_A = item.isReturnToApplicant) != null ? _A : item.IsReturnToApplicant) != null ? _B : item.returnToApplicant) != null ? _C : item.ReturnToApplicant) != null ? _G : Number((_F = (_E = (_D = item.toWorkflowStepId) != null ? _D : item.ToWorkflowStepId) != null ? _E : item.toStepId) != null ? _F : item.ToStepId) === 0,
5572
+ isDefault: (_I = (_H = item.isDefault) != null ? _H : item.IsDefault) != null ? _I : false,
5573
+ requireComment: (_K = (_J = item.requireComment) != null ? _J : item.RequireComment) != null ? _K : false,
5574
+ isActive: (_M = (_L = item.isActive) != null ? _L : item.IsActive) != null ? _M : true
5492
5575
  });
5493
5576
  };
5494
5577
  function WorkFlowTransition() {
@@ -5497,6 +5580,8 @@ function WorkFlowTransition() {
5497
5580
  const [showModal, setShowModal] = useState16(false);
5498
5581
  const [editingTransition, setEditingTransition] = useState16(null);
5499
5582
  const [loadingEditId, setLoadingEditId] = useState16(null);
5583
+ const [updatingStatusId, setUpdatingStatusId] = useState16(null);
5584
+ const [deletingTransitionId, setDeletingTransitionId] = useState16(null);
5500
5585
  const [pageSize, setPageSize] = useState16(10);
5501
5586
  const [currentPage, setCurrentPage] = useState16(1);
5502
5587
  const [search, setSearch] = useState16("");
@@ -5522,11 +5607,16 @@ function WorkFlowTransition() {
5522
5607
  })();
5523
5608
  }, [refreshKey]);
5524
5609
  const saveTransition = async (payload, isEdit) => {
5525
- var _a, _b;
5610
+ var _a, _b, _c;
5526
5611
  try {
5612
+ const requestPayload = __spreadProps(__spreadValues({}, payload), {
5613
+ isReturnToApplicant: Boolean(
5614
+ (_a = payload.isReturnToApplicant) != null ? _a : Number(payload.toWorkflowStepId) === 0
5615
+ )
5616
+ });
5527
5617
  await getApiService()[isEdit ? "put" : "post"](
5528
5618
  getEndpoint(isEdit ? "update" : "create"),
5529
- payload
5619
+ requestPayload
5530
5620
  );
5531
5621
  await Swal9.fire(
5532
5622
  "Success",
@@ -5538,7 +5628,7 @@ function WorkFlowTransition() {
5538
5628
  } catch (error) {
5539
5629
  await Swal9.fire(
5540
5630
  "Error",
5541
- ((_b = (_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || (error == null ? void 0 : error.message) || `Unable to ${isEdit ? "update" : "create"} workflow transition.`,
5631
+ ((_c = (_b = error == null ? void 0 : error.response) == null ? void 0 : _b.data) == null ? void 0 : _c.message) || (error == null ? void 0 : error.message) || `Unable to ${isEdit ? "update" : "create"} workflow transition.`,
5542
5632
  "error"
5543
5633
  );
5544
5634
  return false;
@@ -5564,13 +5654,90 @@ function WorkFlowTransition() {
5564
5654
  setLoadingEditId(null);
5565
5655
  }
5566
5656
  };
5657
+ const toggleTransitionStatus = async (transition) => {
5658
+ var _a, _b, _c, _d, _e, _f;
5659
+ const isActive = !transition.isActive;
5660
+ const result = await Swal9.fire({
5661
+ title: `${isActive ? "Activate" : "Deactivate"} workflow transition?`,
5662
+ text: `Transition #${transition.transitionId} will be ${isActive ? "available" : "inactive"}.`,
5663
+ icon: "warning",
5664
+ showCancelButton: true,
5665
+ confirmButtonColor: isActive ? "#059669" : "#e11d48",
5666
+ confirmButtonText: isActive ? "Activate" : "Deactivate"
5667
+ });
5668
+ if (!result.isConfirmed) return;
5669
+ try {
5670
+ setUpdatingStatusId(transition.transitionId);
5671
+ await getApiService().put(getEndpoint("update"), {
5672
+ transitionId: transition.transitionId,
5673
+ workflowTypeId: Number(transition.workflowTypeId) || 0,
5674
+ workflowId: Number(transition.workflowId) || 0,
5675
+ fromWorkflowStepId: Number(transition.fromWorkflowStepId) || 0,
5676
+ toWorkflowStepId: Number(transition.toWorkflowStepId) || 0,
5677
+ actionCode: (_a = transition.actionCode) != null ? _a : "",
5678
+ actionName: (_b = transition.actionName) != null ? _b : "",
5679
+ isReturnToApplicant: Boolean(transition.isReturnToApplicant),
5680
+ isDefault: Boolean(transition.isDefault),
5681
+ requireComment: Boolean(transition.requireComment),
5682
+ isActive,
5683
+ updatedBy: (_d = (_c = transition.updatedBy) != null ? _c : transition.createdBy) != null ? _d : "System"
5684
+ });
5685
+ await Swal9.fire(
5686
+ "Success",
5687
+ `Workflow transition ${isActive ? "activated" : "deactivated"}.`,
5688
+ "success"
5689
+ );
5690
+ refresh();
5691
+ } catch (error) {
5692
+ await Swal9.fire(
5693
+ "Error",
5694
+ ((_f = (_e = error == null ? void 0 : error.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || (error == null ? void 0 : error.message) || "Unable to update workflow transition status.",
5695
+ "error"
5696
+ );
5697
+ } finally {
5698
+ setUpdatingStatusId(null);
5699
+ }
5700
+ };
5701
+ const deleteTransition = async (transition) => {
5702
+ var _a, _b;
5703
+ const confirmation = await Swal9.fire({
5704
+ title: "Delete workflow transition?",
5705
+ text: `Transition ${transition.transitionId} will be permanently deleted.`,
5706
+ icon: "warning",
5707
+ showCancelButton: true,
5708
+ confirmButtonColor: "#dc2626",
5709
+ confirmButtonText: "Delete",
5710
+ cancelButtonText: "Cancel",
5711
+ reverseButtons: true
5712
+ });
5713
+ if (!confirmation.isConfirmed) return;
5714
+ try {
5715
+ setDeletingTransitionId(transition.transitionId);
5716
+ const endpoint2 = getEndpoint("delete");
5717
+ const deleteUrl = typeof endpoint2 === "function" ? endpoint2() : String(endpoint2);
5718
+ await getApiService().delete(deleteUrl, {
5719
+ transitionId: transition.transitionId
5720
+ });
5721
+ await Swal9.fire("Deleted", "Workflow transition deleted successfully.", "success");
5722
+ refresh();
5723
+ } catch (error) {
5724
+ await Swal9.fire(
5725
+ "Error",
5726
+ ((_b = (_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || (error == null ? void 0 : error.message) || "Unable to delete workflow transition.",
5727
+ "error"
5728
+ );
5729
+ } finally {
5730
+ setDeletingTransitionId(null);
5731
+ }
5732
+ };
5567
5733
  const columns = [
5568
5734
  ["Transition ID", "transitionId", "fc:w-[15%]"],
5569
- ["Workflow ID", "workflowId", "fc:w-[15%]"],
5570
- ["From Step ID", "fromWorkflowStepId", "fc:w-[15%]"],
5571
- ["To Step ID", "toWorkflowStepId", "fc:w-[15%]"],
5735
+ ["Workflow Name", "workflowName", "fc:w-[15%]"],
5736
+ ["From Step", "fromStepName", "fc:w-[15%]"],
5737
+ ["To Step", "toStepName", "fc:w-[15%]"],
5572
5738
  ["Action Code", "actionCode", "fc:w-[14%]"],
5573
- ["Action Name", "actionName", "fc:w-[16%]"]
5739
+ ["Action Name", "actionName", "fc:w-[16%]"],
5740
+ ["Status", "isActive", "fc:w-[10%]"]
5574
5741
  ];
5575
5742
  const visibleRows = rows.filter(
5576
5743
  (item) => Object.values(item).join(" ").toLowerCase().includes(search.toLowerCase())
@@ -5689,24 +5856,53 @@ function WorkFlowTransition() {
5689
5856
  className: "fc:transition-colors fc:hover:bg-slate-50/50",
5690
5857
  children: [
5691
5858
  /* @__PURE__ */ jsx21("td", { className: "fc:py-3.5 fc:px-4 fc:text-sm fc:text-slate-700 fc:whitespace-nowrap", children: item.transitionId || "-" }),
5692
- /* @__PURE__ */ jsx21("td", { className: "fc:py-3.5 fc:px-4 fc:text-sm fc:text-slate-700 fc:whitespace-nowrap", children: item.workflowId || "-" }),
5693
- /* @__PURE__ */ jsx21("td", { className: "fc:py-3.5 fc:px-4 fc:text-sm fc:text-slate-700 fc:whitespace-nowrap", children: item.fromWorkflowStepId || "-" }),
5694
- /* @__PURE__ */ jsx21("td", { className: "fc:py-3.5 fc:px-4 fc:text-sm fc:text-slate-700 fc:whitespace-nowrap", children: item.toWorkflowStepId || "-" }),
5859
+ /* @__PURE__ */ jsx21("td", { className: "fc:py-3.5 fc:px-4 fc:text-sm fc:text-slate-700 fc:whitespace-nowrap", children: item.workflowName || "-" }),
5860
+ /* @__PURE__ */ jsx21("td", { className: "fc:py-3.5 fc:px-4 fc:text-sm fc:text-slate-700 fc:whitespace-nowrap", children: item.fromStepName || "-" }),
5861
+ /* @__PURE__ */ jsx21("td", { className: "fc:py-3.5 fc:px-4 fc:text-sm fc:text-slate-700 fc:whitespace-nowrap", children: item.toStepName || "-" }),
5695
5862
  /* @__PURE__ */ jsx21("td", { className: "fc:py-3.5 fc:px-4 fc:text-sm fc:font-mono fc:text-slate-700 fc:whitespace-nowrap", children: item.actionCode || "-" }),
5696
5863
  /* @__PURE__ */ jsx21("td", { className: "fc:py-3.5 fc:px-4 fc:text-sm fc:text-slate-700 fc:whitespace-nowrap", children: item.actionName || "-" }),
5697
- /* @__PURE__ */ jsx21("td", { className: "fc:py-3.5 fc:px-4 fc:text-center fc:whitespace-nowrap", children: /* @__PURE__ */ jsx21("div", { className: "fc:flex fc:items-center fc:justify-center", children: /* @__PURE__ */ jsx21(
5698
- "button",
5864
+ /* @__PURE__ */ jsx21("td", { className: "fc:py-3.5 fc:px-4 fc:text-sm fc:whitespace-nowrap", children: /* @__PURE__ */ jsx21(
5865
+ "span",
5699
5866
  {
5700
- type: "button",
5701
- onClick: () => editTransition(item),
5702
- disabled: loadingEditId === item.transitionId,
5703
- className: "fc:inline-flex fc:items-center fc:justify-center fc:gap-1.5 fc:px-3 fc:py-1 fc:bg-blue-100/70 hover:fc:bg-blue-200/80 fc:text-blue-600 fc:font-semibold fc:text-xs fc:rounded-full fc:transition-all fc:duration-150 fc:cursor-pointer disabled:fc:opacity-50 disabled:fc:cursor-not-allowed",
5704
- children: loadingEditId === item.transitionId ? /* @__PURE__ */ jsxs20(Fragment4, { children: [
5705
- /* @__PURE__ */ jsx21("span", { className: "fc:inline-block fc:w-3 fc:h-3 fc:border-2 fc:border-blue-600 fc:border-t-transparent fc:rounded-full fc:animate-spin" }),
5706
- /* @__PURE__ */ jsx21("span", { children: "Loading..." })
5707
- ] }) : "Edit"
5867
+ className: `fc:inline-flex fc:rounded-full fc:px-2.5 fc:py-1 fc:text-[11px] fc:font-semibold ${item.isActive ? "fc:bg-emerald-50 fc:text-emerald-700" : "fc:bg-slate-100 fc:text-slate-500"}`,
5868
+ children: item.isActive ? "Active" : "Inactive"
5708
5869
  }
5709
- ) }) })
5870
+ ) }),
5871
+ /* @__PURE__ */ jsx21("td", { className: "fc:py-3.5 fc:px-4 fc:text-center fc:whitespace-nowrap", children: /* @__PURE__ */ jsxs20("div", { className: "fc:flex fc:items-center fc:justify-center fc:gap-2", children: [
5872
+ /* @__PURE__ */ jsx21(
5873
+ "button",
5874
+ {
5875
+ type: "button",
5876
+ onClick: () => editTransition(item),
5877
+ disabled: loadingEditId === item.transitionId || deletingTransitionId === item.transitionId,
5878
+ className: "fc:inline-flex fc:items-center fc:justify-center fc:gap-1.5 fc:px-3 fc:py-1 fc:bg-blue-100/70 hover:fc:bg-blue-200/80 fc:text-blue-600 fc:font-semibold fc:text-xs fc:rounded-full fc:transition-all fc:duration-150 fc:cursor-pointer disabled:fc:opacity-50 disabled:fc:cursor-not-allowed",
5879
+ children: loadingEditId === item.transitionId ? /* @__PURE__ */ jsxs20(Fragment5, { children: [
5880
+ /* @__PURE__ */ jsx21("span", { className: "fc:inline-block fc:w-3 fc:h-3 fc:border-2 fc:border-blue-600 fc:border-t-transparent fc:rounded-full fc:animate-spin" }),
5881
+ /* @__PURE__ */ jsx21("span", { children: "Loading..." })
5882
+ ] }) : "Edit"
5883
+ }
5884
+ ),
5885
+ /* @__PURE__ */ jsx21(
5886
+ "button",
5887
+ {
5888
+ type: "button",
5889
+ onClick: () => toggleTransitionStatus(item),
5890
+ disabled: updatingStatusId === item.transitionId || deletingTransitionId === item.transitionId,
5891
+ className: `fc:inline-flex fc:items-center fc:justify-center fc:px-2.5 fc:py-1 fc:font-semibold fc:text-[11px] fc:rounded-full fc:transition-colors disabled:fc:opacity-50 disabled:fc:cursor-not-allowed ${item.isActive ? "fc:bg-rose-50 fc:text-rose-700 hover:fc:bg-rose-100" : "fc:bg-emerald-50 fc:text-emerald-700 hover:fc:bg-emerald-100"}`,
5892
+ children: updatingStatusId === item.transitionId ? "Saving..." : item.isActive ? "Deactivate" : "Activate"
5893
+ }
5894
+ ),
5895
+ /* @__PURE__ */ jsx21(
5896
+ "button",
5897
+ {
5898
+ type: "button",
5899
+ onClick: () => deleteTransition(item),
5900
+ disabled: deletingTransitionId === item.transitionId || updatingStatusId === item.transitionId,
5901
+ className: "fc:inline-flex fc:items-center fc:justify-center fc:px-2.5 fc:py-1 fc:bg-rose-600 hover:fc:bg-rose-700 fc:text-white fc:font-semibold fc:text-[11px] fc:rounded-full fc:transition-colors disabled:fc:opacity-50 disabled:fc:cursor-not-allowed",
5902
+ children: deletingTransitionId === item.transitionId ? "Deleting..." : "Delete"
5903
+ }
5904
+ )
5905
+ ] }) })
5710
5906
  ]
5711
5907
  },
5712
5908
  item.transitionId
@@ -9233,9 +9429,45 @@ function Table({
9233
9429
  // src/components/task-permission/Popup.js
9234
9430
  import React41, { useState as useState30, useEffect as useEffect24 } from "react";
9235
9431
  import Swal13 from "sweetalert2";
9432
+
9433
+ // src/components/task-permission/permissionLabels.js
9434
+ var permissionLabelFields = [
9435
+ { field: "viewLabel", label: "View Label", fallback: "View" },
9436
+ { field: "editLabel", label: "Edit Label", fallback: "Edit" },
9437
+ { field: "approveLabel", label: "Approve Label", fallback: "Approve" },
9438
+ { field: "rejectLabel", label: "Reject Label", fallback: "Reject" },
9439
+ { field: "forwardLabel", label: "Forward Label", fallback: "Forward" },
9440
+ { field: "freeForwardLabel", label: "Free Forward Label", fallback: "Free Forward" },
9441
+ { field: "returnLabel", label: "Return Label", fallback: "Return" },
9442
+ {
9443
+ field: "returnToApplicantLabel",
9444
+ label: "Return To Applicant Label",
9445
+ fallback: "Return to Applicant"
9446
+ },
9447
+ { field: "delegateLabel", label: "Delegate Label", fallback: "Delegate" },
9448
+ { field: "holdLabel", label: "Hold Label", fallback: "Hold" }
9449
+ ];
9450
+ var getPermissionLabelValues = (source = {}) => Object.fromEntries(
9451
+ permissionLabelFields.map(({ field, fallback }) => {
9452
+ var _a, _b;
9453
+ const pascalField = field.charAt(0).toUpperCase() + field.slice(1);
9454
+ return [field, (_b = (_a = source[field]) != null ? _a : source[pascalField]) != null ? _b : fallback];
9455
+ })
9456
+ );
9457
+ var getPermissionLabelPayload = (source = {}) => Object.fromEntries(
9458
+ permissionLabelFields.map(({ field, fallback }) => {
9459
+ var _a;
9460
+ return [
9461
+ field,
9462
+ String((_a = source[field]) != null ? _a : "").trim() || fallback
9463
+ ];
9464
+ })
9465
+ );
9466
+
9467
+ // src/components/task-permission/Popup.js
9236
9468
  import { jsx as jsx41, jsxs as jsxs40 } from "react/jsx-runtime";
9237
9469
  function Popup({ isOpen, onClose, onSave }) {
9238
- const [formData, setFormData] = useState30({
9470
+ const [formData, setFormData] = useState30(__spreadValues({
9239
9471
  workflowStepId: "",
9240
9472
  canView: false,
9241
9473
  canEdit: false,
@@ -9248,7 +9480,7 @@ function Popup({ isOpen, onClose, onSave }) {
9248
9480
  canDelegate: false,
9249
9481
  canHold: false,
9250
9482
  isActive: true
9251
- });
9483
+ }, getPermissionLabelValues()));
9252
9484
  const [errors, setErrors] = useState30({});
9253
9485
  const [isSubmitting, setIsSubmitting] = useState30(false);
9254
9486
  const [workflowSteps, setWorkflowSteps] = useState30([]);
@@ -9274,7 +9506,7 @@ function Popup({ isOpen, onClose, onSave }) {
9274
9506
  }, [isOpen]);
9275
9507
  useEffect24(() => {
9276
9508
  if (!isOpen) {
9277
- setFormData({
9509
+ setFormData(__spreadValues({
9278
9510
  workflowStepId: "",
9279
9511
  canView: false,
9280
9512
  canEdit: false,
@@ -9287,7 +9519,7 @@ function Popup({ isOpen, onClose, onSave }) {
9287
9519
  canDelegate: false,
9288
9520
  canHold: false,
9289
9521
  isActive: true
9290
- });
9522
+ }, getPermissionLabelValues()));
9291
9523
  setErrors({});
9292
9524
  }
9293
9525
  }, [isOpen]);
@@ -9311,7 +9543,7 @@ function Popup({ isOpen, onClose, onSave }) {
9311
9543
  const flowCore = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore;
9312
9544
  const endpoint2 = ((_b = flowCore == null ? void 0 : flowCore.stepPermission) == null ? void 0 : _b.create) || ((_c = flowCore == null ? void 0 : flowCore.StepPermission) == null ? void 0 : _c.create);
9313
9545
  if (!endpoint2) throw new Error("Step Permission create endpoint is not configured.");
9314
- const payload = {
9546
+ const payload = __spreadProps(__spreadValues({
9315
9547
  workflowStepId: Number(formData.workflowStepId) || 0,
9316
9548
  canView: Boolean(formData.canView),
9317
9549
  canEdit: Boolean(formData.canEdit),
@@ -9323,9 +9555,10 @@ function Popup({ isOpen, onClose, onSave }) {
9323
9555
  canReturnToApplicant: Boolean(formData.canReturnToApplicant),
9324
9556
  canDelegate: Boolean(formData.canDelegate),
9325
9557
  canHold: Boolean(formData.canHold),
9326
- isActive: Boolean(formData.isActive),
9558
+ isActive: Boolean(formData.isActive)
9559
+ }, getPermissionLabelPayload(formData)), {
9327
9560
  createdBy: "System"
9328
- };
9561
+ });
9329
9562
  await getApiService().post(endpoint2, payload);
9330
9563
  onClose();
9331
9564
  await (onSave == null ? void 0 : onSave());
@@ -9426,6 +9659,25 @@ function Popup({ isOpen, onClose, onSave }) {
9426
9659
  )
9427
9660
  ] }, field)) })
9428
9661
  ] }),
9662
+ /* @__PURE__ */ jsxs40("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-5", children: [
9663
+ /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-3", children: [
9664
+ /* @__PURE__ */ jsx41("span", { children: "\u{1F3F7}\uFE0F" }),
9665
+ /* @__PURE__ */ jsx41("span", { children: "Action Labels" })
9666
+ ] }),
9667
+ /* @__PURE__ */ jsx41("div", { className: "fc:grid fc:grid-cols-2 fc:gap-4", children: permissionLabelFields.map(({ field, label, fallback }) => /* @__PURE__ */ jsxs40("div", { children: [
9668
+ /* @__PURE__ */ jsx41("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: label }),
9669
+ /* @__PURE__ */ jsx41(
9670
+ "input",
9671
+ {
9672
+ type: "text",
9673
+ value: formData[field],
9674
+ onChange: (event) => handleChange(field, event.target.value),
9675
+ placeholder: fallback,
9676
+ className: "fc:w-full fc:px-3 fc:py-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:text-slate-700 fc:bg-white focus:fc:outline-none focus:fc:ring-2 focus:fc:ring-indigo-500/10 focus:fc:border-indigo-500"
9677
+ }
9678
+ )
9679
+ ] }, field)) })
9680
+ ] }),
9429
9681
  /* @__PURE__ */ jsxs40("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-4", children: [
9430
9682
  /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-3", children: [
9431
9683
  /* @__PURE__ */ jsx41("span", { children: "\u{1F518}" }),
@@ -9487,7 +9739,7 @@ import React42, { useState as useState31, useEffect as useEffect25 } from "react
9487
9739
  import { jsx as jsx42, jsxs as jsxs41 } from "react/jsx-runtime";
9488
9740
  function EditTaskPermissionModal({ isOpen, onClose, onSave, selectedData, onUpdate }) {
9489
9741
  var _a, _b, _c, _d, _e;
9490
- const [formData, setFormData] = useState31({
9742
+ const [formData, setFormData] = useState31(__spreadValues({
9491
9743
  workflowStepId: "",
9492
9744
  canView: false,
9493
9745
  canEdit: false,
@@ -9500,8 +9752,9 @@ function EditTaskPermissionModal({ isOpen, onClose, onSave, selectedData, onUpda
9500
9752
  canDelegate: false,
9501
9753
  canHold: false,
9502
9754
  isActive: true,
9755
+ createdBy: "System",
9503
9756
  updatedBy: "System"
9504
- });
9757
+ }, getPermissionLabelValues()));
9505
9758
  const [errors, setErrors] = useState31({});
9506
9759
  const [isSubmitting, setIsSubmitting] = useState31(false);
9507
9760
  const [workflowSteps, setWorkflowSteps] = useState31([]);
@@ -9526,9 +9779,9 @@ function EditTaskPermissionModal({ isOpen, onClose, onSave, selectedData, onUpda
9526
9779
  })();
9527
9780
  }, [isOpen]);
9528
9781
  useEffect25(() => {
9529
- var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
9782
+ var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;
9530
9783
  if (selectedData) {
9531
- setFormData({
9784
+ setFormData(__spreadValues({
9532
9785
  workflowStepId: (_b2 = (_a2 = selectedData.workflowStepId) != null ? _a2 : selectedData.WorkflowStepId) != null ? _b2 : "",
9533
9786
  canView: (_d2 = (_c2 = selectedData.canView) != null ? _c2 : selectedData.CanView) != null ? _d2 : false,
9534
9787
  canEdit: (_f = (_e2 = selectedData.canEdit) != null ? _e2 : selectedData.CanEdit) != null ? _f : false,
@@ -9541,8 +9794,9 @@ function EditTaskPermissionModal({ isOpen, onClose, onSave, selectedData, onUpda
9541
9794
  canDelegate: (_t = (_s = selectedData.canDelegate) != null ? _s : selectedData.CanDelegate) != null ? _t : false,
9542
9795
  canHold: (_v = (_u = selectedData.canHold) != null ? _u : selectedData.CanHold) != null ? _v : false,
9543
9796
  isActive: (_x = (_w = selectedData.isActive) != null ? _w : selectedData.IsActive) != null ? _x : true,
9544
- updatedBy: (_z = (_y = selectedData.updatedBy) != null ? _y : selectedData.UpdatedBy) != null ? _z : "System"
9545
- });
9797
+ createdBy: (_z = (_y = selectedData.createdBy) != null ? _y : selectedData.CreatedBy) != null ? _z : "System",
9798
+ updatedBy: (_B = (_A = selectedData.updatedBy) != null ? _A : selectedData.UpdatedBy) != null ? _B : "System"
9799
+ }, getPermissionLabelValues(selectedData)));
9546
9800
  setErrors({});
9547
9801
  }
9548
9802
  }, [selectedData]);
@@ -9565,7 +9819,7 @@ function EditTaskPermissionModal({ isOpen, onClose, onSave, selectedData, onUpda
9565
9819
  const permissionId = Number(
9566
9820
  (_b2 = (_a2 = selectedData == null ? void 0 : selectedData.stepPermissionId) != null ? _a2 : selectedData == null ? void 0 : selectedData.id) != null ? _b2 : 0
9567
9821
  );
9568
- const payload = __spreadProps(__spreadValues({}, formData), {
9822
+ const payload = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, formData), {
9569
9823
  stepPermissionId: permissionId,
9570
9824
  workflowStepId: Number(formData.workflowStepId) || 0,
9571
9825
  canView: Boolean(formData.canView),
@@ -9579,6 +9833,8 @@ function EditTaskPermissionModal({ isOpen, onClose, onSave, selectedData, onUpda
9579
9833
  canDelegate: Boolean(formData.canDelegate),
9580
9834
  canHold: Boolean(formData.canHold),
9581
9835
  isActive: Boolean(formData.isActive),
9836
+ createdBy: String(formData.createdBy).trim() || "System"
9837
+ }), getPermissionLabelPayload(formData)), {
9582
9838
  updatedBy: String(formData.updatedBy).trim() || "System"
9583
9839
  });
9584
9840
  await onUpdate(payload);
@@ -9683,6 +9939,25 @@ function EditTaskPermissionModal({ isOpen, onClose, onSave, selectedData, onUpda
9683
9939
  )
9684
9940
  ] }, field)) })
9685
9941
  ] }),
9942
+ /* @__PURE__ */ jsxs41("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-5", children: [
9943
+ /* @__PURE__ */ jsxs41("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-indigo-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-3", children: [
9944
+ /* @__PURE__ */ jsx42("span", { children: "\u{1F3F7}\uFE0F" }),
9945
+ /* @__PURE__ */ jsx42("span", { children: "Action Labels" })
9946
+ ] }),
9947
+ /* @__PURE__ */ jsx42("div", { className: "fc:grid fc:grid-cols-2 fc:gap-4", children: permissionLabelFields.map(({ field, label, fallback }) => /* @__PURE__ */ jsxs41("div", { children: [
9948
+ /* @__PURE__ */ jsx42("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: label }),
9949
+ /* @__PURE__ */ jsx42(
9950
+ "input",
9951
+ {
9952
+ type: "text",
9953
+ value: formData[field],
9954
+ onChange: (event) => handleChange(field, event.target.value),
9955
+ placeholder: fallback,
9956
+ className: "fc:w-full fc:px-3 fc:py-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:text-slate-700 fc:bg-white focus:fc:outline-none focus:fc:ring-2 focus:fc:ring-indigo-500/10 focus:fc:border-indigo-500"
9957
+ }
9958
+ )
9959
+ ] }, field)) })
9960
+ ] }),
9686
9961
  /* @__PURE__ */ jsxs41("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-4", children: [
9687
9962
  /* @__PURE__ */ jsxs41("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-indigo-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-3", children: [
9688
9963
  /* @__PURE__ */ jsx42("span", { children: "\u{1F518}" }),
@@ -9791,7 +10066,7 @@ function TaskPermissionMain() {
9791
10066
  const permissionId = Number(
9792
10067
  (_c = (_b = item.stepPermissionId) != null ? _b : item.id) != null ? _c : 0
9793
10068
  );
9794
- await getApiService().put(endpoint2, {
10069
+ await getApiService().put(endpoint2, __spreadProps(__spreadValues({
9795
10070
  stepPermissionId: permissionId,
9796
10071
  workflowStepId: Number(item.workflowStepId) || 0,
9797
10072
  canView: Boolean(item.canView),
@@ -9805,8 +10080,10 @@ function TaskPermissionMain() {
9805
10080
  canDelegate: Boolean(item.canDelegate),
9806
10081
  canHold: Boolean(item.canHold),
9807
10082
  isActive: Boolean(item.isActive),
10083
+ createdBy: item.createdBy || item.CreatedBy || "System"
10084
+ }, getPermissionLabelPayload(item)), {
9808
10085
  updatedBy: item.updatedBy || "System"
9809
- });
10086
+ }));
9810
10087
  handleRefresh();
9811
10088
  return true;
9812
10089
  } catch (error) {
@@ -19310,7 +19587,7 @@ var formatInboxDate = (value) => {
19310
19587
  });
19311
19588
  };
19312
19589
  var normalizePoolFile = (file) => {
19313
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
19590
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C;
19314
19591
  const taskInstanceId = (_a = file.taskInstanceId) != null ? _a : file.TaskInstanceId;
19315
19592
  const filePoolId = (_b = file.filePoolId) != null ? _b : file.FilePoolId;
19316
19593
  const businessEntity = (_c = file.businessEntityType) != null ? _c : file.BusinessEntityType;
@@ -19330,14 +19607,14 @@ var normalizePoolFile = (file) => {
19330
19607
  priority: (_t = file.priority) != null ? _t : "Medium",
19331
19608
  receivedDate: formatInboxDate((_v = (_u = file.addedOn) != null ? _u : file.createdAt) != null ? _v : file.receivedDate),
19332
19609
  dueDate: formatInboxDate(file.dueDate),
19333
- slaStatus: (_w = file.slaStatus) != null ? _w : "-",
19334
- status: "Available",
19610
+ slaStatus: (_x = (_w = file.slaStatus) != null ? _w : file.SlaStatus) != null ? _x : "-",
19611
+ status: (_B = (_A = (_z = (_y = file.statusName) != null ? _y : file.StatusName) != null ? _z : file.fileStatus) != null ? _A : file.FileStatus) != null ? _B : "Available",
19335
19612
  assignedTo: "-",
19336
- currentStep: (_x = file.stepName) != null ? _x : "-"
19613
+ currentStep: (_C = file.stepName) != null ? _C : "-"
19337
19614
  });
19338
19615
  };
19339
19616
  var normalizeMyFile = (file) => {
19340
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E;
19617
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K;
19341
19618
  const taskInstanceId = (_a = file.taskInstanceId) != null ? _a : file.TaskInstanceId;
19342
19619
  const businessEntityId = (_b = file.businessEntityId) != null ? _b : file.BusinessEntityId;
19343
19620
  const businessEntity = (_c = file.businessEntityType) != null ? _c : file.BusinessEntityType;
@@ -19355,11 +19632,12 @@ var normalizeMyFile = (file) => {
19355
19632
  sender: (_s = (_r = file.sender) != null ? _r : businessEntity) != null ? _s : "-",
19356
19633
  priority: (_t = file.priority) != null ? _t : "Medium",
19357
19634
  receivedDate: formatInboxDate((_u = file.createdAt) != null ? _u : file.receivedDate),
19358
- dueDate: formatInboxDate(file.dueDate),
19359
- slaStatus: (_v = file.slaStatus) != null ? _v : "-",
19360
- status: (_x = (_w = file.fileStatus) != null ? _w : file.statusName) != null ? _x : "In Progress",
19361
- assignedTo: (_D = (_C = (_B = (_A = (_z = (_y = file.assignedTo) != null ? _y : file.AssignedTo) != null ? _z : file.assignedUserName) != null ? _A : file.AssignedUserName) != null ? _B : file.assignedUserId) != null ? _C : file.AssignedUserId) != null ? _D : "-",
19362
- currentStep: (_E = file.stepName) != null ? _E : "-"
19635
+ dueDate: formatInboxDate((_v = file.dueDate) != null ? _v : file.DueDate),
19636
+ slaStatus: (_x = (_w = file.slaStatus) != null ? _w : file.SlaStatus) != null ? _x : "-",
19637
+ status: (_B = (_A = (_z = (_y = file.fileStatus) != null ? _y : file.FileStatus) != null ? _z : file.statusName) != null ? _A : file.StatusName) != null ? _B : "In Progress",
19638
+ fileAt: (_D = (_C = file.fileAt) != null ? _C : file.FileAt) != null ? _D : "-",
19639
+ assignedTo: (_J = (_I = (_H = (_G = (_F = (_E = file.assignedTo) != null ? _E : file.AssignedTo) != null ? _F : file.assignedUserName) != null ? _G : file.AssignedUserName) != null ? _H : file.assignedUserId) != null ? _I : file.AssignedUserId) != null ? _J : "-",
19640
+ currentStep: (_K = file.stepName) != null ? _K : "-"
19363
19641
  });
19364
19642
  };
19365
19643
  function InboxMain() {
@@ -19637,7 +19915,7 @@ function InboxMain() {
19637
19915
  if (searchQuery.trim()) {
19638
19916
  const q = searchQuery.toLowerCase().trim();
19639
19917
  result = result.filter(
19640
- (f) => f.fileNumber.toLowerCase().includes(q) || f.subject.toLowerCase().includes(q) || f.workflowName.toLowerCase().includes(q) || f.department && f.department.toLowerCase().includes(q) || f.applicant && f.applicant.toLowerCase().includes(q) || f.category && f.category.toLowerCase().includes(q) || f.financialYear && f.financialYear.toLowerCase().includes(q) || f.sender.toLowerCase().includes(q) || f.status && f.status.toLowerCase().includes(q)
19918
+ (f) => f.fileNumber.toLowerCase().includes(q) || f.subject.toLowerCase().includes(q) || f.workflowName.toLowerCase().includes(q) || f.department && f.department.toLowerCase().includes(q) || f.applicant && f.applicant.toLowerCase().includes(q) || f.category && f.category.toLowerCase().includes(q) || f.financialYear && f.financialYear.toLowerCase().includes(q) || f.sender.toLowerCase().includes(q) || f.fileAt && f.fileAt.toLowerCase().includes(q) || f.status && f.status.toLowerCase().includes(q)
19641
19919
  );
19642
19920
  }
19643
19921
  if (priorityFilter !== "all") {
@@ -19794,6 +20072,7 @@ function InboxMain() {
19794
20072
  "Priority",
19795
20073
  "Received Date",
19796
20074
  "Due Date",
20075
+ ...activeTab === "totalFiles" ? ["File At"] : [],
19797
20076
  "SLA Status",
19798
20077
  "Status"
19799
20078
  ];
@@ -19806,6 +20085,7 @@ function InboxMain() {
19806
20085
  `"${f.priority}"`,
19807
20086
  `"${f.receivedDate}"`,
19808
20087
  `"${f.dueDate}"`,
20088
+ ...activeTab === "totalFiles" ? [`"${f.fileAt}"`] : [],
19809
20089
  `"${f.slaStatus}"`,
19810
20090
  `"${f.status}"`
19811
20091
  ]);
@@ -19937,7 +20217,11 @@ function InboxMain() {
19937
20217
  /* @__PURE__ */ jsx97(
19938
20218
  "span",
19939
20219
  {
19940
- className: `fc:px-2 fc:py-0.5 fc:rounded-full fc:text-[11px] fc:font-extrabold ${activeTab === "filePool" ? "fc:bg-white/25 fc:text-white" : "fc:bg-slate-200 fc:text-slate-700"}`,
20220
+ className: "fc:px-2 fc:py-0.5 fc:rounded-full fc:text-[11px] fc:font-extrabold",
20221
+ style: {
20222
+ backgroundColor: activeTab === "filePool" ? "rgba(255, 255, 255, 0.25)" : "#e2e8f0",
20223
+ color: activeTab === "filePool" ? "#ffffff" : "#334155"
20224
+ },
19941
20225
  children: filePoolFiles.length
19942
20226
  }
19943
20227
  )
@@ -19956,7 +20240,11 @@ function InboxMain() {
19956
20240
  /* @__PURE__ */ jsx97(
19957
20241
  "span",
19958
20242
  {
19959
- className: `fc:px-2 fc:py-0.5 fc:rounded-full fc:text-[11px] fc:font-extrabold ${activeTab === "myFiles" ? "fc:bg-white/25 fc:text-white" : "fc:bg-slate-200 fc:text-slate-700"}`,
20243
+ className: "fc:px-2 fc:py-0.5 fc:rounded-full fc:text-[11px] fc:font-extrabold",
20244
+ style: {
20245
+ backgroundColor: activeTab === "myFiles" ? "rgba(255, 255, 255, 0.25)" : "#e2e8f0",
20246
+ color: activeTab === "myFiles" ? "#ffffff" : "#334155"
20247
+ },
19960
20248
  children: myFiles.length
19961
20249
  }
19962
20250
  )
@@ -19975,7 +20263,11 @@ function InboxMain() {
19975
20263
  /* @__PURE__ */ jsx97(
19976
20264
  "span",
19977
20265
  {
19978
- className: `fc:px-2 fc:py-0.5 fc:rounded-full fc:text-[11px] fc:font-extrabold ${activeTab === "totalFiles" ? "fc:bg-white/25 fc:text-white" : "fc:bg-slate-200 fc:text-slate-700"}`,
20266
+ className: "fc:px-2 fc:py-0.5 fc:rounded-full fc:text-[11px] fc:font-extrabold",
20267
+ style: {
20268
+ backgroundColor: activeTab === "totalFiles" ? "rgba(255, 255, 255, 0.25)" : "#e2e8f0",
20269
+ color: activeTab === "totalFiles" ? "#ffffff" : "#334155"
20270
+ },
19979
20271
  children: totalFiles.length
19980
20272
  }
19981
20273
  )
@@ -20124,387 +20416,424 @@ function InboxMain() {
20124
20416
  ] })
20125
20417
  ] }),
20126
20418
  /* @__PURE__ */ jsxs96("div", { ref: tableRef, className: "fc:flex-1 fc:overflow-hidden fc:flex fc:flex-col fc:pt-3", children: [
20127
- /* @__PURE__ */ jsx97("div", { className: "fc:border fc:border-slate-200 fc:rounded-2xl fc:overflow-auto fc:flex-1 fc:relative", children: /* @__PURE__ */ jsxs96("table", { className: "fc:w-max fc:min-w-full fc:border-collapse fc:text-left", children: [
20128
- /* @__PURE__ */ jsx97("thead", { className: "fc:sticky fc:top-0 fc:z-20 fc:bg-slate-50 fc:border-b fc:border-slate-200", children: /* @__PURE__ */ jsxs96("tr", { children: [
20129
- /* @__PURE__ */ jsx97(
20130
- "th",
20131
- {
20132
- style: { width: "48px", minWidth: "48px", maxWidth: "48px" },
20133
- className: "fc:sticky fc:left-0 fc:z-30 fc:bg-slate-100 fc:w-12 fc:px-2 fc:py-3.5 fc:text-center fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:border-r fc:border-slate-200",
20134
- children: "#"
20135
- }
20136
- ),
20137
- /* @__PURE__ */ jsx97(
20138
- "th",
20139
- {
20140
- onClick: () => handleSort("fileNumber"),
20141
- style: { width: "144px", minWidth: "144px", maxWidth: "144px" },
20142
- className: "fc:sticky fc:left-12 fc:z-30 fc:bg-slate-100 fc:w-36 fc:px-4 fc:py-3.5 fc:text-left fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:border-r fc:border-slate-200 fc:shadow-[4px_0_6px_-2px_rgba(0,0,0,0.06)] fc:cursor-pointer hover:fc:text-blue-600",
20143
- children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center", children: [
20144
- "File No ",
20145
- renderSortIndicator("fileNumber")
20146
- ] })
20147
- }
20148
- ),
20149
- visibleDynamicColumns.map((col) => /* @__PURE__ */ jsx97(
20150
- "th",
20151
- {
20152
- onClick: () => handleSort(col.key),
20153
- style: {
20154
- width: col.width || "180px",
20155
- minWidth: col.width || "180px",
20156
- maxWidth: col.width || "180px"
20419
+ /* @__PURE__ */ jsxs96("div", { className: "fc:border fc:border-slate-200 fc:rounded-2xl fc:overflow-auto fc:flex-1 fc:relative", children: [
20420
+ /* @__PURE__ */ jsx97("style", { children: `
20421
+ .fc-inbox-table tbody td { border-bottom: 1px solid #e2e8f0; }
20422
+ .fc-inbox-table tbody tr:hover td { background-color: #f8fafc; }
20423
+ ` }),
20424
+ /* @__PURE__ */ jsxs96("table", { className: "fc-inbox-table fc:w-max fc:min-w-full fc:border-collapse fc:text-left", children: [
20425
+ /* @__PURE__ */ jsx97("thead", { className: "fc:sticky fc:top-0 fc:z-20 fc:bg-slate-50 fc:border-b fc:border-slate-200", children: /* @__PURE__ */ jsxs96("tr", { children: [
20426
+ /* @__PURE__ */ jsx97(
20427
+ "th",
20428
+ {
20429
+ style: { width: "48px", minWidth: "48px", maxWidth: "48px" },
20430
+ className: "fc:sticky fc:left-0 fc:z-30 fc:bg-slate-100 fc:w-12 fc:px-2 fc:py-3.5 fc:text-center fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:border-r fc:border-slate-200",
20431
+ children: "#"
20432
+ }
20433
+ ),
20434
+ /* @__PURE__ */ jsx97(
20435
+ "th",
20436
+ {
20437
+ onClick: () => handleSort("fileNumber"),
20438
+ style: { width: "144px", minWidth: "144px", maxWidth: "144px" },
20439
+ className: "fc:sticky fc:left-12 fc:z-30 fc:bg-slate-100 fc:w-36 fc:px-4 fc:py-3.5 fc:text-left fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:border-r fc:border-slate-200 fc:shadow-[4px_0_6px_-2px_rgba(0,0,0,0.06)] fc:cursor-pointer hover:fc:text-blue-600",
20440
+ children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center", children: [
20441
+ "File No ",
20442
+ renderSortIndicator("fileNumber")
20443
+ ] })
20444
+ }
20445
+ ),
20446
+ visibleDynamicColumns.map((col) => /* @__PURE__ */ jsx97(
20447
+ "th",
20448
+ {
20449
+ onClick: () => handleSort(col.key),
20450
+ style: {
20451
+ width: col.width || "180px",
20452
+ minWidth: col.width || "180px",
20453
+ maxWidth: col.width || "180px"
20454
+ },
20455
+ className: "fc:px-4 fc:py-3.5 fc:text-left fc:text-[11px] fc:font-bold fc:text-blue-900 fc:bg-blue-50/70 hover:fc:bg-blue-100/60 fc:uppercase fc:tracking-wider fc:cursor-pointer fc:border-r fc:border-blue-100/70 fc:transition-colors",
20456
+ children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center fc:gap-1.5 fc:overflow-hidden", children: [
20457
+ /* @__PURE__ */ jsx97("span", { className: "fc:truncate", children: col.label }),
20458
+ /* @__PURE__ */ jsx97("span", { className: "fc:text-[9px] fc:font-extrabold fc:text-blue-700 fc:bg-blue-100 fc:border fc:border-blue-200/80 fc:px-1.5 fc:py-0.5 fc:rounded-md fc:tracking-wide fc:shrink-0", children: "DYN" }),
20459
+ renderSortIndicator(col.key)
20460
+ ] })
20157
20461
  },
20158
- className: "fc:px-4 fc:py-3.5 fc:text-left fc:text-[11px] fc:font-bold fc:text-blue-900 fc:bg-blue-50/70 hover:fc:bg-blue-100/60 fc:uppercase fc:tracking-wider fc:cursor-pointer fc:border-r fc:border-blue-100/70 fc:transition-colors",
20159
- children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center fc:gap-1.5 fc:overflow-hidden", children: [
20160
- /* @__PURE__ */ jsx97("span", { className: "fc:truncate", children: col.label }),
20161
- /* @__PURE__ */ jsx97("span", { className: "fc:text-[9px] fc:font-extrabold fc:text-blue-700 fc:bg-blue-100 fc:border fc:border-blue-200/80 fc:px-1.5 fc:py-0.5 fc:rounded-md fc:tracking-wide fc:shrink-0", children: "DYN" }),
20162
- renderSortIndicator(col.key)
20163
- ] })
20164
- },
20165
- col.key
20166
- )),
20167
- /* @__PURE__ */ jsx97(
20168
- "th",
20169
- {
20170
- onClick: () => handleSort("subject"),
20171
- style: { width: "300px", minWidth: "300px", maxWidth: "300px" },
20172
- className: "fc:px-4 fc:py-3.5 fc:text-left fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:cursor-pointer hover:fc:text-blue-600",
20173
- children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center", children: [
20174
- "Subject / Title ",
20175
- renderSortIndicator("subject")
20176
- ] })
20177
- }
20178
- ),
20179
- /* @__PURE__ */ jsx97(
20180
- "th",
20181
- {
20182
- onClick: () => handleSort("workflowName"),
20183
- style: { width: "190px", minWidth: "190px", maxWidth: "190px" },
20184
- className: "fc:px-4 fc:py-3.5 fc:text-left fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:cursor-pointer hover:fc:text-blue-600",
20185
- children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center", children: [
20186
- "Workflow ",
20187
- renderSortIndicator("workflowName")
20188
- ] })
20189
- }
20190
- ),
20191
- /* @__PURE__ */ jsx97(
20192
- "th",
20193
- {
20194
- onClick: () => handleSort("sender"),
20195
- style: { width: "190px", minWidth: "190px", maxWidth: "190px" },
20196
- className: "fc:px-4 fc:py-3.5 fc:text-left fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:cursor-pointer hover:fc:text-blue-600",
20197
- children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center", children: [
20198
- "Sender / Initiator ",
20199
- renderSortIndicator("sender")
20200
- ] })
20201
- }
20202
- ),
20203
- /* @__PURE__ */ jsx97(
20204
- "th",
20205
- {
20206
- onClick: () => handleSort("priority"),
20207
- style: { width: "100px", minWidth: "100px", maxWidth: "100px" },
20208
- className: "fc:px-3 fc:py-3.5 fc:text-center fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:cursor-pointer hover:fc:text-blue-600",
20209
- children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center fc:justify-center", children: [
20210
- "Priority ",
20211
- renderSortIndicator("priority")
20212
- ] })
20213
- }
20214
- ),
20215
- /* @__PURE__ */ jsx97(
20216
- "th",
20217
- {
20218
- onClick: () => handleSort("receivedDate"),
20219
- style: { width: "150px", minWidth: "150px", maxWidth: "150px" },
20220
- className: "fc:px-4 fc:py-3.5 fc:text-left fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:cursor-pointer hover:fc:text-blue-600",
20221
- children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center", children: [
20222
- "Received On ",
20223
- renderSortIndicator("receivedDate")
20224
- ] })
20225
- }
20226
- ),
20227
- /* @__PURE__ */ jsx97(
20228
- "th",
20229
- {
20230
- onClick: () => handleSort("dueDate"),
20231
- style: { width: "150px", minWidth: "150px", maxWidth: "150px" },
20232
- className: "fc:px-4 fc:py-3.5 fc:text-left fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:cursor-pointer hover:fc:text-blue-600",
20233
- children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center", children: [
20234
- "SLA / Due ",
20235
- renderSortIndicator("dueDate")
20236
- ] })
20237
- }
20238
- ),
20239
- /* @__PURE__ */ jsx97(
20240
- "th",
20462
+ col.key
20463
+ )),
20464
+ /* @__PURE__ */ jsx97(
20465
+ "th",
20466
+ {
20467
+ onClick: () => handleSort("subject"),
20468
+ style: { width: "300px", minWidth: "300px", maxWidth: "300px" },
20469
+ className: "fc:px-4 fc:py-3.5 fc:text-left fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:cursor-pointer hover:fc:text-blue-600",
20470
+ children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center", children: [
20471
+ "Subject / Title ",
20472
+ renderSortIndicator("subject")
20473
+ ] })
20474
+ }
20475
+ ),
20476
+ /* @__PURE__ */ jsx97(
20477
+ "th",
20478
+ {
20479
+ onClick: () => handleSort("workflowName"),
20480
+ style: { width: "190px", minWidth: "190px", maxWidth: "190px" },
20481
+ className: "fc:px-4 fc:py-3.5 fc:text-left fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:cursor-pointer hover:fc:text-blue-600",
20482
+ children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center", children: [
20483
+ "Workflow ",
20484
+ renderSortIndicator("workflowName")
20485
+ ] })
20486
+ }
20487
+ ),
20488
+ /* @__PURE__ */ jsx97(
20489
+ "th",
20490
+ {
20491
+ onClick: () => handleSort("sender"),
20492
+ style: { width: "190px", minWidth: "190px", maxWidth: "190px" },
20493
+ className: "fc:px-4 fc:py-3.5 fc:text-left fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:cursor-pointer hover:fc:text-blue-600",
20494
+ children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center", children: [
20495
+ "Sender / Initiator ",
20496
+ renderSortIndicator("sender")
20497
+ ] })
20498
+ }
20499
+ ),
20500
+ /* @__PURE__ */ jsx97(
20501
+ "th",
20502
+ {
20503
+ onClick: () => handleSort("priority"),
20504
+ style: { width: "100px", minWidth: "100px", maxWidth: "100px" },
20505
+ className: "fc:px-3 fc:py-3.5 fc:text-center fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:cursor-pointer hover:fc:text-blue-600",
20506
+ children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center fc:justify-center", children: [
20507
+ "Priority ",
20508
+ renderSortIndicator("priority")
20509
+ ] })
20510
+ }
20511
+ ),
20512
+ /* @__PURE__ */ jsx97(
20513
+ "th",
20514
+ {
20515
+ onClick: () => handleSort("receivedDate"),
20516
+ style: { width: "150px", minWidth: "150px", maxWidth: "150px" },
20517
+ className: "fc:px-4 fc:py-3.5 fc:text-left fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:cursor-pointer hover:fc:text-blue-600",
20518
+ children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center", children: [
20519
+ "Received On ",
20520
+ renderSortIndicator("receivedDate")
20521
+ ] })
20522
+ }
20523
+ ),
20524
+ /* @__PURE__ */ jsx97(
20525
+ "th",
20526
+ {
20527
+ onClick: () => handleSort("dueDate"),
20528
+ style: { width: "150px", minWidth: "150px", maxWidth: "150px" },
20529
+ className: "fc:px-4 fc:py-3.5 fc:text-left fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:cursor-pointer hover:fc:text-blue-600",
20530
+ children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center", children: [
20531
+ "SLA / Due ",
20532
+ renderSortIndicator("dueDate")
20533
+ ] })
20534
+ }
20535
+ ),
20536
+ activeTab === "totalFiles" && /* @__PURE__ */ jsx97(
20537
+ "th",
20538
+ {
20539
+ onClick: () => handleSort("fileAt"),
20540
+ style: { width: "160px", minWidth: "160px", maxWidth: "160px" },
20541
+ className: "fc:px-4 fc:py-3.5 fc:text-left fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:cursor-pointer hover:fc:text-blue-600",
20542
+ children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center", children: [
20543
+ "File At ",
20544
+ renderSortIndicator("fileAt")
20545
+ ] })
20546
+ }
20547
+ ),
20548
+ /* @__PURE__ */ jsx97(
20549
+ "th",
20550
+ {
20551
+ onClick: () => handleSort("status"),
20552
+ style: { width: "190px", minWidth: "190px", maxWidth: "190px" },
20553
+ className: "fc:px-3 fc:py-3.5 fc:text-center fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:cursor-pointer hover:fc:text-blue-600",
20554
+ children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center fc:justify-center", children: [
20555
+ "Status ",
20556
+ renderSortIndicator("status")
20557
+ ] })
20558
+ }
20559
+ ),
20560
+ /* @__PURE__ */ jsx97(
20561
+ "th",
20562
+ {
20563
+ style: { width: "100px", minWidth: "100px", maxWidth: "100px" },
20564
+ className: "fc:sticky fc:right-0 fc:z-30 fc:bg-slate-100 fc:px-3 fc:py-3.5 fc:text-center fc:text-[11px] fc:font-bold fc:text-slate-700 fc:uppercase fc:tracking-wider fc:border-l fc:border-slate-200 fc:shadow-[-5px_0_10px_-4px_rgba(0,0,0,0.08)]",
20565
+ children: "Action"
20566
+ }
20567
+ )
20568
+ ] }) }),
20569
+ /* @__PURE__ */ jsx97("tbody", { className: "fc:divide-y fc:divide-slate-100 fc:bg-white", children: paginatedData.length === 0 ? /* @__PURE__ */ jsx97("tr", { children: /* @__PURE__ */ jsx97(
20570
+ "td",
20241
20571
  {
20242
- onClick: () => handleSort("status"),
20243
- style: { width: "120px", minWidth: "120px", maxWidth: "120px" },
20244
- className: "fc:px-3 fc:py-3.5 fc:text-center fc:text-[11px] fc:font-bold fc:text-slate-600 fc:uppercase fc:tracking-wider fc:cursor-pointer hover:fc:text-blue-600",
20245
- children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center fc:justify-center", children: [
20246
- "Status ",
20247
- renderSortIndicator("status")
20572
+ colSpan: 10 + visibleDynamicColumns.length + (activeTab === "totalFiles" ? 1 : 0),
20573
+ className: "fc:py-12 fc:text-center",
20574
+ children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:flex-col fc:items-center fc:justify-center fc:gap-2 fc:text-slate-400", children: [
20575
+ /* @__PURE__ */ jsx97(RiInboxLine, { size: 36, className: "fc:text-slate-300" }),
20576
+ /* @__PURE__ */ jsx97("p", { className: "fc:text-sm fc:font-bold fc:text-slate-600", children: "No Files Found" }),
20577
+ /* @__PURE__ */ jsx97("p", { className: "fc:text-xs", children: searchQuery ? `No records matching "${searchQuery}" in ${activeTab}` : `There are currently no files in ${activeTab}` })
20248
20578
  ] })
20249
20579
  }
20250
- ),
20251
- /* @__PURE__ */ jsx97(
20252
- "th",
20253
- {
20254
- style: { width: "100px", minWidth: "100px", maxWidth: "100px" },
20255
- className: "fc:sticky fc:right-0 fc:z-30 fc:bg-slate-100 fc:px-3 fc:py-3.5 fc:text-center fc:text-[11px] fc:font-bold fc:text-slate-700 fc:uppercase fc:tracking-wider fc:border-l fc:border-slate-200 fc:shadow-[-5px_0_10px_-4px_rgba(0,0,0,0.08)]",
20256
- children: "Action"
20257
- }
20258
- )
20259
- ] }) }),
20260
- /* @__PURE__ */ jsx97("tbody", { className: "fc:divide-y fc:divide-slate-100 fc:bg-white", children: paginatedData.length === 0 ? /* @__PURE__ */ jsx97("tr", { children: /* @__PURE__ */ jsx97(
20261
- "td",
20262
- {
20263
- colSpan: 10 + visibleDynamicColumns.length,
20264
- className: "fc:py-12 fc:text-center",
20265
- children: /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:flex-col fc:items-center fc:justify-center fc:gap-2 fc:text-slate-400", children: [
20266
- /* @__PURE__ */ jsx97(RiInboxLine, { size: 36, className: "fc:text-slate-300" }),
20267
- /* @__PURE__ */ jsx97("p", { className: "fc:text-sm fc:font-bold fc:text-slate-600", children: "No Files Found" }),
20268
- /* @__PURE__ */ jsx97("p", { className: "fc:text-xs", children: searchQuery ? `No records matching "${searchQuery}" in ${activeTab}` : `There are currently no files in ${activeTab}` })
20269
- ] })
20270
- }
20271
- ) }) : paginatedData.map((row, index) => {
20272
- const rowIndex = startIndex + index + 1;
20273
- return /* @__PURE__ */ jsxs96(
20274
- "tr",
20275
- {
20276
- className: "fc:group hover:fc:bg-slate-50/80 fc:transition-colors",
20277
- children: [
20278
- /* @__PURE__ */ jsx97(
20279
- "td",
20280
- {
20281
- style: { width: "48px", minWidth: "48px", maxWidth: "48px" },
20282
- className: "fc:sticky fc:left-0 fc:z-10 fc:bg-white group-hover:fc:bg-slate-50 fc:w-12 fc:px-2 fc:py-3 fc:text-center fc:align-middle fc:text-xs fc:font-semibold fc:text-slate-400 fc:border-r fc:border-slate-100",
20283
- children: rowIndex
20284
- }
20285
- ),
20286
- /* @__PURE__ */ jsx97(
20287
- "td",
20288
- {
20289
- style: { width: "144px", minWidth: "144px", maxWidth: "144px" },
20290
- className: "fc:sticky fc:left-12 fc:z-10 fc:bg-white group-hover:fc:bg-slate-50 fc:w-36 fc:px-4 fc:py-3 fc:align-middle fc:whitespace-nowrap fc:border-r fc:border-slate-100 fc:shadow-[4px_0_6px_-2px_rgba(0,0,0,0.05)]",
20291
- children: /* @__PURE__ */ jsxs96(
20292
- "div",
20293
- {
20294
- onMouseEnter: hasHiddenDynamicColumns ? (e) => handleFileMouseEnter(row, e) : void 0,
20295
- onMouseLeave: hasHiddenDynamicColumns ? handleFileMouseLeave : void 0,
20296
- className: `fc:inline-flex fc:items-center fc:gap-1.5 fc:px-2.5 fc:py-1 fc:rounded-lg fc:transition-all ${hasHiddenDynamicColumns ? "fc:bg-blue-50 hover:fc:bg-blue-100/90 fc:border fc:border-blue-200/90 hover:fc:border-blue-300 fc:text-blue-700 fc:cursor-pointer hover:fc:shadow-sm" : "fc:bg-blue-50 fc:border fc:border-blue-100/90 fc:text-blue-600"}`,
20297
- children: [
20298
- /* @__PURE__ */ jsx97("span", { className: "fc:text-xs fc:font-extrabold", children: row.fileNumber }),
20299
- hasHiddenDynamicColumns && /* @__PURE__ */ jsxs96("span", { className: "fc:inline-flex fc:items-center fc:gap-0.5 fc:px-1.5 fc:py-0.2 fc:rounded fc:bg-amber-100/90 fc:text-amber-800 fc:text-[9px] fc:font-black fc:border fc:border-amber-200/80", children: [
20300
- /* @__PURE__ */ jsx97(RiEyeOffLine, { size: 10 }),
20301
- /* @__PURE__ */ jsx97("span", { children: hiddenDynamicColumns.length })
20302
- ] })
20303
- ]
20304
- }
20305
- )
20306
- }
20307
- ),
20308
- visibleDynamicColumns.map((col) => {
20309
- const colWidthNum = parseInt(col.width || "180", 10);
20310
- const contentWidth = `${Math.max(colWidthNum - 32, 80)}px`;
20311
- return /* @__PURE__ */ jsx97(
20580
+ ) }) : paginatedData.map((row, index) => {
20581
+ const rowIndex = startIndex + index + 1;
20582
+ return /* @__PURE__ */ jsxs96(
20583
+ "tr",
20584
+ {
20585
+ className: "fc:group hover:fc:bg-slate-50/80 fc:transition-colors",
20586
+ children: [
20587
+ /* @__PURE__ */ jsx97(
20312
20588
  "td",
20313
20589
  {
20314
- style: {
20315
- width: col.width || "180px",
20316
- minWidth: col.width || "180px",
20317
- maxWidth: col.width || "180px"
20318
- },
20319
- className: "fc:px-4 fc:py-3 fc:align-middle fc:border-r fc:border-blue-100/60 fc:bg-blue-50/30 group-hover:fc:bg-blue-50/60 fc:transition-colors",
20320
- children: /* @__PURE__ */ jsx97(
20590
+ style: { width: "48px", minWidth: "48px", maxWidth: "48px" },
20591
+ className: "fc:sticky fc:left-0 fc:z-10 fc:bg-white group-hover:fc:bg-slate-50 fc:w-12 fc:px-2 fc:py-3 fc:text-center fc:align-middle fc:text-xs fc:font-semibold fc:text-slate-400 fc:border-r fc:border-slate-100",
20592
+ children: rowIndex
20593
+ }
20594
+ ),
20595
+ /* @__PURE__ */ jsx97(
20596
+ "td",
20597
+ {
20598
+ style: { width: "144px", minWidth: "144px", maxWidth: "144px" },
20599
+ className: "fc:sticky fc:left-12 fc:z-10 fc:bg-white group-hover:fc:bg-slate-50 fc:w-36 fc:px-4 fc:py-3 fc:align-middle fc:whitespace-nowrap fc:border-r fc:border-slate-100 fc:shadow-[4px_0_6px_-2px_rgba(0,0,0,0.05)]",
20600
+ children: /* @__PURE__ */ jsxs96(
20321
20601
  "div",
20322
20602
  {
20323
- style: {
20324
- width: contentWidth,
20325
- wordBreak: "break-word",
20326
- overflowWrap: "anywhere"
20327
- },
20328
- className: "fc:whitespace-normal",
20329
- children: /* @__PURE__ */ jsx97("span", { className: "fc:text-xs fc:font-medium fc:text-slate-800 fc:leading-relaxed", children: row[col.key] || "-" })
20603
+ onMouseEnter: hasHiddenDynamicColumns ? (e) => handleFileMouseEnter(row, e) : void 0,
20604
+ onMouseLeave: hasHiddenDynamicColumns ? handleFileMouseLeave : void 0,
20605
+ className: `fc:inline-flex fc:items-center fc:gap-1.5 fc:px-2.5 fc:py-1 fc:rounded-lg fc:transition-all ${hasHiddenDynamicColumns ? "fc:bg-blue-50 hover:fc:bg-blue-100/90 fc:border fc:border-blue-200/90 hover:fc:border-blue-300 fc:text-blue-700 fc:cursor-pointer hover:fc:shadow-sm" : "fc:bg-blue-50 fc:border fc:border-blue-100/90 fc:text-blue-600"}`,
20606
+ children: [
20607
+ /* @__PURE__ */ jsx97("span", { className: "fc:text-xs fc:font-extrabold", children: row.fileNumber }),
20608
+ hasHiddenDynamicColumns && /* @__PURE__ */ jsxs96("span", { className: "fc:inline-flex fc:items-center fc:gap-0.5 fc:px-1.5 fc:py-0.2 fc:rounded fc:bg-amber-100/90 fc:text-amber-800 fc:text-[9px] fc:font-black fc:border fc:border-amber-200/80", children: [
20609
+ /* @__PURE__ */ jsx97(RiEyeOffLine, { size: 10 }),
20610
+ /* @__PURE__ */ jsx97("span", { children: hiddenDynamicColumns.length })
20611
+ ] })
20612
+ ]
20330
20613
  }
20331
20614
  )
20332
- },
20333
- col.key
20334
- );
20335
- }),
20336
- /* @__PURE__ */ jsx97(
20337
- "td",
20338
- {
20339
- style: { width: "300px", minWidth: "300px", maxWidth: "300px" },
20340
- className: "fc:px-4 fc:py-3 fc:align-middle",
20341
- children: /* @__PURE__ */ jsx97(
20342
- "div",
20343
- {
20344
- style: {
20345
- width: "268px",
20346
- wordBreak: "break-word",
20347
- overflowWrap: "anywhere"
20348
- },
20349
- className: "fc:whitespace-normal",
20350
- children: /* @__PURE__ */ jsx97("p", { className: "fc:text-xs fc:font-semibold fc:text-slate-800 fc:leading-relaxed", children: row.subject })
20351
- }
20352
- )
20353
- }
20354
- ),
20355
- /* @__PURE__ */ jsx97(
20356
- "td",
20357
- {
20358
- style: { width: "190px", minWidth: "190px", maxWidth: "190px" },
20359
- className: "fc:px-4 fc:py-3 fc:align-middle",
20360
- children: /* @__PURE__ */ jsx97(
20361
- "div",
20362
- {
20363
- style: {
20364
- width: "158px",
20365
- wordBreak: "break-word",
20366
- overflowWrap: "anywhere"
20367
- },
20368
- className: "fc:whitespace-normal",
20369
- children: /* @__PURE__ */ jsx97("span", { className: "fc:text-xs fc:font-medium fc:text-slate-700 fc:leading-relaxed", children: row.workflowName })
20370
- }
20371
- )
20372
- }
20373
- ),
20374
- /* @__PURE__ */ jsx97(
20375
- "td",
20376
- {
20377
- style: { width: "190px", minWidth: "190px", maxWidth: "190px" },
20378
- className: "fc:px-4 fc:py-3 fc:align-middle",
20379
- children: /* @__PURE__ */ jsx97(
20380
- "div",
20381
- {
20382
- style: {
20383
- width: "158px",
20384
- wordBreak: "break-word",
20385
- overflowWrap: "anywhere"
20386
- },
20387
- className: "fc:whitespace-normal",
20388
- children: /* @__PURE__ */ jsx97("span", { className: "fc:text-xs fc:text-slate-600 fc:font-medium fc:leading-relaxed", children: row.sender })
20389
- }
20390
- )
20391
- }
20392
- ),
20393
- /* @__PURE__ */ jsx97(
20394
- "td",
20395
- {
20396
- style: { width: "100px", minWidth: "100px", maxWidth: "100px" },
20397
- className: "fc:px-3 fc:py-3 fc:text-center fc:align-middle",
20398
- children: /* @__PURE__ */ jsx97(
20399
- "span",
20400
- {
20401
- className: `fc:inline-block fc:text-[10px] fc:font-extrabold fc:px-2 fc:py-0.5 fc:rounded-full ${row.priority === "Urgent" ? "fc:bg-red-50 fc:text-red-600 fc:border fc:border-red-200" : row.priority === "High" ? "fc:bg-amber-50 fc:text-amber-600 fc:border fc:border-amber-200" : row.priority === "Medium" ? "fc:bg-blue-50 fc:text-blue-600 fc:border fc:border-blue-200" : "fc:bg-slate-100 fc:text-slate-600 fc:border fc:border-slate-200"}`,
20402
- children: row.priority
20403
- }
20404
- )
20405
- }
20406
- ),
20407
- /* @__PURE__ */ jsx97(
20408
- "td",
20409
- {
20410
- style: { width: "150px", minWidth: "150px", maxWidth: "150px" },
20411
- className: "fc:px-4 fc:py-3 fc:align-middle",
20412
- children: /* @__PURE__ */ jsx97("div", { style: { width: "118px" }, className: "fc:whitespace-normal", children: /* @__PURE__ */ jsx97("span", { className: "fc:text-[11px] fc:text-slate-500 fc:font-medium fc:leading-relaxed", children: row.receivedDate }) })
20413
- }
20414
- ),
20415
- /* @__PURE__ */ jsx97(
20416
- "td",
20417
- {
20418
- style: { width: "150px", minWidth: "150px", maxWidth: "150px" },
20419
- className: "fc:px-4 fc:py-3 fc:align-middle",
20420
- children: /* @__PURE__ */ jsx97(
20421
- "div",
20615
+ }
20616
+ ),
20617
+ visibleDynamicColumns.map((col) => {
20618
+ const colWidthNum = parseInt(col.width || "180", 10);
20619
+ const contentWidth = `${Math.max(colWidthNum - 32, 80)}px`;
20620
+ return /* @__PURE__ */ jsx97(
20621
+ "td",
20422
20622
  {
20423
20623
  style: {
20424
- width: "118px",
20425
- wordBreak: "break-word",
20426
- overflowWrap: "anywhere"
20624
+ width: col.width || "180px",
20625
+ minWidth: col.width || "180px",
20626
+ maxWidth: col.width || "180px"
20427
20627
  },
20428
- className: "fc:whitespace-normal",
20628
+ className: "fc:px-4 fc:py-3 fc:align-middle fc:border-r fc:border-blue-100/60 fc:bg-blue-50/30 group-hover:fc:bg-blue-50/60 fc:transition-colors",
20429
20629
  children: /* @__PURE__ */ jsx97(
20430
- "span",
20630
+ "div",
20431
20631
  {
20432
- className: `fc:inline-block fc:text-[11px] fc:font-semibold fc:leading-relaxed ${String(row.slaStatus).includes("Critical") ? "fc:text-red-600 fc:font-bold" : String(row.slaStatus).includes("Met") ? "fc:text-emerald-600" : "fc:text-slate-600"}`,
20433
- children: row.slaStatus
20632
+ style: {
20633
+ width: contentWidth,
20634
+ wordBreak: "break-word",
20635
+ overflowWrap: "anywhere"
20636
+ },
20637
+ className: "fc:whitespace-normal",
20638
+ children: /* @__PURE__ */ jsx97("span", { className: "fc:text-xs fc:font-medium fc:text-slate-800 fc:leading-relaxed", children: row[col.key] || "-" })
20434
20639
  }
20435
20640
  )
20436
- }
20437
- )
20438
- }
20439
- ),
20440
- /* @__PURE__ */ jsx97(
20441
- "td",
20442
- {
20443
- style: { width: "120px", minWidth: "120px", maxWidth: "120px" },
20444
- className: "fc:px-3 fc:py-3 fc:text-center fc:align-middle",
20445
- children: /* @__PURE__ */ jsx97(
20446
- "span",
20447
- {
20448
- className: `fc:inline-block fc:text-[10px] fc:font-bold fc:px-2 fc:py-0.5 fc:rounded-full ${row.status === "Available" ? "fc:bg-blue-50 fc:text-blue-700 fc:border fc:border-blue-100" : row.status === "In Progress" || row.status === "Assigned to Me" ? "fc:bg-emerald-50 fc:text-emerald-700 fc:border fc:border-emerald-100" : "fc:bg-slate-100 fc:text-slate-600 fc:border fc:border-slate-200"}`,
20449
- children: row.status
20450
- }
20451
- )
20452
- }
20453
- ),
20454
- /* @__PURE__ */ jsxs96(
20455
- "td",
20456
- {
20457
- style: { width: "100px", minWidth: "100px", maxWidth: "100px" },
20458
- className: "fc:sticky fc:right-0 fc:z-10 fc:bg-white group-hover:fc:bg-slate-50/95 fc:px-3 fc:py-3 fc:text-center fc:align-middle fc:border-l fc:border-slate-100 fc:shadow-[-5px_0_10px_-4px_rgba(0,0,0,0.06)]",
20459
- children: [
20460
- activeTab === "filePool" && /* @__PURE__ */ jsxs96(
20461
- "button",
20641
+ },
20642
+ col.key
20643
+ );
20644
+ }),
20645
+ /* @__PURE__ */ jsx97(
20646
+ "td",
20647
+ {
20648
+ style: { width: "300px", minWidth: "300px", maxWidth: "300px" },
20649
+ className: "fc:px-4 fc:py-3 fc:align-middle",
20650
+ children: /* @__PURE__ */ jsx97(
20651
+ "div",
20462
20652
  {
20463
- type: "button",
20464
- onClick: () => handleOpenPoolModal(row),
20465
- style: { fontSize: "12px" },
20466
- className: "fc:inline-flex fc:items-center fc:gap-1.5 fc:h-8 fc:px-3 fc:bg-blue-600 hover:fc:bg-blue-700 fc:text-white fc:font-bold fc:rounded-xl fc:shadow-sm fc:shadow-blue-500/20 fc:transition-all hover:fc:scale-[1.02] active:fc:scale-95",
20467
- children: [
20468
- /* @__PURE__ */ jsx97(RiInboxArchiveLine2, { size: 14 }),
20469
- /* @__PURE__ */ jsx97("span", { children: "Pool" })
20470
- ]
20653
+ style: {
20654
+ width: "268px",
20655
+ wordBreak: "break-word",
20656
+ overflowWrap: "anywhere"
20657
+ },
20658
+ className: "fc:whitespace-normal",
20659
+ children: /* @__PURE__ */ jsx97("p", { className: "fc:text-xs fc:font-semibold fc:text-slate-800 fc:leading-relaxed", children: row.subject })
20471
20660
  }
20472
- ),
20473
- activeTab === "myFiles" && /* @__PURE__ */ jsxs96(
20474
- "button",
20661
+ )
20662
+ }
20663
+ ),
20664
+ /* @__PURE__ */ jsx97(
20665
+ "td",
20666
+ {
20667
+ style: { width: "190px", minWidth: "190px", maxWidth: "190px" },
20668
+ className: "fc:px-4 fc:py-3 fc:align-middle",
20669
+ children: /* @__PURE__ */ jsx97(
20670
+ "div",
20475
20671
  {
20476
- type: "button",
20477
- onClick: () => handleOpenTakeAction(row),
20478
- style: { fontSize: "12px" },
20479
- className: "fc:inline-flex fc:items-center fc:gap-1.5 fc:h-8 fc:px-3 fc:bg-emerald-600 hover:fc:bg-emerald-700 fc:text-white fc:font-bold fc:rounded-xl fc:shadow-sm fc:shadow-emerald-500/20 fc:transition-all hover:fc:scale-[1.02] active:fc:scale-95",
20480
- children: [
20481
- /* @__PURE__ */ jsx97(RiFileUploadLine, { size: 14 }),
20482
- /* @__PURE__ */ jsx97("span", { children: "Take Action" })
20483
- ]
20672
+ style: {
20673
+ width: "158px",
20674
+ wordBreak: "break-word",
20675
+ overflowWrap: "anywhere"
20676
+ },
20677
+ className: "fc:whitespace-normal",
20678
+ children: /* @__PURE__ */ jsx97("span", { className: "fc:text-xs fc:font-medium fc:text-slate-700 fc:leading-relaxed", children: row.workflowName })
20484
20679
  }
20485
- ),
20486
- activeTab === "totalFiles" && /* @__PURE__ */ jsxs96(
20487
- "button",
20680
+ )
20681
+ }
20682
+ ),
20683
+ /* @__PURE__ */ jsx97(
20684
+ "td",
20685
+ {
20686
+ style: { width: "190px", minWidth: "190px", maxWidth: "190px" },
20687
+ className: "fc:px-4 fc:py-3 fc:align-middle",
20688
+ children: /* @__PURE__ */ jsx97(
20689
+ "div",
20488
20690
  {
20489
- type: "button",
20490
- onClick: () => handleOpenView(row),
20491
- style: { fontSize: "12px" },
20492
- className: "fc:inline-flex fc:items-center fc:gap-1.5 fc:h-8 fc:px-3 fc:bg-slate-100 hover:fc:bg-slate-200 fc:text-slate-700 fc:font-bold fc:rounded-xl fc:transition-all hover:fc:scale-[1.02] active:fc:scale-95",
20493
- children: [
20494
- /* @__PURE__ */ jsx97(RiEyeLine2, { size: 14 }),
20495
- /* @__PURE__ */ jsx97("span", { children: "View" })
20496
- ]
20691
+ style: {
20692
+ width: "158px",
20693
+ wordBreak: "break-word",
20694
+ overflowWrap: "anywhere"
20695
+ },
20696
+ className: "fc:whitespace-normal",
20697
+ children: /* @__PURE__ */ jsx97("span", { className: "fc:text-xs fc:text-slate-600 fc:font-medium fc:leading-relaxed", children: row.sender })
20497
20698
  }
20498
20699
  )
20499
- ]
20500
- }
20501
- )
20502
- ]
20503
- },
20504
- row.fileId || row.fileNumber
20505
- );
20506
- }) })
20507
- ] }) }),
20700
+ }
20701
+ ),
20702
+ /* @__PURE__ */ jsx97(
20703
+ "td",
20704
+ {
20705
+ style: { width: "100px", minWidth: "100px", maxWidth: "100px" },
20706
+ className: "fc:px-3 fc:py-3 fc:text-center fc:align-middle",
20707
+ children: /* @__PURE__ */ jsx97(
20708
+ "span",
20709
+ {
20710
+ className: `fc:inline-block fc:text-[10px] fc:font-extrabold fc:px-2 fc:py-0.5 fc:rounded-full ${row.priority === "Urgent" ? "fc:bg-red-50 fc:text-red-600 fc:border fc:border-red-200" : row.priority === "High" ? "fc:bg-amber-50 fc:text-amber-600 fc:border fc:border-amber-200" : row.priority === "Medium" ? "fc:bg-blue-50 fc:text-blue-600 fc:border fc:border-blue-200" : "fc:bg-slate-100 fc:text-slate-600 fc:border fc:border-slate-200"}`,
20711
+ children: row.priority
20712
+ }
20713
+ )
20714
+ }
20715
+ ),
20716
+ /* @__PURE__ */ jsx97(
20717
+ "td",
20718
+ {
20719
+ style: { width: "150px", minWidth: "150px", maxWidth: "150px" },
20720
+ className: "fc:px-4 fc:py-3 fc:align-middle",
20721
+ children: /* @__PURE__ */ jsx97("div", { style: { width: "118px" }, className: "fc:whitespace-normal", children: /* @__PURE__ */ jsx97("span", { className: "fc:text-[11px] fc:text-slate-500 fc:font-medium fc:leading-relaxed", children: row.receivedDate }) })
20722
+ }
20723
+ ),
20724
+ /* @__PURE__ */ jsx97(
20725
+ "td",
20726
+ {
20727
+ style: { width: "150px", minWidth: "150px", maxWidth: "150px" },
20728
+ className: "fc:px-4 fc:py-3 fc:align-middle",
20729
+ children: /* @__PURE__ */ jsx97(
20730
+ "div",
20731
+ {
20732
+ style: {
20733
+ width: "118px",
20734
+ wordBreak: "break-word",
20735
+ overflowWrap: "anywhere"
20736
+ },
20737
+ className: "fc:whitespace-normal",
20738
+ children: /* @__PURE__ */ jsx97(
20739
+ "span",
20740
+ {
20741
+ className: `fc:inline-block fc:text-[11px] fc:font-semibold fc:leading-relaxed ${String(row.slaStatus).includes("Critical") ? "fc:text-red-600 fc:font-bold" : String(row.slaStatus).includes("Met") ? "fc:text-emerald-600" : "fc:text-slate-600"}`,
20742
+ children: row.slaStatus
20743
+ }
20744
+ )
20745
+ }
20746
+ )
20747
+ }
20748
+ ),
20749
+ activeTab === "totalFiles" && /* @__PURE__ */ jsx97(
20750
+ "td",
20751
+ {
20752
+ style: { width: "160px", minWidth: "160px", maxWidth: "160px" },
20753
+ className: "fc:px-4 fc:py-3 fc:align-middle",
20754
+ children: /* @__PURE__ */ jsx97("span", { className: "fc:text-xs fc:font-medium fc:text-slate-700", children: row.fileAt })
20755
+ }
20756
+ ),
20757
+ /* @__PURE__ */ jsx97(
20758
+ "td",
20759
+ {
20760
+ style: { width: "190px", minWidth: "190px", maxWidth: "190px" },
20761
+ className: "fc:px-3 fc:py-3 fc:text-center fc:align-middle",
20762
+ children: /* @__PURE__ */ jsx97(
20763
+ "span",
20764
+ {
20765
+ className: `fc:inline-block fc:whitespace-nowrap fc:text-[10px] fc:font-bold fc:px-2 fc:py-0.5 fc:rounded-full ${row.status === "Available" ? "fc:bg-blue-50 fc:text-blue-700 fc:border fc:border-blue-100" : row.status === "In Progress" || row.status === "Assigned to Me" ? "fc:bg-emerald-50 fc:text-emerald-700 fc:border fc:border-emerald-100" : row.status === "RETURN_TO_APPLICANT" ? "fc:bg-amber-50 fc:text-amber-700 fc:border fc:border-amber-200" : "fc:bg-slate-100 fc:text-slate-600 fc:border fc:border-slate-200"}`,
20766
+ children: row.status
20767
+ }
20768
+ )
20769
+ }
20770
+ ),
20771
+ /* @__PURE__ */ jsxs96(
20772
+ "td",
20773
+ {
20774
+ style: { width: "195px", minWidth: "195px", maxWidth: "195px" },
20775
+ className: "fc:sticky fc:right-0 fc:z-10 fc:bg-white group-hover:fc:bg-slate-50/95 fc:px-2 fc:py-3 fc:align-middle fc:border-l fc:border-slate-100 fc:shadow-[-5px_0_10px_-4px_rgba(0,0,0,0.06)]",
20776
+ children: [
20777
+ activeTab === "filePool" && /* @__PURE__ */ jsxs96(
20778
+ "button",
20779
+ {
20780
+ type: "button",
20781
+ onClick: () => handleOpenPoolModal(row),
20782
+ style: { fontSize: "12px" },
20783
+ className: "fc:inline-flex fc:items-center fc:gap-1.5 fc:h-8 fc:px-3 fc:bg-blue-600 hover:fc:bg-blue-700 fc:text-white fc:font-bold fc:rounded-xl fc:shadow-sm fc:shadow-blue-500/20 fc:transition-all hover:fc:scale-[1.02] active:fc:scale-95",
20784
+ children: [
20785
+ /* @__PURE__ */ jsx97(RiInboxArchiveLine2, { size: 14 }),
20786
+ /* @__PURE__ */ jsx97("span", { children: "Claim" })
20787
+ ]
20788
+ }
20789
+ ),
20790
+ activeTab === "myFiles" && /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:items-center fc:justify-center fc:gap-1.5", children: [
20791
+ /* @__PURE__ */ jsxs96(
20792
+ "button",
20793
+ {
20794
+ type: "button",
20795
+ onClick: () => handleOpenTakeAction(row),
20796
+ style: { fontSize: "11px" },
20797
+ className: "fc:inline-flex fc:items-center fc:justify-center fc:gap-1 fc:h-8 fc:px-2 fc:whitespace-nowrap fc:bg-emerald-600 hover:fc:bg-emerald-700 fc:text-white fc:font-bold fc:rounded-lg fc:shadow-sm fc:shadow-emerald-500/20 fc:transition-all hover:fc:scale-[1.02] active:fc:scale-95",
20798
+ children: [
20799
+ /* @__PURE__ */ jsx97(RiFileUploadLine, { size: 13 }),
20800
+ /* @__PURE__ */ jsx97("span", { children: "Take Action" })
20801
+ ]
20802
+ }
20803
+ ),
20804
+ /* @__PURE__ */ jsx97(
20805
+ "button",
20806
+ {
20807
+ type: "button",
20808
+ style: { fontSize: "11px" },
20809
+ className: "fc:inline-flex fc:items-center fc:justify-center fc:h-8 fc:px-2 fc:whitespace-nowrap fc:border fc:border-rose-200 fc:bg-rose-50 fc:text-rose-700 fc:font-bold fc:rounded-lg hover:fc:bg-rose-100 hover:fc:border-rose-300 fc:transition-colors active:fc:scale-95",
20810
+ children: "Unclaim"
20811
+ }
20812
+ )
20813
+ ] }),
20814
+ activeTab === "totalFiles" && /* @__PURE__ */ jsxs96(
20815
+ "button",
20816
+ {
20817
+ type: "button",
20818
+ onClick: () => handleOpenView(row),
20819
+ style: { fontSize: "12px" },
20820
+ className: "fc:inline-flex fc:items-center fc:gap-1.5 fc:h-8 fc:px-3 fc:bg-slate-100 hover:fc:bg-slate-200 fc:text-slate-700 fc:font-bold fc:rounded-xl fc:transition-all hover:fc:scale-[1.02] active:fc:scale-95",
20821
+ children: [
20822
+ /* @__PURE__ */ jsx97(RiEyeLine2, { size: 14 }),
20823
+ /* @__PURE__ */ jsx97("span", { children: "View" })
20824
+ ]
20825
+ }
20826
+ )
20827
+ ]
20828
+ }
20829
+ )
20830
+ ]
20831
+ },
20832
+ row.fileId || row.fileNumber
20833
+ );
20834
+ }) })
20835
+ ] })
20836
+ ] }),
20508
20837
  /* @__PURE__ */ jsxs96("div", { className: "fc:flex fc:flex-col sm:fc:flex-row fc:items-center fc:justify-between fc:gap-3 fc:pt-3 fc:px-1", children: [
20509
20838
  /* @__PURE__ */ jsxs96("span", { className: "fc:text-xs fc:text-slate-500 fc:font-medium", children: [
20510
20839
  "Showing ",
@@ -20867,7 +21196,7 @@ function TrackingSlipModal({ isOpen, onClose, application }) {
20867
21196
  }
20868
21197
 
20869
21198
  // src/components/track-application/TrackApplicationMain.jsx
20870
- import { Fragment as Fragment5, jsx as jsx99, jsxs as jsxs98 } from "react/jsx-runtime";
21199
+ import { Fragment as Fragment6, jsx as jsx99, jsxs as jsxs98 } from "react/jsx-runtime";
20871
21200
  var APPLICATION_DATABASE = [];
20872
21201
  function TrackApplicationMain() {
20873
21202
  var _a, _b, _c;
@@ -21083,7 +21412,7 @@ function TrackApplicationMain() {
21083
21412
  VIEW 1: LIVE TRACKING DASHBOARD
21084
21413
  ======================================================== */
21085
21414
  /* @__PURE__ */ jsxs98("div", { className: "fc:space-y-4", children: [
21086
- selectedApplication && /* @__PURE__ */ jsxs98(Fragment5, { children: [
21415
+ selectedApplication && /* @__PURE__ */ jsxs98(Fragment6, { children: [
21087
21416
  /* @__PURE__ */ jsxs98("div", { className: "fc:rounded-2xl fc:border fc:border-blue-100 fc:bg-gradient-to-r fc:from-blue-50/80 fc:via-indigo-50/40 fc:to-white fc:p-4.5 fc:shadow-sm", children: [
21088
21417
  /* @__PURE__ */ jsxs98("div", { className: "fc:flex fc:items-center fc:justify-between fc:gap-3 fc:flex-wrap", children: [
21089
21418
  /* @__PURE__ */ jsxs98("div", { className: "fc:flex fc:items-center fc:gap-2 fc:flex-wrap", children: [
@@ -21665,7 +21994,7 @@ function TrackApplicationMain() {
21665
21994
  }
21666
21995
 
21667
21996
  // src/components/Sidebar.jsx
21668
- import { Fragment as Fragment6, jsx as jsx100, jsxs as jsxs99 } from "react/jsx-runtime";
21997
+ import { Fragment as Fragment7, jsx as jsx100, jsxs as jsxs99 } from "react/jsx-runtime";
21669
21998
  function Sidebar({ isOpen, onToggle, childrens, sidebar, sidebarConfig }) {
21670
21999
  const router = useRouter();
21671
22000
  const resolvedSidebarConfig = sidebar != null ? sidebar : sidebarConfig;
@@ -21934,7 +22263,7 @@ function Sidebar({ isOpen, onToggle, childrens, sidebar, sidebarConfig }) {
21934
22263
  /* @__PURE__ */ jsx100("p", { className: "fc:text-sm fc:text-[#405170]", children: "You do not have permission to access FlowCore. Please contact your administrator." })
21935
22264
  ] }) });
21936
22265
  }
21937
- return /* @__PURE__ */ jsxs99(Fragment6, { children: [
22266
+ return /* @__PURE__ */ jsxs99(Fragment7, { children: [
21938
22267
  /* @__PURE__ */ jsxs99(
21939
22268
  "aside",
21940
22269
  {
@@ -21964,7 +22293,7 @@ function Sidebar({ isOpen, onToggle, childrens, sidebar, sidebarConfig }) {
21964
22293
  )
21965
22294
  ] }),
21966
22295
  /* @__PURE__ */ jsxs99("div", { className: "fc:min-h-0 min-h-0 fc:flex-1 flex-1 fc:overflow-y-auto overflow-y-auto fc:overflow-x-hidden overflow-x-hidden fc:px-[12px] px-[12px] fc:pb-[24px] pb-[24px] fc:pt-[20px] pt-[20px]", children: [
21967
- (workflowItems.length > 0 || permissionItems.length > 0 || hierarchyItems.length > 0 || documentItems.length > 0) && /* @__PURE__ */ jsxs99(Fragment6, { children: [
22296
+ (workflowItems.length > 0 || permissionItems.length > 0 || hierarchyItems.length > 0 || documentItems.length > 0) && /* @__PURE__ */ jsxs99(Fragment7, { children: [
21968
22297
  /* @__PURE__ */ jsx100("p", { className: "fc:mb-[10px] mb-[10px] fc:px-[10px] px-[10px] fc:text-[12px] text-[12px] fc:font-bold font-bold fc:uppercase uppercase fc:leading-[16px] leading-[16px] fc:tracking-[0.5px] tracking-[0.5px] fc:text-[#3C4D74] text-[#3C4D74]", children: "Configuration Masters" }),
21969
22298
  /* @__PURE__ */ jsxs99("div", { className: "fc:flex flex fc:flex-col flex-col fc:gap-[2px] gap-[2px]", children: [
21970
22299
  renderDropdown("Workflow", workflowOpen, setWorkflowOpen, workflowItems, RiNodeTree),
@@ -21973,7 +22302,7 @@ function Sidebar({ isOpen, onToggle, childrens, sidebar, sidebarConfig }) {
21973
22302
  renderDropdown("Hierarchy", hierarchyOpen, setHierarchyOpen, hierarchyItems, RiNodeTree)
21974
22303
  ] })
21975
22304
  ] }),
21976
- (fileItems.length > 0 || taskItems.length > 0 || trackingItems.length > 0 || communicationItems.length > 0) && /* @__PURE__ */ jsxs99(Fragment6, { children: [
22305
+ (fileItems.length > 0 || taskItems.length > 0 || trackingItems.length > 0 || communicationItems.length > 0) && /* @__PURE__ */ jsxs99(Fragment7, { children: [
21977
22306
  /* @__PURE__ */ jsx100("p", { className: "fc:mb-[10px] mb-[10px] fc:px-[10px] px-[10px] fc:mt-[24px] mt-[24px] fc:text-[12px] text-[12px] fc:font-bold font-bold fc:uppercase uppercase fc:leading-[16px] leading-[16px] fc:tracking-[0.5px] tracking-[0.5px] fc:text-[#3C4D74] text-[#3C4D74]", children: "Runtime" }),
21978
22307
  /* @__PURE__ */ jsxs99("div", { className: "fc:flex flex fc:flex-col flex-col fc:gap-[2px] gap-[2px]", children: [
21979
22308
  renderDropdown("Files", filesOpen, setFilesOpen, fileItems, RiFolder3Line),