@mseva/upyog-ui-module-chb 1.1.61 → 1.1.63

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,5 +1,5 @@
1
- import { TickMark, CardSubHeader, Modal as Modal$1, CardLabelDesc, CardLabel, CardText, Card, FormStep, Dropdown, TextArea, Loader as Loader$1, TextInput, MobileNumber, Toast, LabelFieldPair, UploadFile, Table, KeyNote, SubmitBar, CardHeader, InfoIcon, Calender, TelePhone, DisplayPhotos as DisplayPhotos$1, CardSectionHeader, CheckPoint, ConnectingCheckPoints, AppContainer, BackButton, PrivateRoute, PDFSvg as PDFSvg$2, StatusTable, Row, CheckBox, LinkButton, Banner, Header, MultiLink, SearchField, FilterFormField, RadioButtons, ComplaintIcon, InboxComposer, SearchForm, CardLabelError, DatePicker, EmployeeModuleCard, CloseSvg, Localities, RemoveableTag, FormComposer, ActionBar, Menu, OTPInput, Rating, CitizenHomeCard } from '@mseva/digit-ui-react-components';
2
- import React, { useState, useEffect, useRef, Fragment as Fragment$1, useMemo, useReducer, useCallback } from 'react';
1
+ import { TickMark, CardSubHeader, Modal as Modal$1, CardLabelDesc, CardLabel, CardText, Card, FormStep, Dropdown, TextArea, Loader as Loader$1, TextInput, MobileNumber, Toast, LabelFieldPair, UploadFile, Table, KeyNote, SubmitBar, CardHeader, InfoIcon, Calender, CheckPoint, ConnectingCheckPoints, AppContainer, BackButton, PrivateRoute, PDFSvg as PDFSvg$2, StatusTable, Row, CardSectionHeader, CheckBox, LinkButton, Banner, Header, MultiLink, TelePhone, DisplayPhotos, SearchField, FilterFormField, RadioButtons, ComplaintIcon, InboxComposer, SearchForm, CardLabelError, DatePicker, EmployeeModuleCard, CloseSvg, Localities, RemoveableTag, FormComposer, ActionBar, Menu, OTPInput, Rating, CitizenHomeCard } from '@mseva/digit-ui-react-components';
2
+ import React, { useState, useEffect, useRef, useMemo, useCallback, Fragment as Fragment$1, useReducer } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useLocation, useRouteMatch, useHistory, Switch, Route, Redirect, Link, useParams } from 'react-router-dom';
5
5
  import { useForm, Controller, useFormContext } from 'react-hook-form';
@@ -542,10 +542,6 @@ function createCommonjsModule(fn, module) {
542
542
  return module = { exports: {} }, fn(module, module.exports), module.exports;
543
543
  }
544
544
 
545
- function getCjsExportFromNamespace (n) {
546
- return n && n['default'] || n;
547
- }
548
-
549
545
  var jquery = createCommonjsModule(function (module) {
550
546
  (function (global, factory) {
551
547
 
@@ -14391,8 +14387,6 @@ var accessibility = createCommonjsModule(function (module, exports) {
14391
14387
  });
14392
14388
  unwrapExports(accessibility);
14393
14389
 
14394
- var _shallowEqual = getCjsExportFromNamespace(index_esm);
14395
-
14396
14390
  var Calendar_1 = createCommonjsModule(function (module, exports) {
14397
14391
 
14398
14392
  function _typeof(obj) {
@@ -15047,7 +15041,7 @@ var Calendar_1 = createCommonjsModule(function (module, exports) {
15047
15041
  monthNames: this.getMonthNames()
15048
15042
  });
15049
15043
  }
15050
- if (!(0, _shallowEqual.shallowEqualObjects)(prevProps.scroll, this.props.scroll)) {
15044
+ if (!(0, index_esm.shallowEqualObjects)(prevProps.scroll, this.props.scroll)) {
15051
15045
  this.setState({
15052
15046
  scrollArea: this.calcScrollArea(this.props)
15053
15047
  });
@@ -17661,44 +17655,267 @@ const CommunityHallSearch = ({
17661
17655
  }));
17662
17656
  };
17663
17657
 
17664
- const CHBWFReason = ({
17665
- headComment,
17666
- otherComment
17667
- }) => /*#__PURE__*/React.createElement("div", {
17668
- className: "checkpoint-comments-wrap"
17669
- }, /*#__PURE__*/React.createElement("h4", null, headComment), /*#__PURE__*/React.createElement("p", null, otherComment));
17658
+ const getTimelineAcknowledgementData = (workflowDetails, tenantInfo, t) => {
17659
+ var _workflowDetails$data, _workflowDetails$data2, _processInstances$, _processInstances$2, _processInstances$3, _timeline$, _timeline$2, _timeline$3, _timeline$4;
17660
+ const timeline = (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data = workflowDetails.data) === null || _workflowDetails$data === void 0 ? void 0 : _workflowDetails$data.timeline) || (workflowDetails === null || workflowDetails === void 0 ? void 0 : workflowDetails.timeline) || [];
17661
+ const processInstances = (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data2 = workflowDetails.data) === null || _workflowDetails$data2 === void 0 ? void 0 : _workflowDetails$data2.processInstances) || (workflowDetails === null || workflowDetails === void 0 ? void 0 : workflowDetails.processInstances) || [];
17662
+ const businessId = (processInstances === null || processInstances === void 0 ? void 0 : (_processInstances$ = processInstances[0]) === null || _processInstances$ === void 0 ? void 0 : _processInstances$.businessId) || "N/A";
17663
+ const businessService = (processInstances === null || processInstances === void 0 ? void 0 : (_processInstances$2 = processInstances[0]) === null || _processInstances$2 === void 0 ? void 0 : _processInstances$2.businessService) || "N/A";
17664
+ const moduleName = (processInstances === null || processInstances === void 0 ? void 0 : (_processInstances$3 = processInstances[0]) === null || _processInstances$3 === void 0 ? void 0 : _processInstances$3.moduleName) || "N/A";
17665
+ const timelineRows = timeline.map((item, index) => {
17666
+ var _item$auditDetails, _item$auditDetails2, _item$assigner, _item$assigner2, _item$assigner3, _item$wfComment;
17667
+ const createdDate = (item === null || item === void 0 ? void 0 : (_item$auditDetails = item.auditDetails) === null || _item$auditDetails === void 0 ? void 0 : _item$auditDetails.created) || "N/A";
17668
+ const timing = (item === null || item === void 0 ? void 0 : (_item$auditDetails2 = item.auditDetails) === null || _item$auditDetails2 === void 0 ? void 0 : _item$auditDetails2.timing) || "N/A";
17669
+ const assignerName = (item === null || item === void 0 ? void 0 : (_item$assigner = item.assigner) === null || _item$assigner === void 0 ? void 0 : _item$assigner.name) || "N/A";
17670
+ const assignerType = (item === null || item === void 0 ? void 0 : (_item$assigner2 = item.assigner) === null || _item$assigner2 === void 0 ? void 0 : _item$assigner2.type) || "N/A";
17671
+ const mobileNumber = (item === null || item === void 0 ? void 0 : (_item$assigner3 = item.assigner) === null || _item$assigner3 === void 0 ? void 0 : _item$assigner3.mobileNumber) || "N/A";
17672
+ const action = (item === null || item === void 0 ? void 0 : item.performedAction) || "N/A";
17673
+ const status = (item === null || item === void 0 ? void 0 : item.status) || (item === null || item === void 0 ? void 0 : item.state) || "N/A";
17674
+ const comment = (item === null || item === void 0 ? void 0 : (_item$wfComment = item.wfComment) === null || _item$wfComment === void 0 ? void 0 : _item$wfComment[0]) || "-";
17675
+ const documents = (item === null || item === void 0 ? void 0 : item.wfDocuments) || [];
17676
+ return {
17677
+ sNo: index + 1,
17678
+ action: t ? t(action) : action,
17679
+ status: t ? t(status) : status,
17680
+ assignerName,
17681
+ assignerType,
17682
+ mobileNumber,
17683
+ designation: assignerType,
17684
+ date: createdDate,
17685
+ time: timing,
17686
+ dateTime: `${createdDate} ${timing !== "N/A" ? timing : ""}`.trim(),
17687
+ comment,
17688
+ documents: documents.map(doc => ({
17689
+ name: (doc === null || doc === void 0 ? void 0 : doc.fileName) || (doc === null || doc === void 0 ? void 0 : doc.documentType) || "Document",
17690
+ type: (doc === null || doc === void 0 ? void 0 : doc.documentType) || "Document",
17691
+ fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId
17692
+ })),
17693
+ hasDocuments: documents.length > 0
17694
+ };
17695
+ });
17696
+ return {
17697
+ t,
17698
+ tenantId: (tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.code) || "",
17699
+ tenantName: (tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.name) || (tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.i18nKey) || "Government Department",
17700
+ name: t ? t("TIMELINE_PDF_TITLE") : "Application Timeline",
17701
+ heading: t ? t("TIMELINE_PDF_HEADING") : "File Movement Report",
17702
+ businessId,
17703
+ businessService: t ? t(`CS_COMMON_${businessService === null || businessService === void 0 ? void 0 : businessService.toUpperCase()}`) : businessService,
17704
+ moduleName,
17705
+ currentStatus: t ? t((timeline === null || timeline === void 0 ? void 0 : (_timeline$ = timeline[0]) === null || _timeline$ === void 0 ? void 0 : _timeline$.status) || (timeline === null || timeline === void 0 ? void 0 : (_timeline$2 = timeline[0]) === null || _timeline$2 === void 0 ? void 0 : _timeline$2.state) || "N/A") : (timeline === null || timeline === void 0 ? void 0 : (_timeline$3 = timeline[0]) === null || _timeline$3 === void 0 ? void 0 : _timeline$3.status) || (timeline === null || timeline === void 0 ? void 0 : (_timeline$4 = timeline[0]) === null || _timeline$4 === void 0 ? void 0 : _timeline$4.state) || "N/A",
17706
+ generatedDate: new Date().toLocaleDateString("en-IN", {
17707
+ day: "2-digit",
17708
+ month: "long",
17709
+ year: "numeric"
17710
+ }),
17711
+ generatedDateTime: new Date().toLocaleString("en-IN", {
17712
+ day: "2-digit",
17713
+ month: "2-digit",
17714
+ year: "numeric",
17715
+ hour: "2-digit",
17716
+ minute: "2-digit",
17717
+ hour12: true
17718
+ }),
17719
+ timelineRows,
17720
+ totalSteps: timelineRows.length
17721
+ };
17722
+ };
17670
17723
 
17671
- const CHBWFCaption = ({
17672
- data,
17673
- OpenImage
17724
+ const parseDate = dateStr => {
17725
+ if (!dateStr || dateStr === "N/A") return null;
17726
+ if (typeof dateStr === "string" && dateStr !== null && dateStr !== void 0 && dateStr.includes("/")) {
17727
+ const [day, month, year] = dateStr === null || dateStr === void 0 ? void 0 : dateStr.split("/");
17728
+ return new Date(year, month - 1, day);
17729
+ }
17730
+ return new Date(dateStr);
17731
+ };
17732
+ const calculateDays = (start, end) => {
17733
+ if (!start || !end) return "N/A";
17734
+ const startDate = parseDate(start);
17735
+ const endDate = parseDate(end);
17736
+ if (!startDate || !endDate || isNaN(startDate === null || startDate === void 0 ? void 0 : startDate.getTime()) || isNaN(endDate === null || endDate === void 0 ? void 0 : endDate.getTime())) {
17737
+ return "N/A";
17738
+ }
17739
+ const diffDays = Math.floor((endDate - startDate) / 86400000);
17740
+ return diffDays < 0 ? "N/A" : diffDays === 0 ? "0 Days" : `${diffDays} Days`;
17741
+ };
17742
+ const PDFSvg = React.memo(({
17743
+ width: _width = 85,
17744
+ height: _height = 100,
17745
+ style
17746
+ }) => /*#__PURE__*/React.createElement("svg", {
17747
+ style: style,
17748
+ xmlns: "http://www.w3.org/2000/svg",
17749
+ width: _width,
17750
+ height: _height,
17751
+ viewBox: "0 0 20 20",
17752
+ fill: "gray"
17753
+ }, /*#__PURE__*/React.createElement("path", {
17754
+ d: "M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"
17755
+ })));
17756
+ const pdfDownloadLink = (documents, fileStoreId) => {
17757
+ var _downloadLink$split;
17758
+ const downloadLink = (documents === null || documents === void 0 ? void 0 : documents[fileStoreId]) || "";
17759
+ const formats = (downloadLink === null || downloadLink === void 0 ? void 0 : (_downloadLink$split = downloadLink.split(",")) === null || _downloadLink$split === void 0 ? void 0 : _downloadLink$split.filter(Boolean)) || [];
17760
+ return (formats === null || formats === void 0 ? void 0 : formats.find(link => !(link !== null && link !== void 0 && link.includes("large")) && !(link !== null && link !== void 0 && link.includes("medium")) && !(link !== null && link !== void 0 && link.includes("small")))) || (formats === null || formats === void 0 ? void 0 : formats[0]) || "";
17761
+ };
17762
+ const TimelineDocument = React.memo(({
17763
+ value,
17764
+ Code,
17765
+ index
17674
17766
  }) => {
17675
- var _data$wfComment, _data$thumbnailsToSho, _data$thumbnailsToSho2;
17676
17767
  const {
17677
- t
17678
- } = useTranslation();
17679
- return /*#__PURE__*/React.createElement("div", null, data.date && /*#__PURE__*/React.createElement("p", null, data.date), /*#__PURE__*/React.createElement("p", null, data.name), data.mobileNumber && /*#__PURE__*/React.createElement(TelePhone, {
17680
- mobile: data.mobileNumber
17681
- }), data.source && /*#__PURE__*/React.createElement("p", null, t("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_" + data.source.toUpperCase())), data.comment && /*#__PURE__*/React.createElement(Reason, {
17682
- otherComment: data === null || data === void 0 ? void 0 : data.otherComment,
17683
- headComment: data === null || data === void 0 ? void 0 : data.comment
17684
- }), data !== null && data !== void 0 && data.wfComment ? /*#__PURE__*/React.createElement("div", null, data === null || data === void 0 ? void 0 : (_data$wfComment = data.wfComment) === null || _data$wfComment === void 0 ? void 0 : _data$wfComment.map(e => /*#__PURE__*/React.createElement("div", {
17685
- className: "TLComments"
17686
- }, /*#__PURE__*/React.createElement("h3", null, t("WF_COMMON_COMMENTS")), /*#__PURE__*/React.createElement("p", {
17687
- style: {
17688
- overflowX: "scroll"
17689
- }
17690
- }, e)))) : null, (data === null || data === void 0 ? void 0 : (_data$thumbnailsToSho = data.thumbnailsToShow) === null || _data$thumbnailsToSho === void 0 ? void 0 : (_data$thumbnailsToSho2 = _data$thumbnailsToSho.thumbs) === null || _data$thumbnailsToSho2 === void 0 ? void 0 : _data$thumbnailsToSho2.length) > 0 ? /*#__PURE__*/React.createElement("div", {
17691
- className: "TLComments"
17692
- }, /*#__PURE__*/React.createElement("h3", null, t("CS_COMMON_ATTACHMENTS")), /*#__PURE__*/React.createElement(DisplayPhotos$1, {
17693
- srcs: data === null || data === void 0 ? void 0 : data.thumbnailsToShow.thumbs,
17694
- onClick: (src, index) => {
17695
- OpenImage(src, index, data === null || data === void 0 ? void 0 : data.thumbnailsToShow);
17696
- }
17697
- })) : null);
17768
+ isLoading,
17769
+ data
17770
+ } = Digit.Hooks.ads.useADSDocumentSearch({
17771
+ value
17772
+ }, {
17773
+ value
17774
+ }, Code, index);
17775
+ const documents = useMemo(() => {
17776
+ var _value$documents;
17777
+ const docs = value !== null && value !== void 0 && value.documents ? value === null || value === void 0 ? void 0 : (_value$documents = value.documents) === null || _value$documents === void 0 ? void 0 : _value$documents.documents : value;
17778
+ return (docs === null || docs === void 0 ? void 0 : docs.filter(doc => (doc === null || doc === void 0 ? void 0 : doc.documentType) === Code)) || [];
17779
+ }, [value, Code]);
17780
+ if (isLoading) return /*#__PURE__*/React.createElement(Loader$1, null);
17781
+ return /*#__PURE__*/React.createElement("div", {
17782
+ className: "timeline-docs-wrapper"
17783
+ }, documents === null || documents === void 0 ? void 0 : documents.map((document, idx) => {
17784
+ const documentLink = pdfDownloadLink(data === null || data === void 0 ? void 0 : data.pdfFiles, document === null || document === void 0 ? void 0 : document.fileStoreId);
17785
+ if (!documentLink) return null;
17786
+ return /*#__PURE__*/React.createElement("a", {
17787
+ key: idx,
17788
+ target: "_blank",
17789
+ rel: "noopener noreferrer",
17790
+ href: documentLink,
17791
+ className: "timeline-doc-link"
17792
+ }, /*#__PURE__*/React.createElement(PDFSvg, {
17793
+ className: "timeline-doc-icon"
17794
+ }));
17795
+ }));
17796
+ });
17797
+ const normalizeTimeline = workflowDetails => {
17798
+ var _workflowDetails$data;
17799
+ const rawTimeline = workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data = workflowDetails.data) === null || _workflowDetails$data === void 0 ? void 0 : _workflowDetails$data.timeline;
17800
+ if (!rawTimeline || !Array.isArray(rawTimeline)) return [];
17801
+ return rawTimeline === null || rawTimeline === void 0 ? void 0 : rawTimeline.map((item, index) => {
17802
+ var _item$auditDetails, _item$auditDetails2, _item$assigner, _item$wfComment;
17803
+ const createdDate = (item === null || item === void 0 ? void 0 : (_item$auditDetails = item.auditDetails) === null || _item$auditDetails === void 0 ? void 0 : _item$auditDetails.created) || "N/A";
17804
+ const lastModified = (item === null || item === void 0 ? void 0 : (_item$auditDetails2 = item.auditDetails) === null || _item$auditDetails2 === void 0 ? void 0 : _item$auditDetails2.lastModified) || "N/A";
17805
+ return {
17806
+ id: index,
17807
+ state: item === null || item === void 0 ? void 0 : item.state,
17808
+ assignerName: (item === null || item === void 0 ? void 0 : (_item$assigner = item.assigner) === null || _item$assigner === void 0 ? void 0 : _item$assigner.name) || "N/A",
17809
+ performedAction: item === null || item === void 0 ? void 0 : item.performedAction,
17810
+ comment: (item === null || item === void 0 ? void 0 : (_item$wfComment = item.wfComment) === null || _item$wfComment === void 0 ? void 0 : _item$wfComment[0]) || "",
17811
+ documents: (item === null || item === void 0 ? void 0 : item.wfDocuments) || [],
17812
+ createdDate,
17813
+ lastModified,
17814
+ noOfDays: calculateDays(createdDate, lastModified)
17815
+ };
17816
+ });
17817
+ };
17818
+ const HEADER_FIELDS = [{
17819
+ label: "CM_TIMELINE_NAME",
17820
+ key: "assignerName"
17821
+ }, {
17822
+ label: "CM_TIMELINE_ACTION_TAKEN",
17823
+ key: "performedAction"
17824
+ }, {
17825
+ label: "CM_TIMELINE_ACTION_TAKEN_ON",
17826
+ key: "lastModified"
17827
+ }, {
17828
+ label: "CM_TIMELINE_DATE_RECEIVED",
17829
+ key: "createdDate"
17830
+ }, {
17831
+ label: "CM_TIMELINE_NO_OF_DAYS",
17832
+ key: "noOfDays"
17833
+ }];
17834
+ const TimelineCaption = React.memo(({
17835
+ checkpoint,
17836
+ t,
17837
+ onDownloadPDF
17838
+ }) => {
17839
+ var _checkpoint$documents, _checkpoint$documents2;
17840
+ return /*#__PURE__*/React.createElement("div", {
17841
+ className: "timeline-card"
17842
+ }, /*#__PURE__*/React.createElement("div", {
17843
+ className: "timeline-header"
17844
+ }, HEADER_FIELDS === null || HEADER_FIELDS === void 0 ? void 0 : HEADER_FIELDS.map(({
17845
+ label,
17846
+ key
17847
+ }) => /*#__PURE__*/React.createElement("div", {
17848
+ key: key,
17849
+ className: "timeline-header-item"
17850
+ }, /*#__PURE__*/React.createElement("span", {
17851
+ className: "timeline-label"
17852
+ }, t(label), ":"), /*#__PURE__*/React.createElement("span", {
17853
+ className: "timeline-value"
17854
+ }, t(checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint[key]) || "N/A")))), /*#__PURE__*/React.createElement("div", {
17855
+ className: "timeline-note"
17856
+ }, /*#__PURE__*/React.createElement("span", {
17857
+ className: "timeline-label"
17858
+ }, t("CM_TIMELINE_NOTE"), ":"), /*#__PURE__*/React.createElement("div", {
17859
+ className: "note-box"
17860
+ }, (checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.comment) || t("CM_TIMELINE_NO_COMMENTS"))), (checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$documents = checkpoint.documents) === null || _checkpoint$documents === void 0 ? void 0 : _checkpoint$documents.length) > 0 && /*#__PURE__*/React.createElement("div", {
17861
+ className: "timeline-docs"
17862
+ }, /*#__PURE__*/React.createElement("span", {
17863
+ className: "timeline-label"
17864
+ }, t("CM_TIMELINE_DOCUMENT_ATTACHED"), ":"), checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$documents2 = checkpoint.documents) === null || _checkpoint$documents2 === void 0 ? void 0 : _checkpoint$documents2.map((doc, index) => /*#__PURE__*/React.createElement(TimelineDocument, {
17865
+ key: `${doc === null || doc === void 0 ? void 0 : doc.documentType}-${index}`,
17866
+ value: checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.documents,
17867
+ Code: doc === null || doc === void 0 ? void 0 : doc.documentType,
17868
+ index: index
17869
+ }))));
17870
+ });
17871
+ const ApplicationTimeline = ({
17872
+ workflowDetails,
17873
+ t
17874
+ }) => {
17875
+ var _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _timeline$;
17876
+ const details = (workflowDetails === null || workflowDetails === void 0 ? void 0 : workflowDetails.data) || workflowDetails;
17877
+ const timeline = useMemo(() => normalizeTimeline({
17878
+ data: details
17879
+ }), [details]);
17880
+ const currentState = workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data2 = workflowDetails.data) === null || _workflowDetails$data2 === void 0 ? void 0 : (_workflowDetails$data3 = _workflowDetails$data2.timeline) === null || _workflowDetails$data3 === void 0 ? void 0 : (_workflowDetails$data4 = _workflowDetails$data3[0]) === null || _workflowDetails$data4 === void 0 ? void 0 : _workflowDetails$data4.state;
17881
+ const handleDownloadPDF = useCallback(() => {
17882
+ const tenantInfo = Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY") || {};
17883
+ const acknowledgementData = getTimelineAcknowledgementData(workflowDetails, tenantInfo, t);
17884
+ Digit.Utils.pdf.generateTimelinePDF(acknowledgementData);
17885
+ }, [workflowDetails, t]);
17886
+ if (!(timeline !== null && timeline !== void 0 && timeline.length)) return null;
17887
+ return /*#__PURE__*/React.createElement("div", {
17888
+ className: "timeline-hoc-container"
17889
+ }, /*#__PURE__*/React.createElement("div", {
17890
+ className: "timeline-header-wrapper"
17891
+ }, /*#__PURE__*/React.createElement(CardSubHeader, {
17892
+ className: "timeline-subheader"
17893
+ }, t("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")), /*#__PURE__*/React.createElement("span", {
17894
+ onClick: handleDownloadPDF,
17895
+ className: "download-button"
17896
+ }, t("CS_COMMON_DOWNLOAD"))), (timeline === null || timeline === void 0 ? void 0 : timeline.length) === 1 ? /*#__PURE__*/React.createElement(CheckPoint, {
17897
+ isCompleted: true,
17898
+ label: t(timeline === null || timeline === void 0 ? void 0 : (_timeline$ = timeline[0]) === null || _timeline$ === void 0 ? void 0 : _timeline$.state),
17899
+ customChild: /*#__PURE__*/React.createElement(TimelineCaption, {
17900
+ checkpoint: timeline === null || timeline === void 0 ? void 0 : timeline[0],
17901
+ t: t,
17902
+ onDownloadPDF: handleDownloadPDF
17903
+ })
17904
+ }) : /*#__PURE__*/React.createElement(ConnectingCheckPoints, null, timeline === null || timeline === void 0 ? void 0 : timeline.map(checkpoint => /*#__PURE__*/React.createElement(CheckPoint, {
17905
+ key: checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.id,
17906
+ keyValue: checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.id,
17907
+ isCompleted: (checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.state) === currentState,
17908
+ label: t(checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.state),
17909
+ customChild: /*#__PURE__*/React.createElement(TimelineCaption, {
17910
+ checkpoint: checkpoint,
17911
+ t: t,
17912
+ onDownloadPDF: handleDownloadPDF
17913
+ })
17914
+ }))));
17698
17915
  };
17699
17916
 
17700
17917
  const CHBWFApplicationTimeline = props => {
17701
- var _props$application, _props$application$wo, _props$application2, _props$application3, _data$timeline, _data$timeline2, _data$timeline$;
17918
+ var _props$application, _props$application$wo, _props$application2, _props$application3;
17702
17919
  const {
17703
17920
  t
17704
17921
  } = useTranslation();
@@ -17711,48 +17928,8 @@ const CHBWFApplicationTimeline = props => {
17711
17928
  id: (_props$application3 = props.application) === null || _props$application3 === void 0 ? void 0 : _props$application3.bookingNo,
17712
17929
  moduleCode: businessService
17713
17930
  });
17714
- function OpenImage(imageSource, index, thumbnailsToShow) {
17715
- var _thumbnailsToShow$ful;
17716
- window.open(thumbnailsToShow === null || thumbnailsToShow === void 0 ? void 0 : (_thumbnailsToShow$ful = thumbnailsToShow.fullImage) === null || _thumbnailsToShow$ful === void 0 ? void 0 : _thumbnailsToShow$ful[0], "_blank");
17717
- }
17718
- const getTimelineCaptions = checkpoint => {
17719
- if (checkpoint.state === "OPEN") {
17720
- var _checkpoint$auditDeta, _props$application4;
17721
- const caption = {
17722
- date: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$auditDeta = checkpoint.auditDetails) === null || _checkpoint$auditDeta === void 0 ? void 0 : _checkpoint$auditDeta.lastModified,
17723
- source: ((_props$application4 = props.application) === null || _props$application4 === void 0 ? void 0 : _props$application4.channel) || ""
17724
- };
17725
- return /*#__PURE__*/React.createElement(CHBWFCaption, {
17726
- data: caption
17727
- });
17728
- } else if (checkpoint.state) {
17729
- var _checkpoint$auditDeta2, _checkpoint$assignes, _checkpoint$assignes$, _checkpoint$assignes2, _checkpoint$assignes3;
17730
- const caption = {
17731
- date: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$auditDeta2 = checkpoint.auditDetails) === null || _checkpoint$auditDeta2 === void 0 ? void 0 : _checkpoint$auditDeta2.lastModified,
17732
- name: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assignes = checkpoint.assignes) === null || _checkpoint$assignes === void 0 ? void 0 : (_checkpoint$assignes$ = _checkpoint$assignes[0]) === null || _checkpoint$assignes$ === void 0 ? void 0 : _checkpoint$assignes$.name,
17733
- mobileNumber: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assignes2 = checkpoint.assignes) === null || _checkpoint$assignes2 === void 0 ? void 0 : (_checkpoint$assignes3 = _checkpoint$assignes2[0]) === null || _checkpoint$assignes3 === void 0 ? void 0 : _checkpoint$assignes3.mobileNumber,
17734
- comment: t(checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.comment),
17735
- wfComment: checkpoint.wfComment,
17736
- thumbnailsToShow: checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.thumbnailsToShow
17737
- };
17738
- return /*#__PURE__*/React.createElement(CHBWFCaption, {
17739
- data: caption,
17740
- OpenImage: OpenImage
17741
- });
17742
- } else {
17743
- var _props$application5, _checkpoint$assigner;
17744
- const caption = {
17745
- date: Digit.DateUtils.ConvertTimestampToDate((_props$application5 = props.application) === null || _props$application5 === void 0 ? void 0 : _props$application5.auditDetails.lastModified),
17746
- name: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assigner = checkpoint.assigner) === null || _checkpoint$assigner === void 0 ? void 0 : _checkpoint$assigner.name,
17747
- comment: t(checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.comment)
17748
- };
17749
- return /*#__PURE__*/React.createElement(CHBWFCaption, {
17750
- data: caption
17751
- });
17752
- }
17753
- };
17754
17931
  const showNextActions = nextActions => {
17755
- var _nextAction, _props$application6, _props$application7;
17932
+ var _nextAction, _props$application4, _props$application5;
17756
17933
  let nextAction = nextActions[0];
17757
17934
  const next = nextActions.map(action => action.action);
17758
17935
  if (next.includes("PAY") || next.includes("EDIT")) {
@@ -17771,10 +17948,10 @@ const CHBWFApplicationTimeline = props => {
17771
17948
  }
17772
17949
  }, /*#__PURE__*/React.createElement(Link, {
17773
17950
  to: {
17774
- pathname: `/digit-ui/citizen/payment/my-bills/${businessService}/${props === null || props === void 0 ? void 0 : (_props$application6 = props.application) === null || _props$application6 === void 0 ? void 0 : _props$application6.bookingNo}`,
17951
+ pathname: `/digit-ui/citizen/payment/my-bills/${businessService}/${props === null || props === void 0 ? void 0 : (_props$application4 = props.application) === null || _props$application4 === void 0 ? void 0 : _props$application4.bookingNo}`,
17775
17952
  state: {
17776
17953
  tenantId: props.application.tenantId,
17777
- bookingNo: props === null || props === void 0 ? void 0 : (_props$application7 = props.application) === null || _props$application7 === void 0 ? void 0 : _props$application7.bookingNo
17954
+ bookingNo: props === null || props === void 0 ? void 0 : (_props$application5 = props.application) === null || _props$application5 === void 0 ? void 0 : _props$application5.bookingNo
17778
17955
  }
17779
17956
  }
17780
17957
  }, /*#__PURE__*/React.createElement(SubmitBar, {
@@ -17797,31 +17974,10 @@ const CHBWFApplicationTimeline = props => {
17797
17974
  if (isLoading) {
17798
17975
  return /*#__PURE__*/React.createElement(Loader$1, null);
17799
17976
  }
17800
- return /*#__PURE__*/React.createElement(React.Fragment, null, !isLoading && /*#__PURE__*/React.createElement(Fragment$1, null, (data === null || data === void 0 ? void 0 : (_data$timeline = data.timeline) === null || _data$timeline === void 0 ? void 0 : _data$timeline.length) > 0 && /*#__PURE__*/React.createElement(CardSectionHeader, {
17801
- style: {
17802
- marginBottom: "16px",
17803
- marginTop: "32px"
17804
- }
17805
- }, t("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")), data !== null && data !== void 0 && data.timeline && (data === null || data === void 0 ? void 0 : (_data$timeline2 = data.timeline) === null || _data$timeline2 === void 0 ? void 0 : _data$timeline2.length) === 1 ? /*#__PURE__*/React.createElement(CheckPoint, {
17806
- isCompleted: true,
17807
- label: t((data === null || data === void 0 ? void 0 : (_data$timeline$ = data.timeline[0]) === null || _data$timeline$ === void 0 ? void 0 : _data$timeline$.state) && `WF_${businessService}_${data.timeline[0].state}` || "NA"),
17808
- customChild: getTimelineCaptions(data === null || data === void 0 ? void 0 : data.timeline[0])
17809
- }) : /*#__PURE__*/React.createElement(ConnectingCheckPoints, null, (data === null || data === void 0 ? void 0 : data.timeline) && (data === null || data === void 0 ? void 0 : data.timeline.map((checkpoint, index, arr) => {
17810
- var _data$processInstance;
17811
- let timelineStatusPostfix = "";
17812
- if (window.location.href.includes("/obps/")) {
17813
- var _workflowDetails, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails2, _workflowDetails2$dat, _workflowDetails2$dat2, _workflowDetails2$dat3;
17814
- if ((_workflowDetails = workflowDetails) !== null && _workflowDetails !== void 0 && (_workflowDetails$data = _workflowDetails.data) !== null && _workflowDetails$data !== void 0 && (_workflowDetails$data2 = _workflowDetails$data.timeline[index - 1]) !== null && _workflowDetails$data2 !== void 0 && (_workflowDetails$data3 = _workflowDetails$data2.state) !== null && _workflowDetails$data3 !== void 0 && _workflowDetails$data3.includes("BACK_FROM") || (_workflowDetails2 = workflowDetails) !== null && _workflowDetails2 !== void 0 && (_workflowDetails2$dat = _workflowDetails2.data) !== null && _workflowDetails2$dat !== void 0 && (_workflowDetails2$dat2 = _workflowDetails2$dat.timeline[index - 1]) !== null && _workflowDetails2$dat2 !== void 0 && (_workflowDetails2$dat3 = _workflowDetails2$dat2.state) !== null && _workflowDetails2$dat3 !== void 0 && _workflowDetails2$dat3.includes("SEND_TO_CITIZEN")) timelineStatusPostfix = `_NOT_DONE`;else if ((checkpoint === null || checkpoint === void 0 ? void 0 : checkpoint.performedAction) === "SEND_TO_ARCHITECT") timelineStatusPostfix = `_BY_ARCHITECT_DONE`;else timelineStatusPostfix = index == 0 ? "" : `_DONE`;
17815
- }
17816
- return /*#__PURE__*/React.createElement(React.Fragment, {
17817
- key: index
17818
- }, /*#__PURE__*/React.createElement(CheckPoint, {
17819
- keyValue: index,
17820
- isCompleted: index === 0,
17821
- label: t(`ES_PTR_COMMON_STATUS_${data === null || data === void 0 ? void 0 : (_data$processInstance = data.processInstances[index].state) === null || _data$processInstance === void 0 ? void 0 : _data$processInstance["state"]}${timelineStatusPostfix}`),
17822
- customChild: getTimelineCaptions(checkpoint)
17823
- }));
17824
- })))), data && showNextActions(data === null || data === void 0 ? void 0 : data.nextActions));
17977
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !isLoading && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(ApplicationTimeline, {
17978
+ workflowDetails: data,
17979
+ t: t
17980
+ })), data && showNextActions(data === null || data === void 0 ? void 0 : data.nextActions));
17825
17981
  };
17826
17982
 
17827
17983
  const checkForNotNull = (value = "") => {
@@ -17989,7 +18145,7 @@ const CHBDataConvert = data => {
17989
18145
  const checkForNA = (value = "") => {
17990
18146
  return checkForNotNull(value) ? value : "CS_NA";
17991
18147
  };
17992
- const pdfDownloadLink = (documents = {}, fileStoreId = "", format = "") => {
18148
+ const pdfDownloadLink$1 = (documents = {}, fileStoreId = "", format = "") => {
17993
18149
  let downloadLink = documents[fileStoreId] || "";
17994
18150
  let differentFormats = (downloadLink === null || downloadLink === void 0 ? void 0 : downloadLink.split(",")) || [];
17995
18151
  let fileURL = "";
@@ -18091,7 +18247,7 @@ function CHBDocument({
18091
18247
  flexWrap: "wrap"
18092
18248
  }
18093
18249
  }, documents.map((document, index) => {
18094
- let documentLink = pdfDownloadLink(data.pdfFiles, document.fileStoreId);
18250
+ let documentLink = pdfDownloadLink$1(data.pdfFiles, document.fileStoreId);
18095
18251
  return /*#__PURE__*/React.createElement("a", {
18096
18252
  target: "_",
18097
18253
  href: documentLink,
@@ -18517,10 +18673,62 @@ const CHBAcknowledgement = ({
18517
18673
  }));
18518
18674
  };
18519
18675
 
18676
+ const Loader = ({
18677
+ page: _page = false
18678
+ }) => {
18679
+ const baseStyle = {
18680
+ display: "flex",
18681
+ justifyContent: "center",
18682
+ alignItems: "center"
18683
+ };
18684
+ const pageStyle = {
18685
+ ...baseStyle,
18686
+ position: "fixed",
18687
+ top: 0,
18688
+ left: 0,
18689
+ width: "100vw",
18690
+ height: "100vh",
18691
+ background: "rgba(255,255,255,0.6)",
18692
+ backdropFilter: "blur(4px)",
18693
+ zIndex: 9999
18694
+ };
18695
+ const moduleStyle = {
18696
+ ...baseStyle,
18697
+ minHeight: "100px",
18698
+ width: "100%",
18699
+ position: "relative"
18700
+ };
18701
+ const spinnerStyle = {
18702
+ width: "64px",
18703
+ height: "64px",
18704
+ border: "8px solid #1976d2",
18705
+ borderTop: "8px solid transparent",
18706
+ borderRadius: "50%",
18707
+ animation: "spin 1.2s linear infinite"
18708
+ };
18709
+ return /*#__PURE__*/React.createElement("div", {
18710
+ style: _page ? pageStyle : moduleStyle
18711
+ }, /*#__PURE__*/React.createElement("div", {
18712
+ style: spinnerStyle
18713
+ }), /*#__PURE__*/React.createElement("style", null, `
18714
+ @keyframes spin {
18715
+ 0% { transform: rotate(0deg); }
18716
+ 100% { transform: rotate(360deg); }
18717
+ }
18718
+ `));
18719
+ };
18720
+ Loader.propTypes = {
18721
+ page: propTypes.bool
18722
+ };
18723
+ Loader.defaultProps = {
18724
+ page: false
18725
+ };
18726
+
18520
18727
  const ChbApplication = ({
18521
18728
  application,
18522
18729
  tenantId,
18523
- buttonLabel
18730
+ buttonLabel,
18731
+ refetch
18524
18732
  }) => {
18525
18733
  var _application$applican;
18526
18734
  const {
@@ -18528,7 +18736,7 @@ const ChbApplication = ({
18528
18736
  } = useTranslation();
18529
18737
  const history = useHistory();
18530
18738
  const [showToast, setShowToast] = useState(null);
18531
- console.log("application", application);
18739
+ const [loader, setLoader] = useState(false);
18532
18740
  const getBookingDateRange = bookingSlotDetails => {
18533
18741
  var _bookingSlotDetails$, _bookingSlotDetails;
18534
18742
  if (!bookingSlotDetails || bookingSlotDetails.length === 0) {
@@ -18545,6 +18753,28 @@ const ChbApplication = ({
18545
18753
  const handleMakePayment = async () => {
18546
18754
  history.push(`/digit-ui/citizen/payment/collect/chb-services/${application === null || application === void 0 ? void 0 : application.bookingNo}/${tenantId}?tenantId=${tenantId}`);
18547
18755
  };
18756
+ const handleCancel = async () => {
18757
+ setLoader(true);
18758
+ const finalPayload = {
18759
+ hallsBookingApplication: {
18760
+ ...application,
18761
+ workflow: {
18762
+ action: "CANCEL"
18763
+ }
18764
+ }
18765
+ };
18766
+ try {
18767
+ const response = await Digit.CHBServices.update({
18768
+ tenantId,
18769
+ ...finalPayload
18770
+ });
18771
+ refetch();
18772
+ setLoader(false);
18773
+ } catch (err) {
18774
+ setLoader(false);
18775
+ return err;
18776
+ }
18777
+ };
18548
18778
  useEffect(() => {
18549
18779
  if (showToast) {
18550
18780
  const timer = setTimeout(() => {
@@ -18577,6 +18807,9 @@ const ChbApplication = ({
18577
18807
  })), application.bookingStatus === "PENDING_FOR_PAYMENT" && /*#__PURE__*/React.createElement(SubmitBar, {
18578
18808
  label: t("CS_APPLICATION_DETAILS_MAKE_PAYMENT"),
18579
18809
  onSubmit: handleMakePayment
18810
+ }), application.bookingStatus === "BOOKED" && /*#__PURE__*/React.createElement(SubmitBar, {
18811
+ label: t("WF_EMPLOYEE_NDC_CANCEL"),
18812
+ onSubmit: handleCancel
18580
18813
  })), showToast && /*#__PURE__*/React.createElement(Toast, {
18581
18814
  error: showToast.error,
18582
18815
  warning: showToast.warning,
@@ -18584,6 +18817,8 @@ const ChbApplication = ({
18584
18817
  onClose: () => {
18585
18818
  setShowToast(null);
18586
18819
  }
18820
+ }), loader && /*#__PURE__*/React.createElement(Loader, {
18821
+ page: true
18587
18822
  }));
18588
18823
  };
18589
18824
 
@@ -18634,13 +18869,11 @@ const CHBMyApplications = () => {
18634
18869
  useEffect(() => {
18635
18870
  refetch();
18636
18871
  }, []);
18637
- if (isLoading) {
18638
- return /*#__PURE__*/React.createElement(Loader$1, null);
18639
- }
18640
18872
  const filteredApplications = (data === null || data === void 0 ? void 0 : data.hallsBookingApplication) || [];
18641
18873
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, null, `${t("CHB_MY_APPLICATION_HEADER")} (${filteredApplications.length})`), /*#__PURE__*/React.createElement("div", null, (filteredApplications === null || filteredApplications === void 0 ? void 0 : filteredApplications.length) > 0 && (filteredApplications === null || filteredApplications === void 0 ? void 0 : filteredApplications.map((application, index) => /*#__PURE__*/React.createElement("div", {
18642
18874
  key: index
18643
18875
  }, /*#__PURE__*/React.createElement(ChbApplication, {
18876
+ refetch: refetch,
18644
18877
  application: application,
18645
18878
  tenantId: tenantId,
18646
18879
  buttonLabel: t("CHB_SUMMARY")
@@ -18661,82 +18894,11 @@ const CHBMyApplications = () => {
18661
18894
  color: "#007bff"
18662
18895
  },
18663
18896
  onClick: handleLoadMore
18664
- }, t("CHB_LOAD_MORE_MSG")))));
18897
+ }, t("CHB_LOAD_MORE_MSG"))), isLoading && /*#__PURE__*/React.createElement(Loader, {
18898
+ page: true
18899
+ })));
18665
18900
  };
18666
18901
 
18667
- const PDFSvg = ({
18668
- width: _width = 20,
18669
- height: _height = 20,
18670
- style
18671
- }) => /*#__PURE__*/React.createElement("svg", {
18672
- style: style,
18673
- xmlns: "http://www.w3.org/2000/svg",
18674
- width: _width,
18675
- height: _height,
18676
- viewBox: "0 0 20 20",
18677
- fill: "gray"
18678
- }, /*#__PURE__*/React.createElement("path", {
18679
- d: "M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"
18680
- }));
18681
- function NDCDocument({
18682
- value = {},
18683
- Code,
18684
- index
18685
- }) {
18686
- const {
18687
- t
18688
- } = useTranslation();
18689
- const {
18690
- isLoading,
18691
- isError,
18692
- error,
18693
- data
18694
- } = Digit.Hooks.ads.useADSDocumentSearch({
18695
- value
18696
- }, {
18697
- value
18698
- }, Code, index);
18699
- console.log("dataInNDCDocument", data);
18700
- const documents = value !== null && value !== void 0 && value.documents ? value.documents.documents.filter(doc => doc.documentType === Code).map(doc => ({
18701
- ...doc,
18702
- documentType: doc.documentType.replace(/\./g, "_")
18703
- })) : value.filter(doc => doc.documentType === Code).map(doc => ({
18704
- ...doc,
18705
- documentType: doc.documentType.replace(/\./g, "_")
18706
- }));
18707
- if (isLoading) {
18708
- return /*#__PURE__*/React.createElement(Loader$1, null);
18709
- }
18710
- return /*#__PURE__*/React.createElement("div", {
18711
- style: {
18712
- marginTop: "19px"
18713
- }
18714
- }, /*#__PURE__*/React.createElement(React.Fragment, null, (data === null || data === void 0 ? void 0 : data.pdfFiles) && /*#__PURE__*/React.createElement("div", {
18715
- style: {
18716
- display: "flex",
18717
- flexWrap: "wrap"
18718
- }
18719
- }, documents === null || documents === void 0 ? void 0 : documents.map((document, index) => {
18720
- let documentLink = pdfDownloadLink(data.pdfFiles, document === null || document === void 0 ? void 0 : document.fileStoreId);
18721
- return /*#__PURE__*/React.createElement("a", {
18722
- target: "_",
18723
- href: documentLink,
18724
- style: {
18725
- minWidth: "100px",
18726
- marginRight: "10px"
18727
- },
18728
- key: index
18729
- }, /*#__PURE__*/React.createElement(PDFSvg, {
18730
- width: 85,
18731
- height: 100,
18732
- style: {
18733
- background: "#f6f6f6",
18734
- padding: "8px"
18735
- }
18736
- }));
18737
- }))));
18738
- }
18739
-
18740
18902
  const capitalize = text => text.substr(0, 1).toUpperCase() + text.substr(1);
18741
18903
  const ulbCamel = ulb => ulb.toLowerCase().split(" ").map(capitalize).join(" ");
18742
18904
  const getChbAcknowledgementData = async (application, tenantInfo, t) => {
@@ -41625,45 +41787,8 @@ var standalone = createCommonjsModule(function (module, exports) {
41625
41787
  });
41626
41788
  unwrapExports(standalone);
41627
41789
 
41628
- const getTimelineCaptions = (checkpoint, index, arr, t) => {
41629
- var _checkpoint$auditDeta, _checkpoint$assigner, _checkpoint$assigner2, _thumbnailsToShow$thu;
41630
- const {
41631
- wfComment: comment,
41632
- thumbnailsToShow,
41633
- wfDocuments
41634
- } = checkpoint;
41635
- const caption = {
41636
- date: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$auditDeta = checkpoint.auditDetails) === null || _checkpoint$auditDeta === void 0 ? void 0 : _checkpoint$auditDeta.lastModified,
41637
- name: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assigner = checkpoint.assigner) === null || _checkpoint$assigner === void 0 ? void 0 : _checkpoint$assigner.name,
41638
- source: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assigner2 = checkpoint.assigner) === null || _checkpoint$assigner2 === void 0 ? void 0 : _checkpoint$assigner2.source
41639
- };
41640
- return /*#__PURE__*/React.createElement("div", null, (comment === null || comment === void 0 ? void 0 : comment.length) > 0 && /*#__PURE__*/React.createElement("div", {
41641
- className: "TLComments"
41642
- }, /*#__PURE__*/React.createElement("h3", null, t("WF_COMMON_COMMENTS")), /*#__PURE__*/React.createElement("p", {
41643
- style: {
41644
- overflowX: "scroll"
41645
- }
41646
- }, comment)), (thumbnailsToShow === null || thumbnailsToShow === void 0 ? void 0 : (_thumbnailsToShow$thu = thumbnailsToShow.thumbs) === null || _thumbnailsToShow$thu === void 0 ? void 0 : _thumbnailsToShow$thu.length) > 0 && /*#__PURE__*/React.createElement(DisplayPhotos, {
41647
- srcs: thumbnailsToShow.thumbs,
41648
- onClick: (src, idx) => {
41649
- var _thumbnailsToShow$ful;
41650
- let fullImage = ((_thumbnailsToShow$ful = thumbnailsToShow.fullImage) === null || _thumbnailsToShow$ful === void 0 ? void 0 : _thumbnailsToShow$ful[idx]) || src;
41651
- Digit.Utils.zoomImage(fullImage);
41652
- }
41653
- }), (wfDocuments === null || wfDocuments === void 0 ? void 0 : wfDocuments.length) > 0 && /*#__PURE__*/React.createElement("div", null, wfDocuments === null || wfDocuments === void 0 ? void 0 : wfDocuments.map((doc, index) => /*#__PURE__*/React.createElement("div", {
41654
- key: index
41655
- }, /*#__PURE__*/React.createElement(NDCDocument, {
41656
- value: wfDocuments,
41657
- Code: doc === null || doc === void 0 ? void 0 : doc.documentType,
41658
- index: index
41659
- })))), /*#__PURE__*/React.createElement("div", {
41660
- style: {
41661
- marginTop: "8px"
41662
- }
41663
- }, caption.date && /*#__PURE__*/React.createElement("p", null, caption.date), caption.name && /*#__PURE__*/React.createElement("p", null, caption.name), caption.source && /*#__PURE__*/React.createElement("p", null, t("ES_COMMON_FILED_VIA_" + caption.source.toUpperCase()))));
41664
- };
41665
41790
  const CHBApplicationDetails = () => {
41666
- var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _chb_details$addition, _chb_details$bookingS, _chb_details$applican, _chb_details$applican2, _chb_details$applican3, _chb_details$specialC, _chb_details$purpose, _docs, _docs2, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data0;
41791
+ var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _chb_details$addition, _chb_details$bookingS, _chb_details$applican, _chb_details$applican2, _chb_details$applican3, _chb_details$specialC, _chb_details$purpose, _docs, _docs2;
41667
41792
  const {
41668
41793
  t
41669
41794
  } = useTranslation();
@@ -41981,23 +42106,50 @@ const CHBApplicationDetails = () => {
41981
42106
  marginTop: "10px",
41982
42107
  fontSize: "15px"
41983
42108
  }
41984
- }, t(doc === null || doc === void 0 ? void 0 : doc.documentType))))) : /*#__PURE__*/React.createElement("h5", null, t("CS_NO_DOCUMENTS_UPLOADED"))))), (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data6 = workflowDetails.data) === null || _workflowDetails$data6 === void 0 ? void 0 : _workflowDetails$data6.timeline) && /*#__PURE__*/React.createElement(Card, {
42109
+ }, t(doc === null || doc === void 0 ? void 0 : doc.documentType))))) : /*#__PURE__*/React.createElement("h5", null, t("CS_NO_DOCUMENTS_UPLOADED"))))), /*#__PURE__*/React.createElement(CardSubHeader, {
41985
42110
  style: {
41986
- marginTop: "20px"
42111
+ fontSize: "24px"
41987
42112
  }
41988
- }, /*#__PURE__*/React.createElement(CardSubHeader, {
42113
+ }, t("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")), /*#__PURE__*/React.createElement(ApplicationTimeline, {
42114
+ workflowDetails: workflowDetails,
42115
+ t: t
42116
+ })));
42117
+ };
42118
+
42119
+ const CHBWFReason = ({
42120
+ headComment,
42121
+ otherComment
42122
+ }) => /*#__PURE__*/React.createElement("div", {
42123
+ className: "checkpoint-comments-wrap"
42124
+ }, /*#__PURE__*/React.createElement("h4", null, headComment), /*#__PURE__*/React.createElement("p", null, otherComment));
42125
+
42126
+ const CHBWFCaption = ({
42127
+ data,
42128
+ OpenImage
42129
+ }) => {
42130
+ var _data$wfComment, _data$thumbnailsToSho, _data$thumbnailsToSho2;
42131
+ const {
42132
+ t
42133
+ } = useTranslation();
42134
+ return /*#__PURE__*/React.createElement("div", null, data.date && /*#__PURE__*/React.createElement("p", null, data.date), /*#__PURE__*/React.createElement("p", null, data.name), data.mobileNumber && /*#__PURE__*/React.createElement(TelePhone, {
42135
+ mobile: data.mobileNumber
42136
+ }), data.source && /*#__PURE__*/React.createElement("p", null, t("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_" + data.source.toUpperCase())), data.comment && /*#__PURE__*/React.createElement(Reason, {
42137
+ otherComment: data === null || data === void 0 ? void 0 : data.otherComment,
42138
+ headComment: data === null || data === void 0 ? void 0 : data.comment
42139
+ }), data !== null && data !== void 0 && data.wfComment ? /*#__PURE__*/React.createElement("div", null, data === null || data === void 0 ? void 0 : (_data$wfComment = data.wfComment) === null || _data$wfComment === void 0 ? void 0 : _data$wfComment.map(e => /*#__PURE__*/React.createElement("div", {
42140
+ className: "TLComments"
42141
+ }, /*#__PURE__*/React.createElement("h3", null, t("WF_COMMON_COMMENTS")), /*#__PURE__*/React.createElement("p", {
41989
42142
  style: {
41990
- fontSize: "24px"
42143
+ overflowX: "scroll"
41991
42144
  }
41992
- }, t("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")), (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data7 = workflowDetails.data) === null || _workflowDetails$data7 === void 0 ? void 0 : _workflowDetails$data7.timeline.length) === 1 ? /*#__PURE__*/React.createElement(CheckPoint, {
41993
- isCompleted: true,
41994
- label: t(workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data8 = workflowDetails.data) === null || _workflowDetails$data8 === void 0 ? void 0 : (_workflowDetails$data9 = _workflowDetails$data8.timeline[0]) === null || _workflowDetails$data9 === void 0 ? void 0 : _workflowDetails$data9.status)
41995
- }) : /*#__PURE__*/React.createElement(ConnectingCheckPoints, null, workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data0 = workflowDetails.data) === null || _workflowDetails$data0 === void 0 ? void 0 : _workflowDetails$data0.timeline.map((checkpoint, index, arr) => /*#__PURE__*/React.createElement(CheckPoint, {
41996
- keyValue: index,
41997
- isCompleted: index === 0,
41998
- label: t(checkpoint.status),
41999
- customChild: getTimelineCaptions(checkpoint, index, arr, t)
42000
- }))))));
42145
+ }, e)))) : null, (data === null || data === void 0 ? void 0 : (_data$thumbnailsToSho = data.thumbnailsToShow) === null || _data$thumbnailsToSho === void 0 ? void 0 : (_data$thumbnailsToSho2 = _data$thumbnailsToSho.thumbs) === null || _data$thumbnailsToSho2 === void 0 ? void 0 : _data$thumbnailsToSho2.length) > 0 ? /*#__PURE__*/React.createElement("div", {
42146
+ className: "TLComments"
42147
+ }, /*#__PURE__*/React.createElement("h3", null, t("CS_COMMON_ATTACHMENTS")), /*#__PURE__*/React.createElement(DisplayPhotos, {
42148
+ srcs: data === null || data === void 0 ? void 0 : data.thumbnailsToShow.thumbs,
42149
+ onClick: (src, index) => {
42150
+ OpenImage(src, index, data === null || data === void 0 ? void 0 : data.thumbnailsToShow);
42151
+ }
42152
+ })) : null);
42001
42153
  };
42002
42154
 
42003
42155
  function _extends() {
@@ -43505,57 +43657,6 @@ const TableConfig = t => ({
43505
43657
  }
43506
43658
  });
43507
43659
 
43508
- const Loader = ({
43509
- page: _page = false
43510
- }) => {
43511
- const baseStyle = {
43512
- display: "flex",
43513
- justifyContent: "center",
43514
- alignItems: "center"
43515
- };
43516
- const pageStyle = {
43517
- ...baseStyle,
43518
- position: "fixed",
43519
- top: 0,
43520
- left: 0,
43521
- width: "100vw",
43522
- height: "100vh",
43523
- background: "rgba(255,255,255,0.6)",
43524
- backdropFilter: "blur(4px)",
43525
- zIndex: 9999
43526
- };
43527
- const moduleStyle = {
43528
- ...baseStyle,
43529
- minHeight: "100px",
43530
- width: "100%",
43531
- position: "relative"
43532
- };
43533
- const spinnerStyle = {
43534
- width: "64px",
43535
- height: "64px",
43536
- border: "8px solid #1976d2",
43537
- borderTop: "8px solid transparent",
43538
- borderRadius: "50%",
43539
- animation: "spin 1.2s linear infinite"
43540
- };
43541
- return /*#__PURE__*/React.createElement("div", {
43542
- style: _page ? pageStyle : moduleStyle
43543
- }, /*#__PURE__*/React.createElement("div", {
43544
- style: spinnerStyle
43545
- }), /*#__PURE__*/React.createElement("style", null, `
43546
- @keyframes spin {
43547
- 0% { transform: rotate(0deg); }
43548
- 100% { transform: rotate(360deg); }
43549
- }
43550
- `));
43551
- };
43552
- Loader.propTypes = {
43553
- page: propTypes.bool
43554
- };
43555
- Loader.defaultProps = {
43556
- page: false
43557
- };
43558
-
43559
43660
  const ModalConfig = ({
43560
43661
  t,
43561
43662
  action,
@@ -43717,7 +43818,7 @@ const NDCModal = ({
43717
43818
  };
43718
43819
  }));
43719
43820
  }
43720
- }, [approverData]);
43821
+ }, [approverData, EmployeeStatusData]);
43721
43822
  function selectFile(e) {
43722
43823
  setFile(e.target.files[0]);
43723
43824
  }
@@ -43810,45 +43911,8 @@ const NDCModal = ({
43810
43911
  }));
43811
43912
  };
43812
43913
 
43813
- const getTimelineCaptions$1 = (checkpoint, index, arr, t) => {
43814
- var _checkpoint$auditDeta, _checkpoint$assigner, _checkpoint$assigner2, _thumbnailsToShow$thu;
43815
- const {
43816
- wfComment: comment,
43817
- thumbnailsToShow,
43818
- wfDocuments
43819
- } = checkpoint;
43820
- const caption = {
43821
- date: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$auditDeta = checkpoint.auditDetails) === null || _checkpoint$auditDeta === void 0 ? void 0 : _checkpoint$auditDeta.lastModified,
43822
- name: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assigner = checkpoint.assigner) === null || _checkpoint$assigner === void 0 ? void 0 : _checkpoint$assigner.name,
43823
- source: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assigner2 = checkpoint.assigner) === null || _checkpoint$assigner2 === void 0 ? void 0 : _checkpoint$assigner2.source
43824
- };
43825
- return /*#__PURE__*/React.createElement("div", null, (comment === null || comment === void 0 ? void 0 : comment.length) > 0 && /*#__PURE__*/React.createElement("div", {
43826
- className: "TLComments"
43827
- }, /*#__PURE__*/React.createElement("h3", null, t("WF_COMMON_COMMENTS")), /*#__PURE__*/React.createElement("p", {
43828
- style: {
43829
- overflowX: "scroll"
43830
- }
43831
- }, comment)), (thumbnailsToShow === null || thumbnailsToShow === void 0 ? void 0 : (_thumbnailsToShow$thu = thumbnailsToShow.thumbs) === null || _thumbnailsToShow$thu === void 0 ? void 0 : _thumbnailsToShow$thu.length) > 0 && /*#__PURE__*/React.createElement(DisplayPhotos, {
43832
- srcs: thumbnailsToShow.thumbs,
43833
- onClick: (src, idx) => {
43834
- var _thumbnailsToShow$ful;
43835
- let fullImage = ((_thumbnailsToShow$ful = thumbnailsToShow.fullImage) === null || _thumbnailsToShow$ful === void 0 ? void 0 : _thumbnailsToShow$ful[idx]) || src;
43836
- Digit.Utils.zoomImage(fullImage);
43837
- }
43838
- }), (wfDocuments === null || wfDocuments === void 0 ? void 0 : wfDocuments.length) > 0 && /*#__PURE__*/React.createElement("div", null, wfDocuments === null || wfDocuments === void 0 ? void 0 : wfDocuments.map((doc, index) => /*#__PURE__*/React.createElement("div", {
43839
- key: index
43840
- }, /*#__PURE__*/React.createElement(NDCDocument, {
43841
- value: wfDocuments,
43842
- Code: doc === null || doc === void 0 ? void 0 : doc.documentType,
43843
- index: index
43844
- })))), /*#__PURE__*/React.createElement("div", {
43845
- style: {
43846
- marginTop: "8px"
43847
- }
43848
- }, caption.date && /*#__PURE__*/React.createElement("p", null, caption.date), caption.name && /*#__PURE__*/React.createElement("p", null, caption.name), caption.source && /*#__PURE__*/React.createElement("p", null, t("ES_COMMON_FILED_VIA_" + caption.source.toUpperCase()))));
43849
- };
43850
43914
  const CHBApplicationDetails$1 = () => {
43851
- var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _user$info, _user$info$roles, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetailsTemp$, _workflowDetailsTemp$2, _chb_details$addition, _chb_details$bookingS, _chb_details$applican, _chb_details$applican2, _chb_details$applican3, _chb_details$specialC, _chb_details$purpose, _docs, _docs2, _workflowDetails$data9, _workflowDetails$data0, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data12, _workflowDetails$data13, _workflowDetails$data14, _workflowDetails$data15;
43915
+ var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _user$info, _user$info$roles, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetailsTemp$, _workflowDetailsTemp$2, _chb_details$addition, _chb_details$bookingS, _chb_details$applican, _chb_details$applican2, _chb_details$applican3, _chb_details$specialC, _chb_details$purpose, _docs, _docs2, _workflowDetails$data9, _workflowDetails$data0, _workflowDetails$data1, _workflowDetails$data10;
43852
43916
  const {
43853
43917
  t
43854
43918
  } = useTranslation();
@@ -44034,11 +44098,40 @@ const CHBApplicationDetails$1 = () => {
44034
44098
  history.push(`/digit-ui/employee/payment/collect/chb-services/${appNo}/${tenantId}?tenantId=${tenantId}`);
44035
44099
  } else if ((action === null || action === void 0 ? void 0 : action.action) == "EDIT") {
44036
44100
  history.push(`/digit-ui/employee/ndc/create/${appNo}`);
44101
+ } else if ((action === null || action === void 0 ? void 0 : action.action) == "CANCEL") {
44102
+ handleCancel();
44037
44103
  } else {
44038
44104
  setShowModal(true);
44039
44105
  setSelectedAction(action);
44040
44106
  }
44041
44107
  }
44108
+ const handleCancel = async () => {
44109
+ console.log("displayData?.applicantData", data === null || data === void 0 ? void 0 : data.hallsBookingApplication);
44110
+ setLoader(true);
44111
+ const finalPayload = {
44112
+ hallsBookingApplication: {
44113
+ ...application,
44114
+ workflow: {
44115
+ action: "CANCEL"
44116
+ }
44117
+ }
44118
+ };
44119
+ try {
44120
+ const response = await Digit.CHBServices.update({
44121
+ tenantId,
44122
+ ...finalPayload
44123
+ });
44124
+ workflowDetails.revalidate();
44125
+ setTimeout(() => {
44126
+ history.push("/digit-ui/employee/chb/inbox");
44127
+ window.location.reload();
44128
+ }, 2000);
44129
+ setLoader(false);
44130
+ } catch (err) {
44131
+ setLoader(false);
44132
+ return err;
44133
+ }
44134
+ };
44042
44135
  const fetchBillData = async () => {
44043
44136
  setLoading(true);
44044
44137
  const result = await Digit.PaymentService.fetchBill(tenantId, {
@@ -44337,19 +44430,10 @@ const CHBApplicationDetails$1 = () => {
44337
44430
  marginTop: "10px",
44338
44431
  fontSize: "15px"
44339
44432
  }
44340
- }, t(doc === null || doc === void 0 ? void 0 : doc.documentType))))) : /*#__PURE__*/React.createElement("h5", null, t("CS_NO_DOCUMENTS_UPLOADED"))))), (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data9 = workflowDetails.data) === null || _workflowDetails$data9 === void 0 ? void 0 : _workflowDetails$data9.timeline) && /*#__PURE__*/React.createElement(Card, {
44341
- style: {
44342
- marginTop: "20px"
44343
- }
44344
- }, /*#__PURE__*/React.createElement(CardSubHeader, null, t("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")), (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data0 = workflowDetails.data) === null || _workflowDetails$data0 === void 0 ? void 0 : _workflowDetails$data0.timeline.length) === 1 ? /*#__PURE__*/React.createElement(CheckPoint, {
44345
- isCompleted: true,
44346
- label: t(workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data1 = workflowDetails.data) === null || _workflowDetails$data1 === void 0 ? void 0 : (_workflowDetails$data10 = _workflowDetails$data1.timeline[0]) === null || _workflowDetails$data10 === void 0 ? void 0 : _workflowDetails$data10.status)
44347
- }) : /*#__PURE__*/React.createElement(ConnectingCheckPoints, null, workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data11 = workflowDetails.data) === null || _workflowDetails$data11 === void 0 ? void 0 : _workflowDetails$data11.timeline.map((checkpoint, index, arr) => /*#__PURE__*/React.createElement(CheckPoint, {
44348
- keyValue: index,
44349
- isCompleted: index === 0,
44350
- label: t(checkpoint.status),
44351
- customChild: getTimelineCaptions$1(checkpoint, index, arr, t)
44352
- })))), actions && actions.length > 0 && !actions.some(a => a.action === "SUBMIT") && /*#__PURE__*/React.createElement(ActionBar, null, displayMenu && (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data12 = workflowDetails.data) !== null && _workflowDetails$data12 !== void 0 && (_workflowDetails$data13 = _workflowDetails$data12.actionState) !== null && _workflowDetails$data13 !== void 0 && _workflowDetails$data13.nextActions || workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data14 = workflowDetails.data) !== null && _workflowDetails$data14 !== void 0 && _workflowDetails$data14.nextActions) ? /*#__PURE__*/React.createElement(Menu, {
44433
+ }, t(doc === null || doc === void 0 ? void 0 : doc.documentType))))) : /*#__PURE__*/React.createElement("h5", null, t("CS_NO_DOCUMENTS_UPLOADED"))))), /*#__PURE__*/React.createElement(CardSubHeader, null, t("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")), /*#__PURE__*/React.createElement(ApplicationTimeline, {
44434
+ workflowDetails: workflowDetails,
44435
+ t: t
44436
+ }), actions && actions.length > 0 && !actions.some(a => a.action === "SUBMIT") && /*#__PURE__*/React.createElement(ActionBar, null, displayMenu && (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data9 = workflowDetails.data) !== null && _workflowDetails$data9 !== void 0 && (_workflowDetails$data0 = _workflowDetails$data9.actionState) !== null && _workflowDetails$data0 !== void 0 && _workflowDetails$data0.nextActions || workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data1 = workflowDetails.data) !== null && _workflowDetails$data1 !== void 0 && _workflowDetails$data1.nextActions) ? /*#__PURE__*/React.createElement(Menu, {
44353
44437
  localeKeyPrefix: `WF_EDITRENEWAL`,
44354
44438
  options: filteredActions,
44355
44439
  optionKey: "action",
@@ -44369,7 +44453,7 @@ const CHBApplicationDetails$1 = () => {
44369
44453
  applicationData: data,
44370
44454
  closeModal: closeModal,
44371
44455
  submitAction: submitAction,
44372
- actionData: workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data15 = workflowDetails.data) === null || _workflowDetails$data15 === void 0 ? void 0 : _workflowDetails$data15.timeline,
44456
+ actionData: workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data10 = workflowDetails.data) === null || _workflowDetails$data10 === void 0 ? void 0 : _workflowDetails$data10.timeline,
44373
44457
  workflowDetails: workflowDetails,
44374
44458
  showToast: showToast,
44375
44459
  getEmployees: getEmployees,
@@ -44383,7 +44467,7 @@ const CHBApplicationDetails$1 = () => {
44383
44467
  label: error,
44384
44468
  isDleteBtn: true,
44385
44469
  onClose: closeToast
44386
- }), (isLoading || auditDataLoading || getLoader) && /*#__PURE__*/React.createElement(Loader, {
44470
+ }), (isLoading || auditDataLoading || getLoader || workflowDetails.isLoading || recieptDataLoading) && /*#__PURE__*/React.createElement(Loader, {
44387
44471
  page: true
44388
44472
  })));
44389
44473
  };
@@ -45292,6 +45376,7 @@ const CHBCitizenSecond = ({
45292
45376
  const [loader, setLoader] = useState(false);
45293
45377
  const [showInfo, setShowInfo] = useState(false);
45294
45378
  const [error, setError] = useState(null);
45379
+ console.log("tenantId", tenantId);
45295
45380
  const {
45296
45381
  control,
45297
45382
  handleSubmit,
@@ -47098,8 +47183,6 @@ var reactLifecyclesCompat_es = {
47098
47183
  polyfill: polyfill
47099
47184
  };
47100
47185
 
47101
- var _reactLifecyclesCompat = getCjsExportFromNamespace(reactLifecyclesCompat_es);
47102
-
47103
47186
  var Modal_1 = createCommonjsModule(function (module, exports) {
47104
47187
 
47105
47188
  Object.defineProperty(exports, "__esModule", {
@@ -47388,7 +47471,7 @@ var Modal_1 = createCommonjsModule(function (module, exports) {
47388
47471
  padding: "20px"
47389
47472
  }
47390
47473
  };
47391
- (0, _reactLifecyclesCompat.polyfill)(Modal);
47474
+ (0, reactLifecyclesCompat_es.polyfill)(Modal);
47392
47475
  if (process.env.NODE_ENV !== "production") {
47393
47476
  Modal.setCreateHTMLElement = function (fn) {
47394
47477
  return createHTMLElement = fn;
@@ -47418,7 +47501,9 @@ const CitizenConsent = ({
47418
47501
  showTermsPopupOwner,
47419
47502
  setShowTermsPopupOwner,
47420
47503
  otpVerifiedTimestamp,
47421
- getModalData
47504
+ getModalData,
47505
+ getUser,
47506
+ getShowOtp
47422
47507
  }) => {
47423
47508
  var _user$info, _getModalData$purpose;
47424
47509
  const {
@@ -47443,7 +47528,6 @@ const CitizenConsent = ({
47443
47528
  const [userSelected, setUser] = useState(null);
47444
47529
  const [setOtpLoading, setSetOtpLoading] = useState(false);
47445
47530
  const stateCode = Digit.ULBService.getStateId();
47446
- console.log("getModalData", getModalData);
47447
47531
  const [isUploading, setIsUploading] = useState(false);
47448
47532
  const [isFileUploaded, setIsFileUploaded] = useState(false);
47449
47533
  const isCitizenDeclared = sessionStorage.getItem("CitizenConsentdocFilestoreidCHB");
@@ -47546,12 +47630,11 @@ const CitizenConsent = ({
47546
47630
  setShowTermsPopupOwner(false);
47547
47631
  };
47548
47632
  const handleVerifyOTPClick = async () => {
47549
- var _user$info3, _user$info4;
47550
47633
  const requestData = {
47551
47634
  username: getModalData === null || getModalData === void 0 ? void 0 : getModalData.mobileNumber,
47552
47635
  password: otp,
47553
- tenantId: user === null || user === void 0 ? void 0 : (_user$info3 = user.info) === null || _user$info3 === void 0 ? void 0 : _user$info3.tenantId,
47554
- userType: user === null || user === void 0 ? void 0 : (_user$info4 = user.info) === null || _user$info4 === void 0 ? void 0 : _user$info4.type
47636
+ tenantId: "pb",
47637
+ userType: "citizen"
47555
47638
  };
47556
47639
  try {
47557
47640
  setSetOtpLoading(true);
@@ -47580,10 +47663,6 @@ const CitizenConsent = ({
47580
47663
  const formatted = `${map.day} ${map.month} ${map.year} ${map.weekday} ${map.hour}:${map.minute}:${map.second} ${map.dayPeriod} ${map.timeZoneName}`;
47581
47664
  setOTPVerifiedTimestamp(formatted);
47582
47665
  sessionStorage.setItem("otpVerifiedTimestampcitizen", formatted);
47583
- setUser({
47584
- info,
47585
- ...tokens
47586
- });
47587
47666
  setSetOtpLoading(false);
47588
47667
  setShowOTPInput(false);
47589
47668
  setIsOTPVerified(true);
@@ -47594,7 +47673,30 @@ const CitizenConsent = ({
47594
47673
  return "";
47595
47674
  }
47596
47675
  } catch (error) {
47597
- console.error("Error verifying OTP:", error);
47676
+ setOTPError(t("Error verifying OTP"));
47677
+ setSetOtpLoading(false);
47678
+ return "";
47679
+ }
47680
+ };
47681
+ const handleVerifyOTPClickNew = async () => {
47682
+ setSetOtpLoading(true);
47683
+ const stateCode = "pb";
47684
+ const requestData = {
47685
+ name: getModalData === null || getModalData === void 0 ? void 0 : getModalData.name,
47686
+ emailId: getModalData === null || getModalData === void 0 ? void 0 : getModalData.emailId,
47687
+ username: getModalData === null || getModalData === void 0 ? void 0 : getModalData.mobileNumber,
47688
+ otpReference: otp,
47689
+ tenantId: "pb"
47690
+ };
47691
+ try {
47692
+ const {
47693
+ ResponseInfo,
47694
+ UserRequest: info,
47695
+ ...tokens
47696
+ } = await Digit.UserService.registerUser(requestData, stateCode);
47697
+ setSetOtpLoading(false);
47698
+ setIsOTPVerified(true);
47699
+ } catch (error) {
47598
47700
  setOTPError(t("Error verifying OTP"));
47599
47701
  setSetOtpLoading(false);
47600
47702
  return "";
@@ -47603,17 +47705,15 @@ const CitizenConsent = ({
47603
47705
  const handleGetOTPClick = async () => {
47604
47706
  setLoader(true);
47605
47707
  try {
47606
- var _user$info5;
47607
47708
  const response = await Digit.UserService.sendOtp({
47608
47709
  otp: {
47609
47710
  mobileNumber: getModalData === null || getModalData === void 0 ? void 0 : getModalData.mobileNumber,
47610
- tenantId: user === null || user === void 0 ? void 0 : (_user$info5 = user.info) === null || _user$info5 === void 0 ? void 0 : _user$info5.tenantId,
47611
- userType: "CITIZEN",
47711
+ tenantId: "pb",
47712
+ userType: "citizen",
47612
47713
  type: "login"
47613
47714
  }
47614
47715
  });
47615
47716
  setLoader(false);
47616
- console.log(" Full OTP send response:", JSON.stringify(response, null, 2));
47617
47717
  if (response !== null && response !== void 0 && response.error) {
47618
47718
  if (response.error.fields && Array.isArray(response.error.fields)) {
47619
47719
  const hasUnknownCredential = response.error.fields.some(field => {
@@ -47762,7 +47862,7 @@ const CitizenConsent = ({
47762
47862
  }, /*#__PURE__*/React.createElement(SubmitBar, {
47763
47863
  label: t("BPA_CLOSE"),
47764
47864
  onSubmit: closeModal
47765
- })), /*#__PURE__*/React.createElement("br", null), !isCitizenDeclared && !isOTPVerified && /*#__PURE__*/React.createElement("div", {
47865
+ })), /*#__PURE__*/React.createElement("br", null), !isCitizenDeclared && !isOTPVerified && !getShowOtp && /*#__PURE__*/React.createElement("div", {
47766
47866
  style: {
47767
47867
  display: "flex",
47768
47868
  justifyContent: "flex-end"
@@ -47771,12 +47871,12 @@ const CitizenConsent = ({
47771
47871
  label: t("BPA_UPLOAD"),
47772
47872
  onSubmit: handleGetOTPClick,
47773
47873
  disabled: !isValidMobileNumber
47774
- })), showOTPInput && !isCitizenDeclared && !isOTPVerified && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(CardLabel, null, t("BPA_OTP")), /*#__PURE__*/React.createElement(OTPInput, {
47874
+ })), showOTPInput && !isCitizenDeclared && !isOTPVerified && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(CardLabel, null, t("CHB_OTP")), /*#__PURE__*/React.createElement(OTPInput, {
47775
47875
  length: 6,
47776
47876
  onChange: value => setOTP(value),
47777
47877
  value: otp
47778
47878
  }), /*#__PURE__*/React.createElement(SubmitBar, {
47779
- label: t("VERIFY_OTP"),
47879
+ label: t("CHB_VERIFY_OTP"),
47780
47880
  onSubmit: handleVerifyOTPClick
47781
47881
  }), otpError && /*#__PURE__*/React.createElement(CardLabel, {
47782
47882
  style: {
@@ -47786,7 +47886,14 @@ const CitizenConsent = ({
47786
47886
  style: {
47787
47887
  color: "green"
47788
47888
  }
47789
- }, t(otpSuccess))), isOTPVerified && !isCitizenDeclared && /*#__PURE__*/React.createElement("div", {
47889
+ }, t(otpSuccess))), getShowOtp && !isOTPVerified && !isCitizenDeclared && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(CardLabel, null, t("CHB_OTP")), /*#__PURE__*/React.createElement(OTPInput, {
47890
+ length: 6,
47891
+ onChange: value => setOTP(value),
47892
+ value: otp
47893
+ }), /*#__PURE__*/React.createElement(SubmitBar, {
47894
+ label: t("CHB_VERIFY_OTP"),
47895
+ onSubmit: handleVerifyOTPClickNew
47896
+ })), isOTPVerified && !isCitizenDeclared && /*#__PURE__*/React.createElement("div", {
47790
47897
  style: {
47791
47898
  display: "flex",
47792
47899
  justifyContent: "flex-end"
@@ -47805,7 +47912,7 @@ const CHBCitizenDetailsNew = ({
47805
47912
  currentStepData,
47806
47913
  onGoBack
47807
47914
  }) => {
47808
- var _user$info, _user$info2, _user$info3;
47915
+ var _user$info, _user$info2, _user$info3, _user$info4;
47809
47916
  const tenantId = window.location.href.includes("citizen") ? window.localStorage.getItem("CITIZEN.CITY") : window.localStorage.getItem("Employee.tenant-id");
47810
47917
  const isCitizen = window.location.href.includes("citizen");
47811
47918
  const stateId = Digit.ULBService.getStateId();
@@ -47819,6 +47926,7 @@ const CHBCitizenDetailsNew = ({
47819
47926
  email: false,
47820
47927
  address: false
47821
47928
  });
47929
+ const [getShowOtp, setShowOtp] = useState(false);
47822
47930
  const {
47823
47931
  control,
47824
47932
  handleSubmit,
@@ -47829,11 +47937,13 @@ const CHBCitizenDetailsNew = ({
47829
47937
  getValues,
47830
47938
  watch
47831
47939
  } = useForm({
47940
+ mode: "onChange",
47941
+ reValidateMode: "onChange",
47832
47942
  defaultValues: {
47833
47943
  name: isCitizen && (user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.name) || "",
47834
47944
  emailId: isCitizen && (user === null || user === void 0 ? void 0 : (_user$info2 = user.info) === null || _user$info2 === void 0 ? void 0 : _user$info2.emailId) || "",
47835
47945
  mobileNumber: isCitizen && (user === null || user === void 0 ? void 0 : (_user$info3 = user.info) === null || _user$info3 === void 0 ? void 0 : _user$info3.mobileNumber) || "",
47836
- address: ""
47946
+ address: isCitizen && (user === null || user === void 0 ? void 0 : (_user$info4 = user.info) === null || _user$info4 === void 0 ? void 0 : _user$info4.permanentCity) || ""
47837
47947
  }
47838
47948
  });
47839
47949
  const onSubmit = async data => {
@@ -47842,19 +47952,18 @@ const CHBCitizenDetailsNew = ({
47842
47952
  if (currentStepData !== null && currentStepData !== void 0 && (_currentStepData$venu = currentStepData.venueDetails) !== null && _currentStepData$venu !== void 0 && (_currentStepData$venu2 = _currentStepData$venu[0]) !== null && _currentStepData$venu2 !== void 0 && _currentStepData$venu2.bookingNo) {
47843
47953
  goNext(currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.venueDetails);
47844
47954
  } else {
47845
- var _currentStepData$owne, _user$info4, _baseApplication$purp, _baseApplication$purp2;
47955
+ var _currentStepData$owne, _user$info5, _baseApplication$purp, _baseApplication$purp2;
47846
47956
  const baseApplication = (currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$owne = currentStepData.ownerDetails) === null || _currentStepData$owne === void 0 ? void 0 : _currentStepData$owne.hallsBookingApplication) || {};
47847
47957
  if (!isCitizenDeclared) {
47848
47958
  alert("Please upload Self Certificate");
47849
47959
  return;
47850
47960
  }
47851
- console.log("baseApplication", baseApplication);
47852
47961
  const applicantDetail = {
47853
47962
  tenantId: tenantId,
47854
47963
  applicantName: data === null || data === void 0 ? void 0 : data.name,
47855
47964
  applicantMobileNo: data === null || data === void 0 ? void 0 : data.mobileNumber,
47856
47965
  applicantEmailId: data === null || data === void 0 ? void 0 : data.emailId,
47857
- type: user === null || user === void 0 ? void 0 : (_user$info4 = user.info) === null || _user$info4 === void 0 ? void 0 : _user$info4.type
47966
+ type: user === null || user === void 0 ? void 0 : (_user$info5 = user.info) === null || _user$info5 === void 0 ? void 0 : _user$info5.type
47858
47967
  };
47859
47968
  const additionalDetails = {
47860
47969
  ...(baseApplication === null || baseApplication === void 0 ? void 0 : baseApplication.additionalDetails),
@@ -47881,7 +47990,6 @@ const CHBCitizenDetailsNew = ({
47881
47990
  additionalDetails
47882
47991
  }
47883
47992
  };
47884
- console.log("checkpayload", payload);
47885
47993
  setLoader(true);
47886
47994
  try {
47887
47995
  const response = await Digit.CHBServices.create(payload);
@@ -47906,70 +48014,27 @@ const CHBCitizenDetailsNew = ({
47906
48014
  const updateUser = async () => {
47907
48015
  const checkData = getValues();
47908
48016
  setLoader(true);
47909
- console.log("checkData", checkData);
48017
+ const tenantId = "pb";
47910
48018
  const payload = {
47911
- tenantId: "pb",
47912
- name: (checkData === null || checkData === void 0 ? void 0 : checkData.name) || null,
47913
- userName: (checkData === null || checkData === void 0 ? void 0 : checkData.mobileNumber) || null,
47914
- mobileNumber: (checkData === null || checkData === void 0 ? void 0 : checkData.mobileNumber) || null,
47915
- emailId: (checkData === null || checkData === void 0 ? void 0 : checkData.email) || null,
47916
- gender: (checkData === null || checkData === void 0 ? void 0 : checkData.gender) || "MALE",
47917
- fatherOrHusbandName: (checkData === null || checkData === void 0 ? void 0 : checkData.fatherOrHusbandName) || null,
47918
- permanentCity: (checkData === null || checkData === void 0 ? void 0 : checkData.permanentCity) || null,
47919
- correspondenceCity: (checkData === null || checkData === void 0 ? void 0 : checkData.correspondenceCity) || null,
47920
- permanentDistrict: (checkData === null || checkData === void 0 ? void 0 : checkData.permanentDistrict) || null,
47921
- permanentState: (checkData === null || checkData === void 0 ? void 0 : checkData.permanentState) || null,
47922
- correspondenceState: (checkData === null || checkData === void 0 ? void 0 : checkData.correspondenceState) || null,
47923
- correspondenceDistrict: (checkData === null || checkData === void 0 ? void 0 : checkData.correspondenceDistrict) || null,
47924
- type: "CITIZEN",
47925
- isPrimaryOwner: true,
47926
- ownerType: "NONE",
47927
- status: true,
47928
- active: true,
47929
- accountLocked: false,
47930
- correspondenceAddress: null,
47931
- permanentAddress: null,
47932
- permanentPinCode: null,
47933
- correspondencePinCode: null,
47934
- ownerId: null,
47935
- ownerShipPercentage: null,
47936
- institutionId: null,
47937
- documents: null,
47938
- relationship: null,
47939
- pan: null,
47940
- aadhaarNumber: null,
47941
- dob: null,
47942
- pwdExpiryDate: null,
47943
- locale: null,
47944
- signature: null,
47945
- bloodGroup: null,
47946
- identificationMark: null,
47947
- photo: null,
47948
- roles: [{
47949
- code: "CITIZEN",
47950
- name: "CITIZEN",
47951
- tenantId: "pb"
47952
- }],
47953
- createdBy: "0",
47954
- lastModifiedBy: "0",
47955
- createdDate: null,
47956
- lastModifiedDate: null,
47957
- otpReference: null
48019
+ otp: {
48020
+ tenantId,
48021
+ mobileNumber: (checkData === null || checkData === void 0 ? void 0 : checkData.mobileNumber) || null,
48022
+ name: (checkData === null || checkData === void 0 ? void 0 : checkData.name) || null,
48023
+ emailId: (checkData === null || checkData === void 0 ? void 0 : checkData.emailId) || null,
48024
+ type: "register"
48025
+ }
47958
48026
  };
47959
48027
  try {
47960
- const response = await Digit.UserService.createUser(payload, tenantId);
48028
+ const response = await Digit.UserService.sendOtp(payload, tenantId);
47961
48029
  setLoader(false);
47962
- console.log("response", response);
48030
+ setShowOtp(true);
47963
48031
  } catch (err) {
47964
48032
  setLoader(false);
47965
- console.log(err);
47966
48033
  }
47967
48034
  };
47968
48035
  const handleModalData = e => {
47969
48036
  var _currentStepData$owne2, _getValues, _getValues2, _getValues3, _getValues4, _mapData$purpose, _mapData$bookingSlotD, _mapData$bookingSlotD2, _mapData$bookingSlotD3, _mapData$bookingSlotD4, _mapData$bookingSlotD5;
47970
- console.log("currentStepData", currentStepData);
47971
- console.log("getvalues", getValues());
47972
- if (!getUser) {
48037
+ if (!getUser && !isCitizen) {
47973
48038
  updateUser();
47974
48039
  }
47975
48040
  const mapData = currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$owne2 = currentStepData.ownerDetails) === null || _currentStepData$owne2 === void 0 ? void 0 : _currentStepData$owne2.hallsBookingApplication;
@@ -47987,7 +48052,6 @@ const CHBCitizenDetailsNew = ({
47987
48052
  security: 5000,
47988
48053
  rent: mapData === null || mapData === void 0 ? void 0 : mapData.amount
47989
48054
  };
47990
- console.log("payload", payload);
47991
48055
  setModalData(payload);
47992
48056
  if (e.target.checked) setShowTermsPopup(true);
47993
48057
  };
@@ -48000,13 +48064,13 @@ const CHBCitizenDetailsNew = ({
48000
48064
  mobileNumber: value,
48001
48065
  userType: "CITIZEN"
48002
48066
  }, {});
48003
- console.log("userData", userData);
48067
+ sessionStorage.removeItem("CitizenConsentdocFilestoreidCHB");
48004
48068
  setUser(userData === null || userData === void 0 ? void 0 : (_userData$user = userData.user) === null || _userData$user === void 0 ? void 0 : _userData$user[0]);
48005
48069
  if (userData !== null && userData !== void 0 && (_userData$user2 = userData.user) !== null && _userData$user2 !== void 0 && _userData$user2[0]) {
48006
48070
  setValue("name", userData.user[0].name);
48007
48071
  setValue("emailId", userData.user[0].emailId);
48008
48072
  setValue("address", userData.user[0].permanentAddress);
48009
- clearErrors(["name", "emailId"]);
48073
+ clearErrors(["name", "emailId", "address"]);
48010
48074
  }
48011
48075
  setLoader(false);
48012
48076
  } catch (error) {
@@ -48043,10 +48107,12 @@ const CHBCitizenDetailsNew = ({
48043
48107
  },
48044
48108
  value: props.value,
48045
48109
  onChange: e => {
48046
- console.log("eee", e);
48047
48110
  props.onChange(e);
48048
48111
  setValue("name", "");
48049
48112
  setValue("emailId", "");
48113
+ setValue("address", "");
48114
+ setUser("");
48115
+ setShowOtp(false);
48050
48116
  if (e.length === 10) {
48051
48117
  handleMobileChange(e);
48052
48118
  }
@@ -48226,6 +48292,8 @@ const CHBCitizenDetailsNew = ({
48226
48292
  showTermsPopupOwner: showTermsPopup,
48227
48293
  setShowTermsPopupOwner: setShowTermsPopup,
48228
48294
  getModalData: getModalData,
48295
+ getUser: getUser,
48296
+ getShowOtp: getShowOtp,
48229
48297
  tenantId: tenantId
48230
48298
  }), loader && /*#__PURE__*/React.createElement(Loader, {
48231
48299
  page: true
@@ -48402,7 +48470,7 @@ function CHBDocument$1({
48402
48470
  flexWrap: "wrap"
48403
48471
  }
48404
48472
  }, documents === null || documents === void 0 ? void 0 : documents.map((document, index) => {
48405
- let documentLink = pdfDownloadLink(data.pdfFiles, document === null || document === void 0 ? void 0 : document.fileStoreId);
48473
+ let documentLink = pdfDownloadLink$1(data.pdfFiles, document === null || document === void 0 ? void 0 : document.fileStoreId);
48406
48474
  return /*#__PURE__*/React.createElement("a", {
48407
48475
  target: "_",
48408
48476
  href: documentLink,
@@ -48731,6 +48799,7 @@ const CHBSelectProofIdentity = ({
48731
48799
  const [enableSubmit, setEnableSubmit] = useState(true);
48732
48800
  const [checkRequiredFields, setCheckRequiredFields] = useState(false);
48733
48801
  const tenantId = window.location.href.includes("employee") ? Digit.ULBService.getCurrentPermanentCity() : localStorage.getItem("CITIZEN.CITY");
48802
+ console.log("tenantId", tenantId);
48734
48803
  const {
48735
48804
  data,
48736
48805
  isLoading