flowcore-fn 2.9.3 → 2.9.5

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.
@@ -1,3 +1,23 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+
1
21
  // src/components/WorkflowStep/main.js
2
22
  import React3, { useState } from "react";
3
23
 
@@ -7,10 +27,15 @@ import { jsx, jsxs } from "react/jsx-runtime";
7
27
  function Footer() {
8
28
  return /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center px-6 py-4 border-t border-gray-200 bg-white", children: [
9
29
  /* @__PURE__ */ jsx("div", { className: "text-sm text-slate-500", children: "Showing 1 to 5 of 5 entries" }),
10
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
11
- /* @__PURE__ */ jsx("button", { className: "px-3 py-1.5 border border-slate-200 rounded-lg bg-white text-slate-600 hover:bg-slate-50 shadow-sm", children: "\u2039" }),
12
- /* @__PURE__ */ jsx("button", { className: "px-3.5 py-1.5 bg-blue-600 text-white rounded-lg font-bold shadow-md shadow-blue-500/20", children: "1" }),
13
- /* @__PURE__ */ jsx("button", { className: "px-3 py-1.5 border border-slate-200 rounded-lg bg-white text-slate-600 hover:bg-slate-50 shadow-sm", children: "\u203A" })
30
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
31
+ /* @__PURE__ */ jsx("button", { className: "px-3 py-1.5 border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "First" }),
32
+ /* @__PURE__ */ jsx("button", { className: "px-3 py-1.5 border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "\u2039 Prev" }),
33
+ /* @__PURE__ */ jsx("button", { className: "w-9 h-9 border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "1" }),
34
+ /* @__PURE__ */ jsx("button", { className: "w-9 h-9 border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "2" }),
35
+ /* @__PURE__ */ jsx("button", { className: "w-9 h-9 border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "3" }),
36
+ /* @__PURE__ */ jsx("button", { className: "w-9 h-9 border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "4" }),
37
+ /* @__PURE__ */ jsx("button", { className: "px-3 py-1.5 border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "Next \u203A" }),
38
+ /* @__PURE__ */ jsx("button", { className: "px-3 py-1.5 border border-slate-200 rounded-lg bg-white text-slate-600 shadow-sm transition-all duration-200 hover:bg-blue-600 hover:text-white hover:border-blue-600", children: "Last" })
14
39
  ] })
15
40
  ] });
16
41
  }
@@ -18,7 +43,7 @@ function Footer() {
18
43
  // src/components/WorkflowStep/main.js
19
44
  import Link from "next/link";
20
45
 
21
- // src/components/AddWorkflowStepModal.js
46
+ // src/components/WorkflowStep/AddWorkflowStepModal.js
22
47
  import React2 from "react";
23
48
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
24
49
  function AddWorkflowStepModal({ onClose }) {
@@ -312,6 +337,21 @@ var workflowSteps = [
312
337
  ];
313
338
  function WorkflowStep() {
314
339
  const [showModal, setShowModal] = useState(false);
340
+ const [pageSize, setPageSize] = useState(5);
341
+ const [sortConfig, setSortConfig] = useState({
342
+ key: "",
343
+ direction: "asc"
344
+ });
345
+ const handleSort = (key) => {
346
+ let direction = "asc";
347
+ if (sortConfig.key === key && sortConfig.direction === "asc") {
348
+ direction = "desc";
349
+ }
350
+ setSortConfig({
351
+ key,
352
+ direction
353
+ });
354
+ };
315
355
  return /* @__PURE__ */ jsx3("div", { className: "p-6 bg-[#f5f7fb] min-h-screen font-sans text-slate-700", children: /* @__PURE__ */ jsxs3("div", { className: "bg-white rounded-2xl shadow-md overflow-hidden", children: [
316
356
  /* @__PURE__ */ jsxs3("div", { className: "px-6 py-5 border-b border-gray-200", children: [
317
357
  /* @__PURE__ */ jsx3("h1", { className: "m-0 text-[30px] leading-tight font-semibold text-[#1E293B] tracking-tight", children: "Workflow Step" }),
@@ -334,38 +374,59 @@ function WorkflowStep() {
334
374
  className: "w-[300px] px-4 py-2.5 border border-slate-200/80 rounded-lg text-[13px] text-slate-600 focus:outline-none bg-slate-50"
335
375
  }
336
376
  ),
377
+ /* @__PURE__ */ jsxs3("div", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: [
378
+ /* @__PURE__ */ jsx3("span", { children: "Show" }),
379
+ /* @__PURE__ */ jsxs3(
380
+ "select",
381
+ {
382
+ value: pageSize,
383
+ onChange: (e) => setPageSize(Number(e.target.value)),
384
+ className: "inline-flex item-center px-3 py-1 rounded-md bg-[#f1f5f9] text-[#334155] text-xs font-semibold border border-[#e2e8f0]",
385
+ children: [
386
+ /* @__PURE__ */ jsx3("option", { value: 5, children: "5" }),
387
+ /* @__PURE__ */ jsx3("option", { value: 10, children: "10" }),
388
+ /* @__PURE__ */ jsx3("option", { value: 25, children: "25" })
389
+ ]
390
+ }
391
+ ),
392
+ /* @__PURE__ */ jsx3("span", { children: "entries" })
393
+ ] }),
337
394
  /* @__PURE__ */ jsx3(
338
395
  "button",
339
396
  {
340
397
  onClick: () => setShowModal(true),
341
398
  className: "px-5 py-2.5 bg-blue-600 text-white rounded-lg text-[13px] font-semibold hover:bg-blue-700 transition-colors",
342
- children: "+ Add Workflow Type"
399
+ children: "+ Add Workflow Step"
343
400
  }
344
401
  )
345
402
  ] }) }),
346
403
  /* @__PURE__ */ jsxs3("div", { className: "overflow-x-auto", children: [
347
404
  /* @__PURE__ */ jsxs3("table", { className: "w-full border-collapse", children: [
348
- /* @__PURE__ */ jsx3("thead", { children: /* @__PURE__ */ jsx3("tr", { className: "bg-slate-50/70 border-b border-slate-200 text-[11px] font-bold uppercase tracking-wider text-slate-500", children: [
349
- "WorkflowStepId",
350
- "WorkflowId",
351
- "StepCode",
352
- "StepName",
353
- "SequenceNo",
354
- "SLA Type",
355
- "SLA Value",
356
- "Reminder Before",
357
- "Escalation After",
358
- "Working Hours Only",
359
- "Exclude Holidays"
360
- ].map((heading) => /* @__PURE__ */ jsx3(
405
+ /* @__PURE__ */ jsx3("thead", { children: /* @__PURE__ */ jsx3("tr", { className: "bg-slate-50/70 border-b border-slate-200 text-xs font-bold uppercase tracking-wider text-slate-500", children: [
406
+ { label: "WorkflowStepId", key: "workflowStepId" },
407
+ { label: "WorkflowId", key: "workflowId" },
408
+ { label: "StepCode", key: "stepCode" },
409
+ { label: "StepName", key: "stepName" },
410
+ { label: "SequenceNo", key: "sequenceNo" },
411
+ { label: "SLA Type", key: "slaType" },
412
+ { label: "SLA Value", key: "slaValue" },
413
+ { label: "Reminder Before", key: "reminderBefore" },
414
+ { label: "Escalation After", key: "escalationAfter" },
415
+ { label: "Working Hours Only", key: "workingHoursOnly" },
416
+ { label: "Exclude Holidays", key: "excludeHolidays" }
417
+ ].map((column) => /* @__PURE__ */ jsx3(
361
418
  "th",
362
419
  {
420
+ onClick: () => handleSort(column.key),
363
421
  className: "px-4 py-3 text-left border-b border-gray-200 text-[11px] font-bold uppercase tracking-wider text-slate-500",
364
- children: heading
422
+ children: /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
423
+ /* @__PURE__ */ jsx3("span", { children: column.label }),
424
+ /* @__PURE__ */ jsx3("span", { className: "text-gray-400 text-xs", children: sortConfig.key === column.key ? sortConfig.direction === "asc" ? "\u25B2" : "\u25BC" : "\u2195" })
425
+ ] })
365
426
  },
366
- heading
427
+ column.key
367
428
  )) }) }),
368
- /* @__PURE__ */ jsx3("tbody", { children: workflowSteps.map((item) => /* @__PURE__ */ jsxs3(
429
+ /* @__PURE__ */ jsx3("tbody", { children: workflowSteps.slice(0, pageSize).map((item) => /* @__PURE__ */ jsxs3(
369
430
  "tr",
370
431
  {
371
432
  className: "hover:bg-slate-50 transition-colors",
@@ -399,11 +460,11 @@ function WorkflowPage() {
399
460
  return /* @__PURE__ */ jsx4(WorkflowStep, {});
400
461
  }
401
462
 
402
- // src/pages/Sidebar.js
403
- import { useState as useState3 } from "react";
463
+ // src/components/Layout.jsx
464
+ import { useState as useState9 } from "react";
404
465
 
405
466
  // src/components/Sidebar.jsx
406
- import { useState as useState2 } from "react";
467
+ import { useEffect as useEffect2, useState as useState8 } from "react";
407
468
  import {
408
469
  RiMenuLine,
409
470
  RiGitMergeLine,
@@ -427,227 +488,1680 @@ import {
427
488
  RiArrowRightSLine
428
489
  } from "@remixicon/react";
429
490
  import { useRouter } from "next/router";
430
- import { Fragment, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
431
- var workflowItems = [
432
- { name: "Workflow Type", path: "/WorkflowType", icon: RiGitMergeLine },
433
- { name: "Workflow", path: "/workflow", icon: RiNodeTree },
434
- { name: "Workflow Step", path: "/workflowMaster", icon: RiGitBranchLine },
435
- { name: "Workflow Transition", path: "/TaskPermissionPage", icon: RiCornerDownRightLine }
436
- ];
437
- var permissionItems = [
438
- { name: "Task Permission", path: "/WorkflowType", icon: RiUserSettingsLine },
439
- { name: "Assignment Rule", path: "/WorkflowType", icon: RiFileShieldLine }
440
- ];
441
- var hierarchyItems = [
442
- { name: "Hierarchy Node", path: "/WorkflowType", icon: RiNodeTree },
443
- { name: "User Hierarchy Mapping", path: "/WorkflowType", icon: RiUserSharedLine },
444
- { name: "Workflow Settings", path: "/WorkflowType", icon: RiSettings4Line }
445
- ];
446
- var documentItems = [
447
- { name: "Document Configuration", path: "/WorkflowType", icon: RiFileSettingsLine }
448
- ];
449
- var fileItems = [
450
- { name: "File Instance", path: "/WorkflowType", icon: RiFileList3Line },
451
- { name: "File Pool", path: "/WorkflowType", icon: RiDatabase2Line },
452
- { name: "Uploaded Document", path: "/WorkflowType", icon: RiFileUploadLine }
453
- ];
454
- var communicationItems = [
455
- { name: "Notification", path: "/WorkflowType", icon: RiNotification4Line },
456
- { name: "Comment", path: "/WorkflowType", icon: RiChat3Line }
457
- ];
458
- var taskItems = [
459
- { name: "Task Instance", path: "/WorkflowType", icon: RiCheckboxMultipleLine }
460
- ];
461
- var trackingItems = [
462
- { name: "Audit Log", path: "/WorkflowType", icon: RiShieldCheckLine },
463
- { name: "Movement History", path: "/WorkflowType", icon: RiHistoryLine }
464
- ];
465
- function Sidebar({ isOpen, onToggle }) {
466
- const router = useRouter();
467
- const [workflowOpen, setWorkflowOpen] = useState2(false);
468
- const [permissionOpen, setPermissionOpen] = useState2(false);
469
- const [hierarchyOpen, setHierarchyOpen] = useState2(false);
470
- const [documentOpen, setDocumentOpen] = useState2(false);
471
- const [filesOpen, setFilesOpen] = useState2(false);
472
- const [tasksOpen, setTasksOpen] = useState2(false);
473
- const [trackingOpen, setTrackingOpen] = useState2(false);
474
- const [communicationOpen, setCommunicationOpen] = useState2(false);
475
- const renderMenuItem = (item) => {
476
- const Icon = item.icon;
477
- return /* @__PURE__ */ jsxs4(
478
- "button",
479
- {
480
- type: "button",
481
- className: `
482
- flex h-[56px] w-full items-center gap-[17px]
483
- rounded-[9px] px-[17px]
484
- text-left transition-colors duration-150
485
- ${router.pathname === item.path ? "bg-blue-50 text-blue-600" : "text-[#344261] hover:bg-[#F6F8FC]"}
486
- `,
487
- onClick: () => router.push(item.path),
488
- children: [
491
+
492
+ // src/components/workflowMaster/workFlowMasterMain.js
493
+ import { useState as useState3 } from "react";
494
+
495
+ // src/components/workflowMaster/workflowTable.jsx
496
+ import { useState as useState2, useEffect } from "react";
497
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
498
+ function WorkflowTable({
499
+ search = "",
500
+ workflows = [],
501
+ workflowtoggle,
502
+ entriesPerPage,
503
+ setEntriesPerPage
504
+ }) {
505
+ const [sortField, setSortField] = useState2("");
506
+ const [sortDirection, setSortDirection] = useState2("asc");
507
+ const [currentPage, setCurrentPage] = useState2(100);
508
+ useEffect(() => {
509
+ setCurrentPage(100);
510
+ }, [search]);
511
+ const handleSort = (field) => {
512
+ if (sortField === field) {
513
+ setSortDirection(sortDirection === "asc" ? "desc" : "asc");
514
+ } else {
515
+ setSortField(field);
516
+ setSortDirection("asc");
517
+ }
518
+ };
519
+ const filteredworkflows = workflows.filter(
520
+ (workflow) => {
521
+ var _a, _b;
522
+ return ((_a = workflow == null ? void 0 : workflow.name) == null ? void 0 : _a.toLowerCase().includes(search.toLowerCase())) || ((_b = workflow == null ? void 0 : workflow.workflowcode) == null ? void 0 : _b.toLowerCase().includes(search.toLowerCase()));
523
+ }
524
+ );
525
+ const sortedWorkflows = [...filteredworkflows].sort((a, b) => {
526
+ if (!sortField) return 0;
527
+ let valA = a[sortField] !== void 0 && a[sortField] !== null ? a[sortField].toString().toLowerCase() : "";
528
+ let valB = b[sortField] !== void 0 && b[sortField] !== null ? b[sortField].toString().toLowerCase() : "";
529
+ if (sortField === "version") {
530
+ valA = Number(a[sortField]) || 0;
531
+ valB = Number(b[sortField]) || 0;
532
+ }
533
+ if (valA < valB) return sortDirection === "asc" ? -1 : 1;
534
+ if (valA > valB) return sortDirection === "asc" ? 1 : -1;
535
+ return 0;
536
+ });
537
+ const totalEntries = sortedWorkflows.length;
538
+ const totalPages = Math.ceil(totalEntries / (entriesPerPage || 10)) || 1;
539
+ const activePage = currentPage > totalPages ? 1 : currentPage;
540
+ const indexOfLastEntry = activePage * (entriesPerPage || 10);
541
+ const indexOfFirstEntry = indexOfLastEntry - (entriesPerPage || 10);
542
+ const currentDisplayedWorkflows = sortedWorkflows.slice(indexOfFirstEntry, indexOfLastEntry);
543
+ const renderSortIcon = (field) => {
544
+ if (sortField !== field) {
545
+ return /* @__PURE__ */ jsx5("svg", { className: "w-3.5 h-3.5 text-slate-300", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { d: "M12 3.25a.75.75 0 01.53.22l3.25 3.25a.75.75 0 11-1.06 1.06L12.75 5.81v12.38l1.97-1.97a.75.75 0 111.06 1.06l-3.25 3.25a.75.75 0 01-1.06 0l-3.25-3.25a.75.75 0 111.06-1.06l1.97 1.97V5.81L9.28 7.78a.75.75 0 01-1.06-1.06l3.25-3.25a.75.75 0 01.53-.22z" }) });
546
+ }
547
+ return sortDirection === "asc" ? /* @__PURE__ */ jsx5("svg", { className: "w-3.5 h-3.5 text-blue-600", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { d: "M12.53 3.47a.75.75 0 00-1.06 0l-4 4a.75.75 0 001.06 1.06L11 5.81V19a.75.75 0 001.5 0V5.81l2.47 2.47a.75.75 0 001.06-1.06l-4-4z" }) }) : /* @__PURE__ */ jsx5("svg", { className: "w-3.5 h-3.5 text-blue-600", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { d: "M11.47 20.53a.75.75 0 001.06 0l4-4a.75.75 0 00-1.06-1.06L13 18.19V5a.75.75 0 00-1.5 0v13.19l-2.47-2.47a.75.75 0 00-1.06 1.06l4 4z" }) });
548
+ };
549
+ return /* @__PURE__ */ jsxs4("div", { className: "space-y-6", children: [
550
+ /* @__PURE__ */ jsx5("div", { className: "border border-slate-100 rounded-2xl overflow-hidden bg-white shadow-sm", children: /* @__PURE__ */ jsxs4("table", { className: "w-full border-collapse", children: [
551
+ /* @__PURE__ */ jsx5("thead", { className: "bg-[#f8fafc]", children: /* @__PURE__ */ jsxs4("tr", { children: [
552
+ /* @__PURE__ */ jsx5("th", { className: "px-6 py-4 text-left text-xs font-bold text-slate-500 uppercase tracking-wider w-20", children: "S.No" }),
553
+ /* @__PURE__ */ jsx5(
554
+ "th",
555
+ {
556
+ onClick: () => handleSort("name"),
557
+ className: "px-6 py-4 text-left text-xs font-bold text-slate-500 uppercase tracking-wider cursor-pointer select-none hover:bg-slate-100 transition-colors",
558
+ children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1.5", children: [
559
+ "Workflow Name ",
560
+ renderSortIcon("name")
561
+ ] })
562
+ }
563
+ ),
564
+ /* @__PURE__ */ jsx5(
565
+ "th",
566
+ {
567
+ onClick: () => handleSort("workflowcode"),
568
+ className: "px-6 py-4 text-left text-xs font-bold text-slate-500 uppercase tracking-wider cursor-pointer select-none hover:bg-slate-100 transition-colors",
569
+ children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1.5", children: [
570
+ "Workflow Code ",
571
+ renderSortIcon("workflowcode")
572
+ ] })
573
+ }
574
+ ),
575
+ /* @__PURE__ */ jsx5(
576
+ "th",
577
+ {
578
+ onClick: () => handleSort("workflowtype"),
579
+ className: "px-6 py-4 text-left text-xs font-bold text-slate-500 uppercase tracking-wider cursor-pointer select-none hover:bg-slate-100 transition-colors",
580
+ children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1.5", children: [
581
+ "Workflow Type ",
582
+ renderSortIcon("workflowtype")
583
+ ] })
584
+ }
585
+ ),
586
+ /* @__PURE__ */ jsx5(
587
+ "th",
588
+ {
589
+ onClick: () => handleSort("version"),
590
+ className: "px-6 py-4 text-left text-xs font-bold text-slate-500 uppercase tracking-wider cursor-pointer select-none hover:bg-slate-100 transition-colors w-24",
591
+ children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1.5", children: [
592
+ "Version ",
593
+ renderSortIcon("version")
594
+ ] })
595
+ }
596
+ ),
597
+ /* @__PURE__ */ jsx5("th", { className: "px-6 py-4 text-center text-xs font-bold text-slate-500 uppercase tracking-wider w-32", children: "Published" }),
598
+ /* @__PURE__ */ jsx5("th", { className: "px-6 py-4 text-center text-xs font-bold text-slate-500 uppercase tracking-wider w-32", children: "Status" })
599
+ ] }) }),
600
+ /* @__PURE__ */ jsx5("tbody", { className: "divide-y divide-slate-100", children: currentDisplayedWorkflows.length === 0 ? /* @__PURE__ */ jsx5("tr", { children: /* @__PURE__ */ jsx5("td", { colSpan: 7, className: "px-6 py-12 text-center text-sm font-medium text-slate-400 bg-white", children: "No workflows found matching your criteria." }) }) : currentDisplayedWorkflows.map((workflow, index) => /* @__PURE__ */ jsxs4("tr", { className: "hover:bg-slate-50/50 transition", children: [
601
+ /* @__PURE__ */ jsx5("td", { className: "px-6 py-4 text-sm text-slate-400 font-medium", children: indexOfFirstEntry + index + 1 }),
602
+ /* @__PURE__ */ jsx5("td", { className: "px-6 py-4 text-sm font-semibold text-slate-800", children: workflow.name }),
603
+ /* @__PURE__ */ jsx5("td", { className: "px-6 py-4 text-sm text-slate-500 font-medium", children: workflow.workflowcode }),
604
+ /* @__PURE__ */ jsx5("td", { className: "px-6 py-4 text-sm text-slate-500 font-medium", children: workflow.workflowtype }),
605
+ /* @__PURE__ */ jsx5("td", { className: "px-6 py-4 text-sm text-slate-800 font-bold", children: workflow.version }),
606
+ /* @__PURE__ */ jsx5("td", { className: "px-6 py-4 text-center", children: (() => {
607
+ var _a;
608
+ const isPublished = ((_a = workflow == null ? void 0 : workflow.published) == null ? void 0 : _a.toString().toLowerCase()) === "yes" || (workflow == null ? void 0 : workflow.published) === true;
609
+ return /* @__PURE__ */ jsx5("span", { className: `inline-flex items-center gap-1 px-2.5 py-1 rounded-md text-xs font-semibold ${isPublished ? "bg-emerald-50 text-emerald-600 border border-emerald-200/50" : "bg-rose-50 text-rose-600 border border-rose-200/50"}`, children: isPublished ? "\u2713 Yes" : "\u2715 No" });
610
+ })() }),
611
+ /* @__PURE__ */ jsx5("td", { className: "px-6 py-4 text-center", children: /* @__PURE__ */ jsx5("div", { className: "flex justify-center items-center", children: /* @__PURE__ */ jsxs4("label", { className: "relative inline-flex items-center cursor-pointer group", children: [
489
612
  /* @__PURE__ */ jsx5(
490
- "span",
613
+ "input",
491
614
  {
492
- className: "\r\n flex h-[20px] w-[20px] shrink-0\r\n items-center justify-center\r\n rounded-[6px] text-[#405170]\r\n ",
493
- children: /* @__PURE__ */ jsx5(Icon, { size: 17 })
615
+ type: "checkbox",
616
+ checked: workflow.status || false,
617
+ onChange: () => workflowtoggle && workflowtoggle(workflow.id),
618
+ className: "sr-only peer"
494
619
  }
495
620
  ),
496
- /* @__PURE__ */ jsx5("span", { className: "whitespace-nowrap text-[14px] font-medium leading-[22px]", children: item.name })
497
- ]
498
- },
499
- item.name
500
- );
501
- };
502
- const renderDropdown = (title, open, setOpen, items) => {
503
- return /* @__PURE__ */ jsxs4("div", { className: "mb-2", children: [
504
- /* @__PURE__ */ jsxs4(
621
+ /* @__PURE__ */ jsx5("div", { className: "w-10 h-6 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[4px] after:start-[4px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-blue-600 group-hover:scale-105 transition-transform" })
622
+ ] }) }) })
623
+ ] }, workflow.id)) })
624
+ ] }) }),
625
+ /* @__PURE__ */ jsx5("div", { className: "bg-[#fcfdfe] border border-slate-100 rounded-2xl px-6 py-4 flex items-center justify-end gap-6 shadow-sm", children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1", children: [
626
+ /* @__PURE__ */ jsx5(
505
627
  "button",
506
628
  {
507
- type: "button",
508
- onClick: () => setOpen(!open),
509
- className: "\r\n flex h-[50px] w-full items-center justify-between\r\n rounded-[9px] px-[17px]\r\n text-left text-[#344261]\r\n transition-colors duration-150\r\n hover:bg-[#F6F8FC]\r\n ",
510
- children: [
511
- /* @__PURE__ */ jsx5("span", { className: "text-[16px] font-semibold", children: title }),
512
- open ? /* @__PURE__ */ jsx5(RiArrowDownSLine, { size: 18 }) : /* @__PURE__ */ jsx5(RiArrowRightSLine, { size: 18 })
513
- ]
629
+ onClick: () => setCurrentPage(1),
630
+ disabled: activePage === 1,
631
+ className: `px-3 py-1.5 text-xs font-semibold rounded-lg transition ${activePage === 1 ? "text-slate-300 cursor-not-allowed" : "text-slate-500 hover:bg-slate-50 cursor-pointer"}`,
632
+ children: "First"
514
633
  }
515
634
  ),
516
- open && /* @__PURE__ */ jsx5("div", { className: "ml-[8px] border-l border-[#E5E9F1] pl-[4px]", children: items.map(renderMenuItem) })
517
- ] });
635
+ /* @__PURE__ */ jsx5(
636
+ "button",
637
+ {
638
+ onClick: () => setCurrentPage((prev) => Math.max(prev - 1, 1)),
639
+ disabled: activePage === 1,
640
+ className: `px-3 py-1.5 text-xs font-semibold rounded-lg transition flex items-center gap-1 ${activePage === 1 ? "text-slate-300 cursor-not-allowed" : "text-slate-500 hover:bg-slate-50 cursor-pointer"}`,
641
+ children: "\u2039 Prev"
642
+ }
643
+ ),
644
+ Array.from({ length: totalPages }, (_, index) => {
645
+ const pageNum = index + 1;
646
+ return /* @__PURE__ */ jsx5(
647
+ "button",
648
+ {
649
+ onClick: () => setCurrentPage(pageNum),
650
+ className: `w-8 h-8 text-xs font-bold rounded-lg transition ${activePage === pageNum ? "bg-[#1e60ff] text-white shadow-sm shadow-blue-500/20" : "text-slate-500 hover:bg-slate-50 cursor-pointer"}`,
651
+ children: pageNum
652
+ },
653
+ pageNum
654
+ );
655
+ }),
656
+ /* @__PURE__ */ jsx5(
657
+ "button",
658
+ {
659
+ onClick: () => setCurrentPage((prev) => Math.min(prev + 1, totalPages)),
660
+ disabled: activePage === totalPages,
661
+ className: `px-3 py-1.5 text-xs font-semibold rounded-lg transition flex items-center gap-1 ${activePage === totalPages ? "text-slate-300 cursor-not-allowed" : "text-slate-500 hover:bg-slate-50 cursor-pointer"}`,
662
+ children: "Next \u203A"
663
+ }
664
+ ),
665
+ /* @__PURE__ */ jsx5(
666
+ "button",
667
+ {
668
+ onClick: () => setCurrentPage(totalPages),
669
+ disabled: activePage === totalPages,
670
+ className: `px-3 py-1.5 text-xs font-semibold rounded-lg transition ${activePage === totalPages ? "text-slate-300 cursor-not-allowed" : "text-slate-500 hover:bg-slate-50 cursor-pointer"}`,
671
+ children: "Last"
672
+ }
673
+ )
674
+ ] }) })
675
+ ] });
676
+ }
677
+
678
+ // src/components/workflowMaster/workFlowMasterMain.js
679
+ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
680
+ function WorkflowMasterMain() {
681
+ const [search, setSearch] = useState3("");
682
+ const [entriesPerPage, setEntriesPerPage] = useState3(10);
683
+ const [isModalOpen, setIsModalOpen] = useState3(false);
684
+ const [newWorkflow, setNewWorkflow] = useState3({
685
+ name: "",
686
+ workflowcode: "",
687
+ workflowtype: "",
688
+ version: "1",
689
+ published: "No",
690
+ description: ""
691
+ });
692
+ const [workflows, setWorkflows] = useState3([
693
+ {
694
+ id: 1,
695
+ name: "Trade License Workflow",
696
+ workflowcode: "TRD-001",
697
+ workflowtype: "Trade License",
698
+ version: "1",
699
+ published: "Yes",
700
+ status: true
701
+ },
702
+ {
703
+ id: 2,
704
+ name: "Citizen Petition Workflow",
705
+ workflowcode: "PET-001",
706
+ workflowtype: "Petition",
707
+ version: "1",
708
+ published: "Yes",
709
+ status: true
710
+ },
711
+ {
712
+ id: 3,
713
+ name: "Leave Application Workflow",
714
+ workflowcode: "LEV-001",
715
+ workflowtype: "Leave",
716
+ version: "1",
717
+ published: "No",
718
+ status: true
719
+ },
720
+ {
721
+ id: 4,
722
+ name: "Grievance Redressal Workflow",
723
+ workflowcode: "GRV-001",
724
+ workflowtype: "Grievance",
725
+ version: "2",
726
+ published: "Yes",
727
+ status: true
728
+ },
729
+ {
730
+ id: 5,
731
+ name: "Document Verification",
732
+ workflowcode: "DOC-001",
733
+ workflowtype: "Verification",
734
+ version: "1",
735
+ published: "Yes",
736
+ status: true
737
+ },
738
+ {
739
+ id: 6,
740
+ name: "Building Permission Workflow",
741
+ workflowcode: "BLD-001",
742
+ workflowtype: "Building Permission",
743
+ version: "1",
744
+ published: "Yes",
745
+ status: true
746
+ },
747
+ {
748
+ id: 7,
749
+ name: "Property Tax Assessment",
750
+ workflowcode: "PTX-001",
751
+ workflowtype: "Property Tax",
752
+ version: 1,
753
+ published: true,
754
+ status: true
755
+ },
756
+ {
757
+ id: 8,
758
+ name: "Water Connection Request",
759
+ workflowcode: "WTR-001",
760
+ workflowtype: "Utility Services",
761
+ version: 1,
762
+ published: true,
763
+ status: true
764
+ },
765
+ {
766
+ id: 9,
767
+ name: "Vendor Registration",
768
+ workflowcode: "VND-001",
769
+ workflowtype: "Procurement",
770
+ version: 2,
771
+ published: true,
772
+ status: false
773
+ },
774
+ {
775
+ id: 10,
776
+ name: "No Objection Certificate",
777
+ workflowcode: "NOC-001",
778
+ workflowtype: "Certification",
779
+ version: 1,
780
+ published: false,
781
+ status: true
782
+ },
783
+ {
784
+ id: 11,
785
+ name: "Birth Certificate Application",
786
+ workflowcode: "BRT-001",
787
+ workflowtype: "Registry",
788
+ version: 1,
789
+ published: true,
790
+ isActive: true
791
+ }
792
+ ]);
793
+ const handleToggle = (id) => {
794
+ setWorkflows((prev) => prev.map((w) => w.id === id ? __spreadProps(__spreadValues({}, w), { status: !w.status }) : w));
518
795
  };
519
- return /* @__PURE__ */ jsxs4(Fragment, { children: [
520
- /* @__PURE__ */ jsxs4(
521
- "aside",
522
- {
523
- className: `
524
- flex h-screen flex-col overflow-hidden
525
- border-r border-[#E5E9F1] bg-white
526
- font-sans text-[#273657]
527
- transition-all duration-300 ease-in-out
528
- ${isOpen ? "w-[245px] min-w-[245px] translate-x-0 opacity-100" : "w-0 min-w-0 -translate-x-full opacity-0"}
529
- `,
530
- children: [
531
- /* @__PURE__ */ jsxs4(
532
- "header",
796
+ const handleAddWorkflow = (e) => {
797
+ e.preventDefault();
798
+ if (!newWorkflow.name || !newWorkflow.workflowcode || !newWorkflow.workflowtype) {
799
+ alert("Please fill out all fields.");
800
+ return;
801
+ }
802
+ const newId = workflows.length > 0 ? Math.max(...workflows.map((w) => w.id)) + 1 : 1;
803
+ const addedItem = {
804
+ id: newId,
805
+ name: newWorkflow.name,
806
+ workflowcode: newWorkflow.workflowcode,
807
+ workflowtype: newWorkflow.workflowtype,
808
+ version: newWorkflow.version || "1",
809
+ published: newWorkflow.published,
810
+ status: true
811
+ };
812
+ setWorkflows([addedItem, ...workflows]);
813
+ setNewWorkflow({ name: "", workflowcode: "", workflowtype: "", version: "1", published: "No", description: "" });
814
+ setIsModalOpen(false);
815
+ };
816
+ return /* @__PURE__ */ jsxs5("div", { className: "min-h-screen bg-[#f3f4f6] p-6 font-sans relative", children: [
817
+ /* @__PURE__ */ jsxs5("div", { className: "max-w-full mx-auto space-y-5", children: [
818
+ /* @__PURE__ */ jsxs5("div", { className: "bg-white rounded-2xl border border-gray-100 shadow-sm p-6 flex justify-between items-center", children: [
819
+ /* @__PURE__ */ jsxs5("div", { children: [
820
+ /* @__PURE__ */ jsx6("h1", { className: "text-2xl font-bold text-slate-800", children: "Workflow Master" }),
821
+ /* @__PURE__ */ jsxs5("nav", { className: "text-xs text-slate-400 mt-1", children: [
822
+ "Dashboard > Types > ",
823
+ /* @__PURE__ */ jsx6("span", { className: "text-blue-600 font-semibold", children: "Workflow" })
824
+ ] })
825
+ ] }),
826
+ /* @__PURE__ */ jsxs5(
827
+ "button",
828
+ {
829
+ onClick: () => setIsModalOpen(true),
830
+ className: "bg-[#1e60ff] hover:bg-blue-700 text-white font-semibold text-sm px-5 py-2.5 rounded-xl transition duration-200 flex items-center gap-1.5 shadow-sm cursor-pointer",
831
+ children: [
832
+ /* @__PURE__ */ jsx6("span", { className: "text-base font-bold", children: "+" }),
833
+ " Add New Workflow"
834
+ ]
835
+ }
836
+ )
837
+ ] }),
838
+ /* @__PURE__ */ jsxs5("div", { className: "bg-white rounded-2xl border border-gray-100 shadow-sm p-6 space-y-5", children: [
839
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between", children: [
840
+ /* @__PURE__ */ jsxs5("div", { className: "relative w-80", children: [
841
+ /* @__PURE__ */ jsx6("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3.5 pointer-events-none text-slate-400", children: /* @__PURE__ */ jsx6("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) }),
842
+ /* @__PURE__ */ jsx6(
843
+ "input",
844
+ {
845
+ type: "text",
846
+ placeholder: "Search workflow name or code...",
847
+ value: search,
848
+ onChange: (e) => setSearch(e.target.value),
849
+ className: "w-full pl-10 pr-4 py-2 text-sm bg-[#fcfdfe] border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 text-slate-700 transition"
850
+ }
851
+ )
852
+ ] }),
853
+ /* @__PURE__ */ jsx6("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs5(
854
+ "select",
533
855
  {
534
- className: "\r\n flex h-[84px] items-center justify-between\r\n border-b border-[#EDF0F5]\r\n px-[14px]\r\n ",
856
+ value: entriesPerPage,
857
+ onChange: (e) => setEntriesPerPage(Number(e.target.value)),
858
+ className: "px-4 py-2 text-sm bg-white border border-gray-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 text-slate-700 cursor-pointer font-medium shadow-sm min-w-[110px]",
535
859
  children: [
536
- /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
537
- /* @__PURE__ */ jsxs4(
538
- "svg",
539
- {
540
- width: "36",
541
- height: "42",
542
- viewBox: "0 0 48 56",
543
- fill: "none",
544
- children: [
545
- /* @__PURE__ */ jsx5(
546
- "path",
547
- {
548
- d: "M24 2L45 12.5L24 23L3 12.5L24 2Z",
549
- fill: "#356AF3"
550
- }
551
- ),
552
- /* @__PURE__ */ jsx5(
553
- "path",
554
- {
555
- d: "M24 8L34 13L24 18L14 13L24 8Z",
556
- fill: "white"
557
- }
558
- ),
559
- /* @__PURE__ */ jsx5(
560
- "path",
561
- {
562
- d: "M3 20L24 30.5L45 20V27L24 37.5L3 27V20Z",
563
- fill: "#356AF3"
564
- }
565
- ),
566
- /* @__PURE__ */ jsx5(
567
- "path",
568
- {
569
- d: "M3 33L24 43.5L45 33V40L24 50.5L3 40V33Z",
570
- fill: "#356AF3"
571
- }
572
- )
573
- ]
574
- }
575
- ),
576
- /* @__PURE__ */ jsxs4("div", { children: [
577
- /* @__PURE__ */ jsx5("h1", { className: "text-[18px] font-extrabold text-[#101318]", children: "FLOWCORE" }),
578
- /* @__PURE__ */ jsx5("p", { className: "text-[12px] text-[#344261]", children: "Workflow Engine" })
579
- ] })
580
- ] }),
581
- /* @__PURE__ */ jsx5(
582
- "button",
583
- {
584
- type: "button",
585
- onClick: onToggle,
586
- className: "\r\n flex h-8 w-8\r\n items-center justify-center\r\n rounded-lg\r\n hover:bg-gray-100\r\n ",
587
- children: /* @__PURE__ */ jsx5(RiMenuLine, { size: 18 })
588
- }
589
- )
860
+ /* @__PURE__ */ jsx6("option", { value: 5, children: "5 Rows" }),
861
+ /* @__PURE__ */ jsx6("option", { value: 10, children: "10 Rows" }),
862
+ /* @__PURE__ */ jsx6("option", { value: 20, children: "20 Rows" }),
863
+ /* @__PURE__ */ jsx6("option", { value: 50, children: "50 Rows" })
590
864
  ]
591
865
  }
592
- ),
593
- /* @__PURE__ */ jsxs4(
594
- "div",
595
- {
596
- className: "\r\n min-h-0 flex-1\r\n overflow-y-auto overflow-x-hidden\r\n px-[27px] pb-[30px] pt-[31px]\r\n ",
597
- children: [
598
- /* @__PURE__ */ jsx5(
599
- "p",
600
- {
601
- className: "\r\n mb-[19px] ml-[15px]\r\n text-[14px] font-bold uppercase\r\n leading-[20px] tracking-[0.2px]\r\n text-[#3C4D74]\r\n ",
602
- children: "Configuration Masters"
603
- }
604
- ),
605
- /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-[3px]", children: [
606
- renderDropdown(
607
- "Workflow",
608
- workflowOpen,
609
- setWorkflowOpen,
610
- workflowItems
611
- ),
612
- renderDropdown(
613
- "Permissions",
614
- permissionOpen,
615
- setPermissionOpen,
616
- permissionItems
617
- ),
618
- renderDropdown(
619
- "Documents",
620
- documentOpen,
621
- setDocumentOpen,
622
- documentItems
623
- ),
624
- renderDropdown(
625
- "Hierarchy",
626
- hierarchyOpen,
627
- setHierarchyOpen,
628
- hierarchyItems
629
- )
630
- ] }),
631
- /* @__PURE__ */ jsx5(
632
- "p",
633
- {
634
- className: "\r\n mb-[19px] ml-[15px] mt-[39px]\r\n text-[14px] font-bold uppercase\r\n leading-[20px] tracking-[0.2px]\r\n text-[#3C4D74]\r\n ",
635
- children: "Runtime"
636
- }
637
- ),
638
- /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-[3px]", children: [
639
- renderDropdown(
640
- "Files",
641
- filesOpen,
642
- setFilesOpen,
643
- fileItems
644
- ),
645
- renderDropdown(
646
- "Tasks",
647
- tasksOpen,
648
- setTasksOpen,
649
- taskItems
650
- ),
866
+ ) })
867
+ ] }),
868
+ /* @__PURE__ */ jsx6(
869
+ WorkflowTable,
870
+ {
871
+ search,
872
+ workflows,
873
+ workflowtoggle: handleToggle,
874
+ entriesPerPage,
875
+ setEntriesPerPage
876
+ }
877
+ )
878
+ ] })
879
+ ] }),
880
+ isModalOpen && /* @__PURE__ */ jsx6("div", { className: "fixed inset-0 bg-slate-900/40 backdrop-blur-sm flex justify-center items-center z-50 p-4", children: /* @__PURE__ */ jsxs5("div", { className: "bg-white rounded-[24px] w-full max-w-4xl shadow-2xl border border-slate-100 flex flex-col max-h-[90vh] overflow-hidden animate-in fade-in zoom-in-95 duration-150", children: [
881
+ /* @__PURE__ */ jsxs5("div", { className: "px-8 py-5 border-b border-slate-100 flex justify-between items-center", children: [
882
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-4", children: [
883
+ /* @__PURE__ */ jsx6("div", { className: "w-11 h-11 bg-indigo-50 border border-indigo-100 rounded-xl flex items-center justify-center text-indigo-600", children: /* @__PURE__ */ jsx6("svg", { className: "w-6 h-6 text-[#5c59eb]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", 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" }) }) }),
884
+ /* @__PURE__ */ jsxs5("div", { children: [
885
+ /* @__PURE__ */ jsx6("h2", { className: "text-xl font-extrabold text-slate-800", children: "Add Workflow" }),
886
+ /* @__PURE__ */ jsx6("p", { className: "text-[11px] text-slate-400 font-medium tracking-wide", children: "Create a new workflow and configure its details" })
887
+ ] })
888
+ ] }),
889
+ /* @__PURE__ */ jsx6(
890
+ "button",
891
+ {
892
+ onClick: () => setIsModalOpen(false),
893
+ className: "text-slate-300 hover:text-slate-500 transition cursor-pointer",
894
+ children: /* @__PURE__ */ jsx6("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" }) })
895
+ }
896
+ )
897
+ ] }),
898
+ /* @__PURE__ */ jsxs5("form", { onSubmit: handleAddWorkflow, className: "flex-1 overflow-y-auto p-8 space-y-6", children: [
899
+ /* @__PURE__ */ jsxs5("div", { className: "border border-slate-100 rounded-2xl p-6 bg-white space-y-5", children: [
900
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 pb-1 border-b border-slate-50", children: [
901
+ /* @__PURE__ */ jsx6("span", { className: "text-sm", children: "\u{1F4CB}" }),
902
+ /* @__PURE__ */ jsx6("h3", { className: "text-xs font-bold text-[#5c59eb] uppercase tracking-wider", children: "Workflow Information" })
903
+ ] }),
904
+ /* @__PURE__ */ jsxs5("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
905
+ /* @__PURE__ */ jsxs5("div", { children: [
906
+ /* @__PURE__ */ jsxs5("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
907
+ "Workflow Type ",
908
+ /* @__PURE__ */ jsx6("span", { className: "text-rose-500", children: "*" })
909
+ ] }),
910
+ /* @__PURE__ */ jsxs5(
911
+ "select",
912
+ {
913
+ required: true,
914
+ value: newWorkflow.workflowtype,
915
+ onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { workflowtype: e.target.value })),
916
+ className: "w-full px-4 py-2.5 border border-slate-200 rounded-xl text-sm bg-white text-slate-600 focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none transition appearance-none cursor-pointer",
917
+ children: [
918
+ /* @__PURE__ */ jsx6("option", { value: "", children: "Select workflow type" }),
919
+ /* @__PURE__ */ jsx6("option", { value: "Trade License", children: "Trade License" }),
920
+ /* @__PURE__ */ jsx6("option", { value: "Petition", children: "Petition" }),
921
+ /* @__PURE__ */ jsx6("option", { value: "Leave", children: "Leave" }),
922
+ /* @__PURE__ */ jsx6("option", { value: "Grievance", children: "Grievance" }),
923
+ /* @__PURE__ */ jsx6("option", { value: "Verification", children: "Verification" })
924
+ ]
925
+ }
926
+ ),
927
+ /* @__PURE__ */ jsx6("span", { className: "text-[10px] text-slate-400 mt-1 block", children: "Choose the category this workflow belongs to" })
928
+ ] }),
929
+ /* @__PURE__ */ jsxs5("div", { children: [
930
+ /* @__PURE__ */ jsxs5("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
931
+ "Workflow Code ",
932
+ /* @__PURE__ */ jsx6("span", { className: "text-rose-500", children: "*" })
933
+ ] }),
934
+ /* @__PURE__ */ jsx6(
935
+ "input",
936
+ {
937
+ type: "text",
938
+ required: true,
939
+ placeholder: "Enter workflow code",
940
+ value: newWorkflow.workflowcode,
941
+ onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { workflowcode: e.target.value })),
942
+ className: "w-full px-4 py-2.5 border border-slate-200 rounded-xl text-sm placeholder-slate-300 focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none transition"
943
+ }
944
+ ),
945
+ /* @__PURE__ */ jsx6("span", { className: "text-[10px] text-slate-400 mt-1 block", children: "Unique code for this workflow (e.g., PET-001)" })
946
+ ] })
947
+ ] }),
948
+ /* @__PURE__ */ jsxs5("div", { children: [
949
+ /* @__PURE__ */ jsxs5("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
950
+ "Workflow Name ",
951
+ /* @__PURE__ */ jsx6("span", { className: "text-rose-500", children: "*" })
952
+ ] }),
953
+ /* @__PURE__ */ jsx6(
954
+ "input",
955
+ {
956
+ type: "text",
957
+ required: true,
958
+ placeholder: "Enter workflow name",
959
+ value: newWorkflow.name,
960
+ onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { name: e.target.value })),
961
+ className: "w-full px-4 py-2.5 border border-slate-200 rounded-xl text-sm placeholder-slate-300 focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none transition"
962
+ }
963
+ ),
964
+ /* @__PURE__ */ jsx6("span", { className: "text-[10px] text-slate-400 mt-1 block", children: "Enter a descriptive name for this workflow" })
965
+ ] }),
966
+ /* @__PURE__ */ jsxs5("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
967
+ /* @__PURE__ */ jsxs5("div", { children: [
968
+ /* @__PURE__ */ jsxs5("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
969
+ "Version ",
970
+ /* @__PURE__ */ jsx6("span", { className: "text-rose-500", children: "*" })
971
+ ] }),
972
+ /* @__PURE__ */ jsx6(
973
+ "input",
974
+ {
975
+ type: "number",
976
+ required: true,
977
+ placeholder: "1",
978
+ value: newWorkflow.version,
979
+ onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { version: e.target.value })),
980
+ className: "w-full px-4 py-2.5 border border-slate-200 rounded-xl text-sm placeholder-slate-300 focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none transition"
981
+ }
982
+ ),
983
+ /* @__PURE__ */ jsx6("span", { className: "text-[10px] text-slate-400 mt-1 block", children: "Workflow version number" })
984
+ ] }),
985
+ /* @__PURE__ */ jsxs5("div", { children: [
986
+ /* @__PURE__ */ jsxs5("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
987
+ "Published ",
988
+ /* @__PURE__ */ jsx6("span", { className: "text-rose-500", children: "*" })
989
+ ] }),
990
+ /* @__PURE__ */ jsxs5(
991
+ "select",
992
+ {
993
+ required: true,
994
+ value: newWorkflow.published,
995
+ onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { published: e.target.value })),
996
+ className: "w-full px-4 py-2.5 border border-slate-200 rounded-xl text-sm bg-white text-slate-600 focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none transition appearance-none cursor-pointer",
997
+ children: [
998
+ /* @__PURE__ */ jsx6("option", { value: "No", children: "No" }),
999
+ /* @__PURE__ */ jsx6("option", { value: "Yes", children: "Yes" })
1000
+ ]
1001
+ }
1002
+ ),
1003
+ /* @__PURE__ */ jsx6("span", { className: "text-[10px] text-slate-400 mt-1 block", children: "Make workflow active for use" })
1004
+ ] })
1005
+ ] })
1006
+ ] }),
1007
+ /* @__PURE__ */ jsxs5("div", { className: "border border-slate-100 rounded-2xl p-6 bg-white space-y-3", children: [
1008
+ /* @__PURE__ */ jsxs5("div", { className: "flex justify-between items-center", children: [
1009
+ /* @__PURE__ */ jsx6("h3", { className: "text-xs font-bold text-slate-700", children: "Description" }),
1010
+ /* @__PURE__ */ jsxs5("span", { className: "text-[10px] text-slate-400", children: [
1011
+ newWorkflow.description.length,
1012
+ " / 500"
1013
+ ] })
1014
+ ] }),
1015
+ /* @__PURE__ */ jsx6(
1016
+ "textarea",
1017
+ {
1018
+ rows: "3",
1019
+ maxLength: "500",
1020
+ placeholder: "Enter description here...",
1021
+ value: newWorkflow.description,
1022
+ onChange: (e) => setNewWorkflow(__spreadProps(__spreadValues({}, newWorkflow), { description: e.target.value })),
1023
+ className: "w-full px-4 py-2.5 border border-slate-200 rounded-xl text-sm placeholder-slate-300 focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 focus:outline-none transition resize-none"
1024
+ }
1025
+ )
1026
+ ] }),
1027
+ /* @__PURE__ */ jsxs5("div", { className: "flex gap-3 justify-end pt-4 border-t border-slate-50", children: [
1028
+ /* @__PURE__ */ jsxs5(
1029
+ "button",
1030
+ {
1031
+ type: "button",
1032
+ onClick: () => setIsModalOpen(false),
1033
+ className: "px-6 py-2.5 text-xs font-bold text-slate-500 hover:bg-slate-50 border border-slate-200 rounded-xl transition flex items-center gap-1.5 cursor-pointer",
1034
+ children: [
1035
+ /* @__PURE__ */ jsx6("span", { children: "\u2715" }),
1036
+ " Cancel"
1037
+ ]
1038
+ }
1039
+ ),
1040
+ /* @__PURE__ */ jsxs5(
1041
+ "button",
1042
+ {
1043
+ type: "submit",
1044
+ className: "px-6 py-2.5 text-xs font-bold text-white bg-[#5c59eb] hover:bg-indigo-700 rounded-xl transition flex items-center gap-1.5 shadow-sm cursor-pointer",
1045
+ children: [
1046
+ /* @__PURE__ */ jsx6("span", { children: "\u{1F4BE}" }),
1047
+ " Save Workflow"
1048
+ ]
1049
+ }
1050
+ )
1051
+ ] })
1052
+ ] })
1053
+ ] }) })
1054
+ ] });
1055
+ }
1056
+
1057
+ // src/components/WorkFlowTransition/Transitiontable.js
1058
+ import React6, { useState as useState5 } from "react";
1059
+ import Link3 from "next/link";
1060
+
1061
+ // src/components/WorkFlowTransition/AddWorkFlowTransitionModal.js
1062
+ import React4 from "react";
1063
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
1064
+ function AddWorkTransitionStepModal({ onClose }) {
1065
+ return /* @__PURE__ */ jsxs6("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
1066
+ /* @__PURE__ */ jsx7(
1067
+ "div",
1068
+ {
1069
+ className: "fixed inset-0 bg-slate-900/50 backdrop-blur-sm transition-opacity duration-200",
1070
+ onClick: onClose
1071
+ }
1072
+ ),
1073
+ /* @__PURE__ */ jsxs6("div", { className: "relative w-full max-w-4xl bg-white rounded-3xl shadow-2xl flex flex-col z-10 max-h-[92vh] overflow-hidden animate-in fade-in zoom-in-95 duration-200", children: [
1074
+ /* @__PURE__ */ jsxs6("div", { className: "flex justify-between items-center px-8 py-6 border-b border-slate-100", children: [
1075
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-4", children: [
1076
+ /* @__PURE__ */ jsx7("div", { className: "w-12 h-12 bg-indigo-50 text-indigo-600 rounded-xl flex items-center justify-center shadow-sm", children: /* @__PURE__ */ jsx7("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx7("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" }) }) }),
1077
+ /* @__PURE__ */ jsxs6("div", { children: [
1078
+ /* @__PURE__ */ jsx7("h2", { className: "text-xl font-extrabold text-slate-800", children: "Add Workflow" }),
1079
+ /* @__PURE__ */ jsx7("p", { className: "text-xs text-slate-400 mt-0.5", children: "Create a new workflow and configure its details" })
1080
+ ] })
1081
+ ] }),
1082
+ /* @__PURE__ */ jsx7(
1083
+ "button",
1084
+ {
1085
+ onClick: onClose,
1086
+ className: "text-slate-400 hover:text-slate-600 hover:bg-slate-100 p-2 rounded-full transition-all text-sm font-semibold",
1087
+ children: "\u2715"
1088
+ }
1089
+ )
1090
+ ] }),
1091
+ /* @__PURE__ */ jsxs6("div", { className: "p-8 space-y-8 overflow-y-auto max-h-[calc(92vh-170px)] bg-slate-50/30", children: [
1092
+ /* @__PURE__ */ jsxs6("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1093
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1094
+ /* @__PURE__ */ jsx7("span", { children: "\u{1F4CB}" }),
1095
+ /* @__PURE__ */ jsx7("span", { children: "Workflow Information" })
1096
+ ] }),
1097
+ /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1098
+ /* @__PURE__ */ jsxs6("div", { children: [
1099
+ /* @__PURE__ */ jsxs6("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1100
+ "Workflow Transition",
1101
+ /* @__PURE__ */ jsx7("span", { className: "text-red-500", children: "*" })
1102
+ ] }),
1103
+ /* @__PURE__ */ jsxs6("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1104
+ /* @__PURE__ */ jsx7("option", { value: "", children: "Select workflow type" }),
1105
+ /* @__PURE__ */ jsx7("option", { value: "petition", children: "Petition" }),
1106
+ /* @__PURE__ */ jsx7("option", { value: "building", children: "Building Permission" }),
1107
+ /* @__PURE__ */ jsx7("option", { value: "leave", children: "Leave" })
1108
+ ] }),
1109
+ /* @__PURE__ */ jsx7("p", { className: "text-[10px] text-slate-400 mt-1", children: "Choose the category this workflow belongs to" })
1110
+ ] }),
1111
+ /* @__PURE__ */ jsxs6("div", { children: [
1112
+ /* @__PURE__ */ jsxs6("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1113
+ "Workflow Code ",
1114
+ /* @__PURE__ */ jsx7("span", { className: "text-red-500", children: "*" })
1115
+ ] }),
1116
+ /* @__PURE__ */ jsx7(
1117
+ "input",
1118
+ {
1119
+ type: "text",
1120
+ placeholder: "Enter workflow code",
1121
+ className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1122
+ }
1123
+ ),
1124
+ /* @__PURE__ */ jsx7("p", { className: "text-[10px] text-slate-400 mt-1", children: "Unique code for this workflow (e.g., PET-001)" })
1125
+ ] })
1126
+ ] }),
1127
+ /* @__PURE__ */ jsxs6("div", { children: [
1128
+ /* @__PURE__ */ jsxs6("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1129
+ "Workflow Name ",
1130
+ /* @__PURE__ */ jsx7("span", { className: "text-red-500", children: "*" })
1131
+ ] }),
1132
+ /* @__PURE__ */ jsx7(
1133
+ "input",
1134
+ {
1135
+ type: "text",
1136
+ placeholder: "Enter workflow name",
1137
+ className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1138
+ }
1139
+ ),
1140
+ /* @__PURE__ */ jsx7("p", { className: "text-[10px] text-slate-400 mt-1", children: "Enter a descriptive name for this workflow" })
1141
+ ] }),
1142
+ /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1143
+ /* @__PURE__ */ jsxs6("div", { children: [
1144
+ /* @__PURE__ */ jsxs6("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1145
+ "Version ",
1146
+ /* @__PURE__ */ jsx7("span", { className: "text-red-500", children: "*" })
1147
+ ] }),
1148
+ /* @__PURE__ */ jsx7(
1149
+ "input",
1150
+ {
1151
+ type: "text",
1152
+ defaultValue: "1",
1153
+ className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1154
+ }
1155
+ ),
1156
+ /* @__PURE__ */ jsx7("p", { className: "text-[10px] text-slate-400 mt-1", children: "Workflow version number" })
1157
+ ] }),
1158
+ /* @__PURE__ */ jsxs6("div", { children: [
1159
+ /* @__PURE__ */ jsxs6("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1160
+ "Published ",
1161
+ /* @__PURE__ */ jsx7("span", { className: "text-red-500", children: "*" })
1162
+ ] }),
1163
+ /* @__PURE__ */ jsxs6("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1164
+ /* @__PURE__ */ jsx7("option", { value: "false", children: "No" }),
1165
+ /* @__PURE__ */ jsx7("option", { value: "true", children: "Yes" })
1166
+ ] }),
1167
+ /* @__PURE__ */ jsx7("p", { className: "text-[10px] text-slate-400 mt-1", children: "Make workflow active for use" })
1168
+ ] })
1169
+ ] })
1170
+ ] }),
1171
+ /* @__PURE__ */ jsxs6("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-3", children: [
1172
+ /* @__PURE__ */ jsxs6("div", { className: "flex justify-between items-center", children: [
1173
+ /* @__PURE__ */ jsx7("label", { className: "block text-xs font-bold text-slate-700", children: "Description" }),
1174
+ /* @__PURE__ */ jsx7("span", { className: "text-[10px] text-slate-400", children: "0 / 500" })
1175
+ ] }),
1176
+ /* @__PURE__ */ jsx7(
1177
+ "textarea",
1178
+ {
1179
+ rows: 3,
1180
+ placeholder: "Enter workflow description (optional)",
1181
+ className: "w-full p-3 border border-slate-200 rounded-xl text-xs resize-none focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1182
+ }
1183
+ ),
1184
+ /* @__PURE__ */ jsx7("p", { className: "text-[10px] text-slate-400", children: "Provide additional information about this workflow" })
1185
+ ] }),
1186
+ /* @__PURE__ */ jsxs6("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1187
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1188
+ /* @__PURE__ */ jsx7("span", { children: "\u2699\uFE0F" }),
1189
+ /* @__PURE__ */ jsx7("span", { children: "Status & Settings" })
1190
+ ] }),
1191
+ /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1192
+ /* @__PURE__ */ jsxs6("div", { children: [
1193
+ /* @__PURE__ */ jsxs6("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1194
+ "Status ",
1195
+ /* @__PURE__ */ jsx7("span", { className: "text-red-500", children: "*" })
1196
+ ] }),
1197
+ /* @__PURE__ */ jsxs6("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1198
+ /* @__PURE__ */ jsx7("option", { value: "active", children: "Active" }),
1199
+ /* @__PURE__ */ jsx7("option", { value: "inactive", children: "Inactive" })
1200
+ ] }),
1201
+ /* @__PURE__ */ jsx7("p", { className: "text-[10px] text-slate-400 mt-1", children: "Set the initial status of this workflow" })
1202
+ ] }),
1203
+ /* @__PURE__ */ jsxs6("div", { children: [
1204
+ /* @__PURE__ */ jsx7("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: "Default Priority" }),
1205
+ /* @__PURE__ */ jsxs6("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1206
+ /* @__PURE__ */ jsx7("option", { value: "medium", children: "Medium" }),
1207
+ /* @__PURE__ */ jsx7("option", { value: "high", children: "High" }),
1208
+ /* @__PURE__ */ jsx7("option", { value: "low", children: "Low" })
1209
+ ] }),
1210
+ /* @__PURE__ */ jsx7("p", { className: "text-[10px] text-slate-400 mt-1", children: "Default priority for tasks in this workflow" })
1211
+ ] })
1212
+ ] })
1213
+ ] }),
1214
+ /* @__PURE__ */ jsxs6("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1215
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1216
+ /* @__PURE__ */ jsx7("span", { children: "\u{1F6E0}\uFE0F" }),
1217
+ /* @__PURE__ */ jsx7("span", { children: "Additional Settings" })
1218
+ ] }),
1219
+ /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
1220
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1221
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3", children: [
1222
+ /* @__PURE__ */ jsx7("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u23F1\uFE0F" }),
1223
+ /* @__PURE__ */ jsxs6("div", { children: [
1224
+ /* @__PURE__ */ jsx7("p", { className: "text-xs font-bold text-slate-700", children: "Enable SLA" }),
1225
+ /* @__PURE__ */ jsx7("p", { className: "text-[9px] text-slate-400", children: "Enable SLA for workflow" })
1226
+ ] })
1227
+ ] }),
1228
+ /* @__PURE__ */ jsxs6("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1229
+ /* @__PURE__ */ jsx7("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
1230
+ /* @__PURE__ */ jsx7("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
1231
+ ] })
1232
+ ] }),
1233
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1234
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3", children: [
1235
+ /* @__PURE__ */ jsx7("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F504}" }),
1236
+ /* @__PURE__ */ jsxs6("div", { children: [
1237
+ /* @__PURE__ */ jsx7("p", { className: "text-xs font-bold text-slate-700", children: "Allow Rework" }),
1238
+ /* @__PURE__ */ jsx7("p", { className: "text-[9px] text-slate-400", children: "Allow files to be sent back" })
1239
+ ] })
1240
+ ] }),
1241
+ /* @__PURE__ */ jsxs6("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1242
+ /* @__PURE__ */ jsx7("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
1243
+ /* @__PURE__ */ jsx7("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
1244
+ ] })
1245
+ ] }),
1246
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1247
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3", children: [
1248
+ /* @__PURE__ */ jsx7("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F465}" }),
1249
+ /* @__PURE__ */ jsxs6("div", { children: [
1250
+ /* @__PURE__ */ jsx7("p", { className: "text-xs font-bold text-slate-700", children: "Allow File Delegation" }),
1251
+ /* @__PURE__ */ jsx7("p", { className: "text-[9px] text-slate-400", children: "Allow users to delegate tasks" })
1252
+ ] })
1253
+ ] }),
1254
+ /* @__PURE__ */ jsxs6("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1255
+ /* @__PURE__ */ jsx7("input", { type: "checkbox", className: "sr-only peer" }),
1256
+ /* @__PURE__ */ jsx7("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
1257
+ ] })
1258
+ ] })
1259
+ ] })
1260
+ ] })
1261
+ ] }),
1262
+ /* @__PURE__ */ jsxs6("div", { className: "p-5 bg-white border-t border-slate-100 flex items-center justify-end gap-3 px-8", children: [
1263
+ /* @__PURE__ */ jsx7(
1264
+ "button",
1265
+ {
1266
+ onClick: onClose,
1267
+ className: "px-6 py-2.5 border border-slate-200 text-slate-600 text-xs font-bold rounded-xl hover:bg-slate-50 transition-all flex items-center gap-1.5",
1268
+ children: "\u2715 Cancel"
1269
+ }
1270
+ ),
1271
+ /* @__PURE__ */ jsx7(
1272
+ "button",
1273
+ {
1274
+ type: "button",
1275
+ className: "px-6 py-2.5 bg-indigo-600 hover:bg-indigo-700 text-white text-xs font-bold rounded-xl shadow-md shadow-indigo-500/10 transition-all flex items-center gap-1.5",
1276
+ children: "\u{1F4BE} Save Workflow"
1277
+ }
1278
+ )
1279
+ ] })
1280
+ ] })
1281
+ ] });
1282
+ }
1283
+
1284
+ // src/components/WorkFlowTransition/Transitionheader.js
1285
+ import React5, { useState as useState4 } from "react";
1286
+ import Link2 from "next/link";
1287
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
1288
+ function Header() {
1289
+ return /* @__PURE__ */ jsxs7("div", { className: "px-6 py-5 border-b border-gray-200", children: [
1290
+ /* @__PURE__ */ jsx8("h1", { className: "m-0 text-[30px] leading-tight font-semibold text-[#1E293B] tracking-tight", children: "Workflow" }),
1291
+ /* @__PURE__ */ jsxs7("div", { className: "mt-2 text-[13px] font-medium", children: [
1292
+ /* @__PURE__ */ jsx8("a", { href: "/dashboard", className: "text-blue-600 hover:underline", children: "Dashboard" }),
1293
+ /* @__PURE__ */ jsx8("span", { className: "mx-2 text-slate-400", children: ">" }),
1294
+ /* @__PURE__ */ jsx8("a", { href: "/masters", className: "text-blue-600 hover:underline", children: "Masters" }),
1295
+ /* @__PURE__ */ jsx8("span", { className: "mx-2 text-slate-400", children: ">" }),
1296
+ /* @__PURE__ */ jsx8("a", { href: "/workflowTransition", className: "text-blue-600 hover:underline", children: "Workflow Transition" }),
1297
+ /* @__PURE__ */ jsx8("span", { className: "mx-2 text-slate-400", children: ">" }),
1298
+ /* @__PURE__ */ jsx8("span", { className: "text-slate-500", children: "Workflow Step" })
1299
+ ] })
1300
+ ] });
1301
+ }
1302
+
1303
+ // src/components/WorkFlowTransition/Transitiontable.js
1304
+ import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
1305
+ var WorkflowTransition = [
1306
+ {
1307
+ TransitionId: 1,
1308
+ workflowId: 1,
1309
+ FromStepId: 2,
1310
+ ToStepId: 1,
1311
+ ActionCode: "APPROVE",
1312
+ ActionName: "APPROVE"
1313
+ },
1314
+ {
1315
+ TransitionId: 1,
1316
+ workflowId: 1,
1317
+ FromStepId: 2,
1318
+ ToStepId: 1,
1319
+ ActionCode: "APPROVE",
1320
+ ActionName: "APPROVE"
1321
+ },
1322
+ {
1323
+ TransitionId: 1,
1324
+ workflowId: 1,
1325
+ FromStepId: 2,
1326
+ ToStepId: 1,
1327
+ ActionCode: "APPROVE",
1328
+ ActionName: "APPROVE"
1329
+ },
1330
+ {
1331
+ TransitionId: 1,
1332
+ workflowId: 1,
1333
+ FromStepId: 2,
1334
+ ToStepId: 1,
1335
+ ActionCode: "RETURN",
1336
+ ActionName: "APPROVE"
1337
+ },
1338
+ {
1339
+ TransitionId: 1,
1340
+ workflowId: 1,
1341
+ FromStepId: 2,
1342
+ ToStepId: 1,
1343
+ ActionCode: "APPROVE",
1344
+ ActionName: "RETURN"
1345
+ }
1346
+ ];
1347
+ function WorkFlowTransition() {
1348
+ const [showModal, setShowModal] = useState5(false);
1349
+ const [pageSize, setPageSize] = useState5(5);
1350
+ const [sortConfig, setSortConfig] = useState5({
1351
+ key: "",
1352
+ direction: "asc"
1353
+ });
1354
+ const handleSort = (key) => {
1355
+ let direction = "asc";
1356
+ if (sortConfig.key === key && sortConfig.direction === "asc") {
1357
+ direction = "desc";
1358
+ }
1359
+ setSortConfig({
1360
+ key,
1361
+ direction
1362
+ });
1363
+ };
1364
+ return /* @__PURE__ */ jsx9("div", { className: "p-6 bg-[#f5f7fb] min-h-screen font-sans text-slate-700", children: /* @__PURE__ */ jsxs8("div", { className: "bg-white rounded-2xl shadow-md overflow-hidden", children: [
1365
+ /* @__PURE__ */ jsx9(Header, {}),
1366
+ /* @__PURE__ */ jsx9("div", { className: "px-6 py-5 border-b border-gray-200 ", children: /* @__PURE__ */ jsxs8("div", { className: "flex justify-between items-center flex-wrap gap-3", children: [
1367
+ /* @__PURE__ */ jsx9(
1368
+ "input",
1369
+ {
1370
+ type: "text",
1371
+ placeholder: "Search workflow Transition...",
1372
+ className: "w-[300px] px-4 py-2.5 border border-slate-200/80 rounded-lg text-[13px] text-slate-600 focus:outline-none bg-slate-50"
1373
+ }
1374
+ ),
1375
+ /* @__PURE__ */ jsxs8("div", { className: "px-4 py-3 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: [
1376
+ /* @__PURE__ */ jsx9("span", { children: "Show" }),
1377
+ /* @__PURE__ */ jsxs8(
1378
+ "select",
1379
+ {
1380
+ value: pageSize,
1381
+ onChange: (e) => setPageSize(Number(e.target.value)),
1382
+ className: "inline-flex item-center px-3 py-1 rounded-md bg-[#f1f5f9] text-[#334155] text-xs font-semibold border border-[#e2e8f0]",
1383
+ children: [
1384
+ /* @__PURE__ */ jsx9("option", { value: 5, children: "5" }),
1385
+ /* @__PURE__ */ jsx9("option", { value: 10, children: "10" }),
1386
+ /* @__PURE__ */ jsx9("option", { value: 25, children: "25" })
1387
+ ]
1388
+ }
1389
+ ),
1390
+ /* @__PURE__ */ jsx9("span", { children: "entries" })
1391
+ ] }),
1392
+ /* @__PURE__ */ jsx9(
1393
+ "button",
1394
+ {
1395
+ onClick: () => setShowModal(true),
1396
+ className: "px-5 py-2.5 bg-blue-600 text-white rounded-lg text-[13px] font-semibold hover:bg-blue-700 transition-colors",
1397
+ children: "+ Add Workflow Transition"
1398
+ }
1399
+ )
1400
+ ] }) }),
1401
+ /* @__PURE__ */ jsxs8("div", { className: "overflow-x-auto", children: [
1402
+ /* @__PURE__ */ jsxs8("table", { className: "w-full border-collapse", children: [
1403
+ /* @__PURE__ */ jsx9("thead", { children: /* @__PURE__ */ jsx9("tr", { className: "bg-slate-50/70 border-b border-slate-200 text-xs font-bold uppercase tracking-wider text-slate-500", children: [
1404
+ { label: "TransitionId", key: "TransitionId" },
1405
+ { label: "WorkflowId", key: "workflowId" },
1406
+ { label: "FromStepId", key: "FromStepId" },
1407
+ { label: "ToStepId", key: "ToStepId" },
1408
+ { label: "ActionCode", key: "ActionCode" },
1409
+ { label: "ActionName", key: "ActionName" }
1410
+ ].map((column) => /* @__PURE__ */ jsx9(
1411
+ "th",
1412
+ {
1413
+ onClick: () => handleSort(column.key),
1414
+ className: "px-6 py-4 text-left border-b border-gray-200 text-[11px] font-bold uppercase tracking-wider text-slate-500",
1415
+ children: /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
1416
+ /* @__PURE__ */ jsx9("span", { children: column.label }),
1417
+ /* @__PURE__ */ jsx9("span", { className: "text-gray-400 text-xs", children: sortConfig.key === column.key ? sortConfig.direction === "asc" ? "\u25B2" : "\u25BC" : "\u2195" })
1418
+ ] })
1419
+ },
1420
+ column.key
1421
+ )) }) }),
1422
+ /* @__PURE__ */ jsx9("tbody", { children: WorkflowTransition.slice(0, pageSize).map((item) => /* @__PURE__ */ jsxs8(
1423
+ "tr",
1424
+ {
1425
+ className: "hover:bg-slate-50 transition-colors",
1426
+ children: [
1427
+ /* @__PURE__ */ jsx9("td", { className: "px-6 p-4 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.TransitionId }),
1428
+ /* @__PURE__ */ jsx9("td", { className: "px-6 py-4 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.workflowId }),
1429
+ /* @__PURE__ */ jsx9("td", { className: "px-6 py-4 border-b border-slate-200 text-[13px] text-slate-500 font-bold", children: item.FromStepId }),
1430
+ /* @__PURE__ */ jsx9("td", { className: "px-6 py-4 border-b border-slate-200 text-align center text-[13px] text-slate-500 font-bold", children: item.ToStepId }),
1431
+ /* @__PURE__ */ jsx9("td", { className: "px-6 py-4 border-b border-slate-200", children: /* @__PURE__ */ jsx9(
1432
+ "span",
1433
+ {
1434
+ className: `inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold
1435
+ ${item.ActionCode === "APPROVE" ? "bg-green-100 text-green-700" : "bg-red-100 text-red-700"}`,
1436
+ children: item.ActionCode
1437
+ }
1438
+ ) }),
1439
+ /* @__PURE__ */ jsx9("td", { className: "px-6 py-4 border-b border-slate-200", children: /* @__PURE__ */ jsx9(
1440
+ "span",
1441
+ {
1442
+ className: `inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold
1443
+ ${item.ActionName === "APPROVE" ? "bg-green-100 text-green-700" : "bg-red-100 text-red-700"}`,
1444
+ children: item.ActionName
1445
+ }
1446
+ ) })
1447
+ ]
1448
+ },
1449
+ item.TransitionId
1450
+ )) })
1451
+ ] }),
1452
+ /* @__PURE__ */ jsx9("div", { className: "h-5" }),
1453
+ /* @__PURE__ */ jsx9(Footer, {}),
1454
+ showModal && /* @__PURE__ */ jsx9(AddWorkTransitionStepModal, { onClose: () => setShowModal(false) })
1455
+ ] })
1456
+ ] }) });
1457
+ }
1458
+
1459
+ // src/components/WorkflowType/WorkFlowTypeMain.js
1460
+ import React11, { useState as useState7 } from "react";
1461
+
1462
+ // src/components/WorkflowType/SearchBar.jsx
1463
+ import React7 from "react";
1464
+ import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
1465
+ function SearchBar() {
1466
+ return /* @__PURE__ */ jsxs9("div", { className: "relative max-w-sm w-full", children: [
1467
+ /* @__PURE__ */ jsx10("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3.5 pointer-events-none", children: /* @__PURE__ */ jsx10("svg", { className: "w-4.5 h-4.5 text-slate-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx10("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) }),
1468
+ /* @__PURE__ */ jsx10(
1469
+ "input",
1470
+ {
1471
+ type: "text",
1472
+ placeholder: "Search workflow name or code...",
1473
+ className: "w-full pl-10 pr-4 py-2.5 border border-slate-200 rounded-xl text-sm bg-slate-50/50 focus:outline-none focus:ring-4 focus:ring-blue-500/10 focus:border-blue-500 text-slate-700 placeholder-slate-400 transition-all shadow-sm"
1474
+ }
1475
+ )
1476
+ ] });
1477
+ }
1478
+
1479
+ // src/components/WorkflowType/WorkflowTypeTable.jsx
1480
+ import React8, { useState as useState6 } from "react";
1481
+ import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
1482
+ function WorkflowTypeTable({ pageSize }) {
1483
+ const initialData = [
1484
+ { id: "1", name: "Citizen Petition Workflow", code: "PET-001", type: "Petition", version: "1", published: true, status: true },
1485
+ { id: "2", name: "Building Permission Workflow", code: "BLD-001", type: "Building Permission", version: "1", published: true, status: true },
1486
+ { id: "3", name: "Leave Application Workflow", code: "LEV-001", type: "Leave", version: "1", published: false, status: true },
1487
+ { id: "4", name: "Grievance Redressal Workflow", code: "GRV-001", type: "Grievance", version: "2", published: true, status: true },
1488
+ { id: "5", name: "Trade License Workflow", code: "TRD-001", type: "Trade License", version: "1", published: true, status: true },
1489
+ { id: "6", name: "Document Verification", code: "DOC-001", type: "Verification", version: "1", published: true, status: true }
1490
+ ];
1491
+ const [data, setData] = useState6(initialData);
1492
+ const [sortOrder, setSortOrder] = useState6("asc");
1493
+ const [currentPage, setCurrentPage] = useState6(1);
1494
+ const totalPages = Math.ceil(data.length / pageSize) || 1;
1495
+ const startIndex = (currentPage - 1) * pageSize;
1496
+ const visibleData = data.slice(startIndex, startIndex + pageSize);
1497
+ const handleSort = (columnKey) => {
1498
+ const isAsc = sortOrder === "asc";
1499
+ setSortOrder(isAsc ? "desc" : "asc");
1500
+ const sortedData = [...data].sort((a, b) => {
1501
+ if (a[columnKey] < b[columnKey]) return isAsc ? -1 : 1;
1502
+ if (a[columnKey] > b[columnKey]) return isAsc ? 1 : -1;
1503
+ return 0;
1504
+ });
1505
+ setData(sortedData);
1506
+ };
1507
+ const toggleSwitch = (id) => {
1508
+ const updatedData = data.map(
1509
+ (item) => item.id === id ? __spreadProps(__spreadValues({}, item), { status: !item.status }) : item
1510
+ );
1511
+ setData(updatedData);
1512
+ };
1513
+ return /* @__PURE__ */ jsxs10("div", { className: "space-y-5", children: [
1514
+ /* @__PURE__ */ jsx11("div", { className: "w-full overflow-x-auto border border-slate-200 rounded-2xl shadow-sm", children: /* @__PURE__ */ jsxs10("table", { className: "w-full text-left border-collapse bg-white", children: [
1515
+ /* @__PURE__ */ jsx11("thead", { children: /* @__PURE__ */ jsxs10("tr", { className: "bg-slate-50/70 border-b border-slate-200 text-xs font-bold uppercase tracking-wider text-slate-500", children: [
1516
+ /* @__PURE__ */ jsx11("th", { className: "py-4.5 px-5 w-20 text-center", children: "S.No" }),
1517
+ /* @__PURE__ */ jsxs10("th", { onClick: () => handleSort("name"), className: "py-4.5 px-5 text-sm cursor-pointer select-none hover:text-slate-900", children: [
1518
+ "Workflow Name ",
1519
+ sortOrder === "asc" ? "\u25B2" : "\u25BC"
1520
+ ] }),
1521
+ /* @__PURE__ */ jsxs10("th", { onClick: () => handleSort("code"), className: "py-4.5 px-5 cursor-pointer select-none hover:text-slate-900", children: [
1522
+ "Workflow Code ",
1523
+ sortOrder === "asc" ? "\u25B2" : "\u25BC"
1524
+ ] }),
1525
+ /* @__PURE__ */ jsxs10("th", { onClick: () => handleSort("type"), className: "py-4.5 px-5 cursor-pointer select-none hover:text-slate-900", children: [
1526
+ "Workflow Type ",
1527
+ sortOrder === "asc" ? "\u25B2" : "\u25BC"
1528
+ ] }),
1529
+ /* @__PURE__ */ jsx11("th", { className: "py-4.5 px-5 text-center", children: "Version" }),
1530
+ /* @__PURE__ */ jsx11("th", { className: "py-4.5 px-5 text-center", children: "Published" }),
1531
+ /* @__PURE__ */ jsx11("th", { className: "py-4.5 px-5 text-center", children: "Status" })
1532
+ ] }) }),
1533
+ /* @__PURE__ */ jsx11("tbody", { className: "divide-y divide-slate-100 text-sm text-slate-600", children: visibleData.map((item, index) => /* @__PURE__ */ jsxs10("tr", { className: "hover:bg-slate-50/50 transition-colors", children: [
1534
+ /* @__PURE__ */ jsx11("td", { className: "py-4 px-5 text-center font-medium text-slate-400", children: startIndex + index + 1 }),
1535
+ /* @__PURE__ */ jsx11("td", { className: "py-4 px-5 font-bold text-slate-900 text-[14px]", children: item.name }),
1536
+ /* @__PURE__ */ jsx11("td", { className: "py-4 px-5 text-slate-500", children: item.code }),
1537
+ /* @__PURE__ */ jsx11("td", { className: "py-4 px-5 text-slate-500", children: item.type }),
1538
+ /* @__PURE__ */ jsx11("td", { className: "py-4 px-5 text-center font-semibold text-slate-700", children: item.version }),
1539
+ /* @__PURE__ */ jsx11("td", { className: "py-4 px-5 text-center", children: /* @__PURE__ */ jsx11("span", { className: `px-2.5 py-1 rounded-md text-xs font-medium ${item.published ? "bg-green-50 text-green-700 border border-green-200" : "bg-red-50 text-red-700 border border-red-200"}`, children: item.published ? "\u2713 Yes" : "\u2715 No" }) }),
1540
+ /* @__PURE__ */ jsx11("td", { className: "py-4 px-5 text-center", children: /* @__PURE__ */ jsx11("div", { className: "flex justify-center items-center", children: /* @__PURE__ */ jsx11(
1541
+ "button",
1542
+ {
1543
+ type: "button",
1544
+ onClick: () => toggleSwitch(item.id),
1545
+ className: `relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out outline-none ${item.status ? "bg-blue-600" : "bg-slate-200"}`,
1546
+ children: /* @__PURE__ */ jsx11(
1547
+ "span",
1548
+ {
1549
+ className: `pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${item.status ? "translate-x-5" : "translate-x-0"}`
1550
+ }
1551
+ )
1552
+ }
1553
+ ) }) })
1554
+ ] }, item.id)) })
1555
+ ] }) }),
1556
+ /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-end gap-1 text-[13px] text-slate-700 font-normal mt-4 bg-slate-50/50 p-3 rounded-xl border border-slate-100", children: [
1557
+ /* @__PURE__ */ jsx11(
1558
+ "button",
1559
+ {
1560
+ onClick: () => setCurrentPage(1),
1561
+ className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 transition-colors",
1562
+ children: "First"
1563
+ }
1564
+ ),
1565
+ /* @__PURE__ */ jsx11(
1566
+ "button",
1567
+ {
1568
+ onClick: () => setCurrentPage((prev) => Math.max(prev - 1, 1)),
1569
+ className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 transition-colors mr-2",
1570
+ children: "\u2039 Prev"
1571
+ }
1572
+ ),
1573
+ [1, 2, 3, 4].map((pageNumber) => /* @__PURE__ */ jsx11(
1574
+ "button",
1575
+ {
1576
+ onClick: () => setCurrentPage(pageNumber),
1577
+ className: `px-3 py-1 text-center rounded transition-all min-w-[28px] ${currentPage === pageNumber ? "bg-blue-600 text-white font-medium shadow-sm" : "text-slate-600 hover:bg-slate-100"}`,
1578
+ children: pageNumber
1579
+ },
1580
+ pageNumber
1581
+ )),
1582
+ /* @__PURE__ */ jsx11(
1583
+ "button",
1584
+ {
1585
+ onClick: () => setCurrentPage((prev) => Math.min(prev + 1, 7)),
1586
+ className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 transition-colors ml-2",
1587
+ children: "Next \u203A"
1588
+ }
1589
+ ),
1590
+ /* @__PURE__ */ jsx11(
1591
+ "button",
1592
+ {
1593
+ onClick: () => setCurrentPage(7),
1594
+ className: "px-2.5 py-1 text-slate-500 hover:text-slate-900 transition-colors",
1595
+ children: "Last"
1596
+ }
1597
+ )
1598
+ ] })
1599
+ ] });
1600
+ }
1601
+
1602
+ // src/components/WorkflowType/AddWorkflowTypeModal.jsx
1603
+ import React9 from "react";
1604
+ import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
1605
+ function AddWorkflowTypeModal({ isOpen, onClose }) {
1606
+ if (!isOpen) return null;
1607
+ return /* @__PURE__ */ jsxs11("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
1608
+ /* @__PURE__ */ jsx12(
1609
+ "div",
1610
+ {
1611
+ className: "fixed inset-0 bg-slate-900/50 backdrop-blur-sm transition-opacity duration-200",
1612
+ onClick: onClose
1613
+ }
1614
+ ),
1615
+ /* @__PURE__ */ jsxs11("div", { className: "relative w-full max-w-4xl bg-white rounded-3xl shadow-2xl flex flex-col z-10 max-h-[92vh] overflow-hidden animate-in fade-in zoom-in-95 duration-200", children: [
1616
+ /* @__PURE__ */ jsxs11("div", { className: "flex justify-between items-center px-8 py-6 border-b border-slate-100", children: [
1617
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-4", children: [
1618
+ /* @__PURE__ */ jsx12("div", { className: "w-12 h-12 bg-indigo-50 text-indigo-600 rounded-xl flex items-center justify-center shadow-sm", children: /* @__PURE__ */ jsx12("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx12("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" }) }) }),
1619
+ /* @__PURE__ */ jsxs11("div", { children: [
1620
+ /* @__PURE__ */ jsx12("h2", { className: "text-xl font-extrabold text-slate-800", children: "Add Workflow" }),
1621
+ /* @__PURE__ */ jsx12("p", { className: "text-xs text-slate-400 mt-0.5", children: "Create a new workflow and configure its details" })
1622
+ ] })
1623
+ ] }),
1624
+ /* @__PURE__ */ jsx12(
1625
+ "button",
1626
+ {
1627
+ onClick: onClose,
1628
+ className: "text-slate-400 hover:text-slate-600 hover:bg-slate-100 p-2 rounded-full transition-all text-sm font-semibold",
1629
+ children: "\u2715"
1630
+ }
1631
+ )
1632
+ ] }),
1633
+ /* @__PURE__ */ jsxs11("div", { className: "p-8 space-y-8 overflow-y-auto max-h-[calc(92vh-170px)] bg-slate-50/30", children: [
1634
+ /* @__PURE__ */ jsxs11("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1635
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1636
+ /* @__PURE__ */ jsx12("span", { children: "\u{1F4CB}" }),
1637
+ /* @__PURE__ */ jsx12("span", { children: "Workflow Information" })
1638
+ ] }),
1639
+ /* @__PURE__ */ jsxs11("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1640
+ /* @__PURE__ */ jsxs11("div", { children: [
1641
+ /* @__PURE__ */ jsxs11("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1642
+ "Workflow Type ",
1643
+ /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1644
+ ] }),
1645
+ /* @__PURE__ */ jsxs11("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1646
+ /* @__PURE__ */ jsx12("option", { value: "", children: "Select workflow type" }),
1647
+ /* @__PURE__ */ jsx12("option", { value: "petition", children: "Petition" }),
1648
+ /* @__PURE__ */ jsx12("option", { value: "building", children: "Building Permission" }),
1649
+ /* @__PURE__ */ jsx12("option", { value: "leave", children: "Leave" })
1650
+ ] }),
1651
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Choose the category this workflow belongs to" })
1652
+ ] }),
1653
+ /* @__PURE__ */ jsxs11("div", { children: [
1654
+ /* @__PURE__ */ jsxs11("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1655
+ "Workflow Code ",
1656
+ /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1657
+ ] }),
1658
+ /* @__PURE__ */ jsx12(
1659
+ "input",
1660
+ {
1661
+ type: "text",
1662
+ placeholder: "Enter workflow code",
1663
+ className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1664
+ }
1665
+ ),
1666
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Unique code for this workflow (e.g., PET-001)" })
1667
+ ] })
1668
+ ] }),
1669
+ /* @__PURE__ */ jsxs11("div", { children: [
1670
+ /* @__PURE__ */ jsxs11("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1671
+ "Workflow Name ",
1672
+ /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1673
+ ] }),
1674
+ /* @__PURE__ */ jsx12(
1675
+ "input",
1676
+ {
1677
+ type: "text",
1678
+ placeholder: "Enter workflow name",
1679
+ className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1680
+ }
1681
+ ),
1682
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Enter a descriptive name for this workflow" })
1683
+ ] }),
1684
+ /* @__PURE__ */ jsxs11("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1685
+ /* @__PURE__ */ jsxs11("div", { children: [
1686
+ /* @__PURE__ */ jsxs11("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1687
+ "Version ",
1688
+ /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1689
+ ] }),
1690
+ /* @__PURE__ */ jsx12(
1691
+ "input",
1692
+ {
1693
+ type: "text",
1694
+ defaultValue: "1",
1695
+ className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1696
+ }
1697
+ ),
1698
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Workflow version number" })
1699
+ ] }),
1700
+ /* @__PURE__ */ jsxs11("div", { children: [
1701
+ /* @__PURE__ */ jsxs11("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1702
+ "Published ",
1703
+ /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1704
+ ] }),
1705
+ /* @__PURE__ */ jsxs11("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1706
+ /* @__PURE__ */ jsx12("option", { value: "false", children: "No" }),
1707
+ /* @__PURE__ */ jsx12("option", { value: "true", children: "Yes" })
1708
+ ] }),
1709
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Make workflow active for use" })
1710
+ ] })
1711
+ ] })
1712
+ ] }),
1713
+ /* @__PURE__ */ jsxs11("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-3", children: [
1714
+ /* @__PURE__ */ jsxs11("div", { className: "flex justify-between items-center", children: [
1715
+ /* @__PURE__ */ jsx12("label", { className: "block text-xs font-bold text-slate-700", children: "Description" }),
1716
+ /* @__PURE__ */ jsx12("span", { className: "text-[10px] text-slate-400", children: "0 / 500" })
1717
+ ] }),
1718
+ /* @__PURE__ */ jsx12(
1719
+ "textarea",
1720
+ {
1721
+ rows: 3,
1722
+ placeholder: "Enter workflow description (optional)",
1723
+ className: "w-full p-3 border border-slate-200 rounded-xl text-xs resize-none focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500"
1724
+ }
1725
+ ),
1726
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400", children: "Provide additional information about this workflow" })
1727
+ ] }),
1728
+ /* @__PURE__ */ jsxs11("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1729
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1730
+ /* @__PURE__ */ jsx12("span", { children: "\u2699\uFE0F" }),
1731
+ /* @__PURE__ */ jsx12("span", { children: "Status & Settings" })
1732
+ ] }),
1733
+ /* @__PURE__ */ jsxs11("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-5", children: [
1734
+ /* @__PURE__ */ jsxs11("div", { children: [
1735
+ /* @__PURE__ */ jsxs11("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: [
1736
+ "Status ",
1737
+ /* @__PURE__ */ jsx12("span", { className: "text-red-500", children: "*" })
1738
+ ] }),
1739
+ /* @__PURE__ */ jsxs11("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1740
+ /* @__PURE__ */ jsx12("option", { value: "active", children: "Active" }),
1741
+ /* @__PURE__ */ jsx12("option", { value: "inactive", children: "Inactive" })
1742
+ ] }),
1743
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Set the initial status of this workflow" })
1744
+ ] }),
1745
+ /* @__PURE__ */ jsxs11("div", { children: [
1746
+ /* @__PURE__ */ jsx12("label", { className: "block text-xs font-bold text-slate-700 mb-1.5", children: "Default Priority" }),
1747
+ /* @__PURE__ */ jsxs11("select", { className: "w-full p-2.5 border border-slate-200 rounded-xl text-xs bg-white text-slate-700 focus:outline-none focus:ring-2 focus:ring-indigo-500/10 focus:border-indigo-500", children: [
1748
+ /* @__PURE__ */ jsx12("option", { value: "medium", children: "Medium" }),
1749
+ /* @__PURE__ */ jsx12("option", { value: "high", children: "High" }),
1750
+ /* @__PURE__ */ jsx12("option", { value: "low", children: "Low" })
1751
+ ] }),
1752
+ /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-400 mt-1", children: "Default priority for tasks in this workflow" })
1753
+ ] })
1754
+ ] })
1755
+ ] }),
1756
+ /* @__PURE__ */ jsxs11("div", { className: "bg-white p-6 rounded-2xl border border-slate-100/80 shadow-sm space-y-5", children: [
1757
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2 text-indigo-600 text-sm font-bold border-b border-slate-50 pb-3", children: [
1758
+ /* @__PURE__ */ jsx12("span", { children: "\u{1F6E0}\uFE0F" }),
1759
+ /* @__PURE__ */ jsx12("span", { children: "Additional Settings" })
1760
+ ] }),
1761
+ /* @__PURE__ */ jsxs11("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
1762
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1763
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-3", children: [
1764
+ /* @__PURE__ */ jsx12("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u23F1\uFE0F" }),
1765
+ /* @__PURE__ */ jsxs11("div", { children: [
1766
+ /* @__PURE__ */ jsx12("p", { className: "text-xs font-bold text-slate-700", children: "Enable SLA" }),
1767
+ /* @__PURE__ */ jsx12("p", { className: "text-[9px] text-slate-400", children: "Enable SLA for workflow" })
1768
+ ] })
1769
+ ] }),
1770
+ /* @__PURE__ */ jsxs11("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1771
+ /* @__PURE__ */ jsx12("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
1772
+ /* @__PURE__ */ jsx12("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
1773
+ ] })
1774
+ ] }),
1775
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1776
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-3", children: [
1777
+ /* @__PURE__ */ jsx12("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F504}" }),
1778
+ /* @__PURE__ */ jsxs11("div", { children: [
1779
+ /* @__PURE__ */ jsx12("p", { className: "text-xs font-bold text-slate-700", children: "Allow Rework" }),
1780
+ /* @__PURE__ */ jsx12("p", { className: "text-[9px] text-slate-400", children: "Allow files to be sent back" })
1781
+ ] })
1782
+ ] }),
1783
+ /* @__PURE__ */ jsxs11("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1784
+ /* @__PURE__ */ jsx12("input", { type: "checkbox", defaultChecked: true, className: "sr-only peer" }),
1785
+ /* @__PURE__ */ jsx12("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
1786
+ ] })
1787
+ ] }),
1788
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between p-4 bg-slate-50/50 border border-slate-100 rounded-2xl", children: [
1789
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-3", children: [
1790
+ /* @__PURE__ */ jsx12("div", { className: "w-8 h-8 rounded-lg bg-indigo-50 text-indigo-600 flex items-center justify-center text-sm", children: "\u{1F465}" }),
1791
+ /* @__PURE__ */ jsxs11("div", { children: [
1792
+ /* @__PURE__ */ jsx12("p", { className: "text-xs font-bold text-slate-700", children: "Allow File Delegation" }),
1793
+ /* @__PURE__ */ jsx12("p", { className: "text-[9px] text-slate-400", children: "Allow users to delegate tasks" })
1794
+ ] })
1795
+ ] }),
1796
+ /* @__PURE__ */ jsxs11("label", { className: "relative inline-flex items-center cursor-pointer", children: [
1797
+ /* @__PURE__ */ jsx12("input", { type: "checkbox", className: "sr-only peer" }),
1798
+ /* @__PURE__ */ jsx12("div", { className: "w-8 h-4.5 bg-slate-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-3.5 after:w-3.5 after:transition-all peer-checked:bg-indigo-600" })
1799
+ ] })
1800
+ ] })
1801
+ ] })
1802
+ ] })
1803
+ ] }),
1804
+ /* @__PURE__ */ jsxs11("div", { className: "p-5 bg-white border-t border-slate-100 flex items-center justify-end gap-3 px-8", children: [
1805
+ /* @__PURE__ */ jsx12(
1806
+ "button",
1807
+ {
1808
+ onClick: onClose,
1809
+ className: "px-6 py-2.5 border border-slate-200 text-slate-600 text-xs font-bold rounded-xl hover:bg-slate-50 transition-all flex items-center gap-1.5",
1810
+ children: "\u2715 Cancel"
1811
+ }
1812
+ ),
1813
+ /* @__PURE__ */ jsx12(
1814
+ "button",
1815
+ {
1816
+ type: "button",
1817
+ className: "px-6 py-2.5 bg-indigo-600 hover:bg-indigo-700 text-white text-xs font-bold rounded-xl shadow-md shadow-indigo-500/10 transition-all flex items-center gap-1.5",
1818
+ children: "\u{1F4BE} Save Workflow"
1819
+ }
1820
+ )
1821
+ ] })
1822
+ ] })
1823
+ ] });
1824
+ }
1825
+
1826
+ // src/components/WorkflowType/AddButton.jsx
1827
+ import React10 from "react";
1828
+ import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1829
+ function AddButton({ onOpen }) {
1830
+ return /* @__PURE__ */ jsxs12(
1831
+ "button",
1832
+ {
1833
+ onClick: onOpen,
1834
+ className: "bg-blue-600 hover:bg-blue-700 text-white px-5 py-2.5 rounded-xl font-bold text-sm shadow-md shadow-blue-500/20 hover:shadow-lg hover:shadow-blue-500/30 transition-all active:scale-95 flex items-center gap-2",
1835
+ children: [
1836
+ /* @__PURE__ */ jsx13("svg", { className: "w-4 h-4 stroke-[2.5]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx13("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4.5v15m7.5-7.5h-15" }) }),
1837
+ "Add Workflow Type"
1838
+ ]
1839
+ }
1840
+ );
1841
+ }
1842
+
1843
+ // src/components/WorkflowType/WorkFlowTypeMain.js
1844
+ import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1845
+ function WorkflowTypeMain() {
1846
+ const [modalOpen, setModalOpen] = useState7(false);
1847
+ const [pageSize, setPageSize] = useState7(10);
1848
+ return /* @__PURE__ */ jsxs13("div", { className: "min-h-screen bg-slate-50 p-4 md:p-6", children: [
1849
+ /* @__PURE__ */ jsxs13("div", { className: "w-full space-y-5", children: [
1850
+ /* @__PURE__ */ jsxs13("div", { className: "flex flex-col sm:flex-row sm:items-center sm:justify-between bg-white p-6 rounded-2xl border border-slate-200/80 shadow-sm gap-4", children: [
1851
+ /* @__PURE__ */ jsxs13("div", { children: [
1852
+ /* @__PURE__ */ jsx14("h1", { className: "text-2xl font-extrabold text-slate-900 tracking-tight", children: "Workflow Type" }),
1853
+ /* @__PURE__ */ jsxs13("p", { className: "text-xs text-slate-400 mt-1", children: [
1854
+ "Dashboard > Types > ",
1855
+ /* @__PURE__ */ jsx14("span", { className: "text-blue-600 font-semibold", children: "Workflow Type" })
1856
+ ] })
1857
+ ] }),
1858
+ /* @__PURE__ */ jsx14(AddButton, { onOpen: () => setModalOpen(true) })
1859
+ ] }),
1860
+ /* @__PURE__ */ jsxs13("div", { className: "bg-white p-6 rounded-2xl border border-slate-200/80 shadow-sm space-y-5", children: [
1861
+ /* @__PURE__ */ jsxs13("div", { className: "flex justify-between items-center w-full", children: [
1862
+ /* @__PURE__ */ jsx14("div", { className: "w-full max-w-xs", children: /* @__PURE__ */ jsx14(SearchBar, {}) }),
1863
+ /* @__PURE__ */ jsx14("div", { children: /* @__PURE__ */ jsxs13(
1864
+ "select",
1865
+ {
1866
+ value: pageSize,
1867
+ onChange: (e) => setPageSize(Number(e.target.value)),
1868
+ className: "border border-slate-200 rounded-lg px-3 py-2 text-sm bg-white cursor-pointer outline-none shadow-sm text-slate-700",
1869
+ children: [
1870
+ /* @__PURE__ */ jsx14("option", { value: 2, children: "2 Rows (Testing)" }),
1871
+ /* @__PURE__ */ jsx14("option", { value: 10, children: "10 Rows" }),
1872
+ /* @__PURE__ */ jsx14("option", { value: 20, children: "20 Rows" }),
1873
+ /* @__PURE__ */ jsx14("option", { value: 50, children: "50 Rows" })
1874
+ ]
1875
+ }
1876
+ ) })
1877
+ ] }),
1878
+ /* @__PURE__ */ jsx14(WorkflowTypeTable, { pageSize })
1879
+ ] })
1880
+ ] }),
1881
+ /* @__PURE__ */ jsx14(
1882
+ AddWorkflowTypeModal,
1883
+ {
1884
+ isOpen: modalOpen,
1885
+ onClose: () => setModalOpen(false)
1886
+ }
1887
+ )
1888
+ ] });
1889
+ }
1890
+
1891
+ // src/components/Sidebar.jsx
1892
+ import { Fragment, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
1893
+ var workflowItems = [
1894
+ { name: "Workflow Type", component: "workflowType", icon: RiGitMergeLine },
1895
+ { name: "Workflow", component: "workflow", icon: RiNodeTree },
1896
+ { name: "Workflow Step", component: "workflowStep", icon: RiGitBranchLine },
1897
+ { name: "Workflow Transition", component: "workflowTransition", icon: RiCornerDownRightLine }
1898
+ ];
1899
+ var permissionItems = [
1900
+ { name: "Task Permission", path: "/TaskPermissionPage", icon: RiUserSettingsLine },
1901
+ { name: "Assignment Rule", path: "/AssignmentRulePage", icon: RiFileShieldLine }
1902
+ ];
1903
+ var hierarchyItems = [
1904
+ { name: "Hierarchy Node", path: "/WorkflowType", icon: RiNodeTree },
1905
+ { name: "User Hierarchy Mapping", path: "/WorkflowType", icon: RiUserSharedLine },
1906
+ { name: "Workflow Settings", path: "/WorkflowType", icon: RiSettings4Line }
1907
+ ];
1908
+ var documentItems = [
1909
+ { name: "Document Configuration", path: "/WorkflowType", icon: RiFileSettingsLine }
1910
+ ];
1911
+ var fileItems = [
1912
+ { name: "File Instance", path: "/WorkflowType", icon: RiFileList3Line },
1913
+ { name: "File Pool", path: "/WorkflowType", icon: RiDatabase2Line },
1914
+ { name: "Uploaded Document", path: "/WorkflowType", icon: RiFileUploadLine }
1915
+ ];
1916
+ var communicationItems = [
1917
+ { name: "Notification", path: "/WorkflowType", icon: RiNotification4Line },
1918
+ { name: "Comment", path: "/WorkflowType", icon: RiChat3Line }
1919
+ ];
1920
+ var taskItems = [
1921
+ { name: "Task Instance", path: "/WorkflowType", icon: RiCheckboxMultipleLine }
1922
+ ];
1923
+ var trackingItems = [
1924
+ { name: "Audit Log", path: "/WorkflowType", icon: RiShieldCheckLine },
1925
+ { name: "Movement History", path: "/WorkflowType", icon: RiHistoryLine }
1926
+ ];
1927
+ function Sidebar({ isOpen, onToggle, children }) {
1928
+ const router = useRouter();
1929
+ const [workflowOpen, setWorkflowOpen] = useState8(false);
1930
+ const [permissionOpen, setPermissionOpen] = useState8(false);
1931
+ const [hierarchyOpen, setHierarchyOpen] = useState8(false);
1932
+ const [documentOpen, setDocumentOpen] = useState8(false);
1933
+ const [activeComponent, setActiveComponent] = useState8(null);
1934
+ const [filesOpen, setFilesOpen] = useState8(false);
1935
+ const [tasksOpen, setTasksOpen] = useState8(false);
1936
+ const [trackingOpen, setTrackingOpen] = useState8(false);
1937
+ const [communicationOpen, setCommunicationOpen] = useState8(false);
1938
+ useEffect2(() => {
1939
+ const handleRouteChange = () => {
1940
+ setActiveComponent(null);
1941
+ };
1942
+ router.events.on("routeChangeStart", handleRouteChange);
1943
+ return () => {
1944
+ router.events.off("routeChangeStart", handleRouteChange);
1945
+ };
1946
+ }, []);
1947
+ const renderContent = () => {
1948
+ switch (activeComponent) {
1949
+ case "workflowType":
1950
+ return /* @__PURE__ */ jsx15(WorkflowTypeMain, {});
1951
+ case "workflow":
1952
+ return /* @__PURE__ */ jsx15(WorkflowMasterMain, {});
1953
+ case "workflowStep":
1954
+ return /* @__PURE__ */ jsx15(WorkflowStep, {});
1955
+ case "workflowTransition":
1956
+ return /* @__PURE__ */ jsx15(WorkFlowTransition, {});
1957
+ default:
1958
+ return children;
1959
+ }
1960
+ };
1961
+ const renderMenuItemold = (item) => {
1962
+ const Icon = item.icon;
1963
+ return /* @__PURE__ */ jsxs14(
1964
+ "button",
1965
+ {
1966
+ type: "button",
1967
+ className: `
1968
+ flex h-[56px] w-full items-center gap-[17px]
1969
+ rounded-[9px] px-[17px]
1970
+ text-left transition-colors duration-150
1971
+ ${router.pathname === item.path ? "bg-blue-50 text-blue-600" : "text-[#344261] hover:bg-[#F6F8FC]"}
1972
+ `,
1973
+ onClick: () => router.push(item.path),
1974
+ children: [
1975
+ /* @__PURE__ */ jsx15(
1976
+ "span",
1977
+ {
1978
+ className: "\r\n flex h-[20px] w-[20px] shrink-0\r\n items-center justify-center\r\n rounded-[6px] text-[#405170]\r\n ",
1979
+ children: /* @__PURE__ */ jsx15(Icon, { size: 17 })
1980
+ }
1981
+ ),
1982
+ /* @__PURE__ */ jsx15("span", { className: "whitespace-nowrap text-[14px] font-medium leading-[22px]", children: item.name })
1983
+ ]
1984
+ },
1985
+ item.name
1986
+ );
1987
+ };
1988
+ const renderMenuItem = (item) => {
1989
+ const Icon = item.icon;
1990
+ const handleClick = async () => {
1991
+ if (item.component) {
1992
+ await router.push("/", void 0, { shallow: true });
1993
+ setActiveComponent(item.component);
1994
+ } else {
1995
+ setActiveComponent(null);
1996
+ router.push(item.path);
1997
+ }
1998
+ };
1999
+ return /* @__PURE__ */ jsxs14(
2000
+ "button",
2001
+ {
2002
+ onClick: handleClick,
2003
+ className: `
2004
+ flex h-[56px] w-full items-center gap-[17px]
2005
+ rounded-[9px] px-[17px]
2006
+ ${item.component ? activeComponent === item.component ? "bg-blue-50 text-blue-600" : "text-[#344261] hover:bg-[#F6F8FC]" : router.pathname === item.path ? "bg-blue-50 text-blue-600" : "text-[#344261] hover:bg-[#F6F8FC]"}
2007
+ `,
2008
+ children: [
2009
+ /* @__PURE__ */ jsx15(Icon, { size: 17 }),
2010
+ /* @__PURE__ */ jsx15("span", { children: item.name })
2011
+ ]
2012
+ },
2013
+ item.name
2014
+ );
2015
+ };
2016
+ const renderDropdown = (title, open, setOpen, items) => {
2017
+ return /* @__PURE__ */ jsxs14("div", { className: "mb-2", children: [
2018
+ /* @__PURE__ */ jsxs14(
2019
+ "button",
2020
+ {
2021
+ type: "button",
2022
+ onClick: () => setOpen(!open),
2023
+ className: "\r\n flex h-[50px] w-full items-center justify-between\r\n rounded-[9px] px-[17px]\r\n text-left text-[#344261]\r\n transition-colors duration-150\r\n hover:bg-[#F6F8FC]\r\n ",
2024
+ children: [
2025
+ /* @__PURE__ */ jsx15("span", { className: "text-[16px] font-semibold", children: title }),
2026
+ open ? /* @__PURE__ */ jsx15(RiArrowDownSLine, { size: 18 }) : /* @__PURE__ */ jsx15(RiArrowRightSLine, { size: 18 })
2027
+ ]
2028
+ }
2029
+ ),
2030
+ open && /* @__PURE__ */ jsx15("div", { className: "ml-[8px] border-l border-[#E5E9F1] pl-[4px]", children: items.map(renderMenuItem) })
2031
+ ] });
2032
+ };
2033
+ return /* @__PURE__ */ jsxs14(Fragment, { children: [
2034
+ /* @__PURE__ */ jsxs14(
2035
+ "aside",
2036
+ {
2037
+ className: `
2038
+ flex h-screen flex-col overflow-hidden
2039
+ border-r border-[#E5E9F1] bg-white
2040
+ font-sans text-[#273657]
2041
+ transition-all duration-300 ease-in-out
2042
+ ${isOpen ? "w-[245px] min-w-[245px] translate-x-0 opacity-100" : "w-0 min-w-0 -translate-x-full opacity-0"}
2043
+ `,
2044
+ children: [
2045
+ /* @__PURE__ */ jsxs14(
2046
+ "header",
2047
+ {
2048
+ className: "\r\n flex h-[84px] items-center justify-between\r\n border-b border-[#EDF0F5]\r\n px-[14px]\r\n ",
2049
+ children: [
2050
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2", children: [
2051
+ /* @__PURE__ */ jsxs14(
2052
+ "svg",
2053
+ {
2054
+ width: "36",
2055
+ height: "42",
2056
+ viewBox: "0 0 48 56",
2057
+ fill: "none",
2058
+ children: [
2059
+ /* @__PURE__ */ jsx15(
2060
+ "path",
2061
+ {
2062
+ d: "M24 2L45 12.5L24 23L3 12.5L24 2Z",
2063
+ fill: "#356AF3"
2064
+ }
2065
+ ),
2066
+ /* @__PURE__ */ jsx15(
2067
+ "path",
2068
+ {
2069
+ d: "M24 8L34 13L24 18L14 13L24 8Z",
2070
+ fill: "white"
2071
+ }
2072
+ ),
2073
+ /* @__PURE__ */ jsx15(
2074
+ "path",
2075
+ {
2076
+ d: "M3 20L24 30.5L45 20V27L24 37.5L3 27V20Z",
2077
+ fill: "#356AF3"
2078
+ }
2079
+ ),
2080
+ /* @__PURE__ */ jsx15(
2081
+ "path",
2082
+ {
2083
+ d: "M3 33L24 43.5L45 33V40L24 50.5L3 40V33Z",
2084
+ fill: "#356AF3"
2085
+ }
2086
+ )
2087
+ ]
2088
+ }
2089
+ ),
2090
+ /* @__PURE__ */ jsxs14("div", { children: [
2091
+ /* @__PURE__ */ jsx15("h1", { className: "text-[18px] font-extrabold text-[#101318]", children: "FLOWCORE" }),
2092
+ /* @__PURE__ */ jsx15("p", { className: "text-[12px] text-[#344261]", children: "Workflow Engine" })
2093
+ ] })
2094
+ ] }),
2095
+ /* @__PURE__ */ jsx15(
2096
+ "button",
2097
+ {
2098
+ type: "button",
2099
+ onClick: onToggle,
2100
+ className: "\r\n flex h-8 w-8\r\n items-center justify-center\r\n rounded-lg\r\n hover:bg-gray-100\r\n ",
2101
+ children: /* @__PURE__ */ jsx15(RiMenuLine, { size: 18 })
2102
+ }
2103
+ )
2104
+ ]
2105
+ }
2106
+ ),
2107
+ /* @__PURE__ */ jsxs14(
2108
+ "div",
2109
+ {
2110
+ className: "\r\n min-h-0 flex-1\r\n overflow-y-auto overflow-x-hidden\r\n px-[27px] pb-[30px] pt-[31px]\r\n ",
2111
+ children: [
2112
+ /* @__PURE__ */ jsx15(
2113
+ "p",
2114
+ {
2115
+ className: "\r\n mb-[19px] ml-[15px]\r\n text-[14px] font-bold uppercase\r\n leading-[20px] tracking-[0.2px]\r\n text-[#3C4D74]\r\n ",
2116
+ children: "Configuration Masters"
2117
+ }
2118
+ ),
2119
+ /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-[3px]", children: [
2120
+ renderDropdown(
2121
+ "Workflow",
2122
+ workflowOpen,
2123
+ setWorkflowOpen,
2124
+ workflowItems
2125
+ ),
2126
+ renderDropdown(
2127
+ "Permissions",
2128
+ permissionOpen,
2129
+ setPermissionOpen,
2130
+ permissionItems
2131
+ ),
2132
+ renderDropdown(
2133
+ "Documents",
2134
+ documentOpen,
2135
+ setDocumentOpen,
2136
+ documentItems
2137
+ ),
2138
+ renderDropdown(
2139
+ "Hierarchy",
2140
+ hierarchyOpen,
2141
+ setHierarchyOpen,
2142
+ hierarchyItems
2143
+ )
2144
+ ] }),
2145
+ /* @__PURE__ */ jsx15(
2146
+ "p",
2147
+ {
2148
+ className: "\r\n mb-[19px] ml-[15px] mt-[39px]\r\n text-[14px] font-bold uppercase\r\n leading-[20px] tracking-[0.2px]\r\n text-[#3C4D74]\r\n ",
2149
+ children: "Runtime"
2150
+ }
2151
+ ),
2152
+ /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-[3px]", children: [
2153
+ renderDropdown(
2154
+ "Files",
2155
+ filesOpen,
2156
+ setFilesOpen,
2157
+ fileItems
2158
+ ),
2159
+ renderDropdown(
2160
+ "Tasks",
2161
+ tasksOpen,
2162
+ setTasksOpen,
2163
+ taskItems
2164
+ ),
651
2165
  renderDropdown(
652
2166
  "Tracking",
653
2167
  trackingOpen,
@@ -664,18 +2178,18 @@ function Sidebar({ isOpen, onToggle }) {
664
2178
  ]
665
2179
  }
666
2180
  ),
667
- /* @__PURE__ */ jsx5(
2181
+ /* @__PURE__ */ jsx15(
668
2182
  "div",
669
2183
  {
670
2184
  className: "\r\n shrink-0\r\n bg-white\r\n px-[27px]\r\n pb-[34px]\r\n pt-[18px]\r\n ",
671
- children: /* @__PURE__ */ jsxs4(
2185
+ children: /* @__PURE__ */ jsxs14(
672
2186
  "button",
673
2187
  {
674
2188
  type: "button",
675
2189
  className: "\r\n flex h-[66px] w-full\r\n items-center gap-[18px]\r\n rounded-[10px]\r\n border border-[#E1E5ED]\r\n bg-white\r\n px-[23px]\r\n text-left\r\n text-[16px]\r\n font-semibold\r\n text-[#2D3A58]\r\n shadow-sm\r\n hover:bg-[#F7F8FC]\r\n transition\r\n ",
676
2190
  children: [
677
- /* @__PURE__ */ jsx5(RiSettings4Line, { size: 20 }),
678
- /* @__PURE__ */ jsx5("span", { children: "Settings" })
2191
+ /* @__PURE__ */ jsx15(RiSettings4Line, { size: 20 }),
2192
+ /* @__PURE__ */ jsx15("span", { children: "Settings" })
679
2193
  ]
680
2194
  }
681
2195
  )
@@ -684,60 +2198,36 @@ function Sidebar({ isOpen, onToggle }) {
684
2198
  ]
685
2199
  }
686
2200
  ),
687
- !isOpen && /* @__PURE__ */ jsx5(
2201
+ /* @__PURE__ */ jsx15("div", { className: "flex-1 overflow-auto bg-[#F5F7FB]", children: renderContent() }),
2202
+ !isOpen && /* @__PURE__ */ jsx15(
688
2203
  "button",
689
2204
  {
690
2205
  type: "button",
691
2206
  onClick: onToggle,
692
2207
  "aria-label": "Open sidebar",
693
2208
  className: "\r\n fixed left-[20px] top-[30px] z-[100]\r\n flex h-[46px] w-[46px]\r\n items-center justify-center\r\n rounded-[9px]\r\n border border-[#E1E5ED]\r\n bg-white text-[#344261]\r\n shadow-[0_2px_8px_rgba(0,0,0,0.08)]\r\n transition-colors\r\n hover:bg-[#F3F5F9]\r\n ",
694
- children: /* @__PURE__ */ jsx5(RiMenuLine, { size: 18 })
2209
+ children: /* @__PURE__ */ jsx15(RiMenuLine, { size: 18 })
695
2210
  }
696
2211
  )
697
2212
  ] });
698
2213
  }
699
2214
 
700
- // src/pages/Sidebar.js
701
- import { jsx as jsx6 } from "react/jsx-runtime";
702
- function Home() {
703
- const [isOpen, setIsOpen] = useState3(true);
704
- return /* @__PURE__ */ jsx6("div", { className: "flex h-screen", children: /* @__PURE__ */ jsx6(
2215
+ // src/components/Layout.jsx
2216
+ import { jsx as jsx16 } from "react/jsx-runtime";
2217
+ var Layout = ({ children }) => {
2218
+ const [isOpen, setIsOpen] = useState9(true);
2219
+ return /* @__PURE__ */ jsx16("div", { className: "flex h-screen", children: /* @__PURE__ */ jsx16(
705
2220
  Sidebar,
706
2221
  {
707
2222
  isOpen,
708
- onToggle: () => setIsOpen(!isOpen)
2223
+ onToggle: () => setIsOpen(!isOpen),
2224
+ children
709
2225
  }
710
2226
  ) });
711
- }
712
-
713
- // src/components/Layout.jsx
714
- import { useState as useState4 } from "react";
715
- import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
716
- var Layout = ({ children }) => {
717
- const [isOpen, setIsOpen] = useState4(true);
718
- return /* @__PURE__ */ jsxs5("div", { className: "flex min-h-screen", children: [
719
- /* @__PURE__ */ jsx7(
720
- Sidebar,
721
- {
722
- isOpen,
723
- onToggle: () => setIsOpen(!isOpen)
724
- }
725
- ),
726
- /* @__PURE__ */ jsx7("main", { className: "flex-1 p-6 bg-gray-100", children })
727
- ] });
728
2227
  };
729
2228
  var Layout_default = Layout;
730
-
731
- // src/pages/AdminPanel.js
732
- import React4 from "react";
733
- import { Fragment as Fragment2, jsx as jsx8 } from "react/jsx-runtime";
734
- var AdminPanel = () => {
735
- return /* @__PURE__ */ jsx8(Fragment2, { children: /* @__PURE__ */ jsx8(Layout_default, {}) });
736
- };
737
- var AdminPanel_default = AdminPanel;
738
2229
  export {
739
- AdminPanel_default as AdminPanel,
740
2230
  Layout_default as Layout,
741
- Home as Sidebar,
2231
+ Layout_default as Sidebar,
742
2232
  WorkflowPage
743
2233
  };