@egovernments/digit-ui-libraries 1.5.0-beta.8 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -35904,23 +35904,50 @@ function cloneDeep(value) {
35904
35904
 
35905
35905
  var cloneDeep_1 = cloneDeep;
35906
35906
 
35907
- var getThumbnails = function getThumbnails(ids, tenantId) {
35907
+ var getThumbnails = function getThumbnails(ids, tenantId, documents) {
35908
+ if (documents === void 0) {
35909
+ documents = [];
35910
+ }
35911
+
35908
35912
  try {
35909
35913
  tenantId = window.location.href.includes("/obps/") ? Digit.ULBService.getStateId() : tenantId;
35910
- return Promise.resolve(Digit.UploadServices.Filefetch(ids, tenantId)).then(function (res) {
35911
- if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) {
35912
- return {
35913
- thumbs: res.data.fileStoreIds.map(function (o) {
35914
- return o.url.split(",")[3] || o.url.split(",")[0];
35915
- }),
35916
- images: res.data.fileStoreIds.map(function (o) {
35917
- return Digit.Utils.getFileUrl(o.url);
35918
- })
35919
- };
35914
+
35915
+ if (window.location.href.includes("/obps/")) {
35916
+ var _documents;
35917
+
35918
+ if (((_documents = documents) === null || _documents === void 0 ? void 0 : _documents.length) > 0) {
35919
+ var _documents2;
35920
+
35921
+ var workflowsDocs = [];
35922
+ (_documents2 = documents) === null || _documents2 === void 0 ? void 0 : _documents2.map(function (doc) {
35923
+ if (doc !== null && doc !== void 0 && doc.url) {
35924
+ var thumbs = doc.url.split(",")[3] || doc.url.split(",")[0];
35925
+ workflowsDocs.push({
35926
+ thumbs: [thumbs],
35927
+ images: [Digit.Utils.getFileUrl(doc.url)]
35928
+ });
35929
+ }
35930
+ });
35931
+ return Promise.resolve(workflowsDocs === null || workflowsDocs === void 0 ? void 0 : workflowsDocs[0]);
35920
35932
  } else {
35921
- return null;
35933
+ return Promise.resolve(null);
35922
35934
  }
35923
- });
35935
+ } else {
35936
+ return Promise.resolve(Digit.UploadServices.Filefetch(ids, tenantId)).then(function (res) {
35937
+ if (res.data.fileStoreIds && res.data.fileStoreIds.length !== 0) {
35938
+ return {
35939
+ thumbs: res.data.fileStoreIds.map(function (o) {
35940
+ return o.url.split(",")[3] || o.url.split(",")[0];
35941
+ }),
35942
+ images: res.data.fileStoreIds.map(function (o) {
35943
+ return Digit.Utils.getFileUrl(o.url);
35944
+ })
35945
+ };
35946
+ } else {
35947
+ return null;
35948
+ }
35949
+ });
35950
+ }
35924
35951
  } catch (e) {
35925
35952
  return Promise.reject(e);
35926
35953
  }
@@ -35928,45 +35955,86 @@ var getThumbnails = function getThumbnails(ids, tenantId) {
35928
35955
 
35929
35956
  var makeCommentsSubsidariesOfPreviousActions = function makeCommentsSubsidariesOfPreviousActions(wf) {
35930
35957
  try {
35931
- var _temp5 = function _temp5() {
35932
- var response = TimelineMap.get("tlActions");
35933
- return response;
35934
- };
35958
+ var _wf$;
35935
35959
 
35936
- var TimelineMap = new Map();
35960
+ var _temp9 = function _temp9() {
35961
+ function _temp6() {
35962
+ var response = TimelineMap.get("tlActions");
35963
+ return response;
35964
+ }
35937
35965
 
35938
- var _temp6 = _forOf(wf, function (eventHappened) {
35939
- function _temp2() {
35940
- if (eventHappened.action === "COMMENT") {
35941
- var commentAccumulator = TimelineMap.get("tlCommentStack") || [];
35942
- TimelineMap.set("tlCommentStack", [].concat(commentAccumulator, [eventHappened]));
35943
- } else {
35944
- var eventAccumulator = TimelineMap.get("tlActions") || [];
35966
+ var _temp5 = _forOf(wf, function (eventHappened) {
35967
+ function _temp4() {
35968
+ if (eventHappened.action === "COMMENT") {
35969
+ var commentAccumulator = TimelineMap.get("tlCommentStack") || [];
35970
+ TimelineMap.set("tlCommentStack", [].concat(commentAccumulator, [eventHappened]));
35971
+ } else {
35972
+ var eventAccumulator = TimelineMap.get("tlActions") || [];
35945
35973
 
35946
- var _commentAccumulator = TimelineMap.get("tlCommentStack") || [];
35974
+ var _commentAccumulator = TimelineMap.get("tlCommentStack") || [];
35947
35975
 
35948
- eventHappened.wfComments = [].concat(_commentAccumulator, eventHappened.comment ? [eventHappened] : []);
35949
- TimelineMap.set("tlActions", [].concat(eventAccumulator, [eventHappened]));
35950
- TimelineMap.delete("tlCommentStack");
35976
+ eventHappened.wfComments = [].concat(_commentAccumulator, eventHappened.comment ? [eventHappened] : []);
35977
+ TimelineMap.set("tlActions", [].concat(eventAccumulator, [eventHappened]));
35978
+ TimelineMap.delete("tlCommentStack");
35979
+ }
35951
35980
  }
35952
- }
35953
35981
 
35954
- var _temp = function () {
35955
- if (eventHappened !== null && eventHappened !== void 0 && eventHappened.documents) {
35956
- var _eventHappened$docume;
35982
+ var _temp3 = function () {
35983
+ if (eventHappened !== null && eventHappened !== void 0 && eventHappened.documents) {
35984
+ var _eventHappened$docume;
35985
+
35986
+ return Promise.resolve(getThumbnails(eventHappened === null || eventHappened === void 0 ? void 0 : (_eventHappened$docume = eventHappened.documents) === null || _eventHappened$docume === void 0 ? void 0 : _eventHappened$docume.map(function (e) {
35987
+ return e === null || e === void 0 ? void 0 : e.fileStoreId;
35988
+ }), eventHappened === null || eventHappened === void 0 ? void 0 : eventHappened.tenantId, eventHappened === null || eventHappened === void 0 ? void 0 : eventHappened.documents)).then(function (_getThumbnails) {
35989
+ eventHappened.thumbnailsToShow = _getThumbnails;
35990
+ });
35991
+ }
35992
+ }();
35993
+
35994
+ return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
35995
+ });
35996
+
35997
+ return _temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5);
35998
+ };
35999
+
36000
+ var TimelineMap = new Map();
36001
+ var tenantId = window.location.href.includes("/obps/") ? Digit.ULBService.getStateId() : wf === null || wf === void 0 ? void 0 : (_wf$ = wf[0]) === null || _wf$ === void 0 ? void 0 : _wf$.tenantId;
36002
+ var fileStoreIdsList = [];
36003
+ var res = {};
36004
+
36005
+ var _temp10 = function () {
36006
+ if (window.location.href.includes("/obps/")) {
36007
+ var _temp11 = function _temp11() {
36008
+ wf === null || wf === void 0 ? void 0 : wf.forEach(function (wfData) {
36009
+ var _wfData$documents;
36010
+
36011
+ wfData === null || wfData === void 0 ? void 0 : (_wfData$documents = wfData.documents) === null || _wfData$documents === void 0 ? void 0 : _wfData$documents.forEach(function (wfDoc) {
36012
+ if (wfDoc !== null && wfDoc !== void 0 && wfDoc.fileStoreId) wfDoc.url = res.data[wfDoc === null || wfDoc === void 0 ? void 0 : wfDoc.fileStoreId];
36013
+ });
36014
+ });
36015
+ };
36016
+
36017
+ wf === null || wf === void 0 ? void 0 : wf.map(function (wfData) {
36018
+ var _wfData$documents2;
35957
36019
 
35958
- return Promise.resolve(getThumbnails(eventHappened === null || eventHappened === void 0 ? void 0 : (_eventHappened$docume = eventHappened.documents) === null || _eventHappened$docume === void 0 ? void 0 : _eventHappened$docume.map(function (e) {
35959
- return e === null || e === void 0 ? void 0 : e.fileStoreId;
35960
- }), eventHappened === null || eventHappened === void 0 ? void 0 : eventHappened.tenantId)).then(function (_getThumbnails) {
35961
- eventHappened.thumbnailsToShow = _getThumbnails;
36020
+ wfData === null || wfData === void 0 ? void 0 : (_wfData$documents2 = wfData.documents) === null || _wfData$documents2 === void 0 ? void 0 : _wfData$documents2.map(function (wfDoc) {
36021
+ if (wfDoc !== null && wfDoc !== void 0 && wfDoc.fileStoreId) fileStoreIdsList.push(wfDoc === null || wfDoc === void 0 ? void 0 : wfDoc.fileStoreId);
35962
36022
  });
35963
- }
35964
- }();
36023
+ });
35965
36024
 
35966
- return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
35967
- });
36025
+ var _temp12 = function () {
36026
+ if ((fileStoreIdsList === null || fileStoreIdsList === void 0 ? void 0 : fileStoreIdsList.length) > 0) {
36027
+ return Promise.resolve(Digit.UploadServices.Filefetch(fileStoreIdsList, tenantId)).then(function (_Digit$UploadServices) {
36028
+ res = _Digit$UploadServices;
36029
+ });
36030
+ }
36031
+ }();
36032
+
36033
+ return _temp12 && _temp12.then ? _temp12.then(_temp11) : _temp11(_temp12);
36034
+ }
36035
+ }();
35968
36036
 
35969
- return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(_temp5) : _temp5(_temp6));
36037
+ return Promise.resolve(_temp10 && _temp10.then ? _temp10.then(_temp9) : _temp9(_temp10));
35970
36038
  } catch (e) {
35971
36039
  return Promise.reject(e);
35972
36040
  }
@@ -36026,13 +36094,13 @@ var WorkflowService = {
36026
36094
 
36027
36095
  var _exit = false;
36028
36096
 
36029
- function _temp14(_result2) {
36097
+ function _temp20(_result2) {
36030
36098
  return _exit ? _result2 : {};
36031
36099
  }
36032
36100
 
36033
36101
  var businessServiceResponse = _Digit$WorkflowServic === null || _Digit$WorkflowServic === void 0 ? void 0 : (_Digit$WorkflowServic2 = _Digit$WorkflowServic.BusinessServices[0]) === null || _Digit$WorkflowServic2 === void 0 ? void 0 : _Digit$WorkflowServic2.states;
36034
36102
 
36035
- var _temp13 = function () {
36103
+ var _temp19 = function () {
36036
36104
  if (workflow && workflow.ProcessInstances) {
36037
36105
  var _processInstances$, _businessServiceRespo;
36038
36106
 
@@ -36113,7 +36181,7 @@ var WorkflowService = {
36113
36181
  return function () {
36114
36182
  if (processInstances.length > 0) {
36115
36183
  return Promise.resolve(makeCommentsSubsidariesOfPreviousActions(processInstances)).then(function (TLEnrichedWithWorflowData) {
36116
- function _temp12() {
36184
+ function _temp18() {
36117
36185
  var _workflow$ProcessInst, _workflow$ProcessInst2;
36118
36186
 
36119
36187
  var nextActions = actionRolePair;
@@ -36181,17 +36249,17 @@ var WorkflowService = {
36181
36249
  return checkPoint;
36182
36250
  });
36183
36251
 
36184
- var _temp11 = function () {
36252
+ var _temp17 = function () {
36185
36253
  if (getTripData) {
36186
- var _temp15 = _catch(function () {
36254
+ var _temp21 = _catch(function () {
36187
36255
  var filters = {
36188
36256
  businessService: 'FSM_VEHICLE_TRIP',
36189
36257
  refernceNos: id
36190
36258
  };
36191
36259
  return Promise.resolve(Digit.FSMService.vehicleSearch(tenantId, filters)).then(function (tripSearchResp) {
36192
- var _temp9 = function () {
36260
+ var _temp15 = function () {
36193
36261
  if (tripSearchResp && tripSearchResp.vehicleTrip && tripSearchResp.vehicleTrip.length) {
36194
- var _temp16 = function _temp16() {
36262
+ var _temp22 = function _temp22() {
36195
36263
  var tripTimeline = [];
36196
36264
  var disposalInProgressPosition = timeline.findIndex(function (data) {
36197
36265
  return data.status === "DISPOSAL_IN_PROGRESS";
@@ -36230,7 +36298,7 @@ var WorkflowService = {
36230
36298
  var _waitingForDisposedAction = [];
36231
36299
  var _disposedAction = [];
36232
36300
 
36233
- var _temp17 = _forOf(tripSearchResp.vehicleTrip, function (data) {
36301
+ var _temp23 = _forOf(tripSearchResp.vehicleTrip, function (data) {
36234
36302
  return Promise.resolve(Digit.WorkflowService.getByBusinessId(tenantId, data.applicationNo)).then(function (resp) {
36235
36303
  var _resp$ProcessInstance;
36236
36304
 
@@ -36300,19 +36368,19 @@ var WorkflowService = {
36300
36368
  });
36301
36369
  });
36302
36370
 
36303
- return _temp17 && _temp17.then ? _temp17.then(_temp16) : _temp16(_temp17);
36371
+ return _temp23 && _temp23.then ? _temp23.then(_temp22) : _temp22(_temp23);
36304
36372
  }
36305
36373
  }();
36306
36374
 
36307
- if (_temp9 && _temp9.then) return _temp9.then(function () {});
36375
+ if (_temp15 && _temp15.then) return _temp15.then(function () {});
36308
36376
  });
36309
36377
  }, function () {});
36310
36378
 
36311
- if (_temp15 && _temp15.then) return _temp15.then(function () {});
36379
+ if (_temp21 && _temp21.then) return _temp21.then(function () {});
36312
36380
  }
36313
36381
  }();
36314
36382
 
36315
- return _temp11 && _temp11.then ? _temp11.then(_temp12) : _temp12(_temp11);
36383
+ return _temp17 && _temp17.then ? _temp17.then(_temp18) : _temp18(_temp17);
36316
36384
  });
36317
36385
  }
36318
36386
  }();
@@ -36321,7 +36389,7 @@ var WorkflowService = {
36321
36389
  }
36322
36390
  }();
36323
36391
 
36324
- return _temp13 && _temp13.then ? _temp13.then(_temp14) : _temp14(_temp13);
36392
+ return _temp19 && _temp19.then ? _temp19.then(_temp20) : _temp20(_temp19);
36325
36393
  });
36326
36394
  });
36327
36395
  } catch (e) {
@@ -37574,200 +37642,1260 @@ var useQueryParams = function useQueryParams() {
37574
37642
  return params;
37575
37643
  };
37576
37644
 
37577
- var useOnClickOutside = function useOnClickOutside(ref, handler, isActive, eventParam) {
37578
- if (eventParam === void 0) {
37579
- eventParam = false;
37580
- }
37645
+ var b$1 = "function" === typeof Symbol && Symbol.for,
37646
+ c = b$1 ? Symbol.for("react.element") : 60103,
37647
+ d = b$1 ? Symbol.for("react.portal") : 60106,
37648
+ e = b$1 ? Symbol.for("react.fragment") : 60107,
37649
+ f = b$1 ? Symbol.for("react.strict_mode") : 60108,
37650
+ g = b$1 ? Symbol.for("react.profiler") : 60114,
37651
+ h = b$1 ? Symbol.for("react.provider") : 60109,
37652
+ k$1 = b$1 ? Symbol.for("react.context") : 60110,
37653
+ l = b$1 ? Symbol.for("react.async_mode") : 60111,
37654
+ m = b$1 ? Symbol.for("react.concurrent_mode") : 60111,
37655
+ n = b$1 ? Symbol.for("react.forward_ref") : 60112,
37656
+ p = b$1 ? Symbol.for("react.suspense") : 60113,
37657
+ q = b$1 ? Symbol.for("react.suspense_list") : 60120,
37658
+ r = b$1 ? Symbol.for("react.memo") : 60115,
37659
+ t = b$1 ? Symbol.for("react.lazy") : 60116,
37660
+ v = b$1 ? Symbol.for("react.block") : 60121,
37661
+ w = b$1 ? Symbol.for("react.fundamental") : 60117,
37662
+ x = b$1 ? Symbol.for("react.responder") : 60118,
37663
+ y$1 = b$1 ? Symbol.for("react.scope") : 60119;
37664
+
37665
+ function z(a) {
37666
+ if ("object" === typeof a && null !== a) {
37667
+ var u = a.$$typeof;
37668
+
37669
+ switch (u) {
37670
+ case c:
37671
+ switch (a = a.type, a) {
37672
+ case l:
37673
+ case m:
37674
+ case e:
37675
+ case g:
37676
+ case f:
37677
+ case p:
37678
+ return a;
37581
37679
 
37582
- React.useEffect(function () {
37583
- if (isActive) {
37584
- document.addEventListener("click", handleClickOutSide, eventParam);
37585
- } else {
37586
- document.removeEventListener("click", handleClickOutSide, eventParam);
37587
- }
37680
+ default:
37681
+ switch (a = a && a.$$typeof, a) {
37682
+ case k$1:
37683
+ case n:
37684
+ case t:
37685
+ case r:
37686
+ case h:
37687
+ return a;
37588
37688
 
37589
- return function () {
37590
- document.removeEventListener("click", handleClickOutSide, eventParam);
37591
- };
37592
- }, [isActive]);
37689
+ default:
37690
+ return u;
37691
+ }
37593
37692
 
37594
- var handleClickOutSide = function handleClickOutSide(event) {
37595
- if (ref.current && ref.current.contains(event.target)) {
37596
- return;
37693
+ }
37694
+
37695
+ case d:
37696
+ return u;
37597
37697
  }
37698
+ }
37699
+ }
37598
37700
 
37599
- handler(event);
37600
- };
37601
- };
37701
+ function A(a) {
37702
+ return z(a) === m;
37703
+ }
37602
37704
 
37603
- var _excluded = ["businessService"],
37604
- _excluded2 = ["tenantId", "businessService"],
37605
- _excluded3 = ["tenantId", "businessService"];
37606
- var useFetchCitizenBillsForBuissnessService = function useFetchCitizenBillsForBuissnessService(_ref, config) {
37607
- var _Digit$UserService$ge;
37705
+ var AsyncMode = l;
37706
+ var ConcurrentMode = m;
37707
+ var ContextConsumer = k$1;
37708
+ var ContextProvider = h;
37709
+ var Element = c;
37710
+ var ForwardRef = n;
37711
+ var Fragment = e;
37712
+ var Lazy = t;
37713
+ var Memo = r;
37714
+ var Portal = d;
37715
+ var Profiler = g;
37716
+ var StrictMode = f;
37717
+ var Suspense = p;
37608
37718
 
37609
- var businessService = _ref.businessService,
37610
- filters = _objectWithoutPropertiesLoose(_ref, _excluded);
37719
+ var isAsyncMode = function isAsyncMode(a) {
37720
+ return A(a) || z(a) === l;
37721
+ };
37611
37722
 
37612
- if (config === void 0) {
37613
- config = {};
37614
- }
37723
+ var isConcurrentMode = A;
37615
37724
 
37616
- var queryClient = reactQuery.useQueryClient();
37725
+ var isContextConsumer = function isContextConsumer(a) {
37726
+ return z(a) === k$1;
37727
+ };
37617
37728
 
37618
- var _ref2 = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {},
37619
- mobileNumber = _ref2.mobileNumber,
37620
- tenantId = _ref2.tenantId;
37729
+ var isContextProvider = function isContextProvider(a) {
37730
+ return z(a) === h;
37731
+ };
37621
37732
 
37622
- var params = _extends({
37623
- mobileNumber: mobileNumber,
37624
- businessService: businessService
37625
- }, filters);
37733
+ var isElement = function isElement(a) {
37734
+ return "object" === typeof a && null !== a && a.$$typeof === c;
37735
+ };
37626
37736
 
37627
- if (!params["mobileNumber"]) delete params["mobileNumber"];
37737
+ var isForwardRef = function isForwardRef(a) {
37738
+ return z(a) === n;
37739
+ };
37628
37740
 
37629
- var _useQuery = reactQuery.useQuery(["citizenBillsForBuisnessService", businessService, _extends({}, params)], function () {
37630
- return Digit.PaymentService.fetchBill(tenantId, _extends({}, params));
37631
- }, _extends({
37632
- refetchOnMount: true,
37633
- retry: false
37634
- }, config)),
37635
- isLoading = _useQuery.isLoading,
37636
- error = _useQuery.error,
37637
- isError = _useQuery.isError,
37638
- data = _useQuery.data,
37639
- status = _useQuery.status;
37741
+ var isFragment = function isFragment(a) {
37742
+ return z(a) === e;
37743
+ };
37640
37744
 
37641
- return {
37642
- isLoading: isLoading,
37643
- error: error,
37644
- isError: isError,
37645
- data: data,
37646
- status: status,
37647
- revalidate: function revalidate() {
37648
- return queryClient.invalidateQueries(["citizenBillsForBuisnessService", businessService]);
37649
- }
37650
- };
37745
+ var isLazy = function isLazy(a) {
37746
+ return z(a) === t;
37651
37747
  };
37652
- var useFetchBillsForBuissnessService = function useFetchBillsForBuissnessService(_ref3, config) {
37653
- var _Digit$UserService$ge2, _Digit$UserService$ge3;
37654
37748
 
37655
- var tenantId = _ref3.tenantId,
37656
- businessService = _ref3.businessService,
37657
- filters = _objectWithoutPropertiesLoose(_ref3, _excluded2);
37749
+ var isMemo = function isMemo(a) {
37750
+ return z(a) === r;
37751
+ };
37658
37752
 
37659
- if (config === void 0) {
37660
- config = {};
37661
- }
37753
+ var isPortal = function isPortal(a) {
37754
+ return z(a) === d;
37755
+ };
37662
37756
 
37663
- var queryClient = reactQuery.useQueryClient();
37664
- var isPTAccessDone = sessionStorage.getItem("IsPTAccessDone");
37757
+ var isProfiler = function isProfiler(a) {
37758
+ return z(a) === g;
37759
+ };
37665
37760
 
37666
- var params = _extends({
37667
- businessService: businessService
37668
- }, filters);
37761
+ var isStrictMode = function isStrictMode(a) {
37762
+ return z(a) === f;
37763
+ };
37669
37764
 
37670
- var _tenantId = tenantId || ((_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : (_Digit$UserService$ge3 = _Digit$UserService$ge2.info) === null || _Digit$UserService$ge3 === void 0 ? void 0 : _Digit$UserService$ge3.tenantId);
37765
+ var isSuspense = function isSuspense(a) {
37766
+ return z(a) === p;
37767
+ };
37671
37768
 
37672
- var _useQuery2 = reactQuery.useQuery(["billsForBuisnessService", businessService, _extends({}, filters), config, isPTAccessDone], function () {
37673
- return Digit.PaymentService.fetchBill(_tenantId, params);
37674
- }, _extends({
37675
- retry: function retry(count, err) {
37676
- return false;
37677
- }
37678
- }, config)),
37679
- isLoading = _useQuery2.isLoading,
37680
- error = _useQuery2.error,
37681
- isError = _useQuery2.isError,
37682
- data = _useQuery2.data,
37683
- status = _useQuery2.status;
37769
+ var isValidElementType = function isValidElementType(a) {
37770
+ return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k$1 || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y$1 || a.$$typeof === v);
37771
+ };
37684
37772
 
37685
- return {
37686
- isLoading: isLoading,
37687
- error: error,
37688
- isError: isError,
37689
- data: data,
37690
- status: status,
37691
- revalidate: function revalidate() {
37692
- return queryClient.invalidateQueries(["billsForBuisnessService", businessService]);
37693
- }
37694
- };
37773
+ var typeOf = z;
37774
+ var reactIs_production_min = {
37775
+ AsyncMode: AsyncMode,
37776
+ ConcurrentMode: ConcurrentMode,
37777
+ ContextConsumer: ContextConsumer,
37778
+ ContextProvider: ContextProvider,
37779
+ Element: Element,
37780
+ ForwardRef: ForwardRef,
37781
+ Fragment: Fragment,
37782
+ Lazy: Lazy,
37783
+ Memo: Memo,
37784
+ Portal: Portal,
37785
+ Profiler: Profiler,
37786
+ StrictMode: StrictMode,
37787
+ Suspense: Suspense,
37788
+ isAsyncMode: isAsyncMode,
37789
+ isConcurrentMode: isConcurrentMode,
37790
+ isContextConsumer: isContextConsumer,
37791
+ isContextProvider: isContextProvider,
37792
+ isElement: isElement,
37793
+ isForwardRef: isForwardRef,
37794
+ isFragment: isFragment,
37795
+ isLazy: isLazy,
37796
+ isMemo: isMemo,
37797
+ isPortal: isPortal,
37798
+ isProfiler: isProfiler,
37799
+ isStrictMode: isStrictMode,
37800
+ isSuspense: isSuspense,
37801
+ isValidElementType: isValidElementType,
37802
+ typeOf: typeOf
37695
37803
  };
37696
- var useFetchPayment = function useFetchPayment(_ref4, config) {
37697
- var tenantId = _ref4.tenantId,
37698
- consumerCode = _ref4.consumerCode,
37699
- businessService = _ref4.businessService;
37700
- var queryClient = reactQuery.useQueryClient();
37701
37804
 
37702
- var fetchBill = function fetchBill() {
37703
- try {
37704
- if (businessService !== null && businessService !== void 0 && businessService.includes("PT")) {
37705
- return Promise.resolve(Digit.PaymentService.fetchBill(tenantId, {
37706
- consumerCode: consumerCode,
37707
- businessService: businessService
37708
- })).then(function (fetchedBill) {
37709
- var _fetchedBill$Bill, _fetchedBill$Bill$, _fetchedBill$Bill$$bi, _fetchedBill$Bill$$bi2, _fetchedBill$Bill3, _fetchedBill$Bill3$, _fetchedBill$Bill3$$b;
37805
+ var reactIs_development = createCommonjsModule(function (module, exports) {
37710
37806
 
37711
- var billdetail = (fetchedBill === null || fetchedBill === void 0 ? void 0 : (_fetchedBill$Bill = fetchedBill.Bill) === null || _fetchedBill$Bill === void 0 ? void 0 : (_fetchedBill$Bill$ = _fetchedBill$Bill[0]) === null || _fetchedBill$Bill$ === void 0 ? void 0 : (_fetchedBill$Bill$$bi = _fetchedBill$Bill$.billDetails) === null || _fetchedBill$Bill$$bi === void 0 ? void 0 : (_fetchedBill$Bill$$bi2 = _fetchedBill$Bill$$bi.sort(function (a, b) {
37712
- return b.fromPeriod - a.fromPeriod;
37713
- })) === null || _fetchedBill$Bill$$bi2 === void 0 ? void 0 : _fetchedBill$Bill$$bi2[0]) || {};
37714
- fetchedBill.Bill[0].billDetails = fetchedBill.Bill[0].billDetails.map(function (ele) {
37715
- var _fetchedBill$Bill2, _fetchedBill$Bill2$;
37807
+ if (process.env.NODE_ENV !== "production") {
37808
+ (function () {
37716
37809
 
37717
- return _extends({}, ele, {
37718
- currentBillNo: fetchedBill === null || fetchedBill === void 0 ? void 0 : (_fetchedBill$Bill2 = fetchedBill.Bill) === null || _fetchedBill$Bill2 === void 0 ? void 0 : (_fetchedBill$Bill2$ = _fetchedBill$Bill2[0]) === null || _fetchedBill$Bill2$ === void 0 ? void 0 : _fetchedBill$Bill2$.billNumber,
37719
- currentExpiryDate: billdetail === null || billdetail === void 0 ? void 0 : billdetail.expiryDate
37720
- });
37721
- });
37810
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
37811
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
37812
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
37813
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
37814
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
37815
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
37816
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
37817
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
37818
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
37819
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
37820
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
37821
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
37822
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
37823
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
37824
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
37825
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
37826
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
37827
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
37828
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
37829
+
37830
+ function isValidElementType(type) {
37831
+ return typeof type === 'string' || typeof type === 'function' || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
37832
+ }
37833
+
37834
+ function typeOf(object) {
37835
+ if (typeof object === 'object' && object !== null) {
37836
+ var $$typeof = object.$$typeof;
37837
+
37838
+ switch ($$typeof) {
37839
+ case REACT_ELEMENT_TYPE:
37840
+ var type = object.type;
37841
+
37842
+ switch (type) {
37843
+ case REACT_ASYNC_MODE_TYPE:
37844
+ case REACT_CONCURRENT_MODE_TYPE:
37845
+ case REACT_FRAGMENT_TYPE:
37846
+ case REACT_PROFILER_TYPE:
37847
+ case REACT_STRICT_MODE_TYPE:
37848
+ case REACT_SUSPENSE_TYPE:
37849
+ return type;
37722
37850
 
37723
- if (fetchedBill && (fetchedBill === null || fetchedBill === void 0 ? void 0 : (_fetchedBill$Bill3 = fetchedBill.Bill) === null || _fetchedBill$Bill3 === void 0 ? void 0 : (_fetchedBill$Bill3$ = _fetchedBill$Bill3[0]) === null || _fetchedBill$Bill3$ === void 0 ? void 0 : (_fetchedBill$Bill3$$b = _fetchedBill$Bill3$.billDetails) === null || _fetchedBill$Bill3$$b === void 0 ? void 0 : _fetchedBill$Bill3$$b.length) > 1) {
37724
- var _fetchedBill$Bill4, _fetchedBill$Bill4$, _fetchedBill$Bill4$$b;
37851
+ default:
37852
+ var $$typeofType = type && type.$$typeof;
37725
37853
 
37726
- fetchedBill === null || fetchedBill === void 0 ? void 0 : (_fetchedBill$Bill4 = fetchedBill.Bill) === null || _fetchedBill$Bill4 === void 0 ? void 0 : (_fetchedBill$Bill4$ = _fetchedBill$Bill4[0]) === null || _fetchedBill$Bill4$ === void 0 ? void 0 : (_fetchedBill$Bill4$$b = _fetchedBill$Bill4$.billDetails) === null || _fetchedBill$Bill4$$b === void 0 ? void 0 : _fetchedBill$Bill4$$b.map(function (billdet) {
37727
- try {
37728
- return Promise.resolve(Digit.PaymentService.searchBill(tenantId, {
37729
- consumerCode: consumerCode,
37730
- fromPeriod: billdet === null || billdet === void 0 ? void 0 : billdet.fromPeriod,
37731
- toPeriod: billdet === null || billdet === void 0 ? void 0 : billdet.toPeriod,
37732
- service: businessService,
37733
- retrieveOldest: true
37734
- })).then(function (searchBill) {
37735
- var _searchBill$Bill, _searchBill$Bill$, _searchBill$Bill$$bil, _searchBill$Bill$$bil2, _searchBill$Bill2, _searchBill$Bill2$;
37854
+ switch ($$typeofType) {
37855
+ case REACT_CONTEXT_TYPE:
37856
+ case REACT_FORWARD_REF_TYPE:
37857
+ case REACT_LAZY_TYPE:
37858
+ case REACT_MEMO_TYPE:
37859
+ case REACT_PROVIDER_TYPE:
37860
+ return $$typeofType;
37861
+
37862
+ default:
37863
+ return $$typeof;
37864
+ }
37736
37865
 
37737
- billdet.expiryDate = searchBill === null || searchBill === void 0 ? void 0 : (_searchBill$Bill = searchBill.Bill) === null || _searchBill$Bill === void 0 ? void 0 : (_searchBill$Bill$ = _searchBill$Bill[0]) === null || _searchBill$Bill$ === void 0 ? void 0 : (_searchBill$Bill$$bil = _searchBill$Bill$.billDetails) === null || _searchBill$Bill$$bil === void 0 ? void 0 : (_searchBill$Bill$$bil2 = _searchBill$Bill$$bil[0]) === null || _searchBill$Bill$$bil2 === void 0 ? void 0 : _searchBill$Bill$$bil2.expiryDate;
37738
- billdet.billNumber = searchBill === null || searchBill === void 0 ? void 0 : (_searchBill$Bill2 = searchBill.Bill) === null || _searchBill$Bill2 === void 0 ? void 0 : (_searchBill$Bill2$ = _searchBill$Bill2[0]) === null || _searchBill$Bill2$ === void 0 ? void 0 : _searchBill$Bill2$.billNumber;
37739
- });
37740
- } catch (e) {
37741
- return Promise.reject(e);
37742
37866
  }
37743
- });
37867
+
37868
+ case REACT_PORTAL_TYPE:
37869
+ return $$typeof;
37744
37870
  }
37871
+ }
37745
37872
 
37746
- return fetchedBill;
37747
- });
37748
- } else {
37749
- return Promise.resolve(Digit.PaymentService.fetchBill(tenantId, {
37750
- consumerCode: consumerCode,
37751
- businessService: businessService
37752
- }));
37873
+ return undefined;
37753
37874
  }
37754
- } catch (e) {
37755
- return Promise.reject(e);
37756
- }
37757
- };
37758
37875
 
37759
- var retry = function retry(failureCount, error) {
37760
- var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
37876
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
37877
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
37878
+ var ContextConsumer = REACT_CONTEXT_TYPE;
37879
+ var ContextProvider = REACT_PROVIDER_TYPE;
37880
+ var Element = REACT_ELEMENT_TYPE;
37881
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
37882
+ var Fragment = REACT_FRAGMENT_TYPE;
37883
+ var Lazy = REACT_LAZY_TYPE;
37884
+ var Memo = REACT_MEMO_TYPE;
37885
+ var Portal = REACT_PORTAL_TYPE;
37886
+ var Profiler = REACT_PROFILER_TYPE;
37887
+ var StrictMode = REACT_STRICT_MODE_TYPE;
37888
+ var Suspense = REACT_SUSPENSE_TYPE;
37889
+ var hasWarnedAboutDeprecatedIsAsyncMode = false;
37761
37890
 
37762
- if ((error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.code) === "EG_BS_BILL_NO_DEMANDS_FOUND") return false;else return failureCount < 3;
37763
- };
37891
+ function isAsyncMode(object) {
37892
+ {
37893
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
37894
+ hasWarnedAboutDeprecatedIsAsyncMode = true;
37895
+ console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
37896
+ }
37897
+ }
37898
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
37899
+ }
37764
37900
 
37765
- var queryData = reactQuery.useQuery(["paymentFetchDetails", tenantId, consumerCode, businessService], function () {
37766
- return fetchBill();
37767
- }, _extends({
37768
- retry: retry
37769
- }, config));
37770
- return _extends({}, queryData, {
37901
+ function isConcurrentMode(object) {
37902
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
37903
+ }
37904
+
37905
+ function isContextConsumer(object) {
37906
+ return typeOf(object) === REACT_CONTEXT_TYPE;
37907
+ }
37908
+
37909
+ function isContextProvider(object) {
37910
+ return typeOf(object) === REACT_PROVIDER_TYPE;
37911
+ }
37912
+
37913
+ function isElement(object) {
37914
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
37915
+ }
37916
+
37917
+ function isForwardRef(object) {
37918
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
37919
+ }
37920
+
37921
+ function isFragment(object) {
37922
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
37923
+ }
37924
+
37925
+ function isLazy(object) {
37926
+ return typeOf(object) === REACT_LAZY_TYPE;
37927
+ }
37928
+
37929
+ function isMemo(object) {
37930
+ return typeOf(object) === REACT_MEMO_TYPE;
37931
+ }
37932
+
37933
+ function isPortal(object) {
37934
+ return typeOf(object) === REACT_PORTAL_TYPE;
37935
+ }
37936
+
37937
+ function isProfiler(object) {
37938
+ return typeOf(object) === REACT_PROFILER_TYPE;
37939
+ }
37940
+
37941
+ function isStrictMode(object) {
37942
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
37943
+ }
37944
+
37945
+ function isSuspense(object) {
37946
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
37947
+ }
37948
+
37949
+ exports.AsyncMode = AsyncMode;
37950
+ exports.ConcurrentMode = ConcurrentMode;
37951
+ exports.ContextConsumer = ContextConsumer;
37952
+ exports.ContextProvider = ContextProvider;
37953
+ exports.Element = Element;
37954
+ exports.ForwardRef = ForwardRef;
37955
+ exports.Fragment = Fragment;
37956
+ exports.Lazy = Lazy;
37957
+ exports.Memo = Memo;
37958
+ exports.Portal = Portal;
37959
+ exports.Profiler = Profiler;
37960
+ exports.StrictMode = StrictMode;
37961
+ exports.Suspense = Suspense;
37962
+ exports.isAsyncMode = isAsyncMode;
37963
+ exports.isConcurrentMode = isConcurrentMode;
37964
+ exports.isContextConsumer = isContextConsumer;
37965
+ exports.isContextProvider = isContextProvider;
37966
+ exports.isElement = isElement;
37967
+ exports.isForwardRef = isForwardRef;
37968
+ exports.isFragment = isFragment;
37969
+ exports.isLazy = isLazy;
37970
+ exports.isMemo = isMemo;
37971
+ exports.isPortal = isPortal;
37972
+ exports.isProfiler = isProfiler;
37973
+ exports.isStrictMode = isStrictMode;
37974
+ exports.isSuspense = isSuspense;
37975
+ exports.isValidElementType = isValidElementType;
37976
+ exports.typeOf = typeOf;
37977
+ })();
37978
+ }
37979
+ });
37980
+
37981
+ var reactIs = createCommonjsModule(function (module) {
37982
+
37983
+ if (process.env.NODE_ENV === 'production') {
37984
+ module.exports = reactIs_production_min;
37985
+ } else {
37986
+ module.exports = reactIs_development;
37987
+ }
37988
+ });
37989
+
37990
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
37991
+ var ReactPropTypesSecret_1 = ReactPropTypesSecret;
37992
+
37993
+ var has = Function.call.bind(Object.prototype.hasOwnProperty);
37994
+
37995
+ var printWarning = function printWarning() {};
37996
+
37997
+ if (process.env.NODE_ENV !== 'production') {
37998
+ var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
37999
+ var loggedTypeFailures = {};
38000
+ var has$1 = has;
38001
+
38002
+ printWarning = function printWarning(text) {
38003
+ var message = 'Warning: ' + text;
38004
+
38005
+ if (typeof console !== 'undefined') {
38006
+ console.error(message);
38007
+ }
38008
+
38009
+ try {
38010
+ throw new Error(message);
38011
+ } catch (x) {}
38012
+ };
38013
+ }
38014
+
38015
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
38016
+ if (process.env.NODE_ENV !== 'production') {
38017
+ for (var typeSpecName in typeSpecs) {
38018
+ if (has$1(typeSpecs, typeSpecName)) {
38019
+ var error;
38020
+
38021
+ try {
38022
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
38023
+ var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
38024
+ err.name = 'Invariant Violation';
38025
+ throw err;
38026
+ }
38027
+
38028
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
38029
+ } catch (ex) {
38030
+ error = ex;
38031
+ }
38032
+
38033
+ if (error && !(error instanceof Error)) {
38034
+ printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).');
38035
+ }
38036
+
38037
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
38038
+ loggedTypeFailures[error.message] = true;
38039
+ var stack = getStack ? getStack() : '';
38040
+ printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));
38041
+ }
38042
+ }
38043
+ }
38044
+ }
38045
+ }
38046
+
38047
+ checkPropTypes.resetWarningCache = function () {
38048
+ if (process.env.NODE_ENV !== 'production') {
38049
+ loggedTypeFailures = {};
38050
+ }
38051
+ };
38052
+
38053
+ var checkPropTypes_1 = checkPropTypes;
38054
+
38055
+ var printWarning$1 = function printWarning() {};
38056
+
38057
+ if (process.env.NODE_ENV !== 'production') {
38058
+ printWarning$1 = function printWarning(text) {
38059
+ var message = 'Warning: ' + text;
38060
+
38061
+ if (typeof console !== 'undefined') {
38062
+ console.error(message);
38063
+ }
38064
+
38065
+ try {
38066
+ throw new Error(message);
38067
+ } catch (x) {}
38068
+ };
38069
+ }
38070
+
38071
+ function emptyFunctionThatReturnsNull() {
38072
+ return null;
38073
+ }
38074
+
38075
+ var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, throwOnDirectAccess) {
38076
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
38077
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
38078
+
38079
+ function getIteratorFn(maybeIterable) {
38080
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
38081
+
38082
+ if (typeof iteratorFn === 'function') {
38083
+ return iteratorFn;
38084
+ }
38085
+ }
38086
+
38087
+ var ANONYMOUS = '<<anonymous>>';
38088
+ var ReactPropTypes = {
38089
+ array: createPrimitiveTypeChecker('array'),
38090
+ bigint: createPrimitiveTypeChecker('bigint'),
38091
+ bool: createPrimitiveTypeChecker('boolean'),
38092
+ func: createPrimitiveTypeChecker('function'),
38093
+ number: createPrimitiveTypeChecker('number'),
38094
+ object: createPrimitiveTypeChecker('object'),
38095
+ string: createPrimitiveTypeChecker('string'),
38096
+ symbol: createPrimitiveTypeChecker('symbol'),
38097
+ any: createAnyTypeChecker(),
38098
+ arrayOf: createArrayOfTypeChecker,
38099
+ element: createElementTypeChecker(),
38100
+ elementType: createElementTypeTypeChecker(),
38101
+ instanceOf: createInstanceTypeChecker,
38102
+ node: createNodeChecker(),
38103
+ objectOf: createObjectOfTypeChecker,
38104
+ oneOf: createEnumTypeChecker,
38105
+ oneOfType: createUnionTypeChecker,
38106
+ shape: createShapeTypeChecker,
38107
+ exact: createStrictShapeTypeChecker
38108
+ };
38109
+
38110
+ function is(x, y) {
38111
+ if (x === y) {
38112
+ return x !== 0 || 1 / x === 1 / y;
38113
+ } else {
38114
+ return x !== x && y !== y;
38115
+ }
38116
+ }
38117
+
38118
+ function PropTypeError(message, data) {
38119
+ this.message = message;
38120
+ this.data = data && typeof data === 'object' ? data : {};
38121
+ this.stack = '';
38122
+ }
38123
+
38124
+ PropTypeError.prototype = Error.prototype;
38125
+
38126
+ function createChainableTypeChecker(validate) {
38127
+ if (process.env.NODE_ENV !== 'production') {
38128
+ var manualPropTypeCallCache = {};
38129
+ var manualPropTypeWarningCount = 0;
38130
+ }
38131
+
38132
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
38133
+ componentName = componentName || ANONYMOUS;
38134
+ propFullName = propFullName || propName;
38135
+
38136
+ if (secret !== ReactPropTypesSecret_1) {
38137
+ if (throwOnDirectAccess) {
38138
+ var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
38139
+ err.name = 'Invariant Violation';
38140
+ throw err;
38141
+ } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
38142
+ var cacheKey = componentName + ':' + propName;
38143
+
38144
+ if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) {
38145
+ printWarning$1('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.');
38146
+ manualPropTypeCallCache[cacheKey] = true;
38147
+ manualPropTypeWarningCount++;
38148
+ }
38149
+ }
38150
+ }
38151
+
38152
+ if (props[propName] == null) {
38153
+ if (isRequired) {
38154
+ if (props[propName] === null) {
38155
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
38156
+ }
38157
+
38158
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
38159
+ }
38160
+
38161
+ return null;
38162
+ } else {
38163
+ return validate(props, propName, componentName, location, propFullName);
38164
+ }
38165
+ }
38166
+
38167
+ var chainedCheckType = checkType.bind(null, false);
38168
+ chainedCheckType.isRequired = checkType.bind(null, true);
38169
+ return chainedCheckType;
38170
+ }
38171
+
38172
+ function createPrimitiveTypeChecker(expectedType) {
38173
+ function validate(props, propName, componentName, location, propFullName, secret) {
38174
+ var propValue = props[propName];
38175
+ var propType = getPropType(propValue);
38176
+
38177
+ if (propType !== expectedType) {
38178
+ var preciseType = getPreciseType(propValue);
38179
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {
38180
+ expectedType: expectedType
38181
+ });
38182
+ }
38183
+
38184
+ return null;
38185
+ }
38186
+
38187
+ return createChainableTypeChecker(validate);
38188
+ }
38189
+
38190
+ function createAnyTypeChecker() {
38191
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
38192
+ }
38193
+
38194
+ function createArrayOfTypeChecker(typeChecker) {
38195
+ function validate(props, propName, componentName, location, propFullName) {
38196
+ if (typeof typeChecker !== 'function') {
38197
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
38198
+ }
38199
+
38200
+ var propValue = props[propName];
38201
+
38202
+ if (!Array.isArray(propValue)) {
38203
+ var propType = getPropType(propValue);
38204
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
38205
+ }
38206
+
38207
+ for (var i = 0; i < propValue.length; i++) {
38208
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1);
38209
+
38210
+ if (error instanceof Error) {
38211
+ return error;
38212
+ }
38213
+ }
38214
+
38215
+ return null;
38216
+ }
38217
+
38218
+ return createChainableTypeChecker(validate);
38219
+ }
38220
+
38221
+ function createElementTypeChecker() {
38222
+ function validate(props, propName, componentName, location, propFullName) {
38223
+ var propValue = props[propName];
38224
+
38225
+ if (!isValidElement(propValue)) {
38226
+ var propType = getPropType(propValue);
38227
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
38228
+ }
38229
+
38230
+ return null;
38231
+ }
38232
+
38233
+ return createChainableTypeChecker(validate);
38234
+ }
38235
+
38236
+ function createElementTypeTypeChecker() {
38237
+ function validate(props, propName, componentName, location, propFullName) {
38238
+ var propValue = props[propName];
38239
+
38240
+ if (!reactIs.isValidElementType(propValue)) {
38241
+ var propType = getPropType(propValue);
38242
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
38243
+ }
38244
+
38245
+ return null;
38246
+ }
38247
+
38248
+ return createChainableTypeChecker(validate);
38249
+ }
38250
+
38251
+ function createInstanceTypeChecker(expectedClass) {
38252
+ function validate(props, propName, componentName, location, propFullName) {
38253
+ if (!(props[propName] instanceof expectedClass)) {
38254
+ var expectedClassName = expectedClass.name || ANONYMOUS;
38255
+ var actualClassName = getClassName(props[propName]);
38256
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
38257
+ }
38258
+
38259
+ return null;
38260
+ }
38261
+
38262
+ return createChainableTypeChecker(validate);
38263
+ }
38264
+
38265
+ function createEnumTypeChecker(expectedValues) {
38266
+ if (!Array.isArray(expectedValues)) {
38267
+ if (process.env.NODE_ENV !== 'production') {
38268
+ if (arguments.length > 1) {
38269
+ printWarning$1('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');
38270
+ } else {
38271
+ printWarning$1('Invalid argument supplied to oneOf, expected an array.');
38272
+ }
38273
+ }
38274
+
38275
+ return emptyFunctionThatReturnsNull;
38276
+ }
38277
+
38278
+ function validate(props, propName, componentName, location, propFullName) {
38279
+ var propValue = props[propName];
38280
+
38281
+ for (var i = 0; i < expectedValues.length; i++) {
38282
+ if (is(propValue, expectedValues[i])) {
38283
+ return null;
38284
+ }
38285
+ }
38286
+
38287
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
38288
+ var type = getPreciseType(value);
38289
+
38290
+ if (type === 'symbol') {
38291
+ return String(value);
38292
+ }
38293
+
38294
+ return value;
38295
+ });
38296
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
38297
+ }
38298
+
38299
+ return createChainableTypeChecker(validate);
38300
+ }
38301
+
38302
+ function createObjectOfTypeChecker(typeChecker) {
38303
+ function validate(props, propName, componentName, location, propFullName) {
38304
+ if (typeof typeChecker !== 'function') {
38305
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
38306
+ }
38307
+
38308
+ var propValue = props[propName];
38309
+ var propType = getPropType(propValue);
38310
+
38311
+ if (propType !== 'object') {
38312
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
38313
+ }
38314
+
38315
+ for (var key in propValue) {
38316
+ if (has(propValue, key)) {
38317
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
38318
+
38319
+ if (error instanceof Error) {
38320
+ return error;
38321
+ }
38322
+ }
38323
+ }
38324
+
38325
+ return null;
38326
+ }
38327
+
38328
+ return createChainableTypeChecker(validate);
38329
+ }
38330
+
38331
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
38332
+ if (!Array.isArray(arrayOfTypeCheckers)) {
38333
+ process.env.NODE_ENV !== 'production' ? printWarning$1('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
38334
+ return emptyFunctionThatReturnsNull;
38335
+ }
38336
+
38337
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
38338
+ var checker = arrayOfTypeCheckers[i];
38339
+
38340
+ if (typeof checker !== 'function') {
38341
+ printWarning$1('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');
38342
+ return emptyFunctionThatReturnsNull;
38343
+ }
38344
+ }
38345
+
38346
+ function validate(props, propName, componentName, location, propFullName) {
38347
+ var expectedTypes = [];
38348
+
38349
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
38350
+ var checker = arrayOfTypeCheckers[i];
38351
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1);
38352
+
38353
+ if (checkerResult == null) {
38354
+ return null;
38355
+ }
38356
+
38357
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
38358
+ expectedTypes.push(checkerResult.data.expectedType);
38359
+ }
38360
+ }
38361
+
38362
+ var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';
38363
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
38364
+ }
38365
+
38366
+ return createChainableTypeChecker(validate);
38367
+ }
38368
+
38369
+ function createNodeChecker() {
38370
+ function validate(props, propName, componentName, location, propFullName) {
38371
+ if (!isNode(props[propName])) {
38372
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
38373
+ }
38374
+
38375
+ return null;
38376
+ }
38377
+
38378
+ return createChainableTypeChecker(validate);
38379
+ }
38380
+
38381
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
38382
+ return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.');
38383
+ }
38384
+
38385
+ function createShapeTypeChecker(shapeTypes) {
38386
+ function validate(props, propName, componentName, location, propFullName) {
38387
+ var propValue = props[propName];
38388
+ var propType = getPropType(propValue);
38389
+
38390
+ if (propType !== 'object') {
38391
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
38392
+ }
38393
+
38394
+ for (var key in shapeTypes) {
38395
+ var checker = shapeTypes[key];
38396
+
38397
+ if (typeof checker !== 'function') {
38398
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
38399
+ }
38400
+
38401
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
38402
+
38403
+ if (error) {
38404
+ return error;
38405
+ }
38406
+ }
38407
+
38408
+ return null;
38409
+ }
38410
+
38411
+ return createChainableTypeChecker(validate);
38412
+ }
38413
+
38414
+ function createStrictShapeTypeChecker(shapeTypes) {
38415
+ function validate(props, propName, componentName, location, propFullName) {
38416
+ var propValue = props[propName];
38417
+ var propType = getPropType(propValue);
38418
+
38419
+ if (propType !== 'object') {
38420
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
38421
+ }
38422
+
38423
+ var allKeys = objectAssign({}, props[propName], shapeTypes);
38424
+
38425
+ for (var key in allKeys) {
38426
+ var checker = shapeTypes[key];
38427
+
38428
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
38429
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
38430
+ }
38431
+
38432
+ if (!checker) {
38433
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));
38434
+ }
38435
+
38436
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
38437
+
38438
+ if (error) {
38439
+ return error;
38440
+ }
38441
+ }
38442
+
38443
+ return null;
38444
+ }
38445
+
38446
+ return createChainableTypeChecker(validate);
38447
+ }
38448
+
38449
+ function isNode(propValue) {
38450
+ switch (typeof propValue) {
38451
+ case 'number':
38452
+ case 'string':
38453
+ case 'undefined':
38454
+ return true;
38455
+
38456
+ case 'boolean':
38457
+ return !propValue;
38458
+
38459
+ case 'object':
38460
+ if (Array.isArray(propValue)) {
38461
+ return propValue.every(isNode);
38462
+ }
38463
+
38464
+ if (propValue === null || isValidElement(propValue)) {
38465
+ return true;
38466
+ }
38467
+
38468
+ var iteratorFn = getIteratorFn(propValue);
38469
+
38470
+ if (iteratorFn) {
38471
+ var iterator = iteratorFn.call(propValue);
38472
+ var step;
38473
+
38474
+ if (iteratorFn !== propValue.entries) {
38475
+ while (!(step = iterator.next()).done) {
38476
+ if (!isNode(step.value)) {
38477
+ return false;
38478
+ }
38479
+ }
38480
+ } else {
38481
+ while (!(step = iterator.next()).done) {
38482
+ var entry = step.value;
38483
+
38484
+ if (entry) {
38485
+ if (!isNode(entry[1])) {
38486
+ return false;
38487
+ }
38488
+ }
38489
+ }
38490
+ }
38491
+ } else {
38492
+ return false;
38493
+ }
38494
+
38495
+ return true;
38496
+
38497
+ default:
38498
+ return false;
38499
+ }
38500
+ }
38501
+
38502
+ function isSymbol(propType, propValue) {
38503
+ if (propType === 'symbol') {
38504
+ return true;
38505
+ }
38506
+
38507
+ if (!propValue) {
38508
+ return false;
38509
+ }
38510
+
38511
+ if (propValue['@@toStringTag'] === 'Symbol') {
38512
+ return true;
38513
+ }
38514
+
38515
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
38516
+ return true;
38517
+ }
38518
+
38519
+ return false;
38520
+ }
38521
+
38522
+ function getPropType(propValue) {
38523
+ var propType = typeof propValue;
38524
+
38525
+ if (Array.isArray(propValue)) {
38526
+ return 'array';
38527
+ }
38528
+
38529
+ if (propValue instanceof RegExp) {
38530
+ return 'object';
38531
+ }
38532
+
38533
+ if (isSymbol(propType, propValue)) {
38534
+ return 'symbol';
38535
+ }
38536
+
38537
+ return propType;
38538
+ }
38539
+
38540
+ function getPreciseType(propValue) {
38541
+ if (typeof propValue === 'undefined' || propValue === null) {
38542
+ return '' + propValue;
38543
+ }
38544
+
38545
+ var propType = getPropType(propValue);
38546
+
38547
+ if (propType === 'object') {
38548
+ if (propValue instanceof Date) {
38549
+ return 'date';
38550
+ } else if (propValue instanceof RegExp) {
38551
+ return 'regexp';
38552
+ }
38553
+ }
38554
+
38555
+ return propType;
38556
+ }
38557
+
38558
+ function getPostfixForTypeWarning(value) {
38559
+ var type = getPreciseType(value);
38560
+
38561
+ switch (type) {
38562
+ case 'array':
38563
+ case 'object':
38564
+ return 'an ' + type;
38565
+
38566
+ case 'boolean':
38567
+ case 'date':
38568
+ case 'regexp':
38569
+ return 'a ' + type;
38570
+
38571
+ default:
38572
+ return type;
38573
+ }
38574
+ }
38575
+
38576
+ function getClassName(propValue) {
38577
+ if (!propValue.constructor || !propValue.constructor.name) {
38578
+ return ANONYMOUS;
38579
+ }
38580
+
38581
+ return propValue.constructor.name;
38582
+ }
38583
+
38584
+ ReactPropTypes.checkPropTypes = checkPropTypes_1;
38585
+ ReactPropTypes.resetWarningCache = checkPropTypes_1.resetWarningCache;
38586
+ ReactPropTypes.PropTypes = ReactPropTypes;
38587
+ return ReactPropTypes;
38588
+ };
38589
+
38590
+ function emptyFunction() {}
38591
+
38592
+ function emptyFunctionWithReset() {}
38593
+
38594
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
38595
+
38596
+ var factoryWithThrowingShims = function factoryWithThrowingShims() {
38597
+ function shim(props, propName, componentName, location, propFullName, secret) {
38598
+ if (secret === ReactPropTypesSecret_1) {
38599
+ return;
38600
+ }
38601
+
38602
+ var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
38603
+ err.name = 'Invariant Violation';
38604
+ throw err;
38605
+ }
38606
+ shim.isRequired = shim;
38607
+
38608
+ function getShim() {
38609
+ return shim;
38610
+ }
38611
+ var ReactPropTypes = {
38612
+ array: shim,
38613
+ bigint: shim,
38614
+ bool: shim,
38615
+ func: shim,
38616
+ number: shim,
38617
+ object: shim,
38618
+ string: shim,
38619
+ symbol: shim,
38620
+ any: shim,
38621
+ arrayOf: getShim,
38622
+ element: shim,
38623
+ elementType: shim,
38624
+ instanceOf: getShim,
38625
+ node: shim,
38626
+ objectOf: getShim,
38627
+ oneOf: getShim,
38628
+ oneOfType: getShim,
38629
+ shape: getShim,
38630
+ exact: getShim,
38631
+ checkPropTypes: emptyFunctionWithReset,
38632
+ resetWarningCache: emptyFunction
38633
+ };
38634
+ ReactPropTypes.PropTypes = ReactPropTypes;
38635
+ return ReactPropTypes;
38636
+ };
38637
+
38638
+ var propTypes = createCommonjsModule(function (module) {
38639
+ if (process.env.NODE_ENV !== 'production') {
38640
+ var ReactIs = reactIs;
38641
+ var throwOnDirectAccess = true;
38642
+ module.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
38643
+ } else {
38644
+ module.exports = factoryWithThrowingShims();
38645
+ }
38646
+ });
38647
+
38648
+ var useDocumentSearch = function useDocumentSearch(documents, config) {
38649
+ var _documents;
38650
+
38651
+ if (documents === void 0) {
38652
+ documents = [];
38653
+ }
38654
+
38655
+ if (config === void 0) {
38656
+ config = {};
38657
+ }
38658
+
38659
+ var client = reactQuery.useQueryClient();
38660
+ var tenant = Digit.ULBService.getStateId();
38661
+ var filesArray = (_documents = documents) === null || _documents === void 0 ? void 0 : _documents.map(function (value) {
38662
+ return value === null || value === void 0 ? void 0 : value.fileStoreId;
38663
+ });
38664
+
38665
+ var _useQuery = reactQuery.useQuery([filesArray.join('')], function () {
38666
+ return Digit.UploadServices.Filefetch(filesArray, tenant);
38667
+ }, _extends({
38668
+ enabled: filesArray && filesArray.length > 0,
38669
+ select: function select(data) {
38670
+ return documents.map(function (document) {
38671
+ var _data$data, _data$data2, _data$data3;
38672
+
38673
+ return _extends({}, document, {
38674
+ fileURL: (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data[document === null || document === void 0 ? void 0 : document.fileStoreId]) && Digit.Utils.getFileUrl(data.data[document === null || document === void 0 ? void 0 : document.fileStoreId]),
38675
+ url: (data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : _data$data2[document === null || document === void 0 ? void 0 : document.fileStoreId]) && Digit.Utils.getFileUrl(data.data[document === null || document === void 0 ? void 0 : document.fileStoreId]),
38676
+ fileResponse: (data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : _data$data3[document === null || document === void 0 ? void 0 : document.fileStoreId]) || ""
38677
+ });
38678
+ });
38679
+ }
38680
+ }, config)),
38681
+ isLoading = _useQuery.isLoading,
38682
+ error = _useQuery.error,
38683
+ data = _useQuery.data;
38684
+
38685
+ return {
38686
+ isLoading: isLoading,
38687
+ error: error,
38688
+ data: {
38689
+ pdfFiles: data
38690
+ },
38691
+ revalidate: function revalidate() {
38692
+ return client.invalidateQueries([filesArray.join('')]);
38693
+ }
38694
+ };
38695
+ };
38696
+ useDocumentSearch.propTypes = {
38697
+ documents: propTypes.array,
38698
+ config: propTypes.object
38699
+ };
38700
+ useDocumentSearch.defaultProps = {
38701
+ documents: [],
38702
+ config: {}
38703
+ };
38704
+
38705
+ var useOnClickOutside = function useOnClickOutside(ref, handler, isActive, eventParam) {
38706
+ if (eventParam === void 0) {
38707
+ eventParam = false;
38708
+ }
38709
+
38710
+ React.useEffect(function () {
38711
+ if (isActive) {
38712
+ document.addEventListener("click", handleClickOutSide, eventParam);
38713
+ } else {
38714
+ document.removeEventListener("click", handleClickOutSide, eventParam);
38715
+ }
38716
+
38717
+ return function () {
38718
+ document.removeEventListener("click", handleClickOutSide, eventParam);
38719
+ };
38720
+ }, [isActive]);
38721
+
38722
+ var handleClickOutSide = function handleClickOutSide(event) {
38723
+ if (ref.current && ref.current.contains(event.target)) {
38724
+ return;
38725
+ }
38726
+
38727
+ handler(event);
38728
+ };
38729
+ };
38730
+
38731
+ var _excluded = ["businessService"],
38732
+ _excluded2 = ["tenantId", "businessService"],
38733
+ _excluded3 = ["tenantId", "businessService"];
38734
+ var useFetchCitizenBillsForBuissnessService = function useFetchCitizenBillsForBuissnessService(_ref, config) {
38735
+ var _Digit$UserService$ge;
38736
+
38737
+ var businessService = _ref.businessService,
38738
+ filters = _objectWithoutPropertiesLoose(_ref, _excluded);
38739
+
38740
+ if (config === void 0) {
38741
+ config = {};
38742
+ }
38743
+
38744
+ var queryClient = reactQuery.useQueryClient();
38745
+
38746
+ var _ref2 = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {},
38747
+ mobileNumber = _ref2.mobileNumber,
38748
+ tenantId = _ref2.tenantId;
38749
+
38750
+ var params = _extends({
38751
+ mobileNumber: mobileNumber,
38752
+ businessService: businessService
38753
+ }, filters);
38754
+
38755
+ if (!params["mobileNumber"]) delete params["mobileNumber"];
38756
+
38757
+ var _useQuery = reactQuery.useQuery(["citizenBillsForBuisnessService", businessService, _extends({}, params)], function () {
38758
+ return Digit.PaymentService.fetchBill(tenantId, _extends({}, params));
38759
+ }, _extends({
38760
+ refetchOnMount: true,
38761
+ retry: false
38762
+ }, config)),
38763
+ isLoading = _useQuery.isLoading,
38764
+ error = _useQuery.error,
38765
+ isError = _useQuery.isError,
38766
+ data = _useQuery.data,
38767
+ status = _useQuery.status;
38768
+
38769
+ return {
38770
+ isLoading: isLoading,
38771
+ error: error,
38772
+ isError: isError,
38773
+ data: data,
38774
+ status: status,
38775
+ revalidate: function revalidate() {
38776
+ return queryClient.invalidateQueries(["citizenBillsForBuisnessService", businessService]);
38777
+ }
38778
+ };
38779
+ };
38780
+ var useFetchBillsForBuissnessService = function useFetchBillsForBuissnessService(_ref3, config) {
38781
+ var _Digit$UserService$ge2, _Digit$UserService$ge3;
38782
+
38783
+ var tenantId = _ref3.tenantId,
38784
+ businessService = _ref3.businessService,
38785
+ filters = _objectWithoutPropertiesLoose(_ref3, _excluded2);
38786
+
38787
+ if (config === void 0) {
38788
+ config = {};
38789
+ }
38790
+
38791
+ var queryClient = reactQuery.useQueryClient();
38792
+ var isPTAccessDone = sessionStorage.getItem("IsPTAccessDone");
38793
+
38794
+ var params = _extends({
38795
+ businessService: businessService
38796
+ }, filters);
38797
+
38798
+ var _tenantId = tenantId || ((_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : (_Digit$UserService$ge3 = _Digit$UserService$ge2.info) === null || _Digit$UserService$ge3 === void 0 ? void 0 : _Digit$UserService$ge3.tenantId);
38799
+
38800
+ var _useQuery2 = reactQuery.useQuery(["billsForBuisnessService", businessService, _extends({}, filters), config, isPTAccessDone], function () {
38801
+ return Digit.PaymentService.fetchBill(_tenantId, params);
38802
+ }, _extends({
38803
+ retry: function retry(count, err) {
38804
+ return false;
38805
+ }
38806
+ }, config)),
38807
+ isLoading = _useQuery2.isLoading,
38808
+ error = _useQuery2.error,
38809
+ isError = _useQuery2.isError,
38810
+ data = _useQuery2.data,
38811
+ status = _useQuery2.status;
38812
+
38813
+ return {
38814
+ isLoading: isLoading,
38815
+ error: error,
38816
+ isError: isError,
38817
+ data: data,
38818
+ status: status,
38819
+ revalidate: function revalidate() {
38820
+ return queryClient.invalidateQueries(["billsForBuisnessService", businessService]);
38821
+ }
38822
+ };
38823
+ };
38824
+ var useFetchPayment = function useFetchPayment(_ref4, config) {
38825
+ var tenantId = _ref4.tenantId,
38826
+ consumerCode = _ref4.consumerCode,
38827
+ businessService = _ref4.businessService;
38828
+ var queryClient = reactQuery.useQueryClient();
38829
+
38830
+ var fetchBill = function fetchBill() {
38831
+ try {
38832
+ if (businessService !== null && businessService !== void 0 && businessService.includes("PT")) {
38833
+ return Promise.resolve(Digit.PaymentService.fetchBill(tenantId, {
38834
+ consumerCode: consumerCode,
38835
+ businessService: businessService
38836
+ })).then(function (fetchedBill) {
38837
+ var _fetchedBill$Bill, _fetchedBill$Bill$, _fetchedBill$Bill$$bi, _fetchedBill$Bill$$bi2, _fetchedBill$Bill3, _fetchedBill$Bill3$, _fetchedBill$Bill3$$b;
38838
+
38839
+ var billdetail = (fetchedBill === null || fetchedBill === void 0 ? void 0 : (_fetchedBill$Bill = fetchedBill.Bill) === null || _fetchedBill$Bill === void 0 ? void 0 : (_fetchedBill$Bill$ = _fetchedBill$Bill[0]) === null || _fetchedBill$Bill$ === void 0 ? void 0 : (_fetchedBill$Bill$$bi = _fetchedBill$Bill$.billDetails) === null || _fetchedBill$Bill$$bi === void 0 ? void 0 : (_fetchedBill$Bill$$bi2 = _fetchedBill$Bill$$bi.sort(function (a, b) {
38840
+ return b.fromPeriod - a.fromPeriod;
38841
+ })) === null || _fetchedBill$Bill$$bi2 === void 0 ? void 0 : _fetchedBill$Bill$$bi2[0]) || {};
38842
+ fetchedBill.Bill[0].billDetails = fetchedBill.Bill[0].billDetails.map(function (ele) {
38843
+ var _fetchedBill$Bill2, _fetchedBill$Bill2$;
38844
+
38845
+ return _extends({}, ele, {
38846
+ currentBillNo: fetchedBill === null || fetchedBill === void 0 ? void 0 : (_fetchedBill$Bill2 = fetchedBill.Bill) === null || _fetchedBill$Bill2 === void 0 ? void 0 : (_fetchedBill$Bill2$ = _fetchedBill$Bill2[0]) === null || _fetchedBill$Bill2$ === void 0 ? void 0 : _fetchedBill$Bill2$.billNumber,
38847
+ currentExpiryDate: billdetail === null || billdetail === void 0 ? void 0 : billdetail.expiryDate
38848
+ });
38849
+ });
38850
+
38851
+ if (fetchedBill && (fetchedBill === null || fetchedBill === void 0 ? void 0 : (_fetchedBill$Bill3 = fetchedBill.Bill) === null || _fetchedBill$Bill3 === void 0 ? void 0 : (_fetchedBill$Bill3$ = _fetchedBill$Bill3[0]) === null || _fetchedBill$Bill3$ === void 0 ? void 0 : (_fetchedBill$Bill3$$b = _fetchedBill$Bill3$.billDetails) === null || _fetchedBill$Bill3$$b === void 0 ? void 0 : _fetchedBill$Bill3$$b.length) > 1) {
38852
+ var _fetchedBill$Bill4, _fetchedBill$Bill4$, _fetchedBill$Bill4$$b;
38853
+
38854
+ fetchedBill === null || fetchedBill === void 0 ? void 0 : (_fetchedBill$Bill4 = fetchedBill.Bill) === null || _fetchedBill$Bill4 === void 0 ? void 0 : (_fetchedBill$Bill4$ = _fetchedBill$Bill4[0]) === null || _fetchedBill$Bill4$ === void 0 ? void 0 : (_fetchedBill$Bill4$$b = _fetchedBill$Bill4$.billDetails) === null || _fetchedBill$Bill4$$b === void 0 ? void 0 : _fetchedBill$Bill4$$b.map(function (billdet) {
38855
+ try {
38856
+ return Promise.resolve(Digit.PaymentService.searchBill(tenantId, {
38857
+ consumerCode: consumerCode,
38858
+ fromPeriod: billdet === null || billdet === void 0 ? void 0 : billdet.fromPeriod,
38859
+ toPeriod: billdet === null || billdet === void 0 ? void 0 : billdet.toPeriod,
38860
+ service: businessService,
38861
+ retrieveOldest: true
38862
+ })).then(function (searchBill) {
38863
+ var _searchBill$Bill, _searchBill$Bill$, _searchBill$Bill$$bil, _searchBill$Bill$$bil2, _searchBill$Bill2, _searchBill$Bill2$;
38864
+
38865
+ billdet.expiryDate = searchBill === null || searchBill === void 0 ? void 0 : (_searchBill$Bill = searchBill.Bill) === null || _searchBill$Bill === void 0 ? void 0 : (_searchBill$Bill$ = _searchBill$Bill[0]) === null || _searchBill$Bill$ === void 0 ? void 0 : (_searchBill$Bill$$bil = _searchBill$Bill$.billDetails) === null || _searchBill$Bill$$bil === void 0 ? void 0 : (_searchBill$Bill$$bil2 = _searchBill$Bill$$bil[0]) === null || _searchBill$Bill$$bil2 === void 0 ? void 0 : _searchBill$Bill$$bil2.expiryDate;
38866
+ billdet.billNumber = searchBill === null || searchBill === void 0 ? void 0 : (_searchBill$Bill2 = searchBill.Bill) === null || _searchBill$Bill2 === void 0 ? void 0 : (_searchBill$Bill2$ = _searchBill$Bill2[0]) === null || _searchBill$Bill2$ === void 0 ? void 0 : _searchBill$Bill2$.billNumber;
38867
+ });
38868
+ } catch (e) {
38869
+ return Promise.reject(e);
38870
+ }
38871
+ });
38872
+ }
38873
+
38874
+ return fetchedBill;
38875
+ });
38876
+ } else {
38877
+ return Promise.resolve(Digit.PaymentService.fetchBill(tenantId, {
38878
+ consumerCode: consumerCode,
38879
+ businessService: businessService
38880
+ }));
38881
+ }
38882
+ } catch (e) {
38883
+ return Promise.reject(e);
38884
+ }
38885
+ };
38886
+
38887
+ var retry = function retry(failureCount, error) {
38888
+ var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
38889
+
38890
+ if ((error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.code) === "EG_BS_BILL_NO_DEMANDS_FOUND") return false;else return failureCount < 3;
38891
+ };
38892
+
38893
+ var queryData = reactQuery.useQuery(["paymentFetchDetails", tenantId, consumerCode, businessService], function () {
38894
+ return fetchBill();
38895
+ }, _extends({
38896
+ retry: retry
38897
+ }, config));
38898
+ return _extends({}, queryData, {
37771
38899
  revalidate: function revalidate() {
37772
38900
  return queryClient.invalidateQueries(["paymentFetchDetails", tenantId, consumerCode, businessService]);
37773
38901
  }
@@ -41350,7 +42478,7 @@ var PTSearch = {
41350
42478
  value: owner === null || owner === void 0 ? void 0 : owner.emailId
41351
42479
  }, {
41352
42480
  title: "PT_OWNERSHIP_INFO_CORR_ADDR",
41353
- value: owner === null || owner === void 0 ? void 0 : owner.correspondenceAddress
42481
+ value: owner === null || owner === void 0 ? void 0 : owner.permanentAddress
41354
42482
  }]
41355
42483
  };
41356
42484
  })
@@ -42267,7 +43395,7 @@ var useTradeLicenseMDMS = function useTradeLicenseMDMS(tenantId, moduleCode, typ
42267
43395
  };
42268
43396
 
42269
43397
  var useTLDocumentSearch = function useTLDocumentSearch(data1, config) {
42270
- var _data, _data$value, _data$value$tradeLice, _data2, _data2$value, _data2$value$owners, _data2$value$owners$d, _data3, _data3$value, _data3$value$owners, _data3$value$owners$d, _data4, _data4$value, _data4$value$owners, _data4$value$owners$d;
43398
+ var _data, _data$value, _data$value$tradeLice, _data2, _data2$value, _data3, _data3$value, _data3$value$workflow, _data4, _data4$value, _data4$value$owners, _data4$value$owners$d, _data5, _data5$value, _data5$value$owners, _data5$value$owners$d, _data6, _data6$value, _data6$value$owners, _data6$value$owners$d;
42271
43399
 
42272
43400
  if (data1 === void 0) {
42273
43401
  data1 = {};
@@ -42279,9 +43407,12 @@ var useTLDocumentSearch = function useTLDocumentSearch(data1, config) {
42279
43407
  var filesArray = window.location.href.includes("/tl/tradelicence/application/") ? (_data = data1) === null || _data === void 0 ? void 0 : (_data$value = _data.value) === null || _data$value === void 0 ? void 0 : (_data$value$tradeLice = _data$value.tradeLicenseDetail) === null || _data$value$tradeLice === void 0 ? void 0 : _data$value$tradeLice.applicationDocuments.map(function (ob) {
42280
43408
  return ob === null || ob === void 0 ? void 0 : ob.fileStoreId;
42281
43409
  }) : [];
42282
- if ((_data2 = data1) !== null && _data2 !== void 0 && (_data2$value = _data2.value) !== null && _data2$value !== void 0 && (_data2$value$owners = _data2$value.owners) !== null && _data2$value$owners !== void 0 && (_data2$value$owners$d = _data2$value$owners.documents["OwnerPhotoProof"]) !== null && _data2$value$owners$d !== void 0 && _data2$value$owners$d.fileStoreId) filesArray.push(data1.value.owners.documents["OwnerPhotoProof"].fileStoreId);
42283
- if ((_data3 = data1) !== null && _data3 !== void 0 && (_data3$value = _data3.value) !== null && _data3$value !== void 0 && (_data3$value$owners = _data3$value.owners) !== null && _data3$value$owners !== void 0 && (_data3$value$owners$d = _data3$value$owners.documents["ProofOfIdentity"]) !== null && _data3$value$owners$d !== void 0 && _data3$value$owners$d.fileStoreId) filesArray.push(data1.value.owners.documents["ProofOfIdentity"].fileStoreId);
42284
- if ((_data4 = data1) !== null && _data4 !== void 0 && (_data4$value = _data4.value) !== null && _data4$value !== void 0 && (_data4$value$owners = _data4$value.owners) !== null && _data4$value$owners !== void 0 && (_data4$value$owners$d = _data4$value$owners.documents["ProofOfOwnership"]) !== null && _data4$value$owners$d !== void 0 && _data4$value$owners$d.fileStoreId) filesArray.push(data1.value.owners.documents["ProofOfOwnership"].fileStoreId);
43410
+ if ((_data2 = data1) !== null && _data2 !== void 0 && (_data2$value = _data2.value) !== null && _data2$value !== void 0 && _data2$value.workflowDocs) filesArray = (_data3 = data1) === null || _data3 === void 0 ? void 0 : (_data3$value = _data3.value) === null || _data3$value === void 0 ? void 0 : (_data3$value$workflow = _data3$value.workflowDocs) === null || _data3$value$workflow === void 0 ? void 0 : _data3$value$workflow.map(function (ob) {
43411
+ return ob === null || ob === void 0 ? void 0 : ob.fileStoreId;
43412
+ });
43413
+ if ((_data4 = data1) !== null && _data4 !== void 0 && (_data4$value = _data4.value) !== null && _data4$value !== void 0 && (_data4$value$owners = _data4$value.owners) !== null && _data4$value$owners !== void 0 && (_data4$value$owners$d = _data4$value$owners.documents["OwnerPhotoProof"]) !== null && _data4$value$owners$d !== void 0 && _data4$value$owners$d.fileStoreId) filesArray.push(data1.value.owners.documents["OwnerPhotoProof"].fileStoreId);
43414
+ if ((_data5 = data1) !== null && _data5 !== void 0 && (_data5$value = _data5.value) !== null && _data5$value !== void 0 && (_data5$value$owners = _data5$value.owners) !== null && _data5$value$owners !== void 0 && (_data5$value$owners$d = _data5$value$owners.documents["ProofOfIdentity"]) !== null && _data5$value$owners$d !== void 0 && _data5$value$owners$d.fileStoreId) filesArray.push(data1.value.owners.documents["ProofOfIdentity"].fileStoreId);
43415
+ if ((_data6 = data1) !== null && _data6 !== void 0 && (_data6$value = _data6.value) !== null && _data6$value !== void 0 && (_data6$value$owners = _data6$value.owners) !== null && _data6$value$owners !== void 0 && (_data6$value$owners$d = _data6$value$owners.documents["ProofOfOwnership"]) !== null && _data6$value$owners$d !== void 0 && _data6$value$owners$d.fileStoreId) filesArray.push(data1.value.owners.documents["ProofOfOwnership"].fileStoreId);
42285
43416
 
42286
43417
  var _useQuery = reactQuery.useQuery(["tlDocuments-" + 1, filesArray], function () {
42287
43418
  return Digit.UploadServices.Filefetch(filesArray, tenant);
@@ -42591,7 +43722,7 @@ var TLSearch = {
42591
43722
  value: response !== null && response !== void 0 && (_response$tradeLicens2 = response.tradeLicenseDetail) !== null && _response$tradeLicens2 !== void 0 && _response$tradeLicens2.structureType ? "COMMON_MASTERS_STRUCTURETYPE_" + (response === null || response === void 0 ? void 0 : (_response$tradeLicens3 = response.tradeLicenseDetail) === null || _response$tradeLicens3 === void 0 ? void 0 : (_response$tradeLicens4 = _response$tradeLicens3.structureType) === null || _response$tradeLicens4 === void 0 ? void 0 : _response$tradeLicens4.split(".")[0]) : "NA"
42592
43723
  }, {
42593
43724
  title: "TL_NEW_TRADE_DETAILS_STRUCT_SUB_TYPE_LABEL",
42594
- value: response !== null && response !== void 0 && (_response$tradeLicens5 = response.tradeLicenseDetail) !== null && _response$tradeLicens5 !== void 0 && _response$tradeLicens5.structureType ? "COMMON_MASTERS_STRUCTURETYPE_" + stringReplaceAll$2(response === null || response === void 0 ? void 0 : (_response$tradeLicens6 = response.tradeLicenseDetail) === null || _response$tradeLicens6 === void 0 ? void 0 : _response$tradeLicens6.structureType, ".", "_") : "NA"
43725
+ value: response !== null && response !== void 0 && (_response$tradeLicens5 = response.tradeLicenseDetail) !== null && _response$tradeLicens5 !== void 0 && _response$tradeLicens5.structureType ? "TL_" + (response === null || response === void 0 ? void 0 : (_response$tradeLicens6 = response.tradeLicenseDetail) === null || _response$tradeLicens6 === void 0 ? void 0 : _response$tradeLicens6.tradeType) : "NA"
42595
43726
  }, {
42596
43727
  title: "TL_NEW_TRADE_DETAILS_TRADE_COMM_DATE_LABEL",
42597
43728
  value: response !== null && response !== void 0 && response.commencementDate ? convertEpochToDate(response === null || response === void 0 ? void 0 : response.commencementDate) : "NA"
@@ -43536,13 +44667,14 @@ var SearchMdmsTypes = {
43536
44667
  var _data$BPA3, _data$BPA3$BPAAppicat;
43537
44668
 
43538
44669
  return [].concat(data === null || data === void 0 ? void 0 : (_data$BPA3 = data.BPA) === null || _data$BPA3 === void 0 ? void 0 : (_data$BPA3$BPAAppicat = _data$BPA3.BPAAppicationMapping) === null || _data$BPA3$BPAAppicat === void 0 ? void 0 : _data$BPA3$BPAAppicat.filter(function (currentObject) {
43539
- var _currentObject$roles;
44670
+ var _userInfo$value, _currentObject$roles;
43540
44671
 
44672
+ var userInfos = sessionStorage.getItem("Digit.citizen.userRequestObject");
44673
+ var userInfo = userInfos ? JSON.parse(userInfos) : {};
44674
+ var userInformation = userInfo === null || userInfo === void 0 ? void 0 : (_userInfo$value = userInfo.value) === null || _userInfo$value === void 0 ? void 0 : _userInfo$value.info;
43541
44675
  var flag = 0;
43542
44676
  currentObject === null || currentObject === void 0 ? void 0 : (_currentObject$roles = currentObject.roles) === null || _currentObject$roles === void 0 ? void 0 : _currentObject$roles.map(function (bpaRole) {
43543
- var _Digit$UserService$ge, _Digit$UserService$ge2;
43544
-
43545
- var found = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : (_Digit$UserService$ge2 = _Digit$UserService$ge.info) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.roles.some(function (role) {
44677
+ var found = userInformation === null || userInformation === void 0 ? void 0 : userInformation.roles.some(function (role) {
43546
44678
  return (role === null || role === void 0 ? void 0 : role.code) === bpaRole;
43547
44679
  });
43548
44680
  if (found == true) flag = 1;
@@ -43860,21 +44992,124 @@ var OBPSService = {
43860
44992
  isEmployee: true
43861
44993
  })).then(function (paymentRes) {
43862
44994
  return Promise.resolve(MdmsService.getMultipleTypes(License === null || License === void 0 ? void 0 : License.tenantId, "StakeholderRegistraition", ["TradeTypetoRoleMapping"])).then(function (mdmsRes) {
43863
- var _License$tradeLicense, _License$tradeLicense2, _mdmsRes$StakeholderR, _mdmsRes$StakeholderR2, _License$tradeLicense8, _License$tradeLicense9, _License$tradeLicense10, _License$tradeLicense11, _License$tradeLicense12, _License$tradeLicense13, _License$tradeLicense14, _License$tradeLicense15, _License$tradeLicense16, _License$tradeLicense17, _License$tradeLicense18, _License$tradeLicense19, _License$tradeLicense20, _License$tradeLicense21, _License$tradeLicense22, _License$tradeLicense23, _License$tradeLicense24, _License$tradeLicense25, _License$tradeLicense26, _License$tradeLicense27, _License$tradeLicense28, _License$tradeLicense29, _License$tradeLicense30, _License$tradeLicense31, _License$tradeLicense32, _License$tradeLicense33, _License$tradeLicense34, _License$tradeLicense35, _License$tradeLicense36, _License$tradeLicense37, _License$tradeLicense38, _License$tradeLicense39, _License$tradeLicense40, _License$tradeLicense41, _License$tradeLicense42, _License$tradeLicense43, _paymentRes$Payments, _paymentRes$Payments2, _paymentRes$Payments3, _paymentRes$Payments4, _paymentRes$Payments5, _ref;
44995
+ var _License$tradeLicense37, _License$tradeLicense38, _mdmsRes$StakeholderR, _mdmsRes$StakeholderR2, _License$tradeLicense44, _License$tradeLicense45;
44996
+
44997
+ function _temp2() {
44998
+ var _License$tradeLicense, _License$tradeLicense2, _License$tradeLicense3, _License$tradeLicense4, _License$tradeLicense5, _License$tradeLicense6, _License$tradeLicense7, _License$tradeLicense8, _License$tradeLicense9, _License$tradeLicense10, _License$tradeLicense11, _License$tradeLicense12, _License$tradeLicense13, _License$tradeLicense14, _License$tradeLicense15, _License$tradeLicense16, _License$tradeLicense17, _License$tradeLicense18, _License$tradeLicense19, _License$tradeLicense20, _License$tradeLicense21, _License$tradeLicense22, _License$tradeLicense23, _License$tradeLicense24, _License$tradeLicense25, _License$tradeLicense26, _License$tradeLicense27, _License$tradeLicense28, _License$tradeLicense29, _License$tradeLicense30, _License$tradeLicense31, _License$tradeLicense32, _License$tradeLicense33, _License$tradeLicense34, _License$tradeLicense35, _License$tradeLicense36, _paymentRes$Payments, _paymentRes$Payments2, _paymentRes$Payments3, _paymentRes$Payments4, _paymentRes$Payments5, _ref;
44999
+
45000
+ var details = [{
45001
+ title: " ",
45002
+ values: [{
45003
+ title: "BPA_APPLICATION_NUMBER_LABEL",
45004
+ value: (License === null || License === void 0 ? void 0 : License.applicationNumber) || "NA"
45005
+ }]
45006
+ }, License !== null && License !== void 0 && (_License$tradeLicense = License.tradeLicenseDetail) !== null && _License$tradeLicense !== void 0 && (_License$tradeLicense2 = _License$tradeLicense.tradeUnits) !== null && _License$tradeLicense2 !== void 0 && (_License$tradeLicense3 = _License$tradeLicense2[0]) !== null && _License$tradeLicense3 !== void 0 && _License$tradeLicense3.tradeType.includes("ARCHITECT") ? {
45007
+ title: "BPA_LICENSE_DETAILS_LABEL",
45008
+ asSectionHeader: true,
45009
+ values: [{
45010
+ title: "BPA_LICENSE_TYPE",
45011
+ value: "TRADELICENSE_TRADETYPE_" + (License === null || License === void 0 ? void 0 : (_License$tradeLicense4 = License.tradeLicenseDetail) === null || _License$tradeLicense4 === void 0 ? void 0 : (_License$tradeLicense5 = _License$tradeLicense4.tradeUnits) === null || _License$tradeLicense5 === void 0 ? void 0 : (_License$tradeLicense6 = _License$tradeLicense5[0]) === null || _License$tradeLicense6 === void 0 ? void 0 : (_License$tradeLicense7 = _License$tradeLicense6.tradeType) === null || _License$tradeLicense7 === void 0 ? void 0 : _License$tradeLicense7.split(".")[0]) || "NA"
45012
+ }, {
45013
+ title: "BPA_COUNCIL_OF_ARCH_NO_LABEL",
45014
+ value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense8 = License.tradeLicenseDetail) === null || _License$tradeLicense8 === void 0 ? void 0 : (_License$tradeLicense9 = _License$tradeLicense8.additionalDetail) === null || _License$tradeLicense9 === void 0 ? void 0 : _License$tradeLicense9.counsilForArchNo) || "NA"
45015
+ }]
45016
+ } : {
45017
+ title: "BPA_LICENSE_DETAILS_LABEL",
45018
+ asSectionHeader: true,
45019
+ values: [{
45020
+ title: "BPA_LICENSE_TYPE",
45021
+ value: "TRADELICENSE_TRADETYPE_" + (License === null || License === void 0 ? void 0 : (_License$tradeLicense10 = License.tradeLicenseDetail) === null || _License$tradeLicense10 === void 0 ? void 0 : (_License$tradeLicense11 = _License$tradeLicense10.tradeUnits) === null || _License$tradeLicense11 === void 0 ? void 0 : (_License$tradeLicense12 = _License$tradeLicense11[0]) === null || _License$tradeLicense12 === void 0 ? void 0 : (_License$tradeLicense13 = _License$tradeLicense12.tradeType) === null || _License$tradeLicense13 === void 0 ? void 0 : _License$tradeLicense13.split(".")[0]) || "NA"
45022
+ }]
45023
+ }, {
45024
+ title: "BPA_LICENSEE_DETAILS_HEADER_OWNER_INFO",
45025
+ asSectionHeader: true,
45026
+ values: [{
45027
+ title: "BPA_APPLICANT_NAME_LABEL",
45028
+ value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense14 = License.tradeLicenseDetail) === null || _License$tradeLicense14 === void 0 ? void 0 : (_License$tradeLicense15 = _License$tradeLicense14.owners) === null || _License$tradeLicense15 === void 0 ? void 0 : (_License$tradeLicense16 = _License$tradeLicense15[0]) === null || _License$tradeLicense16 === void 0 ? void 0 : _License$tradeLicense16.name) || "NA"
45029
+ }, {
45030
+ title: "BPA_APPLICANT_GENDER_LABEL",
45031
+ value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense17 = License.tradeLicenseDetail) === null || _License$tradeLicense17 === void 0 ? void 0 : (_License$tradeLicense18 = _License$tradeLicense17.owners) === null || _License$tradeLicense18 === void 0 ? void 0 : (_License$tradeLicense19 = _License$tradeLicense18[0]) === null || _License$tradeLicense19 === void 0 ? void 0 : _License$tradeLicense19.gender) || "NA"
45032
+ }, {
45033
+ title: "BPA_OWNER_MOBILE_NO_LABEL",
45034
+ value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense20 = License.tradeLicenseDetail) === null || _License$tradeLicense20 === void 0 ? void 0 : (_License$tradeLicense21 = _License$tradeLicense20.owners) === null || _License$tradeLicense21 === void 0 ? void 0 : (_License$tradeLicense22 = _License$tradeLicense21[0]) === null || _License$tradeLicense22 === void 0 ? void 0 : _License$tradeLicense22.mobileNumber) || "NA"
45035
+ }, {
45036
+ title: "BPA_APPLICANT_EMAIL_LABEL",
45037
+ value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense23 = License.tradeLicenseDetail) === null || _License$tradeLicense23 === void 0 ? void 0 : (_License$tradeLicense24 = _License$tradeLicense23.owners) === null || _License$tradeLicense24 === void 0 ? void 0 : (_License$tradeLicense25 = _License$tradeLicense24[0]) === null || _License$tradeLicense25 === void 0 ? void 0 : _License$tradeLicense25.emailId) || "NA"
45038
+ }, {
45039
+ title: "BPA_APPLICANT_PAN_NO",
45040
+ value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense26 = License.tradeLicenseDetail) === null || _License$tradeLicense26 === void 0 ? void 0 : (_License$tradeLicense27 = _License$tradeLicense26.owners) === null || _License$tradeLicense27 === void 0 ? void 0 : (_License$tradeLicense28 = _License$tradeLicense27[0]) === null || _License$tradeLicense28 === void 0 ? void 0 : _License$tradeLicense28.pan) || "NA"
45041
+ }]
45042
+ }, {
45043
+ title: "BPA_PERMANANT_ADDRESS_LABEL",
45044
+ asSectionHeader: true,
45045
+ values: [{
45046
+ title: "BPA_PERMANANT_ADDRESS_LABEL",
45047
+ value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense29 = License.tradeLicenseDetail) === null || _License$tradeLicense29 === void 0 ? void 0 : (_License$tradeLicense30 = _License$tradeLicense29.owners) === null || _License$tradeLicense30 === void 0 ? void 0 : (_License$tradeLicense31 = _License$tradeLicense30[0]) === null || _License$tradeLicense31 === void 0 ? void 0 : _License$tradeLicense31.permanentAddress) || "NA"
45048
+ }]
45049
+ }, {
45050
+ title: "BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL",
45051
+ asSectionHeader: true,
45052
+ values: [{
45053
+ title: "BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL",
45054
+ value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense32 = License.tradeLicenseDetail) === null || _License$tradeLicense32 === void 0 ? void 0 : (_License$tradeLicense33 = _License$tradeLicense32.owners) === null || _License$tradeLicense33 === void 0 ? void 0 : (_License$tradeLicense34 = _License$tradeLicense33[0]) === null || _License$tradeLicense34 === void 0 ? void 0 : _License$tradeLicense34.correspondenceAddress) || "NA"
45055
+ }]
45056
+ }, {
45057
+ title: "BPA_DOCUMENT_DETAILS_LABEL",
45058
+ asSectionHeader: true,
45059
+ additionalDetails: {
45060
+ documentsWithUrl: [{
45061
+ title: "",
45062
+ values: License === null || License === void 0 ? void 0 : (_License$tradeLicense35 = License.tradeLicenseDetail) === null || _License$tradeLicense35 === void 0 ? void 0 : (_License$tradeLicense36 = _License$tradeLicense35.applicationDocuments) === null || _License$tradeLicense36 === void 0 ? void 0 : _License$tradeLicense36.map(function (doc) {
45063
+ var _doc$documentType, _fileDetails, _fileDetails2, _fileDetails2$data$do;
45064
+
45065
+ return {
45066
+ title: "BPAREG_HEADER_" + (doc === null || doc === void 0 ? void 0 : (_doc$documentType = doc.documentType) === null || _doc$documentType === void 0 ? void 0 : _doc$documentType.replaceAll('.', '_')),
45067
+ documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
45068
+ documentUid: doc === null || doc === void 0 ? void 0 : doc.documentUid,
45069
+ fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
45070
+ id: doc === null || doc === void 0 ? void 0 : doc.id,
45071
+ docInfo: doc === null || doc === void 0 ? void 0 : doc.info,
45072
+ url: (_fileDetails = fileDetails) !== null && _fileDetails !== void 0 && _fileDetails.data[doc === null || doc === void 0 ? void 0 : doc.fileStoreId] ? (_fileDetails2 = fileDetails) === null || _fileDetails2 === void 0 ? void 0 : (_fileDetails2$data$do = _fileDetails2.data[doc === null || doc === void 0 ? void 0 : doc.fileStoreId]) === null || _fileDetails2$data$do === void 0 ? void 0 : _fileDetails2$data$do.split(',')[0] : ""
45073
+ };
45074
+ })
45075
+ }]
45076
+ }
45077
+ }, (paymentRes === null || paymentRes === void 0 ? void 0 : (_paymentRes$Payments = paymentRes.Payments) === null || _paymentRes$Payments === void 0 ? void 0 : _paymentRes$Payments.length) > 0 && {
45078
+ title: "BPA_FEE_DETAILS_LABEL",
45079
+ additionalDetails: {
45080
+ inspectionReport: [],
45081
+ values: [{
45082
+ title: "BPAREG_FEES",
45083
+ value: /*#__PURE__*/React__default.createElement("span", null, "\u20B9", paymentRes === null || paymentRes === void 0 ? void 0 : (_paymentRes$Payments2 = paymentRes.Payments) === null || _paymentRes$Payments2 === void 0 ? void 0 : (_paymentRes$Payments3 = _paymentRes$Payments2[0]) === null || _paymentRes$Payments3 === void 0 ? void 0 : _paymentRes$Payments3.totalAmountPaid)
45084
+ }, (_ref = {
45085
+ title: "BPA_STATUS_LABEL",
45086
+ isTransLate: true,
45087
+ isStatus: true,
45088
+ value: paymentRes !== null && paymentRes !== void 0 && (_paymentRes$Payments4 = paymentRes.Payments) !== null && _paymentRes$Payments4 !== void 0 && (_paymentRes$Payments5 = _paymentRes$Payments4[0]) !== null && _paymentRes$Payments5 !== void 0 && _paymentRes$Payments5.totalAmountPaid ? "WF_BPA_PAID" : "NA"
45089
+ }, _ref["isTransLate"] = true, _ref)]
45090
+ }
45091
+ }];
45092
+ return {
45093
+ applicationData: License,
45094
+ applicationDetails: details,
45095
+ tenantId: License === null || License === void 0 ? void 0 : License.tenantId,
45096
+ payments: (paymentRes === null || paymentRes === void 0 ? void 0 : paymentRes.Payments) || []
45097
+ };
45098
+ }
43864
45099
 
43865
- if (License !== null && License !== void 0 && (_License$tradeLicense = License.tradeLicenseDetail) !== null && _License$tradeLicense !== void 0 && (_License$tradeLicense2 = _License$tradeLicense.applicationDocuments) !== null && _License$tradeLicense2 !== void 0 && _License$tradeLicense2.length && (mdmsRes === null || mdmsRes === void 0 ? void 0 : (_mdmsRes$StakeholderR = mdmsRes.StakeholderRegistraition) === null || _mdmsRes$StakeholderR === void 0 ? void 0 : (_mdmsRes$StakeholderR2 = _mdmsRes$StakeholderR.TradeTypetoRoleMapping) === null || _mdmsRes$StakeholderR2 === void 0 ? void 0 : _mdmsRes$StakeholderR2.length) > 0) {
45100
+ if (License !== null && License !== void 0 && (_License$tradeLicense37 = License.tradeLicenseDetail) !== null && _License$tradeLicense37 !== void 0 && (_License$tradeLicense38 = _License$tradeLicense37.applicationDocuments) !== null && _License$tradeLicense38 !== void 0 && _License$tradeLicense38.length && (mdmsRes === null || mdmsRes === void 0 ? void 0 : (_mdmsRes$StakeholderR = mdmsRes.StakeholderRegistraition) === null || _mdmsRes$StakeholderR === void 0 ? void 0 : (_mdmsRes$StakeholderR2 = _mdmsRes$StakeholderR.TradeTypetoRoleMapping) === null || _mdmsRes$StakeholderR2 === void 0 ? void 0 : _mdmsRes$StakeholderR2.length) > 0) {
43866
45101
  var _mdmsRes$StakeholderR3, _mdmsRes$StakeholderR4;
43867
45102
 
43868
45103
  mdmsRes === null || mdmsRes === void 0 ? void 0 : (_mdmsRes$StakeholderR3 = mdmsRes.StakeholderRegistraition) === null || _mdmsRes$StakeholderR3 === void 0 ? void 0 : (_mdmsRes$StakeholderR4 = _mdmsRes$StakeholderR3.TradeTypetoRoleMapping) === null || _mdmsRes$StakeholderR4 === void 0 ? void 0 : _mdmsRes$StakeholderR4.map(function (doc) {
43869
- var _doc$docTypes, _License$tradeLicense3, _License$tradeLicense4, _License$tradeLicense5;
45104
+ var _doc$docTypes, _License$tradeLicense39, _License$tradeLicense40, _License$tradeLicense41;
43870
45105
 
43871
- if ((doc === null || doc === void 0 ? void 0 : (_doc$docTypes = doc.docTypes) === null || _doc$docTypes === void 0 ? void 0 : _doc$docTypes.length) > 0 && (doc === null || doc === void 0 ? void 0 : doc.tradeType) == (License === null || License === void 0 ? void 0 : (_License$tradeLicense3 = License.tradeLicenseDetail) === null || _License$tradeLicense3 === void 0 ? void 0 : (_License$tradeLicense4 = _License$tradeLicense3.tradeUnits) === null || _License$tradeLicense4 === void 0 ? void 0 : (_License$tradeLicense5 = _License$tradeLicense4[0]) === null || _License$tradeLicense5 === void 0 ? void 0 : _License$tradeLicense5.tradeType)) {
45106
+ if ((doc === null || doc === void 0 ? void 0 : (_doc$docTypes = doc.docTypes) === null || _doc$docTypes === void 0 ? void 0 : _doc$docTypes.length) > 0 && (doc === null || doc === void 0 ? void 0 : doc.tradeType) == (License === null || License === void 0 ? void 0 : (_License$tradeLicense39 = License.tradeLicenseDetail) === null || _License$tradeLicense39 === void 0 ? void 0 : (_License$tradeLicense40 = _License$tradeLicense39.tradeUnits) === null || _License$tradeLicense40 === void 0 ? void 0 : (_License$tradeLicense41 = _License$tradeLicense40[0]) === null || _License$tradeLicense41 === void 0 ? void 0 : _License$tradeLicense41.tradeType)) {
43872
45107
  var _doc$docTypes2;
43873
45108
 
43874
45109
  doc === null || doc === void 0 ? void 0 : (_doc$docTypes2 = doc.docTypes) === null || _doc$docTypes2 === void 0 ? void 0 : _doc$docTypes2.map(function (docType) {
43875
- var _License$tradeLicense6, _License$tradeLicense7;
45110
+ var _License$tradeLicense42, _License$tradeLicense43;
43876
45111
 
43877
- License === null || License === void 0 ? void 0 : (_License$tradeLicense6 = License.tradeLicenseDetail) === null || _License$tradeLicense6 === void 0 ? void 0 : (_License$tradeLicense7 = _License$tradeLicense6.applicationDocuments) === null || _License$tradeLicense7 === void 0 ? void 0 : _License$tradeLicense7.forEach(function (document) {
45112
+ License === null || License === void 0 ? void 0 : (_License$tradeLicense42 = License.tradeLicenseDetail) === null || _License$tradeLicense42 === void 0 ? void 0 : (_License$tradeLicense43 = _License$tradeLicense42.applicationDocuments) === null || _License$tradeLicense43 === void 0 ? void 0 : _License$tradeLicense43.forEach(function (document) {
43878
45113
  if ((docType === null || docType === void 0 ? void 0 : docType.code) == (document === null || document === void 0 ? void 0 : document.documentType) && docType !== null && docType !== void 0 && docType.info) document.info = docType === null || docType === void 0 ? void 0 : docType.info;
43879
45114
  });
43880
45115
  });
@@ -43882,103 +45117,20 @@ var OBPSService = {
43882
45117
  });
43883
45118
  }
43884
45119
 
43885
- var details = [{
43886
- title: " ",
43887
- values: [{
43888
- title: "BPA_APPLICATION_NUMBER_LABEL",
43889
- value: (License === null || License === void 0 ? void 0 : License.applicationNumber) || "NA"
43890
- }]
43891
- }, License !== null && License !== void 0 && (_License$tradeLicense8 = License.tradeLicenseDetail) !== null && _License$tradeLicense8 !== void 0 && (_License$tradeLicense9 = _License$tradeLicense8.tradeUnits) !== null && _License$tradeLicense9 !== void 0 && (_License$tradeLicense10 = _License$tradeLicense9[0]) !== null && _License$tradeLicense10 !== void 0 && _License$tradeLicense10.tradeType.includes("ARCHITECT") ? {
43892
- title: "BPA_LICENSE_DETAILS_LABEL",
43893
- asSectionHeader: true,
43894
- values: [{
43895
- title: "BPA_LICENSE_TYPE",
43896
- value: "TRADELICENSE_TRADETYPE_" + (License === null || License === void 0 ? void 0 : (_License$tradeLicense11 = License.tradeLicenseDetail) === null || _License$tradeLicense11 === void 0 ? void 0 : (_License$tradeLicense12 = _License$tradeLicense11.tradeUnits) === null || _License$tradeLicense12 === void 0 ? void 0 : (_License$tradeLicense13 = _License$tradeLicense12[0]) === null || _License$tradeLicense13 === void 0 ? void 0 : (_License$tradeLicense14 = _License$tradeLicense13.tradeType) === null || _License$tradeLicense14 === void 0 ? void 0 : _License$tradeLicense14.split(".")[0]) || "NA"
43897
- }, {
43898
- title: "BPA_COUNCIL_OF_ARCH_NO_LABEL",
43899
- value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense15 = License.tradeLicenseDetail) === null || _License$tradeLicense15 === void 0 ? void 0 : (_License$tradeLicense16 = _License$tradeLicense15.additionalDetail) === null || _License$tradeLicense16 === void 0 ? void 0 : _License$tradeLicense16.counsilForArchNo) || "NA"
43900
- }]
43901
- } : {
43902
- title: "BPA_LICENSE_DETAILS_LABEL",
43903
- asSectionHeader: true,
43904
- values: [{
43905
- title: "BPA_LICENSE_TYPE",
43906
- value: "TRADELICENSE_TRADETYPE_" + (License === null || License === void 0 ? void 0 : (_License$tradeLicense17 = License.tradeLicenseDetail) === null || _License$tradeLicense17 === void 0 ? void 0 : (_License$tradeLicense18 = _License$tradeLicense17.tradeUnits) === null || _License$tradeLicense18 === void 0 ? void 0 : (_License$tradeLicense19 = _License$tradeLicense18[0]) === null || _License$tradeLicense19 === void 0 ? void 0 : (_License$tradeLicense20 = _License$tradeLicense19.tradeType) === null || _License$tradeLicense20 === void 0 ? void 0 : _License$tradeLicense20.split(".")[0]) || "NA"
43907
- }]
43908
- }, {
43909
- title: "BPA_LICENSEE_DETAILS_HEADER_OWNER_INFO",
43910
- asSectionHeader: true,
43911
- values: [{
43912
- title: "BPA_APPLICANT_NAME_LABEL",
43913
- value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense21 = License.tradeLicenseDetail) === null || _License$tradeLicense21 === void 0 ? void 0 : (_License$tradeLicense22 = _License$tradeLicense21.owners) === null || _License$tradeLicense22 === void 0 ? void 0 : (_License$tradeLicense23 = _License$tradeLicense22[0]) === null || _License$tradeLicense23 === void 0 ? void 0 : _License$tradeLicense23.name) || "NA"
43914
- }, {
43915
- title: "BPA_APPLICANT_GENDER_LABEL",
43916
- value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense24 = License.tradeLicenseDetail) === null || _License$tradeLicense24 === void 0 ? void 0 : (_License$tradeLicense25 = _License$tradeLicense24.owners) === null || _License$tradeLicense25 === void 0 ? void 0 : (_License$tradeLicense26 = _License$tradeLicense25[0]) === null || _License$tradeLicense26 === void 0 ? void 0 : _License$tradeLicense26.gender) || "NA"
43917
- }, {
43918
- title: "BPA_OWNER_MOBILE_NO_LABEL",
43919
- value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense27 = License.tradeLicenseDetail) === null || _License$tradeLicense27 === void 0 ? void 0 : (_License$tradeLicense28 = _License$tradeLicense27.owners) === null || _License$tradeLicense28 === void 0 ? void 0 : (_License$tradeLicense29 = _License$tradeLicense28[0]) === null || _License$tradeLicense29 === void 0 ? void 0 : _License$tradeLicense29.mobileNumber) || "NA"
43920
- }, {
43921
- title: "BPA_APPLICANT_EMAIL_LABEL",
43922
- value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense30 = License.tradeLicenseDetail) === null || _License$tradeLicense30 === void 0 ? void 0 : (_License$tradeLicense31 = _License$tradeLicense30.owners) === null || _License$tradeLicense31 === void 0 ? void 0 : (_License$tradeLicense32 = _License$tradeLicense31[0]) === null || _License$tradeLicense32 === void 0 ? void 0 : _License$tradeLicense32.emailId) || "NA"
43923
- }, {
43924
- title: "BPA_APPLICANT_PAN_NO",
43925
- value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense33 = License.tradeLicenseDetail) === null || _License$tradeLicense33 === void 0 ? void 0 : (_License$tradeLicense34 = _License$tradeLicense33.owners) === null || _License$tradeLicense34 === void 0 ? void 0 : (_License$tradeLicense35 = _License$tradeLicense34[0]) === null || _License$tradeLicense35 === void 0 ? void 0 : _License$tradeLicense35.pan) || "NA"
43926
- }]
43927
- }, {
43928
- title: "BPA_PERMANANT_ADDRESS_LABEL",
43929
- asSectionHeader: true,
43930
- values: [{
43931
- title: "BPA_PERMANANT_ADDRESS_LABEL",
43932
- value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense36 = License.tradeLicenseDetail) === null || _License$tradeLicense36 === void 0 ? void 0 : (_License$tradeLicense37 = _License$tradeLicense36.owners) === null || _License$tradeLicense37 === void 0 ? void 0 : (_License$tradeLicense38 = _License$tradeLicense37[0]) === null || _License$tradeLicense38 === void 0 ? void 0 : _License$tradeLicense38.permanentAddress) || "NA"
43933
- }]
43934
- }, {
43935
- title: "BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL",
43936
- asSectionHeader: true,
43937
- values: [{
43938
- title: "BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL",
43939
- value: (License === null || License === void 0 ? void 0 : (_License$tradeLicense39 = License.tradeLicenseDetail) === null || _License$tradeLicense39 === void 0 ? void 0 : (_License$tradeLicense40 = _License$tradeLicense39.owners) === null || _License$tradeLicense40 === void 0 ? void 0 : (_License$tradeLicense41 = _License$tradeLicense40[0]) === null || _License$tradeLicense41 === void 0 ? void 0 : _License$tradeLicense41.correspondenceAddress) || "NA"
43940
- }]
43941
- }, {
43942
- title: "BPA_DOCUMENT_DETAILS_LABEL",
43943
- asSectionHeader: true,
43944
- additionalDetails: {
43945
- documents: [{
43946
- title: "",
43947
- values: License === null || License === void 0 ? void 0 : (_License$tradeLicense42 = License.tradeLicenseDetail) === null || _License$tradeLicense42 === void 0 ? void 0 : (_License$tradeLicense43 = _License$tradeLicense42.applicationDocuments) === null || _License$tradeLicense43 === void 0 ? void 0 : _License$tradeLicense43.map(function (doc) {
43948
- var _doc$documentType;
45120
+ var appDocumentFileStoreIds = License === null || License === void 0 ? void 0 : (_License$tradeLicense44 = License.tradeLicenseDetail) === null || _License$tradeLicense44 === void 0 ? void 0 : (_License$tradeLicense45 = _License$tradeLicense44.applicationDocuments) === null || _License$tradeLicense45 === void 0 ? void 0 : _License$tradeLicense45.map(function (appDoc) {
45121
+ return appDoc === null || appDoc === void 0 ? void 0 : appDoc.fileStoreId;
45122
+ });
45123
+ var fileDetails = {};
43949
45124
 
43950
- return {
43951
- title: "BPAREG_HEADER_" + (doc === null || doc === void 0 ? void 0 : (_doc$documentType = doc.documentType) === null || _doc$documentType === void 0 ? void 0 : _doc$documentType.replaceAll('.', '_')),
43952
- documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
43953
- documentUid: doc === null || doc === void 0 ? void 0 : doc.documentUid,
43954
- fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
43955
- id: doc === null || doc === void 0 ? void 0 : doc.id,
43956
- docInfo: doc === null || doc === void 0 ? void 0 : doc.info
43957
- };
43958
- })
43959
- }]
45125
+ var _temp = function () {
45126
+ if ((appDocumentFileStoreIds === null || appDocumentFileStoreIds === void 0 ? void 0 : appDocumentFileStoreIds.length) > 0) {
45127
+ return Promise.resolve(UploadServices.Filefetch(appDocumentFileStoreIds, Digit.ULBService.getStateId())).then(function (_UploadServices$Filef) {
45128
+ fileDetails = _UploadServices$Filef;
45129
+ });
43960
45130
  }
43961
- }, (paymentRes === null || paymentRes === void 0 ? void 0 : (_paymentRes$Payments = paymentRes.Payments) === null || _paymentRes$Payments === void 0 ? void 0 : _paymentRes$Payments.length) > 0 && {
43962
- title: "BPA_FEE_DETAILS_LABEL",
43963
- additionalDetails: {
43964
- inspectionReport: [],
43965
- values: [{
43966
- title: "BPAREG_FEES",
43967
- value: /*#__PURE__*/React__default.createElement("span", null, "\u20B9", paymentRes === null || paymentRes === void 0 ? void 0 : (_paymentRes$Payments2 = paymentRes.Payments) === null || _paymentRes$Payments2 === void 0 ? void 0 : (_paymentRes$Payments3 = _paymentRes$Payments2[0]) === null || _paymentRes$Payments3 === void 0 ? void 0 : _paymentRes$Payments3.totalAmountPaid)
43968
- }, (_ref = {
43969
- title: "BPA_STATUS_LABEL",
43970
- isTransLate: true,
43971
- isStatus: true,
43972
- value: paymentRes !== null && paymentRes !== void 0 && (_paymentRes$Payments4 = paymentRes.Payments) !== null && _paymentRes$Payments4 !== void 0 && (_paymentRes$Payments5 = _paymentRes$Payments4[0]) !== null && _paymentRes$Payments5 !== void 0 && _paymentRes$Payments5.totalAmountPaid ? "WF_BPA_PAID" : "NA"
43973
- }, _ref["isTransLate"] = true, _ref)]
43974
- }
43975
- }];
43976
- return {
43977
- applicationData: License,
43978
- applicationDetails: details,
43979
- tenantId: License === null || License === void 0 ? void 0 : License.tenantId,
43980
- payments: (paymentRes === null || paymentRes === void 0 ? void 0 : paymentRes.Payments) || []
43981
- };
45131
+ }();
45132
+
45133
+ return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
43982
45134
  });
43983
45135
  });
43984
45136
  });
@@ -43989,16 +45141,28 @@ var OBPSService = {
43989
45141
  BPADetailsPage: function (tenantId, filters) {
43990
45142
  try {
43991
45143
  return Promise.resolve(OBPSService.BPASearch(tenantId, filters)).then(function (response) {
43992
- var _response$BPA, _response$BPA2, _response$BPA2$, _response$BPA2$$addit, _response$BPA3, _response$BPA3$, _response$BPA3$$addit;
45144
+ var _response$BPA, _response$BPA$, _response$BPA$$docume, _response$BPA2, _response$BPA2$, _response$BPA2$$addit, _response$BPA2$$addit2, _response$BPA3, _response$BPA4, _response$BPA4$, _response$BPA4$$addit, _response$BPA5, _response$BPA5$, _response$BPA5$$addit;
43993
45145
 
43994
- if (!(response !== null && response !== void 0 && (_response$BPA = response.BPA) !== null && _response$BPA !== void 0 && _response$BPA.length)) {
45146
+ var appDocumentFileStoreIds = response === null || response === void 0 ? void 0 : (_response$BPA = response.BPA) === null || _response$BPA === void 0 ? void 0 : (_response$BPA$ = _response$BPA[0]) === null || _response$BPA$ === void 0 ? void 0 : (_response$BPA$$docume = _response$BPA$.documents) === null || _response$BPA$$docume === void 0 ? void 0 : _response$BPA$$docume.map(function (docId) {
45147
+ return docId.fileStoreId;
45148
+ });
45149
+ if (!appDocumentFileStoreIds) appDocumentFileStoreIds = [];
45150
+ response === null || response === void 0 ? void 0 : (_response$BPA2 = response.BPA) === null || _response$BPA2 === void 0 ? void 0 : (_response$BPA2$ = _response$BPA2[0]) === null || _response$BPA2$ === void 0 ? void 0 : (_response$BPA2$$addit = _response$BPA2$.additionalDetails) === null || _response$BPA2$$addit === void 0 ? void 0 : (_response$BPA2$$addit2 = _response$BPA2$$addit.fieldinspection_pending) === null || _response$BPA2$$addit2 === void 0 ? void 0 : _response$BPA2$$addit2.map(function (fiData) {
45151
+ var _fiData$docs;
45152
+
45153
+ fiData === null || fiData === void 0 ? void 0 : (_fiData$docs = fiData.docs) === null || _fiData$docs === void 0 ? void 0 : _fiData$docs.map(function (fiDoc) {
45154
+ if (fiDoc !== null && fiDoc !== void 0 && fiDoc.fileStoreId) appDocumentFileStoreIds.push(fiDoc === null || fiDoc === void 0 ? void 0 : fiDoc.fileStoreId);
45155
+ });
45156
+ });
45157
+
45158
+ if (!(response !== null && response !== void 0 && (_response$BPA3 = response.BPA) !== null && _response$BPA3 !== void 0 && _response$BPA3.length)) {
43995
45159
  return;
43996
45160
  }
43997
45161
 
43998
- sessionStorage.setItem("BPA_ARCHITECT_NAME", JSON.stringify(response !== null && response !== void 0 && (_response$BPA2 = response.BPA) !== null && _response$BPA2 !== void 0 && (_response$BPA2$ = _response$BPA2[0]) !== null && _response$BPA2$ !== void 0 && (_response$BPA2$$addit = _response$BPA2$.additionalDetails) !== null && _response$BPA2$$addit !== void 0 && _response$BPA2$$addit.typeOfArchitect ? response === null || response === void 0 ? void 0 : (_response$BPA3 = response.BPA) === null || _response$BPA3 === void 0 ? void 0 : (_response$BPA3$ = _response$BPA3[0]) === null || _response$BPA3$ === void 0 ? void 0 : (_response$BPA3$$addit = _response$BPA3$.additionalDetails) === null || _response$BPA3$$addit === void 0 ? void 0 : _response$BPA3$$addit.typeOfArchitect : "ARCHITECT"));
45162
+ sessionStorage.setItem("BPA_ARCHITECT_NAME", JSON.stringify(response !== null && response !== void 0 && (_response$BPA4 = response.BPA) !== null && _response$BPA4 !== void 0 && (_response$BPA4$ = _response$BPA4[0]) !== null && _response$BPA4$ !== void 0 && (_response$BPA4$$addit = _response$BPA4$.additionalDetails) !== null && _response$BPA4$$addit !== void 0 && _response$BPA4$$addit.typeOfArchitect ? response === null || response === void 0 ? void 0 : (_response$BPA5 = response.BPA) === null || _response$BPA5 === void 0 ? void 0 : (_response$BPA5$ = _response$BPA5[0]) === null || _response$BPA5$ === void 0 ? void 0 : (_response$BPA5$$addit = _response$BPA5$.additionalDetails) === null || _response$BPA5$$addit === void 0 ? void 0 : _response$BPA5$$addit.typeOfArchitect : "ARCHITECT"));
43999
45163
 
44000
- var _response$BPA4 = response === null || response === void 0 ? void 0 : response.BPA,
44001
- BPA = _response$BPA4[0];
45164
+ var _response$BPA6 = response === null || response === void 0 ? void 0 : response.BPA,
45165
+ BPA = _response$BPA6[0];
44002
45166
 
44003
45167
  return Promise.resolve(OBPSService.scrutinyDetails(BPA === null || BPA === void 0 ? void 0 : BPA.tenantId, {
44004
45168
  edcrNumber: BPA === null || BPA === void 0 ? void 0 : BPA.edcrNumber
@@ -44009,507 +45173,541 @@ var OBPSService = {
44009
45173
  return Promise.resolve(MdmsService.getMultipleTypes(tenantId, "BPA", ["RiskTypeComputation", "CheckList"])).then(function (mdmsRes) {
44010
45174
  var _mdmsRes$BPA, _edcr$planDetail, _edcr$planDetail$plot, _edcr$planDetail2;
44011
45175
 
44012
- var riskType = Digit.Utils.obps.calculateRiskType(mdmsRes === null || mdmsRes === void 0 ? void 0 : (_mdmsRes$BPA = mdmsRes.BPA) === null || _mdmsRes$BPA === void 0 ? void 0 : _mdmsRes$BPA.RiskTypeComputation, edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail = edcr.planDetail) === null || _edcr$planDetail === void 0 ? void 0 : (_edcr$planDetail$plot = _edcr$planDetail.plot) === null || _edcr$planDetail$plot === void 0 ? void 0 : _edcr$planDetail$plot.area, edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail2 = edcr.planDetail) === null || _edcr$planDetail2 === void 0 ? void 0 : _edcr$planDetail2.blocks);
44013
- BPA.riskType = riskType;
44014
- return Promise.resolve(OBPSService.NOCSearch(BPA === null || BPA === void 0 ? void 0 : BPA.tenantId, {
44015
- sourceRefId: BPA === null || BPA === void 0 ? void 0 : BPA.applicationNo
44016
- })).then(function (nocResponse) {
44017
- var noc = nocResponse === null || nocResponse === void 0 ? void 0 : nocResponse.Noc;
44018
- var filter = {
44019
- approvalNo: edcr === null || edcr === void 0 ? void 0 : edcr.permitNumber
44020
- };
44021
- return Promise.resolve(OBPSService.BPASearch(tenantId, _extends({}, filter))).then(function (bpaResponse) {
44022
- var _bpaResponse$BPA, _bpaResponse$BPA$, _bpaResponse$BPA2, _bpaResponse$BPA2$, _bpaResponse$BPA3, _bpaResponse$BPA3$;
45176
+ var riskType = Digit.Utils.obps.calculateRiskType(mdmsRes === null || mdmsRes === void 0 ? void 0 : (_mdmsRes$BPA = mdmsRes.BPA) === null || _mdmsRes$BPA === void 0 ? void 0 : _mdmsRes$BPA.RiskTypeComputation, edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail = edcr.planDetail) === null || _edcr$planDetail === void 0 ? void 0 : (_edcr$planDetail$plot = _edcr$planDetail.plot) === null || _edcr$planDetail$plot === void 0 ? void 0 : _edcr$planDetail$plot.area, edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail2 = edcr.planDetail) === null || _edcr$planDetail2 === void 0 ? void 0 : _edcr$planDetail2.blocks);
45177
+ BPA.riskType = riskType;
45178
+ return Promise.resolve(OBPSService.NOCSearch(BPA === null || BPA === void 0 ? void 0 : BPA.tenantId, {
45179
+ sourceRefId: BPA === null || BPA === void 0 ? void 0 : BPA.applicationNo
45180
+ })).then(function (nocResponse) {
45181
+ var noc = nocResponse === null || nocResponse === void 0 ? void 0 : nocResponse.Noc;
45182
+ var filter = {
45183
+ approvalNo: edcr === null || edcr === void 0 ? void 0 : edcr.permitNumber
45184
+ };
45185
+ return Promise.resolve(OBPSService.BPASearch(tenantId, _extends({}, filter))).then(function (bpaResponse) {
45186
+ var _bpaResponse$BPA, _bpaResponse$BPA$, _bpaResponse$BPA2, _bpaResponse$BPA2$, _bpaResponse$BPA3, _bpaResponse$BPA3$;
45187
+
45188
+ var comparisionRep = {
45189
+ ocdcrNumber: BPA !== null && BPA !== void 0 && BPA.edcrNumber.includes("OCDCR") ? BPA === null || BPA === void 0 ? void 0 : BPA.edcrNumber : bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA = bpaResponse.BPA) === null || _bpaResponse$BPA === void 0 ? void 0 : (_bpaResponse$BPA$ = _bpaResponse$BPA[0]) === null || _bpaResponse$BPA$ === void 0 ? void 0 : _bpaResponse$BPA$.edcrNumber,
45190
+ edcrNumber: bpaResponse !== null && bpaResponse !== void 0 && (_bpaResponse$BPA2 = bpaResponse.BPA) !== null && _bpaResponse$BPA2 !== void 0 && (_bpaResponse$BPA2$ = _bpaResponse$BPA2[0]) !== null && _bpaResponse$BPA2$ !== void 0 && _bpaResponse$BPA2$.edcrNumber.includes("OCDCR") ? BPA === null || BPA === void 0 ? void 0 : BPA.edcrNumber : bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA3 = bpaResponse.BPA) === null || _bpaResponse$BPA3 === void 0 ? void 0 : (_bpaResponse$BPA3$ = _bpaResponse$BPA3[0]) === null || _bpaResponse$BPA3$ === void 0 ? void 0 : _bpaResponse$BPA3$.edcrNumber
45191
+ };
45192
+ return Promise.resolve(OBPSService.comparisionReport(BPA === null || BPA === void 0 ? void 0 : BPA.tenantId, _extends({}, comparisionRep))).then(function (comparisionReport) {
45193
+ function _temp4() {
45194
+ var _BPA$additionalDetail, _BPA$additionalDetail2, _BPA$additionalDetail3, _BPA$additionalDetail4, _BPA$additionalDetail5, _BPA$additionalDetail6, _BPA$additionalDetail7, _permitcondn, _permitcondn2, _BPA$auditDetails, _BPA$auditDetails2, _edcr$planDetail3, _edcr$planDetail3$pla, _edcr$planDetail4, _edcr$planDetail4$pla, _edcr$planDetail5, _edcr$planDetail5$pla, _edcr$planDetail6, _edcr$planDetail6$pla, _edcr$planDetail7, _edcr$planDetail7$pla, _BPA$additionalDetail11, _BPA$additionalDetail12, _edcr$planDetail8, _edcr$planDetail8$blo, _edcr$planDetail8$blo2, _edcr$planDetail8$blo3, _edcr$planDetail9, _edcr$planDetail9$blo, _edcr$planDetail9$blo2, _edcr$planDetail9$blo3, _edcr$planDetail10, _edcr$planDetail10$bl, _edcr$planDetail10$bl2, _edcr$planDetail10$bl3, _edcr$planDetail11, _edcr$planDetail11$pl, _BPA$landInfo, _BPA$landInfo$address, _BPA$landInfo2, _BPA$landInfo2$addres, _BPA$landInfo3, _BPA$landInfo3$addres, _BPA$landInfo3$addres2, _BPA$landInfo4, _BPA$landInfo4$addres, _BPA$landInfo5, _BPA$landInfo5$addres, _BPA$landInfo6, _BPA$landInfo6$owners, _BPA$landInfo7, _BPA$landInfo7$owners, _BPA$landInfo9, _BPA$landInfo9$owners, _BPA$documents, _BPA$additionalDetail13, _BPA$additionalDetail14, _BPA$additionalDetail15, _BPA$additionalDetail16, _BPA$additionalDetail17, _BPA$additionalDetail18, _BPA$additionalDetail19, _details;
45195
+
45196
+ function ConvertEpochToValidityDate(dateEpoch) {
45197
+ if (dateEpoch == null || dateEpoch == undefined || dateEpoch == '') {
45198
+ return "NA";
45199
+ }
45200
+
45201
+ var dateFromApi = new Date(dateEpoch);
45202
+ var month = dateFromApi.getMonth() + 1;
45203
+ var day = dateFromApi.getDate();
45204
+ var year = dateFromApi.getFullYear() - 3;
45205
+ month = (month > 9 ? "" : "0") + month;
45206
+ day = (day > 9 ? "" : "0") + day;
45207
+ return day + "/" + month + "/" + year;
45208
+ }
45209
+
45210
+ BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail = BPA.additionalDetails) === null || _BPA$additionalDetail === void 0 ? void 0 : (_BPA$additionalDetail2 = _BPA$additionalDetail.fieldinspection_pending) === null || _BPA$additionalDetail2 === void 0 ? void 0 : _BPA$additionalDetail2.forEach(function (fiData) {
45211
+ var _fiData$docs2;
45212
+
45213
+ fiData === null || fiData === void 0 ? void 0 : (_fiData$docs2 = fiData.docs) === null || _fiData$docs2 === void 0 ? void 0 : _fiData$docs2.forEach(function (fiDoc) {
45214
+ var _fileDetails3, _fileDetails4, _fileDetails4$data$fi;
45215
+
45216
+ if ((_fileDetails3 = fileDetails) !== null && _fileDetails3 !== void 0 && _fileDetails3.data[fiDoc === null || fiDoc === void 0 ? void 0 : fiDoc.fileStoreId]) fiDoc.url = (_fileDetails4 = fileDetails) === null || _fileDetails4 === void 0 ? void 0 : (_fileDetails4$data$fi = _fileDetails4.data[fiDoc === null || fiDoc === void 0 ? void 0 : fiDoc.fileStoreId]) === null || _fileDetails4$data$fi === void 0 ? void 0 : _fileDetails4$data$fi.split(',')[0];
45217
+ });
45218
+ });
45219
+ var nocDetails = noc === null || noc === void 0 ? void 0 : noc.map(function (nocDetails, index) {
45220
+ var _nocDetails$additiona, _nocDetails$additiona2, _nocDetails$additiona3, _nocDetails$auditDeta, _nocDetails$documents;
45221
+
45222
+ return {
45223
+ title: index === 0 ? "BPA_NOC_DETAILS_SUMMARY" : "",
45224
+ values: [{
45225
+ title: "BPA_" + (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.nocType) + "_LABEL",
45226
+ value: nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationNo,
45227
+ isNotTranslated: true
45228
+ }, {
45229
+ title: "BPA_NOC_STATUS",
45230
+ value: nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus,
45231
+ field: "STATUS"
45232
+ }, (nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$additiona = nocDetails.additionalDetails) === null || _nocDetails$additiona === void 0 ? void 0 : _nocDetails$additiona.SubmittedOn) && {
45233
+ title: "BPA_SUDMITTED_ON_LABEL",
45234
+ value: nocDetails !== null && nocDetails !== void 0 && (_nocDetails$additiona2 = nocDetails.additionalDetails) !== null && _nocDetails$additiona2 !== void 0 && _nocDetails$additiona2.SubmittedOn ? dateFns.format(new Date(Number(nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$additiona3 = nocDetails.additionalDetails) === null || _nocDetails$additiona3 === void 0 ? void 0 : _nocDetails$additiona3.SubmittedOn)), 'dd/MM/yyyy') : "NA",
45235
+ isNotTranslated: true
45236
+ }, (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.nocNo) && {
45237
+ title: "BPA_APPROVAL_NUMBER_LABEL",
45238
+ value: (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.nocNo) || "NA",
45239
+ isNotTranslated: true
45240
+ }, (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.nocNo) && {
45241
+ title: "BPA_APPROVED_REJECTED_ON_LABEL",
45242
+ value: (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus) === "APPROVED" || (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus) === "REJECTED" || (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus) === "AUTO_APPROVED" || (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus) === "AUTO_REJECTED" ? dateFns.format(new Date(Number(nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$auditDeta = nocDetails.auditDetails) === null || _nocDetails$auditDeta === void 0 ? void 0 : _nocDetails$auditDeta.lastModifiedTime)), 'dd/MM/yyyy') : "NA",
45243
+ isNotTranslated: true
45244
+ }],
45245
+ additionalDetails: {
45246
+ data: nocDetails,
45247
+ noc: [{
45248
+ title: "BPA_DOCUMENT_DETAILS_LABEL",
45249
+ values: nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$documents = nocDetails.documents) === null || _nocDetails$documents === void 0 ? void 0 : _nocDetails$documents.map(function (doc) {
45250
+ var _doc$documentType2, _fileDetails5, _fileDetails5$data, _fileDetails6, _fileDetails6$data, _fileDetails6$data$do;
45251
+
45252
+ return {
45253
+ title: doc === null || doc === void 0 ? void 0 : (_doc$documentType2 = doc.documentType) === null || _doc$documentType2 === void 0 ? void 0 : _doc$documentType2.replaceAll('.', '_'),
45254
+ documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
45255
+ documentUid: doc === null || doc === void 0 ? void 0 : doc.documentUid,
45256
+ fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
45257
+ id: doc === null || doc === void 0 ? void 0 : doc.id,
45258
+ url: (_fileDetails5 = fileDetails) !== null && _fileDetails5 !== void 0 && (_fileDetails5$data = _fileDetails5.data) !== null && _fileDetails5$data !== void 0 && _fileDetails5$data[doc === null || doc === void 0 ? void 0 : doc.fileStoreId] ? (_fileDetails6 = fileDetails) === null || _fileDetails6 === void 0 ? void 0 : (_fileDetails6$data = _fileDetails6.data) === null || _fileDetails6$data === void 0 ? void 0 : (_fileDetails6$data$do = _fileDetails6$data[doc === null || doc === void 0 ? void 0 : doc.fileStoreId]) === null || _fileDetails6$data$do === void 0 ? void 0 : _fileDetails6$data$do.split(',')[0] : ""
45259
+ };
45260
+ })
45261
+ }]
45262
+ }
45263
+ };
45264
+ });
45265
+ var inspectionReport = [];
45266
+ var checklist = [];
45267
+ BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail3 = BPA.additionalDetails) === null || _BPA$additionalDetail3 === void 0 ? void 0 : (_BPA$additionalDetail4 = _BPA$additionalDetail3.fieldinspection_pending) === null || _BPA$additionalDetail4 === void 0 ? void 0 : _BPA$additionalDetail4.filter(function (ob) {
45268
+ return ob.docs && ob.docs.length > 0;
45269
+ }).map(function (ob, ind) {
45270
+ var _ob$date, _ob$date2, _ob$date3, _ob$questions, _ob$docs;
45271
+
45272
+ checklist = [];
45273
+ inspectionReport.push({
45274
+ title: "BPA_FI_REPORT",
45275
+ asSectionHeader: true,
45276
+ values: [{
45277
+ title: "BPA_FI_DATE_LABEL",
45278
+ value: ob.date.includes("-") ? ((_ob$date = ob.date) === null || _ob$date === void 0 ? void 0 : _ob$date.split("-")[2]) + "/" + ((_ob$date2 = ob.date) === null || _ob$date2 === void 0 ? void 0 : _ob$date2.split("-")[1]) + "/" + ((_ob$date3 = ob.date) === null || _ob$date3 === void 0 ? void 0 : _ob$date3.split("-")[0]) : ob.date
45279
+ }, {
45280
+ title: "BPA_FI_TIME_LABEL",
45281
+ value: ob.time
45282
+ }]
45283
+ });
45284
+ ob === null || ob === void 0 ? void 0 : (_ob$questions = ob.questions) === null || _ob$questions === void 0 ? void 0 : _ob$questions.map(function (q, index) {
45285
+ checklist.push({
45286
+ title: q.question,
45287
+ value: q.value
45288
+ });
45289
+ checklist.push({
45290
+ title: "BPA_ENTER_REMARKS",
45291
+ value: q.remarks
45292
+ });
45293
+ });
45294
+ inspectionReport.push({
45295
+ title: "BPA_CHECK_LIST_DETAILS",
45296
+ asSectionHeader: true,
45297
+ values: checklist
45298
+ });
45299
+ inspectionReport.push({
45300
+ title: "BPA_DOCUMENT_DETAILS_LABEL",
45301
+ asSectionHeader: true,
45302
+ additionalDetails: {
45303
+ obpsDocuments: [{
45304
+ title: "",
45305
+ values: ob === null || ob === void 0 ? void 0 : (_ob$docs = ob.docs) === null || _ob$docs === void 0 ? void 0 : _ob$docs.map(function (doc) {
45306
+ var _doc$documentType3, _fileDetails7, _fileDetails7$data, _fileDetails8, _fileDetails8$data, _fileDetails8$data$do;
45307
+
45308
+ return {
45309
+ title: doc === null || doc === void 0 ? void 0 : (_doc$documentType3 = doc.documentType) === null || _doc$documentType3 === void 0 ? void 0 : _doc$documentType3.replaceAll('.', '_'),
45310
+ documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
45311
+ documentUid: doc === null || doc === void 0 ? void 0 : doc.fileStore,
45312
+ fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
45313
+ id: doc === null || doc === void 0 ? void 0 : doc.id,
45314
+ url: (_fileDetails7 = fileDetails) !== null && _fileDetails7 !== void 0 && (_fileDetails7$data = _fileDetails7.data) !== null && _fileDetails7$data !== void 0 && _fileDetails7$data[doc === null || doc === void 0 ? void 0 : doc.fileStoreId] ? (_fileDetails8 = fileDetails) === null || _fileDetails8 === void 0 ? void 0 : (_fileDetails8$data = _fileDetails8.data) === null || _fileDetails8$data === void 0 ? void 0 : (_fileDetails8$data$do = _fileDetails8$data[doc === null || doc === void 0 ? void 0 : doc.fileStoreId]) === null || _fileDetails8$data$do === void 0 ? void 0 : _fileDetails8$data$do.split(',')[0] : ""
45315
+ };
45316
+ })
45317
+ }]
45318
+ }
45319
+ });
45320
+ });
45321
+ var details = [];
45322
+ var applicationDetailsInfo = {
45323
+ title: " ",
45324
+ isCommon: true,
45325
+ values: [{
45326
+ title: "BPA_APPLICATION_NUMBER_LABEL",
45327
+ value: (BPA === null || BPA === void 0 ? void 0 : BPA.applicationNo) || "NA"
45328
+ }]
45329
+ };
45330
+
45331
+ if (BPA !== null && BPA !== void 0 && BPA.businessService.includes("BPA_OC")) {
45332
+ var _bpaResponse$BPA4, _bpaResponse$BPA4$, _bpaResponse$BPA5, _bpaResponse$BPA5$;
44023
45333
 
44024
- var comparisionRep = {
44025
- ocdcrNumber: BPA !== null && BPA !== void 0 && BPA.edcrNumber.includes("OCDCR") ? BPA === null || BPA === void 0 ? void 0 : BPA.edcrNumber : bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA = bpaResponse.BPA) === null || _bpaResponse$BPA === void 0 ? void 0 : (_bpaResponse$BPA$ = _bpaResponse$BPA[0]) === null || _bpaResponse$BPA$ === void 0 ? void 0 : _bpaResponse$BPA$.edcrNumber,
44026
- edcrNumber: bpaResponse !== null && bpaResponse !== void 0 && (_bpaResponse$BPA2 = bpaResponse.BPA) !== null && _bpaResponse$BPA2 !== void 0 && (_bpaResponse$BPA2$ = _bpaResponse$BPA2[0]) !== null && _bpaResponse$BPA2$ !== void 0 && _bpaResponse$BPA2$.edcrNumber.includes("OCDCR") ? BPA === null || BPA === void 0 ? void 0 : BPA.edcrNumber : bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA3 = bpaResponse.BPA) === null || _bpaResponse$BPA3 === void 0 ? void 0 : (_bpaResponse$BPA3$ = _bpaResponse$BPA3[0]) === null || _bpaResponse$BPA3$ === void 0 ? void 0 : _bpaResponse$BPA3$.edcrNumber
44027
- };
45334
+ applicationDetailsInfo["values"] = [].concat(applicationDetailsInfo === null || applicationDetailsInfo === void 0 ? void 0 : applicationDetailsInfo.values, [{
45335
+ title: "BPA_PERMIT_APP_NUMBER",
45336
+ to: "/digit-ui/employee/obps/bpa/" + (bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA4 = bpaResponse.BPA) === null || _bpaResponse$BPA4 === void 0 ? void 0 : (_bpaResponse$BPA4$ = _bpaResponse$BPA4[0]) === null || _bpaResponse$BPA4$ === void 0 ? void 0 : _bpaResponse$BPA4$.applicationNo),
45337
+ value: bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA5 = bpaResponse.BPA) === null || _bpaResponse$BPA5 === void 0 ? void 0 : (_bpaResponse$BPA5$ = _bpaResponse$BPA5[0]) === null || _bpaResponse$BPA5$ === void 0 ? void 0 : _bpaResponse$BPA5$.applicationNo,
45338
+ isLink: true
45339
+ }]);
45340
+ }
44028
45341
 
44029
- function ConvertEpochToValidityDate(dateEpoch) {
44030
- if (dateEpoch == null || dateEpoch == undefined || dateEpoch == '') {
44031
- return "NA";
44032
- }
45342
+ var permitcondn = [];
45343
+ (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail5 = BPA.additionalDetails) === null || _BPA$additionalDetail5 === void 0 ? void 0 : _BPA$additionalDetail5.pendingapproval) && (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail6 = BPA.additionalDetails) === null || _BPA$additionalDetail6 === void 0 ? void 0 : _BPA$additionalDetail6.pendingapproval.length) > 0 && (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail7 = BPA.additionalDetails) === null || _BPA$additionalDetail7 === void 0 ? void 0 : _BPA$additionalDetail7.pendingapproval.map(function (ob, index) {
45344
+ permitcondn.push({
45345
+ title: index + 1 + ". " + ob,
45346
+ value: ""
45347
+ });
45348
+ }));
45349
+ var PermitConditions = {
45350
+ title: "BPA_PERMIT_CONDITIONS",
45351
+ isTitleVisible: ((_permitcondn = permitcondn) === null || _permitcondn === void 0 ? void 0 : _permitcondn.length) > 0 ? false : true,
45352
+ isNotAllowed: ((_permitcondn2 = permitcondn) === null || _permitcondn2 === void 0 ? void 0 : _permitcondn2.length) > 0 ? false : true,
45353
+ additionalDetails: {
45354
+ inspectionReport: [],
45355
+ permit: [].concat(permitcondn)
45356
+ }
45357
+ };
45358
+ if (permitcondn.length == 0) PermitConditions = {};
44033
45359
 
44034
- var dateFromApi = new Date(dateEpoch);
44035
- var month = dateFromApi.getMonth() + 1;
44036
- var day = dateFromApi.getDate();
44037
- var year = dateFromApi.getFullYear() - 3;
44038
- month = (month > 9 ? "" : "0") + month;
44039
- day = (day > 9 ? "" : "0") + day;
44040
- return day + "/" + month + "/" + year;
44041
- }
45360
+ if (riskType == "LOW" && permitcondn.length > 0) {
45361
+ permitcondn = [];
45362
+ PermitConditions = {};
45363
+ }
44042
45364
 
44043
- return Promise.resolve(OBPSService.comparisionReport(BPA === null || BPA === void 0 ? void 0 : BPA.tenantId, _extends({}, comparisionRep))).then(function (comparisionReport) {
44044
- var _BPA$additionalDetail, _BPA$additionalDetail2, _BPA$additionalDetail3, _BPA$additionalDetail4, _BPA$additionalDetail5, _permitcondn, _permitcondn2, _BPA$auditDetails, _BPA$auditDetails2, _edcr$planDetail3, _edcr$planDetail3$pla, _edcr$planDetail4, _edcr$planDetail4$pla, _edcr$planDetail5, _edcr$planDetail5$pla, _edcr$planDetail6, _edcr$planDetail6$pla, _edcr$planDetail7, _edcr$planDetail7$pla, _BPA$additionalDetail9, _BPA$additionalDetail10, _edcr$planDetail8, _edcr$planDetail8$blo, _edcr$planDetail8$blo2, _edcr$planDetail8$blo3, _edcr$planDetail9, _edcr$planDetail9$blo, _edcr$planDetail9$blo2, _edcr$planDetail9$blo3, _edcr$planDetail10, _edcr$planDetail10$bl, _edcr$planDetail10$bl2, _edcr$planDetail10$bl3, _edcr$planDetail11, _edcr$planDetail11$pl, _BPA$landInfo, _BPA$landInfo$address, _BPA$landInfo2, _BPA$landInfo2$addres, _BPA$landInfo3, _BPA$landInfo3$addres, _BPA$landInfo3$addres2, _BPA$landInfo4, _BPA$landInfo4$addres, _BPA$landInfo5, _BPA$landInfo5$addres, _BPA$landInfo6, _BPA$landInfo6$owners, _BPA$landInfo7, _BPA$landInfo7$owners, _BPA$landInfo9, _BPA$landInfo9$owners, _BPA$documents, _BPA$additionalDetail11, _BPA$additionalDetail12, _BPA$additionalDetail13, _BPA$additionalDetail14, _BPA$additionalDetail15, _BPA$additionalDetail16, _BPA$additionalDetail17, _details;
45365
+ if (BPA !== null && BPA !== void 0 && BPA.approvalNo) {
45366
+ var _applicationDetailsIn, _applicationDetailsIn2, _BPA$additionalDetail8, _BPA$additionalDetail9, _BPA$additionalDetail10;
44045
45367
 
44046
- var nocDetails = noc === null || noc === void 0 ? void 0 : noc.map(function (nocDetails, index) {
44047
- var _nocDetails$additiona, _nocDetails$additiona2, _nocDetails$additiona3, _nocDetails$auditDeta, _nocDetails$documents;
45368
+ applicationDetailsInfo === null || applicationDetailsInfo === void 0 ? void 0 : (_applicationDetailsIn = applicationDetailsInfo.values) === null || _applicationDetailsIn === void 0 ? void 0 : _applicationDetailsIn.push({
45369
+ title: (BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC" ? "BPA_PERMIT_NUMBER_LABEL" : "BPA_OC_PERMIT_NUMBER_LABEL",
45370
+ value: (BPA === null || BPA === void 0 ? void 0 : BPA.approvalNo) || "NA"
45371
+ });
45372
+ applicationDetailsInfo === null || applicationDetailsInfo === void 0 ? void 0 : (_applicationDetailsIn2 = applicationDetailsInfo.values) === null || _applicationDetailsIn2 === void 0 ? void 0 : _applicationDetailsIn2.push({
45373
+ title: (BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC" ? "BPA_PERMIT_VALIDITY" : "BPA_OC_PERMIT_VALIDITY",
45374
+ value: BPA !== null && BPA !== void 0 && (_BPA$additionalDetail8 = BPA.additionalDetails) !== null && _BPA$additionalDetail8 !== void 0 && _BPA$additionalDetail8.validityDate ? ConvertEpochToValidityDate(BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail9 = BPA.additionalDetails) === null || _BPA$additionalDetail9 === void 0 ? void 0 : _BPA$additionalDetail9.validityDate) + " - " + dateFns.format(new Date(BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail10 = BPA.additionalDetails) === null || _BPA$additionalDetail10 === void 0 ? void 0 : _BPA$additionalDetail10.validityDate), 'dd/MM/yyyy') : "NA"
45375
+ });
45376
+ }
44048
45377
 
44049
- return {
44050
- title: index === 0 ? "BPA_NOC_DETAILS_SUMMARY" : "",
45378
+ var basicDetails = {
45379
+ title: "BPA_BASIC_DETAILS_TITLE",
45380
+ asSectionHeader: true,
45381
+ isInsert: true,
45382
+ isCommon: true,
45383
+ values: [{
45384
+ title: "BPA_BASIC_DETAILS_APP_DATE_LABEL",
45385
+ value: BPA !== null && BPA !== void 0 && (_BPA$auditDetails = BPA.auditDetails) !== null && _BPA$auditDetails !== void 0 && _BPA$auditDetails.createdTime ? dateFns.format(new Date(BPA === null || BPA === void 0 ? void 0 : (_BPA$auditDetails2 = BPA.auditDetails) === null || _BPA$auditDetails2 === void 0 ? void 0 : _BPA$auditDetails2.createdTime), 'dd/MM/yyyy') : ''
45386
+ }, {
45387
+ title: "BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL",
45388
+ value: "WF_BPA_" + (edcr === null || edcr === void 0 ? void 0 : edcr.appliactionType)
45389
+ }, {
45390
+ title: "BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL",
45391
+ value: edcr === null || edcr === void 0 ? void 0 : edcr.applicationSubType
45392
+ }, {
45393
+ title: "BPA_BASIC_DETAILS_OCCUPANCY_LABEL",
45394
+ value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail3 = edcr.planDetail) === null || _edcr$planDetail3 === void 0 ? void 0 : (_edcr$planDetail3$pla = _edcr$planDetail3.planInformation) === null || _edcr$planDetail3$pla === void 0 ? void 0 : _edcr$planDetail3$pla.occupancy
45395
+ }, {
45396
+ title: "BPA_BASIC_DETAILS_RISK_TYPE_LABEL",
45397
+ value: "WF_BPA_" + riskType,
45398
+ isInsert: true
45399
+ }, {
45400
+ title: "BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL",
45401
+ value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail4 = edcr.planDetail) === null || _edcr$planDetail4 === void 0 ? void 0 : (_edcr$planDetail4$pla = _edcr$planDetail4.planInformation) === null || _edcr$planDetail4$pla === void 0 ? void 0 : _edcr$planDetail4$pla.applicantName
45402
+ }]
45403
+ };
45404
+ var plotDetails = {
45405
+ title: "BPA_PLOT_DETAILS_TITLE",
45406
+ asSectionHeader: true,
45407
+ isCommon: true,
44051
45408
  values: [{
44052
- title: "BPA_" + (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.nocType) + "_LABEL",
44053
- value: nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationNo,
45409
+ title: "BPA_BOUNDARY_PLOT_AREA_LABEL",
45410
+ value: "" + (edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail5 = edcr.planDetail) === null || _edcr$planDetail5 === void 0 ? void 0 : (_edcr$planDetail5$pla = _edcr$planDetail5.planInformation) === null || _edcr$planDetail5$pla === void 0 ? void 0 : _edcr$planDetail5$pla.plotArea),
45411
+ isNotTranslated: true,
45412
+ isUnit: "BPA_SQ_FT_LABEL"
45413
+ }, {
45414
+ title: "BPA_PLOT_NUMBER_LABEL",
45415
+ value: (edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail6 = edcr.planDetail) === null || _edcr$planDetail6 === void 0 ? void 0 : (_edcr$planDetail6$pla = _edcr$planDetail6.planInformation) === null || _edcr$planDetail6$pla === void 0 ? void 0 : _edcr$planDetail6$pla.plotNo) || "NA",
44054
45416
  isNotTranslated: true
44055
45417
  }, {
44056
- title: "BPA_NOC_STATUS",
44057
- value: nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus,
44058
- field: "STATUS"
44059
- }, (nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$additiona = nocDetails.additionalDetails) === null || _nocDetails$additiona === void 0 ? void 0 : _nocDetails$additiona.SubmittedOn) && {
44060
- title: "BPA_SUDMITTED_ON_LABEL",
44061
- value: nocDetails !== null && nocDetails !== void 0 && (_nocDetails$additiona2 = nocDetails.additionalDetails) !== null && _nocDetails$additiona2 !== void 0 && _nocDetails$additiona2.SubmittedOn ? dateFns.format(new Date(Number(nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$additiona3 = nocDetails.additionalDetails) === null || _nocDetails$additiona3 === void 0 ? void 0 : _nocDetails$additiona3.SubmittedOn)), 'dd/MM/yyyy') : "NA",
45418
+ title: "BPA_KHATHA_NUMBER_LABEL",
45419
+ value: (edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail7 = edcr.planDetail) === null || _edcr$planDetail7 === void 0 ? void 0 : (_edcr$planDetail7$pla = _edcr$planDetail7.planInformation) === null || _edcr$planDetail7$pla === void 0 ? void 0 : _edcr$planDetail7$pla.khataNo) || "NA",
44062
45420
  isNotTranslated: true
44063
- }, (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.nocNo) && {
44064
- title: "BPA_APPROVAL_NUMBER_LABEL",
44065
- value: (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.nocNo) || "NA",
45421
+ }, {
45422
+ title: "BPA_HOLDING_NUMBER_LABEL",
45423
+ value: (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail11 = BPA.additionalDetails) === null || _BPA$additionalDetail11 === void 0 ? void 0 : _BPA$additionalDetail11.holdingNo) || "NA",
44066
45424
  isNotTranslated: true
44067
- }, (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.nocNo) && {
44068
- title: "BPA_APPROVED_REJECTED_ON_LABEL",
44069
- value: (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus) === "APPROVED" || (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus) === "REJECTED" || (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus) === "AUTO_APPROVED" || (nocDetails === null || nocDetails === void 0 ? void 0 : nocDetails.applicationStatus) === "AUTO_REJECTED" ? dateFns.format(new Date(Number(nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$auditDeta = nocDetails.auditDetails) === null || _nocDetails$auditDeta === void 0 ? void 0 : _nocDetails$auditDeta.lastModifiedTime)), 'dd/MM/yyyy') : "NA",
45425
+ }, {
45426
+ title: "BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",
45427
+ value: (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail12 = BPA.additionalDetails) === null || _BPA$additionalDetail12 === void 0 ? void 0 : _BPA$additionalDetail12.registrationDetails) || "NA",
44070
45428
  isNotTranslated: true
44071
- }],
45429
+ }]
45430
+ };
45431
+ var scrutinyDetails = {
45432
+ title: "BPA_STEPPER_SCRUTINY_DETAILS_HEADER",
45433
+ isScrutinyDetails: true,
45434
+ isBackGroundColor: true,
44072
45435
  additionalDetails: {
44073
- data: nocDetails,
44074
- noc: [{
44075
- title: "BPA_DOCUMENT_DETAILS_LABEL",
44076
- values: nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$documents = nocDetails.documents) === null || _nocDetails$documents === void 0 ? void 0 : _nocDetails$documents.map(function (doc) {
44077
- var _doc$documentType2;
44078
-
44079
- return {
44080
- title: doc === null || doc === void 0 ? void 0 : (_doc$documentType2 = doc.documentType) === null || _doc$documentType2 === void 0 ? void 0 : _doc$documentType2.replaceAll('.', '_'),
44081
- documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
44082
- documentUid: doc === null || doc === void 0 ? void 0 : doc.documentUid,
44083
- fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
44084
- id: doc === null || doc === void 0 ? void 0 : doc.id
44085
- };
44086
- })
45436
+ values: [{
45437
+ title: "BPA_EDCR_DETAILS",
45438
+ value: " ",
45439
+ isHeader: true
45440
+ }, {
45441
+ title: (BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC" ? "BPA_EDCR_NO_LABEL" : "BPA_OC_EDCR_NO_LABEL",
45442
+ value: (BPA === null || BPA === void 0 ? void 0 : BPA.edcrNumber) || "NA"
45443
+ }],
45444
+ scruntinyDetails: [{
45445
+ title: "BPA_UPLOADED_PLAN_DIAGRAM",
45446
+ value: edcr === null || edcr === void 0 ? void 0 : edcr.updatedDxfFile,
45447
+ text: "BPA_UPLOADED_PLAN_DXF"
45448
+ }, {
45449
+ title: "BPA_SCRUNTINY_REPORT_OUTPUT",
45450
+ value: edcr === null || edcr === void 0 ? void 0 : edcr.planReport,
45451
+ text: "BPA_SCRUTINY_REPORT_PDF"
44087
45452
  }]
44088
45453
  }
44089
45454
  };
44090
- });
44091
- var inspectionReport = [];
44092
- var checklist = [];
44093
- BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail = BPA.additionalDetails) === null || _BPA$additionalDetail === void 0 ? void 0 : (_BPA$additionalDetail2 = _BPA$additionalDetail.fieldinspection_pending) === null || _BPA$additionalDetail2 === void 0 ? void 0 : _BPA$additionalDetail2.filter(function (ob) {
44094
- return ob.docs && ob.docs.length > 0;
44095
- }).map(function (ob, ind) {
44096
- var _ob$date, _ob$date2, _ob$date3, _ob$questions, _ob$docs;
44097
-
44098
- checklist = [];
44099
- inspectionReport.push({
44100
- title: "BPA_FI_REPORT",
45455
+ var buildingExtractionDetails = {
45456
+ title: "",
45457
+ isScrutinyDetails: true,
45458
+ isBackGroundColor: true,
45459
+ additionalDetails: {
45460
+ values: [{
45461
+ title: (BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC" ? "BPA_BUILDING_EXTRACT_HEADER" : "BPA_ACTUAL_BUILDING_EXTRACT_HEADER",
45462
+ value: " ",
45463
+ isHeader: true
45464
+ }, {
45465
+ title: "BPA_TOTAL_BUILT_UP_AREA_HEADER",
45466
+ value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail8 = edcr.planDetail) === null || _edcr$planDetail8 === void 0 ? void 0 : (_edcr$planDetail8$blo = _edcr$planDetail8.blocks) === null || _edcr$planDetail8$blo === void 0 ? void 0 : (_edcr$planDetail8$blo2 = _edcr$planDetail8$blo[0]) === null || _edcr$planDetail8$blo2 === void 0 ? void 0 : (_edcr$planDetail8$blo3 = _edcr$planDetail8$blo2.building) === null || _edcr$planDetail8$blo3 === void 0 ? void 0 : _edcr$planDetail8$blo3.totalBuitUpArea,
45467
+ isUnit: "BPA_SQ_MTRS_LABEL"
45468
+ }, {
45469
+ title: "BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL",
45470
+ value: (edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail9 = edcr.planDetail) === null || _edcr$planDetail9 === void 0 ? void 0 : (_edcr$planDetail9$blo = _edcr$planDetail9.blocks) === null || _edcr$planDetail9$blo === void 0 ? void 0 : (_edcr$planDetail9$blo2 = _edcr$planDetail9$blo[0]) === null || _edcr$planDetail9$blo2 === void 0 ? void 0 : (_edcr$planDetail9$blo3 = _edcr$planDetail9$blo2.building) === null || _edcr$planDetail9$blo3 === void 0 ? void 0 : _edcr$planDetail9$blo3.totalFloors) || "NA"
45471
+ }, {
45472
+ title: "BPA_HEIGHT_FROM_GROUND_LEVEL",
45473
+ value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail10 = edcr.planDetail) === null || _edcr$planDetail10 === void 0 ? void 0 : (_edcr$planDetail10$bl = _edcr$planDetail10.blocks) === null || _edcr$planDetail10$bl === void 0 ? void 0 : (_edcr$planDetail10$bl2 = _edcr$planDetail10$bl[0]) === null || _edcr$planDetail10$bl2 === void 0 ? void 0 : (_edcr$planDetail10$bl3 = _edcr$planDetail10$bl2.building) === null || _edcr$planDetail10$bl3 === void 0 ? void 0 : _edcr$planDetail10$bl3.declaredBuildingHeigh,
45474
+ isUnit: "BPA_MTRS_LABEL"
45475
+ }],
45476
+ scruntinyDetails: []
45477
+ }
45478
+ };
45479
+ var demolitionAreaDetails = {
45480
+ title: "",
45481
+ isScrutinyDetails: true,
45482
+ isBackGroundColor: true,
45483
+ additionalDetails: {
45484
+ values: [{
45485
+ title: "BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL",
45486
+ value: " ",
45487
+ isHeader: true
45488
+ }, {
45489
+ title: "BPA_APPLICATION_DEMOLITION_AREA_LABEL",
45490
+ value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail11 = edcr.planDetail) === null || _edcr$planDetail11 === void 0 ? void 0 : (_edcr$planDetail11$pl = _edcr$planDetail11.planInformation) === null || _edcr$planDetail11$pl === void 0 ? void 0 : _edcr$planDetail11$pl.demolitionArea,
45491
+ isUnit: "BPA_SQ_MTRS_LABEL"
45492
+ }],
45493
+ scruntinyDetails: []
45494
+ }
45495
+ };
45496
+ var subOccupancyTableDetails = {
45497
+ title: "",
45498
+ isSubOccupancyTable: true,
45499
+ isTitleRepeat: true,
45500
+ additionalDetails: {
45501
+ values: [{
45502
+ title: "BPA_OCC_SUBOCC_HEADER",
45503
+ value: " ",
45504
+ isHeader: true
45505
+ }],
45506
+ subOccupancyTableDetails: [{
45507
+ title: "BPA_APPLICATION_DEMOLITION_AREA_LABEL",
45508
+ value: edcr
45509
+ }, {
45510
+ title: "NO_REPEAT",
45511
+ value: ""
45512
+ }]
45513
+ }
45514
+ };
45515
+ var addressDetails = {
45516
+ title: "BPA_NEW_TRADE_DETAILS_HEADER_DETAILS",
44101
45517
  asSectionHeader: true,
45518
+ isCommon: true,
44102
45519
  values: [{
44103
- title: "BPA_FI_DATE_LABEL",
44104
- value: ob.date.includes("-") ? ((_ob$date = ob.date) === null || _ob$date === void 0 ? void 0 : _ob$date.split("-")[2]) + "/" + ((_ob$date2 = ob.date) === null || _ob$date2 === void 0 ? void 0 : _ob$date2.split("-")[1]) + "/" + ((_ob$date3 = ob.date) === null || _ob$date3 === void 0 ? void 0 : _ob$date3.split("-")[0]) : ob.date
45520
+ title: "BPA_DETAILS_PIN_LABEL",
45521
+ value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo = BPA.landInfo) === null || _BPA$landInfo === void 0 ? void 0 : (_BPA$landInfo$address = _BPA$landInfo.address) === null || _BPA$landInfo$address === void 0 ? void 0 : _BPA$landInfo$address.pincode
45522
+ }, {
45523
+ title: "BPA_CITY_LABEL",
45524
+ value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo2 = BPA.landInfo) === null || _BPA$landInfo2 === void 0 ? void 0 : (_BPA$landInfo2$addres = _BPA$landInfo2.address) === null || _BPA$landInfo2$addres === void 0 ? void 0 : _BPA$landInfo2$addres.city
45525
+ }, {
45526
+ title: "BPA_LOC_MOHALLA_LABEL",
45527
+ value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo3 = BPA.landInfo) === null || _BPA$landInfo3 === void 0 ? void 0 : (_BPA$landInfo3$addres = _BPA$landInfo3.address) === null || _BPA$landInfo3$addres === void 0 ? void 0 : (_BPA$landInfo3$addres2 = _BPA$landInfo3$addres.locality) === null || _BPA$landInfo3$addres2 === void 0 ? void 0 : _BPA$landInfo3$addres2.name
44105
45528
  }, {
44106
- title: "BPA_FI_TIME_LABEL",
44107
- value: ob.time
45529
+ title: "BPA_DETAILS_SRT_NAME_LABEL",
45530
+ value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo4 = BPA.landInfo) === null || _BPA$landInfo4 === void 0 ? void 0 : (_BPA$landInfo4$addres = _BPA$landInfo4.address) === null || _BPA$landInfo4$addres === void 0 ? void 0 : _BPA$landInfo4$addres.street
45531
+ }, {
45532
+ title: "ES_NEW_APPLICATION_LOCATION_LANDMARK",
45533
+ value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo5 = BPA.landInfo) === null || _BPA$landInfo5 === void 0 ? void 0 : (_BPA$landInfo5$addres = _BPA$landInfo5.address) === null || _BPA$landInfo5$addres === void 0 ? void 0 : _BPA$landInfo5$addres.landmark
44108
45534
  }]
44109
- });
44110
- ob === null || ob === void 0 ? void 0 : (_ob$questions = ob.questions) === null || _ob$questions === void 0 ? void 0 : _ob$questions.map(function (q, index) {
44111
- checklist.push({
44112
- title: q.question,
44113
- value: q.value
44114
- });
44115
- checklist.push({
44116
- title: "BPA_ENTER_REMARKS",
44117
- value: q.remarks
45535
+ };
45536
+ var checkOwnerLength = (BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo6 = BPA.landInfo) === null || _BPA$landInfo6 === void 0 ? void 0 : (_BPA$landInfo6$owners = _BPA$landInfo6.owners) === null || _BPA$landInfo6$owners === void 0 ? void 0 : _BPA$landInfo6$owners.length) || 1;
45537
+
45538
+ if ((BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo7 = BPA.landInfo) === null || _BPA$landInfo7 === void 0 ? void 0 : (_BPA$landInfo7$owners = _BPA$landInfo7.owners) === null || _BPA$landInfo7$owners === void 0 ? void 0 : _BPA$landInfo7$owners.length) > 0) {
45539
+ var _BPA$landInfo8, _BPA$landInfo8$owners;
45540
+
45541
+ BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo8 = BPA.landInfo) === null || _BPA$landInfo8 === void 0 ? void 0 : (_BPA$landInfo8$owners = _BPA$landInfo8.owners) === null || _BPA$landInfo8$owners === void 0 ? void 0 : _BPA$landInfo8$owners.forEach(function (ownerD) {
45542
+ if (!ownerD.isPrimaryOwner) ownerD.isPrimaryOwner = "false";
44118
45543
  });
44119
- });
44120
- inspectionReport.push({
44121
- title: "BPA_CHECK_LIST_DETAILS",
44122
- asSectionHeader: true,
44123
- values: checklist
44124
- });
44125
- inspectionReport.push({
45544
+ }
45545
+
45546
+ var ownerDetails = {
45547
+ title: "BPA_APPLICANT_DETAILS_HEADER",
45548
+ isOwnerDetails: true,
45549
+ additionalDetails: {
45550
+ owners: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo9 = BPA.landInfo) === null || _BPA$landInfo9 === void 0 ? void 0 : (_BPA$landInfo9$owners = _BPA$landInfo9.owners) === null || _BPA$landInfo9$owners === void 0 ? void 0 : _BPA$landInfo9$owners.map(function (owner, index) {
45551
+ return {
45552
+ title: Number(checkOwnerLength) > 1 ? "COMMON_OWNER" : "",
45553
+ values: [{
45554
+ title: "CORE_COMMON_NAME",
45555
+ value: owner === null || owner === void 0 ? void 0 : owner.name
45556
+ }, {
45557
+ title: "BPA_APPLICANT_GENDER_LABEL",
45558
+ value: owner === null || owner === void 0 ? void 0 : owner.gender
45559
+ }, {
45560
+ title: "CORE_COMMON_MOBILE_NUMBER",
45561
+ value: owner === null || owner === void 0 ? void 0 : owner.mobileNumber
45562
+ }, {
45563
+ title: "BPA_IS_PRIMARY_OWNER_LABEL",
45564
+ value: owner === null || owner === void 0 ? void 0 : owner.isPrimaryOwner,
45565
+ isNotTranslated: false
45566
+ }]
45567
+ };
45568
+ })
45569
+ }
45570
+ };
45571
+ var documentDetails = {
44126
45572
  title: "BPA_DOCUMENT_DETAILS_LABEL",
44127
45573
  asSectionHeader: true,
45574
+ isDocumentDetails: true,
44128
45575
  additionalDetails: {
44129
45576
  obpsDocuments: [{
44130
45577
  title: "",
44131
- values: ob === null || ob === void 0 ? void 0 : (_ob$docs = ob.docs) === null || _ob$docs === void 0 ? void 0 : _ob$docs.map(function (doc) {
44132
- var _doc$documentType3;
45578
+ values: BPA === null || BPA === void 0 ? void 0 : (_BPA$documents = BPA.documents) === null || _BPA$documents === void 0 ? void 0 : _BPA$documents.map(function (doc) {
45579
+ var _doc$documentType4, _fileDetails9, _fileDetails9$data, _fileDetails10, _fileDetails10$data, _fileDetails10$data$d;
44133
45580
 
44134
45581
  return {
44135
- title: doc === null || doc === void 0 ? void 0 : (_doc$documentType3 = doc.documentType) === null || _doc$documentType3 === void 0 ? void 0 : _doc$documentType3.replaceAll('.', '_'),
45582
+ title: doc === null || doc === void 0 ? void 0 : (_doc$documentType4 = doc.documentType) === null || _doc$documentType4 === void 0 ? void 0 : _doc$documentType4.replaceAll('.', '_'),
44136
45583
  documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
44137
- documentUid: doc === null || doc === void 0 ? void 0 : doc.fileStore,
45584
+ documentUid: doc === null || doc === void 0 ? void 0 : doc.documentUid,
44138
45585
  fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
44139
- id: doc === null || doc === void 0 ? void 0 : doc.id
45586
+ id: doc === null || doc === void 0 ? void 0 : doc.id,
45587
+ url: (_fileDetails9 = fileDetails) !== null && _fileDetails9 !== void 0 && (_fileDetails9$data = _fileDetails9.data) !== null && _fileDetails9$data !== void 0 && _fileDetails9$data[doc === null || doc === void 0 ? void 0 : doc.fileStoreId] ? (_fileDetails10 = fileDetails) === null || _fileDetails10 === void 0 ? void 0 : (_fileDetails10$data = _fileDetails10.data) === null || _fileDetails10$data === void 0 ? void 0 : (_fileDetails10$data$d = _fileDetails10$data[doc === null || doc === void 0 ? void 0 : doc.fileStoreId]) === null || _fileDetails10$data$d === void 0 ? void 0 : _fileDetails10$data$d.split(',')[0] : ""
44140
45588
  };
44141
45589
  })
44142
45590
  }]
44143
45591
  }
44144
- });
44145
- });
44146
- var details = [];
44147
- var applicationDetailsInfo = {
44148
- title: " ",
44149
- isCommon: true,
44150
- values: [{
44151
- title: "BPA_APPLICATION_NUMBER_LABEL",
44152
- value: (BPA === null || BPA === void 0 ? void 0 : BPA.applicationNo) || "NA"
44153
- }]
44154
- };
45592
+ };
45593
+ var approvalChecks = [];
45594
+ var approvalChecksDetails = {};
44155
45595
 
44156
- if (BPA !== null && BPA !== void 0 && BPA.businessService.includes("BPA_OC")) {
44157
- var _bpaResponse$BPA4, _bpaResponse$BPA4$, _bpaResponse$BPA5, _bpaResponse$BPA5$;
45596
+ if ((BPA === null || BPA === void 0 ? void 0 : BPA.status) === "APPROVAL_INPROGRESS") {
45597
+ var _mdmsRes$BPA2;
44158
45598
 
44159
- applicationDetailsInfo["values"] = [].concat(applicationDetailsInfo === null || applicationDetailsInfo === void 0 ? void 0 : applicationDetailsInfo.values, [{
44160
- title: "BPA_PERMIT_APP_NUMBER",
44161
- to: "/digit-ui/employee/obps/bpa/" + (bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA4 = bpaResponse.BPA) === null || _bpaResponse$BPA4 === void 0 ? void 0 : (_bpaResponse$BPA4$ = _bpaResponse$BPA4[0]) === null || _bpaResponse$BPA4$ === void 0 ? void 0 : _bpaResponse$BPA4$.applicationNo),
44162
- value: bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA5 = bpaResponse.BPA) === null || _bpaResponse$BPA5 === void 0 ? void 0 : (_bpaResponse$BPA5$ = _bpaResponse$BPA5[0]) === null || _bpaResponse$BPA5$ === void 0 ? void 0 : _bpaResponse$BPA5$.applicationNo,
44163
- isLink: true
44164
- }]);
44165
- }
45599
+ mdmsRes === null || mdmsRes === void 0 ? void 0 : (_mdmsRes$BPA2 = mdmsRes.BPA) === null || _mdmsRes$BPA2 === void 0 ? void 0 : _mdmsRes$BPA2.CheckList.forEach(function (checklist) {
45600
+ var _checklist$conditions;
44166
45601
 
44167
- var permitcondn = [];
44168
- (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail3 = BPA.additionalDetails) === null || _BPA$additionalDetail3 === void 0 ? void 0 : _BPA$additionalDetail3.pendingapproval) && (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail4 = BPA.additionalDetails) === null || _BPA$additionalDetail4 === void 0 ? void 0 : _BPA$additionalDetail4.pendingapproval.length) > 0 && (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail5 = BPA.additionalDetails) === null || _BPA$additionalDetail5 === void 0 ? void 0 : _BPA$additionalDetail5.pendingapproval.map(function (ob, index) {
44169
- permitcondn.push({
44170
- title: index + 1 + ". " + ob,
44171
- value: ""
44172
- });
44173
- }));
44174
- var PermitConditions = {
44175
- title: "BPA_PERMIT_CONDITIONS",
44176
- isTitleVisible: ((_permitcondn = permitcondn) === null || _permitcondn === void 0 ? void 0 : _permitcondn.length) > 0 ? false : true,
44177
- isNotAllowed: ((_permitcondn2 = permitcondn) === null || _permitcondn2 === void 0 ? void 0 : _permitcondn2.length) > 0 ? false : true,
44178
- additionalDetails: {
44179
- inspectionReport: [],
44180
- permit: [].concat(permitcondn)
45602
+ if ((checklist === null || checklist === void 0 ? void 0 : checklist.RiskType) === riskType && (checklist === null || checklist === void 0 ? void 0 : checklist.applicationType) === (edcr === null || edcr === void 0 ? void 0 : edcr.appliactionType) && (checklist === null || checklist === void 0 ? void 0 : checklist.ServiceType) === (edcr === null || edcr === void 0 ? void 0 : edcr.applicationSubType) && (checklist === null || checklist === void 0 ? void 0 : checklist.WFState) === "PENDINGAPPROVAL" && (checklist === null || checklist === void 0 ? void 0 : (_checklist$conditions = checklist.conditions) === null || _checklist$conditions === void 0 ? void 0 : _checklist$conditions.length) > 0) {
45603
+ approvalChecks.push.apply(approvalChecks, checklist === null || checklist === void 0 ? void 0 : checklist.conditions);
45604
+ }
45605
+ });
45606
+ approvalChecksDetails = {
45607
+ title: "",
45608
+ isTitleVisible: (approvalChecks === null || approvalChecks === void 0 ? void 0 : approvalChecks.length) > 0 ? false : true,
45609
+ asSectionHeader: true,
45610
+ isPermissions: true,
45611
+ additionalDetails: {
45612
+ permissions: approvalChecks
45613
+ }
45614
+ };
44181
45615
  }
44182
- };
44183
- if (permitcondn.length == 0) PermitConditions = {};
44184
-
44185
- if (riskType == "LOW" && permitcondn.length > 0) {
44186
- permitcondn = [];
44187
- PermitConditions = {};
44188
- }
44189
45616
 
44190
- if (BPA !== null && BPA !== void 0 && BPA.approvalNo) {
44191
- var _applicationDetailsIn, _applicationDetailsIn2, _BPA$additionalDetail6, _BPA$additionalDetail7, _BPA$additionalDetail8;
45617
+ if (riskType == "LOW" && approvalChecks.length > 0) approvalChecksDetails = {};
45618
+ var val;
45619
+ var i;
45620
+ var FieldInspectionData = [];
45621
+ inspectionReport && (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail13 = BPA.additionalDetails) === null || _BPA$additionalDetail13 === void 0 ? void 0 : (_BPA$additionalDetail14 = _BPA$additionalDetail13.fieldinspection_pending) === null || _BPA$additionalDetail14 === void 0 ? void 0 : (_BPA$additionalDetail15 = _BPA$additionalDetail14[0]) === null || _BPA$additionalDetail15 === void 0 ? void 0 : _BPA$additionalDetail15.questions.length) > 0 && inspectionReport.map(function (ob, index) {
45622
+ if (ob.title.includes("FI_REPORT")) FieldInspectionData = [].concat(FieldInspectionData, [{
45623
+ title: ob.title,
45624
+ additionalDetails: {
45625
+ inspectionReport: [],
45626
+ values: ob.values
45627
+ }
45628
+ }]);else if (ob.title.includes("CHECK_LIST")) FieldInspectionData = [].concat(FieldInspectionData, [{
45629
+ title: ob.title,
45630
+ additionalDetails: {
45631
+ isChecklist: true,
45632
+ inspectionReport: [],
45633
+ values: ob.values
45634
+ }
45635
+ }]);else {
45636
+ var _ob$additionalDetails, _ob$additionalDetails2;
44192
45637
 
44193
- applicationDetailsInfo === null || applicationDetailsInfo === void 0 ? void 0 : (_applicationDetailsIn = applicationDetailsInfo.values) === null || _applicationDetailsIn === void 0 ? void 0 : _applicationDetailsIn.push({
44194
- title: (BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC" ? "BPA_PERMIT_NUMBER_LABEL" : "BPA_OC_PERMIT_NUMBER_LABEL",
44195
- value: (BPA === null || BPA === void 0 ? void 0 : BPA.approvalNo) || "NA"
44196
- });
44197
- applicationDetailsInfo === null || applicationDetailsInfo === void 0 ? void 0 : (_applicationDetailsIn2 = applicationDetailsInfo.values) === null || _applicationDetailsIn2 === void 0 ? void 0 : _applicationDetailsIn2.push({
44198
- title: (BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC" ? "BPA_PERMIT_VALIDITY" : "BPA_OC_PERMIT_VALIDITY",
44199
- value: BPA !== null && BPA !== void 0 && (_BPA$additionalDetail6 = BPA.additionalDetails) !== null && _BPA$additionalDetail6 !== void 0 && _BPA$additionalDetail6.validityDate ? ConvertEpochToValidityDate(BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail7 = BPA.additionalDetails) === null || _BPA$additionalDetail7 === void 0 ? void 0 : _BPA$additionalDetail7.validityDate) + " - " + dateFns.format(new Date(BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail8 = BPA.additionalDetails) === null || _BPA$additionalDetail8 === void 0 ? void 0 : _BPA$additionalDetail8.validityDate), 'dd/MM/yyyy') : "NA"
45638
+ var improvedDoc = [].concat((_ob$additionalDetails = ob.additionalDetails.obpsDocuments) === null || _ob$additionalDetails === void 0 ? void 0 : (_ob$additionalDetails2 = _ob$additionalDetails[0]) === null || _ob$additionalDetails2 === void 0 ? void 0 : _ob$additionalDetails2.values);
45639
+ improvedDoc.map(function (ob) {
45640
+ ob["isNotDuplicate"] = true;
45641
+ });
45642
+ improvedDoc.map(function (ob, index) {
45643
+ val = ob.documentType;
45644
+ if (ob.isNotDuplicate == true) for (i = index + 1; i < improvedDoc.length; i++) {
45645
+ if (val === improvedDoc[i].documentType) improvedDoc[i].isNotDuplicate = false;
45646
+ }
45647
+ });
45648
+ FieldInspectionData = [].concat(FieldInspectionData, [{
45649
+ title: ob.title,
45650
+ additionalDetails: {
45651
+ FIdocuments: [],
45652
+ "documents": [{
45653
+ values: improvedDoc
45654
+ }]
45655
+ }
45656
+ }]);
45657
+ }
44200
45658
  });
44201
- }
45659
+ var fiReports = {
45660
+ title: "",
45661
+ isFieldInspection: true,
45662
+ isNotAllowed: (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail16 = BPA.additionalDetails) === null || _BPA$additionalDetail16 === void 0 ? void 0 : (_BPA$additionalDetail17 = _BPA$additionalDetail16.fieldinspection_pending) === null || _BPA$additionalDetail17 === void 0 ? void 0 : _BPA$additionalDetail17.length) > 0 ? false : true,
45663
+ additionalDetails: {
45664
+ values: [],
45665
+ fiReport: (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail18 = BPA.additionalDetails) === null || _BPA$additionalDetail18 === void 0 ? void 0 : (_BPA$additionalDetail19 = _BPA$additionalDetail18.fieldinspection_pending) === null || _BPA$additionalDetail19 === void 0 ? void 0 : _BPA$additionalDetail19.length) > 0 ? true : false
45666
+ }
45667
+ };
44202
45668
 
44203
- var basicDetails = {
44204
- title: "BPA_BASIC_DETAILS_TITLE",
44205
- asSectionHeader: true,
44206
- isInsert: true,
44207
- isCommon: true,
44208
- values: [{
44209
- title: "BPA_BASIC_DETAILS_APP_DATE_LABEL",
44210
- value: BPA !== null && BPA !== void 0 && (_BPA$auditDetails = BPA.auditDetails) !== null && _BPA$auditDetails !== void 0 && _BPA$auditDetails.createdTime ? dateFns.format(new Date(BPA === null || BPA === void 0 ? void 0 : (_BPA$auditDetails2 = BPA.auditDetails) === null || _BPA$auditDetails2 === void 0 ? void 0 : _BPA$auditDetails2.createdTime), 'dd/MM/yyyy') : ''
44211
- }, {
44212
- title: "BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL",
44213
- value: "WF_BPA_" + (edcr === null || edcr === void 0 ? void 0 : edcr.appliactionType)
44214
- }, {
44215
- title: "BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL",
44216
- value: edcr === null || edcr === void 0 ? void 0 : edcr.applicationSubType
44217
- }, {
44218
- title: "BPA_BASIC_DETAILS_OCCUPANCY_LABEL",
44219
- value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail3 = edcr.planDetail) === null || _edcr$planDetail3 === void 0 ? void 0 : (_edcr$planDetail3$pla = _edcr$planDetail3.planInformation) === null || _edcr$planDetail3$pla === void 0 ? void 0 : _edcr$planDetail3$pla.occupancy
44220
- }, {
44221
- title: "BPA_BASIC_DETAILS_RISK_TYPE_LABEL",
44222
- value: "WF_BPA_" + riskType,
44223
- isInsert: true
44224
- }, {
44225
- title: "BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL",
44226
- value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail4 = edcr.planDetail) === null || _edcr$planDetail4 === void 0 ? void 0 : (_edcr$planDetail4$pla = _edcr$planDetail4.planInformation) === null || _edcr$planDetail4$pla === void 0 ? void 0 : _edcr$planDetail4$pla.applicantName
44227
- }]
44228
- };
44229
- var plotDetails = {
44230
- title: "BPA_PLOT_DETAILS_TITLE",
44231
- asSectionHeader: true,
44232
- isCommon: true,
44233
- values: [{
44234
- title: "BPA_BOUNDARY_PLOT_AREA_LABEL",
44235
- value: "" + (edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail5 = edcr.planDetail) === null || _edcr$planDetail5 === void 0 ? void 0 : (_edcr$planDetail5$pla = _edcr$planDetail5.planInformation) === null || _edcr$planDetail5$pla === void 0 ? void 0 : _edcr$planDetail5$pla.plotArea),
44236
- isNotTranslated: true,
44237
- isUnit: "BPA_SQ_FT_LABEL"
44238
- }, {
44239
- title: "BPA_PLOT_NUMBER_LABEL",
44240
- value: (edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail6 = edcr.planDetail) === null || _edcr$planDetail6 === void 0 ? void 0 : (_edcr$planDetail6$pla = _edcr$planDetail6.planInformation) === null || _edcr$planDetail6$pla === void 0 ? void 0 : _edcr$planDetail6$pla.plotNo) || "NA",
44241
- isNotTranslated: true
44242
- }, {
44243
- title: "BPA_KHATHA_NUMBER_LABEL",
44244
- value: (edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail7 = edcr.planDetail) === null || _edcr$planDetail7 === void 0 ? void 0 : (_edcr$planDetail7$pla = _edcr$planDetail7.planInformation) === null || _edcr$planDetail7$pla === void 0 ? void 0 : _edcr$planDetail7$pla.khataNo) || "NA",
44245
- isNotTranslated: true
44246
- }, {
44247
- title: "BPA_HOLDING_NUMBER_LABEL",
44248
- value: (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail9 = BPA.additionalDetails) === null || _BPA$additionalDetail9 === void 0 ? void 0 : _BPA$additionalDetail9.holdingNo) || "NA",
44249
- isNotTranslated: true
44250
- }, {
44251
- title: "BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",
44252
- value: (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail10 = BPA.additionalDetails) === null || _BPA$additionalDetail10 === void 0 ? void 0 : _BPA$additionalDetail10.registrationDetails) || "NA",
44253
- isNotTranslated: true
44254
- }]
44255
- };
44256
- var scrutinyDetails = {
44257
- title: "BPA_STEPPER_SCRUTINY_DETAILS_HEADER",
44258
- isScrutinyDetails: true,
44259
- isBackGroundColor: true,
44260
- additionalDetails: {
44261
- values: [{
44262
- title: "BPA_EDCR_DETAILS",
44263
- value: " ",
44264
- isHeader: true
44265
- }, {
44266
- title: (BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC" ? "BPA_EDCR_NO_LABEL" : "BPA_OC_EDCR_NO_LABEL",
44267
- value: (BPA === null || BPA === void 0 ? void 0 : BPA.edcrNumber) || "NA"
44268
- }],
44269
- scruntinyDetails: [{
44270
- title: "BPA_UPLOADED_PLAN_DIAGRAM",
44271
- value: edcr === null || edcr === void 0 ? void 0 : edcr.updatedDxfFile,
44272
- text: "BPA_UPLOADED_PLAN_DXF"
44273
- }, {
44274
- title: "BPA_SCRUNTINY_REPORT_OUTPUT",
44275
- value: edcr === null || edcr === void 0 ? void 0 : edcr.planReport,
44276
- text: "BPA_SCRUTINY_REPORT_PDF"
44277
- }]
44278
- }
44279
- };
44280
- var buildingExtractionDetails = {
44281
- title: "",
44282
- isScrutinyDetails: true,
44283
- isBackGroundColor: true,
44284
- additionalDetails: {
44285
- values: [{
44286
- title: (BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC" ? "BPA_BUILDING_EXTRACT_HEADER" : "BPA_ACTUAL_BUILDING_EXTRACT_HEADER",
44287
- value: " ",
44288
- isHeader: true
44289
- }, {
44290
- title: "BPA_TOTAL_BUILT_UP_AREA_HEADER",
44291
- value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail8 = edcr.planDetail) === null || _edcr$planDetail8 === void 0 ? void 0 : (_edcr$planDetail8$blo = _edcr$planDetail8.blocks) === null || _edcr$planDetail8$blo === void 0 ? void 0 : (_edcr$planDetail8$blo2 = _edcr$planDetail8$blo[0]) === null || _edcr$planDetail8$blo2 === void 0 ? void 0 : (_edcr$planDetail8$blo3 = _edcr$planDetail8$blo2.building) === null || _edcr$planDetail8$blo3 === void 0 ? void 0 : _edcr$planDetail8$blo3.totalBuitUpArea,
44292
- isUnit: "BPA_SQ_MTRS_LABEL"
44293
- }, {
44294
- title: "BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL",
44295
- value: (edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail9 = edcr.planDetail) === null || _edcr$planDetail9 === void 0 ? void 0 : (_edcr$planDetail9$blo = _edcr$planDetail9.blocks) === null || _edcr$planDetail9$blo === void 0 ? void 0 : (_edcr$planDetail9$blo2 = _edcr$planDetail9$blo[0]) === null || _edcr$planDetail9$blo2 === void 0 ? void 0 : (_edcr$planDetail9$blo3 = _edcr$planDetail9$blo2.building) === null || _edcr$planDetail9$blo3 === void 0 ? void 0 : _edcr$planDetail9$blo3.totalFloors) || "NA"
44296
- }, {
44297
- title: "BPA_HEIGHT_FROM_GROUND_LEVEL",
44298
- value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail10 = edcr.planDetail) === null || _edcr$planDetail10 === void 0 ? void 0 : (_edcr$planDetail10$bl = _edcr$planDetail10.blocks) === null || _edcr$planDetail10$bl === void 0 ? void 0 : (_edcr$planDetail10$bl2 = _edcr$planDetail10$bl[0]) === null || _edcr$planDetail10$bl2 === void 0 ? void 0 : (_edcr$planDetail10$bl3 = _edcr$planDetail10$bl2.building) === null || _edcr$planDetail10$bl3 === void 0 ? void 0 : _edcr$planDetail10$bl3.declaredBuildingHeigh,
44299
- isUnit: "BPA_MTRS_LABEL"
44300
- }],
44301
- scruntinyDetails: []
44302
- }
44303
- };
44304
- var demolitionAreaDetails = {
44305
- title: "",
44306
- isScrutinyDetails: true,
44307
- isBackGroundColor: true,
44308
- additionalDetails: {
44309
- values: [{
44310
- title: "BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL",
44311
- value: " ",
44312
- isHeader: true
44313
- }, {
44314
- title: "BPA_APPLICATION_DEMOLITION_AREA_LABEL",
44315
- value: edcr === null || edcr === void 0 ? void 0 : (_edcr$planDetail11 = edcr.planDetail) === null || _edcr$planDetail11 === void 0 ? void 0 : (_edcr$planDetail11$pl = _edcr$planDetail11.planInformation) === null || _edcr$planDetail11$pl === void 0 ? void 0 : _edcr$planDetail11$pl.demolitionArea,
44316
- isUnit: "BPA_SQ_MTRS_LABEL"
44317
- }],
44318
- scruntinyDetails: []
44319
- }
44320
- };
44321
- var subOccupancyTableDetails = {
44322
- title: "",
44323
- isSubOccupancyTable: true,
44324
- isTitleRepeat: true,
44325
- additionalDetails: {
44326
- values: [{
44327
- title: "BPA_OCC_SUBOCC_HEADER",
44328
- value: " ",
44329
- isHeader: true
44330
- }],
44331
- subOccupancyTableDetails: [{
44332
- title: "BPA_APPLICATION_DEMOLITION_AREA_LABEL",
44333
- value: edcr
44334
- }, {
44335
- title: "NO_REPEAT",
44336
- value: ""
44337
- }]
45669
+ if ((BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC") {
45670
+ details = [].concat(details, [applicationDetailsInfo, basicDetails, plotDetails, scrutinyDetails, buildingExtractionDetails, subOccupancyTableDetails, demolitionAreaDetails, addressDetails, ownerDetails, documentDetails, fiReports], nocDetails, [approvalChecksDetails, PermitConditions]);
45671
+ } else {
45672
+ details = [].concat(details, [applicationDetailsInfo, basicDetails, plotDetails, scrutinyDetails, buildingExtractionDetails, subOccupancyTableDetails, demolitionAreaDetails, documentDetails, fiReports], nocDetails, [PermitConditions]);
44338
45673
  }
44339
- };
44340
- var addressDetails = {
44341
- title: "BPA_NEW_TRADE_DETAILS_HEADER_DETAILS",
44342
- asSectionHeader: true,
44343
- isCommon: true,
44344
- values: [{
44345
- title: "BPA_DETAILS_PIN_LABEL",
44346
- value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo = BPA.landInfo) === null || _BPA$landInfo === void 0 ? void 0 : (_BPA$landInfo$address = _BPA$landInfo.address) === null || _BPA$landInfo$address === void 0 ? void 0 : _BPA$landInfo$address.pincode
44347
- }, {
44348
- title: "BPA_CITY_LABEL",
44349
- value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo2 = BPA.landInfo) === null || _BPA$landInfo2 === void 0 ? void 0 : (_BPA$landInfo2$addres = _BPA$landInfo2.address) === null || _BPA$landInfo2$addres === void 0 ? void 0 : _BPA$landInfo2$addres.city
44350
- }, {
44351
- title: "BPA_LOC_MOHALLA_LABEL",
44352
- value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo3 = BPA.landInfo) === null || _BPA$landInfo3 === void 0 ? void 0 : (_BPA$landInfo3$addres = _BPA$landInfo3.address) === null || _BPA$landInfo3$addres === void 0 ? void 0 : (_BPA$landInfo3$addres2 = _BPA$landInfo3$addres.locality) === null || _BPA$landInfo3$addres2 === void 0 ? void 0 : _BPA$landInfo3$addres2.name
44353
- }, {
44354
- title: "BPA_DETAILS_SRT_NAME_LABEL",
44355
- value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo4 = BPA.landInfo) === null || _BPA$landInfo4 === void 0 ? void 0 : (_BPA$landInfo4$addres = _BPA$landInfo4.address) === null || _BPA$landInfo4$addres === void 0 ? void 0 : _BPA$landInfo4$addres.street
44356
- }, {
44357
- title: "ES_NEW_APPLICATION_LOCATION_LANDMARK",
44358
- value: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo5 = BPA.landInfo) === null || _BPA$landInfo5 === void 0 ? void 0 : (_BPA$landInfo5$addres = _BPA$landInfo5.address) === null || _BPA$landInfo5$addres === void 0 ? void 0 : _BPA$landInfo5$addres.landmark
44359
- }]
44360
- };
44361
- var checkOwnerLength = (BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo6 = BPA.landInfo) === null || _BPA$landInfo6 === void 0 ? void 0 : (_BPA$landInfo6$owners = _BPA$landInfo6.owners) === null || _BPA$landInfo6$owners === void 0 ? void 0 : _BPA$landInfo6$owners.length) || 1;
44362
-
44363
- if ((BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo7 = BPA.landInfo) === null || _BPA$landInfo7 === void 0 ? void 0 : (_BPA$landInfo7$owners = _BPA$landInfo7.owners) === null || _BPA$landInfo7$owners === void 0 ? void 0 : _BPA$landInfo7$owners.length) > 0) {
44364
- var _BPA$landInfo8, _BPA$landInfo8$owners;
44365
45674
 
44366
- BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo8 = BPA.landInfo) === null || _BPA$landInfo8 === void 0 ? void 0 : (_BPA$landInfo8$owners = _BPA$landInfo8.owners) === null || _BPA$landInfo8$owners === void 0 ? void 0 : _BPA$landInfo8$owners.forEach(function (ownerD) {
44367
- if (!ownerD.isPrimaryOwner) ownerD.isPrimaryOwner = "false";
45675
+ var bpaFilterDetails = (_details = details) === null || _details === void 0 ? void 0 : _details.filter(function (data) {
45676
+ return data;
44368
45677
  });
45678
+ return {
45679
+ applicationData: BPA,
45680
+ applicationDetails: bpaFilterDetails,
45681
+ tenantId: BPA === null || BPA === void 0 ? void 0 : BPA.tenantId,
45682
+ edcrDetails: edcr,
45683
+ nocData: noc,
45684
+ comparisionReport: comparisionReport === null || comparisionReport === void 0 ? void 0 : comparisionReport.comparisonDetail,
45685
+ businessService: BPA === null || BPA === void 0 ? void 0 : BPA.businessService,
45686
+ applicationNo: BPA === null || BPA === void 0 ? void 0 : BPA.applicationNo,
45687
+ applicationStatus: BPA === null || BPA === void 0 ? void 0 : BPA.status
45688
+ };
44369
45689
  }
44370
45690
 
44371
- var ownerDetails = {
44372
- title: "BPA_APPLICANT_DETAILS_HEADER",
44373
- isOwnerDetails: true,
44374
- additionalDetails: {
44375
- owners: BPA === null || BPA === void 0 ? void 0 : (_BPA$landInfo9 = BPA.landInfo) === null || _BPA$landInfo9 === void 0 ? void 0 : (_BPA$landInfo9$owners = _BPA$landInfo9.owners) === null || _BPA$landInfo9$owners === void 0 ? void 0 : _BPA$landInfo9$owners.map(function (owner, index) {
44376
- return {
44377
- title: Number(checkOwnerLength) > 1 ? "COMMON_OWNER" : "",
44378
- values: [{
44379
- title: "CORE_COMMON_NAME",
44380
- value: owner === null || owner === void 0 ? void 0 : owner.name
44381
- }, {
44382
- title: "BPA_APPLICANT_GENDER_LABEL",
44383
- value: owner === null || owner === void 0 ? void 0 : owner.gender
44384
- }, {
44385
- title: "CORE_COMMON_MOBILE_NUMBER",
44386
- value: owner === null || owner === void 0 ? void 0 : owner.mobileNumber
44387
- }, {
44388
- title: "BPA_IS_PRIMARY_OWNER_LABEL",
44389
- value: owner === null || owner === void 0 ? void 0 : owner.isPrimaryOwner,
44390
- isNotTranslated: false
44391
- }]
44392
- };
44393
- })
44394
- }
44395
- };
44396
- var documentDetails = {
44397
- title: "BPA_DOCUMENT_DETAILS_LABEL",
44398
- asSectionHeader: true,
44399
- isDocumentDetails: true,
44400
- additionalDetails: {
44401
- obpsDocuments: [{
44402
- title: "",
44403
- values: BPA === null || BPA === void 0 ? void 0 : (_BPA$documents = BPA.documents) === null || _BPA$documents === void 0 ? void 0 : _BPA$documents.map(function (doc) {
44404
- var _doc$documentType4;
44405
-
44406
- return {
44407
- title: doc === null || doc === void 0 ? void 0 : (_doc$documentType4 = doc.documentType) === null || _doc$documentType4 === void 0 ? void 0 : _doc$documentType4.replaceAll('.', '_'),
44408
- documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
44409
- documentUid: doc === null || doc === void 0 ? void 0 : doc.documentUid,
44410
- fileStoreId: doc === null || doc === void 0 ? void 0 : doc.fileStoreId,
44411
- id: doc === null || doc === void 0 ? void 0 : doc.id
44412
- };
44413
- })
44414
- }]
44415
- }
44416
- };
44417
- var approvalChecks = [];
44418
- var approvalChecksDetails = {};
44419
-
44420
- if ((BPA === null || BPA === void 0 ? void 0 : BPA.status) === "APPROVAL_INPROGRESS") {
44421
- var _mdmsRes$BPA2;
45691
+ noc === null || noc === void 0 ? void 0 : noc.map(function (nocDetails) {
45692
+ var _nocDetails$documents2;
44422
45693
 
44423
- mdmsRes === null || mdmsRes === void 0 ? void 0 : (_mdmsRes$BPA2 = mdmsRes.BPA) === null || _mdmsRes$BPA2 === void 0 ? void 0 : _mdmsRes$BPA2.CheckList.forEach(function (checklist) {
44424
- var _checklist$conditions;
44425
-
44426
- if ((checklist === null || checklist === void 0 ? void 0 : checklist.RiskType) === riskType && (checklist === null || checklist === void 0 ? void 0 : checklist.applicationType) === (edcr === null || edcr === void 0 ? void 0 : edcr.appliactionType) && (checklist === null || checklist === void 0 ? void 0 : checklist.ServiceType) === (edcr === null || edcr === void 0 ? void 0 : edcr.applicationSubType) && (checklist === null || checklist === void 0 ? void 0 : checklist.WFState) === "PENDINGAPPROVAL" && (checklist === null || checklist === void 0 ? void 0 : (_checklist$conditions = checklist.conditions) === null || _checklist$conditions === void 0 ? void 0 : _checklist$conditions.length) > 0) {
44427
- approvalChecks.push.apply(approvalChecks, checklist === null || checklist === void 0 ? void 0 : checklist.conditions);
44428
- }
45694
+ nocDetails === null || nocDetails === void 0 ? void 0 : (_nocDetails$documents2 = nocDetails.documents) === null || _nocDetails$documents2 === void 0 ? void 0 : _nocDetails$documents2.map(function (nocDoc) {
45695
+ if (nocDoc !== null && nocDoc !== void 0 && nocDoc.fileStoreId) appDocumentFileStoreIds.push(nocDoc === null || nocDoc === void 0 ? void 0 : nocDoc.fileStoreId);
44429
45696
  });
44430
- approvalChecksDetails = {
44431
- title: "",
44432
- isTitleVisible: (approvalChecks === null || approvalChecks === void 0 ? void 0 : approvalChecks.length) > 0 ? false : true,
44433
- asSectionHeader: true,
44434
- isPermissions: true,
44435
- additionalDetails: {
44436
- permissions: approvalChecks
44437
- }
44438
- };
44439
- }
45697
+ });
45698
+ var fileDetails = {};
44440
45699
 
44441
- if (riskType == "LOW" && approvalChecks.length > 0) approvalChecksDetails = {};
44442
- var val;
44443
- var i;
44444
- var FieldInspectionData = [];
44445
- inspectionReport && (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail11 = BPA.additionalDetails) === null || _BPA$additionalDetail11 === void 0 ? void 0 : (_BPA$additionalDetail12 = _BPA$additionalDetail11.fieldinspection_pending) === null || _BPA$additionalDetail12 === void 0 ? void 0 : (_BPA$additionalDetail13 = _BPA$additionalDetail12[0]) === null || _BPA$additionalDetail13 === void 0 ? void 0 : _BPA$additionalDetail13.questions.length) > 0 && inspectionReport.map(function (ob, index) {
44446
- if (ob.title.includes("FI_REPORT")) FieldInspectionData = [].concat(FieldInspectionData, [{
44447
- title: ob.title,
44448
- additionalDetails: {
44449
- inspectionReport: [],
44450
- values: ob.values
44451
- }
44452
- }]);else if (ob.title.includes("CHECK_LIST")) FieldInspectionData = [].concat(FieldInspectionData, [{
44453
- title: ob.title,
44454
- additionalDetails: {
44455
- isChecklist: true,
44456
- inspectionReport: [],
44457
- values: ob.values
44458
- }
44459
- }]);else {
44460
- var _ob$additionalDetails, _ob$additionalDetails2;
45700
+ var _temp3 = function () {
45701
+ var _appDocumentFileStore;
44461
45702
 
44462
- var improvedDoc = [].concat((_ob$additionalDetails = ob.additionalDetails.obpsDocuments) === null || _ob$additionalDetails === void 0 ? void 0 : (_ob$additionalDetails2 = _ob$additionalDetails[0]) === null || _ob$additionalDetails2 === void 0 ? void 0 : _ob$additionalDetails2.values);
44463
- improvedDoc.map(function (ob) {
44464
- ob["isNotDuplicate"] = true;
44465
- });
44466
- improvedDoc.map(function (ob, index) {
44467
- val = ob.documentType;
44468
- if (ob.isNotDuplicate == true) for (i = index + 1; i < improvedDoc.length; i++) {
44469
- if (val === improvedDoc[i].documentType) improvedDoc[i].isNotDuplicate = false;
44470
- }
45703
+ if (((_appDocumentFileStore = appDocumentFileStoreIds) === null || _appDocumentFileStore === void 0 ? void 0 : _appDocumentFileStore.length) > 0) {
45704
+ return Promise.resolve(UploadServices.Filefetch(appDocumentFileStoreIds, Digit.ULBService.getStateId())).then(function (_UploadServices$Filef2) {
45705
+ fileDetails = _UploadServices$Filef2;
44471
45706
  });
44472
- FieldInspectionData = [].concat(FieldInspectionData, [{
44473
- title: ob.title,
44474
- additionalDetails: {
44475
- FIdocuments: [],
44476
- "documents": [{
44477
- values: improvedDoc
44478
- }]
44479
- }
44480
- }]);
44481
- }
44482
- });
44483
- var fiReports = {
44484
- title: "",
44485
- isFieldInspection: true,
44486
- isNotAllowed: (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail14 = BPA.additionalDetails) === null || _BPA$additionalDetail14 === void 0 ? void 0 : (_BPA$additionalDetail15 = _BPA$additionalDetail14.fieldinspection_pending) === null || _BPA$additionalDetail15 === void 0 ? void 0 : _BPA$additionalDetail15.length) > 0 ? false : true,
44487
- additionalDetails: {
44488
- values: [],
44489
- fiReport: (BPA === null || BPA === void 0 ? void 0 : (_BPA$additionalDetail16 = BPA.additionalDetails) === null || _BPA$additionalDetail16 === void 0 ? void 0 : (_BPA$additionalDetail17 = _BPA$additionalDetail16.fieldinspection_pending) === null || _BPA$additionalDetail17 === void 0 ? void 0 : _BPA$additionalDetail17.length) > 0 ? true : false
44490
45707
  }
44491
- };
44492
-
44493
- if ((BPA === null || BPA === void 0 ? void 0 : BPA.businessService) !== "BPA_OC") {
44494
- details = [].concat(details, [applicationDetailsInfo, basicDetails, plotDetails, scrutinyDetails, buildingExtractionDetails, subOccupancyTableDetails, demolitionAreaDetails, addressDetails, ownerDetails, documentDetails, fiReports], nocDetails, [approvalChecksDetails, PermitConditions]);
44495
- } else {
44496
- details = [].concat(details, [applicationDetailsInfo, basicDetails, plotDetails, scrutinyDetails, buildingExtractionDetails, subOccupancyTableDetails, demolitionAreaDetails, documentDetails, fiReports], nocDetails, [PermitConditions]);
44497
- }
45708
+ }();
44498
45709
 
44499
- var bpaFilterDetails = (_details = details) === null || _details === void 0 ? void 0 : _details.filter(function (data) {
44500
- return data;
44501
- });
44502
- return {
44503
- applicationData: BPA,
44504
- applicationDetails: bpaFilterDetails,
44505
- tenantId: BPA === null || BPA === void 0 ? void 0 : BPA.tenantId,
44506
- edcrDetails: edcr,
44507
- nocData: noc,
44508
- comparisionReport: comparisionReport === null || comparisionReport === void 0 ? void 0 : comparisionReport.comparisonDetail,
44509
- businessService: BPA === null || BPA === void 0 ? void 0 : BPA.businessService,
44510
- applicationNo: BPA === null || BPA === void 0 ? void 0 : BPA.applicationNo,
44511
- applicationStatus: BPA === null || BPA === void 0 ? void 0 : BPA.status
44512
- };
45710
+ return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
44513
45711
  });
44514
45712
  });
44515
45713
  });
@@ -44794,6 +45992,34 @@ var useOBPSDocumentSearch = function useOBPSDocumentSearch(_ref, config, Code, i
44794
45992
  };
44795
45993
  };
44796
45994
 
45995
+ var updateNOCAPI = function updateNOCAPI(data, tenantId) {
45996
+ try {
45997
+ return Promise.resolve(_catch(function () {
45998
+ return Promise.resolve(OBPSService.updateNOC(data, tenantId));
45999
+ }, function (error) {
46000
+ var _error$response, _error$response$data;
46001
+
46002
+ throw new Error(error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.Errors[0].code);
46003
+ }));
46004
+ } catch (e) {
46005
+ return Promise.reject(e);
46006
+ }
46007
+ };
46008
+
46009
+ var updateAPI = function updateAPI(data, tenantId) {
46010
+ try {
46011
+ return Promise.resolve(_catch(function () {
46012
+ return Promise.resolve(OBPSService.update(data, tenantId));
46013
+ }, function (error) {
46014
+ var _error$response2, _error$response2$data;
46015
+
46016
+ throw new Error(error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : _error$response2$data.Errors[0].code);
46017
+ }));
46018
+ } catch (e) {
46019
+ return Promise.reject(e);
46020
+ }
46021
+ };
46022
+
44797
46023
  var useObpsAPI = function useObpsAPI(tenantId, type) {
44798
46024
  if (type === void 0) {
44799
46025
  type = false;
@@ -44801,11 +46027,11 @@ var useObpsAPI = function useObpsAPI(tenantId, type) {
44801
46027
 
44802
46028
  if (type) {
44803
46029
  return reactQuery.useMutation(function (data) {
44804
- return OBPSService.updateNOC(data, tenantId);
46030
+ return updateNOCAPI(data, tenantId);
44805
46031
  });
44806
46032
  } else {
44807
46033
  return reactQuery.useMutation(function (data) {
44808
- return OBPSService.update(data, tenantId);
46034
+ return updateAPI(data, tenantId);
44809
46035
  });
44810
46036
  }
44811
46037
  };
@@ -44989,7 +46215,7 @@ var useBPAInbox = function useBPAInbox(_ref) {
44989
46215
  processSearchCriteria: _extends({
44990
46216
  assignee: assignee === "ASSIGNED_TO_ME" ? user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.uuid : "",
44991
46217
  moduleName: moduleName !== "BPAREG" ? "bpa-services" : "BPAREG",
44992
- businessService: moduleName !== "BPAREG" ? businessService ? [businessService] : ["BPA_LOW", "BPA", "BPA_OC"] : businessService ? [businessService.identifier] : ["ARCHITECT", "BUILDER", "ENGINEER", "STRUCTURALENGINEER"]
46218
+ businessService: moduleName !== "BPAREG" ? businessService ? [businessService] : ["BPA_LOW", "BPA", "BPA_OC"] : businessService ? [businessService.identifier] : ["ARCHITECT", "BUILDER", "ENGINEER", "STRUCTURALENGINEER", "TOWNPLANNER", "SUPERVISOR"]
44993
46219
  }, (applicationStatus === null || applicationStatus === void 0 ? void 0 : applicationStatus.length) > 0 ? {
44994
46220
  status: applicationStatus
44995
46221
  } : {}),
@@ -45012,9 +46238,15 @@ var useBPAInbox = function useBPAInbox(_ref) {
45012
46238
  return item.code.split("_").pop();
45013
46239
  }).join(",")
45014
46240
  } : {}),
45015
- limit: limit,
45016
- offset: offset
46241
+ limit: limit
45017
46242
  };
46243
+
46244
+ if (!applicationNo) {
46245
+ _filters = _extends({}, _filters, {
46246
+ offset: offset
46247
+ });
46248
+ }
46249
+
45018
46250
  return useInbox({
45019
46251
  tenantId: tenantId,
45020
46252
  filters: _filters,
@@ -45411,8 +46643,8 @@ var useBusinessServiceData = function useBusinessServiceData(tenantId, businessS
45411
46643
  }, config);
45412
46644
  };
45413
46645
 
45414
- var useBPATaxDocuments = function useBPATaxDocuments(stateId, formData, PrevStateDocuments) {
45415
- var _bpaDocs$BPA, _filtredBpaDocs, _filtredBpaDocs$, _filtredBpaDocs$$docT;
46646
+ var useBPATaxDocuments = function useBPATaxDocuments(stateId, formData, beforeUploadDocuments) {
46647
+ var _beforeUploadDocument, _data$pdfFiles, _bpaDocs$BPA, _filtredBpaDocs, _filtredBpaDocs$, _filtredBpaDocs$$docT;
45416
46648
 
45417
46649
  var _Digit$Hooks$obps$use = Digit.Hooks.obps.useMDMS(stateId, "BPA", ["DocTypeMapping"]),
45418
46650
  bpaDocsLoading = _Digit$Hooks$obps$use.isLoading,
@@ -45422,6 +46654,17 @@ var useBPATaxDocuments = function useBPATaxDocuments(stateId, formData, PrevStat
45422
46654
  commonDocsLoading = _Digit$Hooks$obps$use2.isLoading,
45423
46655
  commonDocs = _Digit$Hooks$obps$use2.data;
45424
46656
 
46657
+ var documents = beforeUploadDocuments;
46658
+
46659
+ var _Digit$Hooks$useDocum = Digit.Hooks.useDocumentSearch(documents, {
46660
+ enabled: ((_beforeUploadDocument = beforeUploadDocuments) === null || _beforeUploadDocument === void 0 ? void 0 : _beforeUploadDocument.length) > 0 ? true : false
46661
+ }),
46662
+ data = _Digit$Hooks$useDocum.data;
46663
+
46664
+ if ((data === null || data === void 0 ? void 0 : (_data$pdfFiles = data.pdfFiles) === null || _data$pdfFiles === void 0 ? void 0 : _data$pdfFiles.length) > 0) {
46665
+ beforeUploadDocuments = data === null || data === void 0 ? void 0 : data.pdfFiles;
46666
+ }
46667
+
45425
46668
  var filtredBpaDocs = [];
45426
46669
 
45427
46670
  if (bpaDocs !== null && bpaDocs !== void 0 && (_bpaDocs$BPA = bpaDocs.BPA) !== null && _bpaDocs$BPA !== void 0 && _bpaDocs$BPA.DocTypeMapping) {
@@ -45452,7 +46695,7 @@ var useBPATaxDocuments = function useBPATaxDocuments(stateId, formData, PrevStat
45452
46695
  });
45453
46696
  doc.uploadedDocuments[0] = {};
45454
46697
  doc.uploadedDocuments[0].values = [];
45455
- PrevStateDocuments.map(function (upDocs) {
46698
+ beforeUploadDocuments.map(function (upDocs) {
45456
46699
  var _upDocs$documentType, _upDocs$documentType2;
45457
46700
 
45458
46701
  if (code === (upDocs === null || upDocs === void 0 ? void 0 : (_upDocs$documentType = upDocs.documentType) === null || _upDocs$documentType === void 0 ? void 0 : _upDocs$documentType.split('.')[0]) + "." + (upDocs === null || upDocs === void 0 ? void 0 : (_upDocs$documentType2 = upDocs.documentType) === null || _upDocs$documentType2 === void 0 ? void 0 : _upDocs$documentType2.split('.')[1])) {
@@ -46533,6 +47776,7 @@ var Hooks = {
46533
47776
  useClearNotifications: useClearNotifications,
46534
47777
  useNotificationCount: useNotificationCount,
46535
47778
  useStore: useStore$1,
47779
+ useDocumentSearch: useDocumentSearch,
46536
47780
  useTenants: useTenants,
46537
47781
  useInbox: useTLInbox,
46538
47782
  pgr: pgr,