@djb25/digit-ui-module-ws 1.0.49 → 1.0.50

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.
@@ -10043,7 +10043,7 @@ const BILLSBreadCrumbs = _ref => {
10043
10043
  }));
10044
10044
  };
10045
10045
  const App$1 = _ref2 => {
10046
- var _Digit, _Digit$ComponentRegis, _Digit2, _Digit2$ComponentRegi, _Digit3, _Digit3$ComponentRegi, _Digit4, _Digit4$ComponentRegi, _Digit5, _Digit5$ComponentRegi, _Digit6, _Digit6$ComponentRegi, _Digit7, _Digit7$ComponentRegi, _Digit8, _Digit8$ComponentRegi, _Digit9, _Digit9$ComponentRegi, _Digit0, _Digit0$ComponentRegi, _Digit1, _Digit1$ComponentRegi, _Digit10, _Digit10$ComponentReg, _Digit11, _Digit11$ComponentReg, _Digit12, _Digit12$ComponentReg, _Digit13, _Digit13$ComponentReg, _Digit14, _Digit14$ComponentReg, _Digit15, _Digit15$ComponentReg, _Digit16, _Digit16$ComponentReg, _Digit17, _Digit17$ComponentReg, _Digit18, _Digit18$ComponentReg, _Digit19, _Digit19$ComponentReg, _Digit20, _Digit20$ComponentReg, _Digit21, _Digit21$ComponentReg, _Digit22, _Digit22$ComponentReg, _Digit23, _Digit23$ComponentReg, _Digit24, _Digit24$ComponentReg, _Digit25, _Digit25$ComponentReg, _Digit26, _Digit26$ComponentReg, _Digit27, _Digit27$ComponentReg, _Digit28, _Digit28$ComponentReg, _Digit29, _Digit29$ComponentReg;
10046
+ var _Digit, _Digit$ComponentRegis, _Digit2, _Digit2$ComponentRegi, _Digit3, _Digit3$ComponentRegi, _Digit4, _Digit4$ComponentRegi, _Digit5, _Digit5$ComponentRegi, _Digit6, _Digit6$ComponentRegi, _Digit7, _Digit7$ComponentRegi, _Digit8, _Digit8$ComponentRegi, _Digit9, _Digit9$ComponentRegi, _Digit0, _Digit0$ComponentRegi, _Digit1, _Digit1$ComponentRegi, _Digit10, _Digit10$ComponentReg, _Digit11, _Digit11$ComponentReg, _Digit12, _Digit12$ComponentReg, _Digit13, _Digit13$ComponentReg, _Digit14, _Digit14$ComponentReg, _Digit15, _Digit15$ComponentReg, _Digit16, _Digit16$ComponentReg, _Digit17, _Digit17$ComponentReg, _Digit18, _Digit18$ComponentReg, _Digit19, _Digit19$ComponentReg, _Digit20, _Digit20$ComponentReg, _Digit21, _Digit21$ComponentReg, _Digit22, _Digit22$ComponentReg, _Digit23, _Digit23$ComponentReg, _Digit24, _Digit24$ComponentReg, _Digit25, _Digit25$ComponentReg, _Digit26, _Digit26$ComponentReg, _Digit27, _Digit27$ComponentReg, _Digit28, _Digit28$ComponentReg, _Digit29, _Digit29$ComponentReg, _Digit30, _Digit30$ComponentReg;
10047
10047
  let path = _ref2.path;
10048
10048
  const location = useLocation();
10049
10049
  const WSDocsRequired = (_Digit = Digit) === null || _Digit === void 0 ? void 0 : (_Digit$ComponentRegis = _Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("WSDocsRequired");
@@ -10063,21 +10063,22 @@ const App$1 = _ref2 => {
10063
10063
  const WSConsumptionDetails = (_Digit13 = Digit) === null || _Digit13 === void 0 ? void 0 : (_Digit13$ComponentReg = _Digit13.ComponentRegistryService) === null || _Digit13$ComponentReg === void 0 ? void 0 : _Digit13$ComponentReg.getComponent("WSConsumptionDetails");
10064
10064
  const WSModifyApplication = (_Digit14 = Digit) === null || _Digit14 === void 0 ? void 0 : (_Digit14$ComponentReg = _Digit14.ComponentRegistryService) === null || _Digit14$ComponentReg === void 0 ? void 0 : _Digit14$ComponentReg.getComponent("WSModifyApplication");
10065
10065
  const WSEditModifyApplication = (_Digit15 = Digit) === null || _Digit15 === void 0 ? void 0 : (_Digit15$ComponentReg = _Digit15.ComponentRegistryService) === null || _Digit15$ComponentReg === void 0 ? void 0 : _Digit15$ComponentReg.getComponent("WSEditModifyApplication");
10066
- const WSDisconnectionApplication = (_Digit16 = Digit) === null || _Digit16 === void 0 ? void 0 : (_Digit16$ComponentReg = _Digit16.ComponentRegistryService) === null || _Digit16$ComponentReg === void 0 ? void 0 : _Digit16$ComponentReg.getComponent("WSDisconnectionApplication");
10067
- const WSRestorationApplication = (_Digit17 = Digit) === null || _Digit17 === void 0 ? void 0 : (_Digit17$ComponentReg = _Digit17.ComponentRegistryService) === null || _Digit17$ComponentReg === void 0 ? void 0 : _Digit17$ComponentReg.getComponent("WSRestorationApplication");
10068
- const WSEditApplicationByConfig = (_Digit18 = Digit) === null || _Digit18 === void 0 ? void 0 : (_Digit18$ComponentReg = _Digit18.ComponentRegistryService) === null || _Digit18$ComponentReg === void 0 ? void 0 : _Digit18$ComponentReg.getComponent("WSEditApplicationByConfig");
10069
- const WSBillIAmendMentInbox = (_Digit19 = Digit) === null || _Digit19 === void 0 ? void 0 : (_Digit19$ComponentReg = _Digit19.ComponentRegistryService) === null || _Digit19$ComponentReg === void 0 ? void 0 : _Digit19$ComponentReg.getComponent("WSBillIAmendMentInbox");
10070
- const WSGetDisconnectionDetails = (_Digit20 = Digit) === null || _Digit20 === void 0 ? void 0 : (_Digit20$ComponentReg = _Digit20.ComponentRegistryService) === null || _Digit20$ComponentReg === void 0 ? void 0 : _Digit20$ComponentReg.getComponent("WSGetDisconnectionDetails");
10071
- const WSModifyApplicationDetails = (_Digit21 = Digit) === null || _Digit21 === void 0 ? void 0 : (_Digit21$ComponentReg = _Digit21.ComponentRegistryService) === null || _Digit21$ComponentReg === void 0 ? void 0 : _Digit21$ComponentReg.getComponent("WSModifyApplicationDetails");
10072
- const WSEditDisconnectionApplication = (_Digit22 = Digit) === null || _Digit22 === void 0 ? void 0 : (_Digit22$ComponentReg = _Digit22.ComponentRegistryService) === null || _Digit22$ComponentReg === void 0 ? void 0 : _Digit22$ComponentReg.getComponent("WSEditDisconnectionApplication");
10073
- const WSEditDisconnectionByConfig = (_Digit23 = Digit) === null || _Digit23 === void 0 ? void 0 : (_Digit23$ComponentReg = _Digit23.ComponentRegistryService) === null || _Digit23$ComponentReg === void 0 ? void 0 : _Digit23$ComponentReg.getComponent("WSEditDisconnectionByConfig");
10074
- const WSResubmitDisconnection = (_Digit24 = Digit) === null || _Digit24 === void 0 ? void 0 : (_Digit24$ComponentReg = _Digit24.ComponentRegistryService) === null || _Digit24$ComponentReg === void 0 ? void 0 : _Digit24$ComponentReg.getComponent("WSResubmitDisconnection");
10075
- const WSSearchIntegrated = (_Digit25 = Digit) === null || _Digit25 === void 0 ? void 0 : (_Digit25$ComponentReg = _Digit25.ComponentRegistryService) === null || _Digit25$ComponentReg === void 0 ? void 0 : _Digit25$ComponentReg.getComponent("WSSearchIntegrated");
10076
- const WSBulkBillGeneration = (_Digit26 = Digit) === null || _Digit26 === void 0 ? void 0 : (_Digit26$ComponentReg = _Digit26.ComponentRegistryService) === null || _Digit26$ComponentReg === void 0 ? void 0 : _Digit26$ComponentReg.getComponent("WSBulkBillGeneration");
10077
- const CPTCreateProperty = (_Digit27 = Digit) === null || _Digit27 === void 0 ? void 0 : (_Digit27$ComponentReg = _Digit27.ComponentRegistryService) === null || _Digit27$ComponentReg === void 0 ? void 0 : _Digit27$ComponentReg.getComponent("CPTCreateProperty");
10078
- const CPTAcknowledgement = (_Digit28 = Digit) === null || _Digit28 === void 0 ? void 0 : (_Digit28$ComponentReg = _Digit28.ComponentRegistryService) === null || _Digit28$ComponentReg === void 0 ? void 0 : _Digit28$ComponentReg.getComponent("CPTAcknowledgement");
10079
- const WSInfoPage = (_Digit29 = Digit) === null || _Digit29 === void 0 ? void 0 : (_Digit29$ComponentReg = _Digit29.ComponentRegistryService) === null || _Digit29$ComponentReg === void 0 ? void 0 : _Digit29$ComponentReg.getComponent("WSInfoPage");
10080
- const locationCheck = window.location.href.includes("/employee/ws/new-application") || window.location.href.includes("/employee/ws/modify-application") || window.location.href.includes("/employee/ws/edit-application") || window.location.href.includes("/employee/ws/activate-connection") || window.location.href.includes("/employee/ws/application-details") || window.location.href.includes("/employee/ws/modify-details") || window.location.href.includes("/employee/ws/ws-response") || window.location.href.includes("/employee/ws/new-disconnection/application-form") || window.location.href.includes("/employee/ws/ws-disconnection-response") || window.location.href.includes("/employee/ws/consumption-details") || window.location.href.includes("/employee/ws/edit-disconnection-application") || window.location.href.includes("/employee/ws/config-by-disconnection-application") || window.location.href.includes("/employee/ws/resubmit-disconnection-application") || window.location.href.includes("/employee/ws/water/bulk-bill");
10066
+ const WSMutationApplication = (_Digit16 = Digit) === null || _Digit16 === void 0 ? void 0 : (_Digit16$ComponentReg = _Digit16.ComponentRegistryService) === null || _Digit16$ComponentReg === void 0 ? void 0 : _Digit16$ComponentReg.getComponent("WSMutationApplication");
10067
+ const WSDisconnectionApplication = (_Digit17 = Digit) === null || _Digit17 === void 0 ? void 0 : (_Digit17$ComponentReg = _Digit17.ComponentRegistryService) === null || _Digit17$ComponentReg === void 0 ? void 0 : _Digit17$ComponentReg.getComponent("WSDisconnectionApplication");
10068
+ const WSRestorationApplication = (_Digit18 = Digit) === null || _Digit18 === void 0 ? void 0 : (_Digit18$ComponentReg = _Digit18.ComponentRegistryService) === null || _Digit18$ComponentReg === void 0 ? void 0 : _Digit18$ComponentReg.getComponent("WSRestorationApplication");
10069
+ const WSEditApplicationByConfig = (_Digit19 = Digit) === null || _Digit19 === void 0 ? void 0 : (_Digit19$ComponentReg = _Digit19.ComponentRegistryService) === null || _Digit19$ComponentReg === void 0 ? void 0 : _Digit19$ComponentReg.getComponent("WSEditApplicationByConfig");
10070
+ const WSBillIAmendMentInbox = (_Digit20 = Digit) === null || _Digit20 === void 0 ? void 0 : (_Digit20$ComponentReg = _Digit20.ComponentRegistryService) === null || _Digit20$ComponentReg === void 0 ? void 0 : _Digit20$ComponentReg.getComponent("WSBillIAmendMentInbox");
10071
+ const WSGetDisconnectionDetails = (_Digit21 = Digit) === null || _Digit21 === void 0 ? void 0 : (_Digit21$ComponentReg = _Digit21.ComponentRegistryService) === null || _Digit21$ComponentReg === void 0 ? void 0 : _Digit21$ComponentReg.getComponent("WSGetDisconnectionDetails");
10072
+ const WSModifyApplicationDetails = (_Digit22 = Digit) === null || _Digit22 === void 0 ? void 0 : (_Digit22$ComponentReg = _Digit22.ComponentRegistryService) === null || _Digit22$ComponentReg === void 0 ? void 0 : _Digit22$ComponentReg.getComponent("WSModifyApplicationDetails");
10073
+ const WSEditDisconnectionApplication = (_Digit23 = Digit) === null || _Digit23 === void 0 ? void 0 : (_Digit23$ComponentReg = _Digit23.ComponentRegistryService) === null || _Digit23$ComponentReg === void 0 ? void 0 : _Digit23$ComponentReg.getComponent("WSEditDisconnectionApplication");
10074
+ const WSEditDisconnectionByConfig = (_Digit24 = Digit) === null || _Digit24 === void 0 ? void 0 : (_Digit24$ComponentReg = _Digit24.ComponentRegistryService) === null || _Digit24$ComponentReg === void 0 ? void 0 : _Digit24$ComponentReg.getComponent("WSEditDisconnectionByConfig");
10075
+ const WSResubmitDisconnection = (_Digit25 = Digit) === null || _Digit25 === void 0 ? void 0 : (_Digit25$ComponentReg = _Digit25.ComponentRegistryService) === null || _Digit25$ComponentReg === void 0 ? void 0 : _Digit25$ComponentReg.getComponent("WSResubmitDisconnection");
10076
+ const WSSearchIntegrated = (_Digit26 = Digit) === null || _Digit26 === void 0 ? void 0 : (_Digit26$ComponentReg = _Digit26.ComponentRegistryService) === null || _Digit26$ComponentReg === void 0 ? void 0 : _Digit26$ComponentReg.getComponent("WSSearchIntegrated");
10077
+ const WSBulkBillGeneration = (_Digit27 = Digit) === null || _Digit27 === void 0 ? void 0 : (_Digit27$ComponentReg = _Digit27.ComponentRegistryService) === null || _Digit27$ComponentReg === void 0 ? void 0 : _Digit27$ComponentReg.getComponent("WSBulkBillGeneration");
10078
+ const CPTCreateProperty = (_Digit28 = Digit) === null || _Digit28 === void 0 ? void 0 : (_Digit28$ComponentReg = _Digit28.ComponentRegistryService) === null || _Digit28$ComponentReg === void 0 ? void 0 : _Digit28$ComponentReg.getComponent("CPTCreateProperty");
10079
+ const CPTAcknowledgement = (_Digit29 = Digit) === null || _Digit29 === void 0 ? void 0 : (_Digit29$ComponentReg = _Digit29.ComponentRegistryService) === null || _Digit29$ComponentReg === void 0 ? void 0 : _Digit29$ComponentReg.getComponent("CPTAcknowledgement");
10080
+ const WSInfoPage = (_Digit30 = Digit) === null || _Digit30 === void 0 ? void 0 : (_Digit30$ComponentReg = _Digit30.ComponentRegistryService) === null || _Digit30$ComponentReg === void 0 ? void 0 : _Digit30$ComponentReg.getComponent("WSInfoPage");
10081
+ const locationCheck = window.location.href.includes("/employee/ws/new-application") || window.location.href.includes("/employee/ws/modify-application") || window.location.href.includes("/employee/ws/mutation-application") || window.location.href.includes("/employee/ws/edit-application") || window.location.href.includes("/employee/ws/activate-connection") || window.location.href.includes("/employee/ws/application-details") || window.location.href.includes("/employee/ws/modify-details") || window.location.href.includes("/employee/ws/ws-response") || window.location.href.includes("/employee/ws/new-disconnection/application-form") || window.location.href.includes("/employee/ws/ws-disconnection-response") || window.location.href.includes("/employee/ws/consumption-details") || window.location.href.includes("/employee/ws/edit-disconnection-application") || window.location.href.includes("/employee/ws/config-by-disconnection-application") || window.location.href.includes("/employee/ws/resubmit-disconnection-application") || window.location.href.includes("/employee/ws/water/bulk-bill");
10081
10082
  const locationCheckReqDocs = window.location.href.includes("/employee/ws/create-application") || window.location.href.includes("/employee/ws/new-disconnection/docsrequired");
10082
10083
  return /*#__PURE__*/React.createElement("div", {
10083
10084
  className: "app-container"
@@ -10217,6 +10218,9 @@ const App$1 = _ref2 => {
10217
10218
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
10218
10219
  path: path + "/modify-application-edit",
10219
10220
  component: WSEditModifyApplication
10221
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
10222
+ path: path + "/mutation-application",
10223
+ component: WSMutationApplication
10220
10224
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
10221
10225
  path: path + "/disconnection-application",
10222
10226
  component: WSDisconnectionDocsRequired
@@ -15057,7 +15061,7 @@ const WSActivationPageDetails = _ref => {
15057
15061
  const _useTranslation = useTranslation(),
15058
15062
  t = _useTranslation.t;
15059
15063
  const filters = getQueryStringParams(location.search);
15060
- const _ref2 = window.location.href.includes("modify") ? useState(formData !== null && formData !== void 0 && formData.activationDetails ? [formData === null || formData === void 0 ? void 0 : (_formData$activationD = formData.activationDetails) === null || _formData$activationD === void 0 ? void 0 : _formData$activationD[0]] : [createActivationDetails()]) : useState((formData === null || formData === void 0 ? void 0 : formData.activationDetails) || [createActivationDetails()]),
15064
+ const _ref2 = window.location.href.includes("modify") || window.location.href.includes("mutation") ? useState(formData !== null && formData !== void 0 && formData.activationDetails ? [formData === null || formData === void 0 ? void 0 : (_formData$activationD = formData.activationDetails) === null || _formData$activationD === void 0 ? void 0 : _formData$activationD[0]] : [createActivationDetails()]) : useState((formData === null || formData === void 0 ? void 0 : formData.activationDetails) || [createActivationDetails()]),
15061
15065
  activationDetails = _ref2[0],
15062
15066
  setActivationDetails = _ref2[1];
15063
15067
  const _useState = useState({
@@ -15157,7 +15161,7 @@ const ConnectionDetails$3 = _props => {
15157
15161
  trigger();
15158
15162
  }, [formData === null || formData === void 0 ? void 0 : (_formData$connectionD = formData.connectionDetails) === null || _formData$connectionD === void 0 ? void 0 : (_formData$connectionD2 = _formData$connectionD[0]) === null || _formData$connectionD2 === void 0 ? void 0 : _formData$connectionD2.connectionType]);
15159
15163
  useEffect(() => {
15160
- if (window.location.href.includes("modify")) trigger();
15164
+ if (window.location.href.includes("modify") || window.location.href.includes("mutation")) trigger();
15161
15165
  }, [activationDetails, formData === null || formData === void 0 ? void 0 : formData.ConnectionDetails, formData === null || formData === void 0 ? void 0 : formData.ConnectionHolderDetails, formData === null || formData === void 0 ? void 0 : formData.DocumentsRequired, formData === null || formData === void 0 ? void 0 : formData.connectionDetails, formData === null || formData === void 0 ? void 0 : formData.cpt]);
15162
15166
  useEffect(() => {
15163
15167
  var _formState$errors$con;
@@ -15320,7 +15324,7 @@ const ConnectionDetails$3 = _props => {
15320
15324
  }
15321
15325
  }))), /*#__PURE__*/React.createElement(CardLabelError, {
15322
15326
  style: errorStyle
15323
- }, localFormState.touched.connectionExecutionDate ? errors === null || errors === void 0 ? void 0 : (_errors$connectionExe2 = errors.connectionExecutionDate) === null || _errors$connectionExe2 === void 0 ? void 0 : _errors$connectionExe2.message : ""), window.location.href.includes("modify") ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
15327
+ }, localFormState.touched.connectionExecutionDate ? errors === null || errors === void 0 ? void 0 : (_errors$connectionExe2 = errors.connectionExecutionDate) === null || _errors$connectionExe2 === void 0 ? void 0 : _errors$connectionExe2.message : ""), window.location.href.includes("modify") || window.location.href.includes("mutation") ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
15324
15328
  style: isMobile && isEmployee ? {
15325
15329
  fontWeight: "700",
15326
15330
  width: "100%"
@@ -20627,7 +20631,7 @@ const _excluded = ["t", "config", "onSelect", "formData", "formState", "setError
20627
20631
  const NUMBER_PATTERN = /^\d+$/;
20628
20632
  const DECIMAL_PATTERN = /^\d+(\.\d{1,2})?$/;
20629
20633
  const PropertyWaterConnection = _ref => {
20630
- var _formData$cpt2, _errors$useDetails, _errors$useDetails2, _errors$useDetails3, _errors$useDetails4, _errors$useDetails5, _errors$useDetails6, _errors$useDetails7, _errors$useDetails8, _errors$useDetails9, _errors$useDetails0, _errors$useDetails1, _errors$useDetails10, _errors$useDetails11;
20634
+ var _formData$cpt2, _errors$useDetails, _errors$useDetails2, _errors$useDetails3, _errors$useDetails4, _errors$useDetails5, _errors$useDetails6, _errors$useDetails7, _errors$useDetails8, _errors$useDetails9, _errors$useDetails0, _errors$useDetails1, _errors$useDetails10, _errors$useDetails11, _errors$useDetails12;
20631
20635
  let t = _ref.t,
20632
20636
  config = _ref.config,
20633
20637
  onSelect = _ref.onSelect,
@@ -20648,8 +20652,9 @@ const PropertyWaterConnection = _ref => {
20648
20652
  SelectYearofConstruction: null,
20649
20653
  NumberofDwellingUnits: "",
20650
20654
  NumberofRooms: "",
20651
- hospitalBeds: "",
20652
- numnberOfStudents: ""
20655
+ numberOfBeds: "",
20656
+ numberOfStudents: "",
20657
+ ServantQuartersRoom: ""
20653
20658
  }
20654
20659
  }
20655
20660
  }),
@@ -20688,6 +20693,8 @@ const PropertyWaterConnection = _ref => {
20688
20693
  const isHospitalProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOSPITAL_NURSING_HOME" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HospitalNursingHome";
20689
20694
  const isHotelRestaurantProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOTEL_OR_RESTAURANT" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HotelOrRestaurant";
20690
20695
  const isSchoolCollegeProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "School" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "College";
20696
+ const isDwellingUnit = (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL" || (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL";
20697
+ const isServentHouse = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "Apartment" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "FlatOrApartment" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "IndividualHouse";
20691
20698
  const yearOptions = useMemo(() => {
20692
20699
  const currentYear = new Date().getFullYear();
20693
20700
  const years = [];
@@ -20817,8 +20824,9 @@ const PropertyWaterConnection = _ref => {
20817
20824
  setValue("useDetails.SelectYearofConstruction", null);
20818
20825
  setValue("useDetails.NumberofDwellingUnits", "");
20819
20826
  setValue("useDetails.NumberofRooms", "");
20820
- setValue("useDetails.hospitalBeds", "");
20821
- setValue("useDetails.numnberOfStudents", "");
20827
+ setValue("useDetails.numberOfBeds", "");
20828
+ setValue("useDetails.numberOfStudents", "");
20829
+ setValue("useDetails.ServantQuartersRoom", "");
20822
20830
  }
20823
20831
  }, [formData === null || formData === void 0 ? void 0 : (_formData$cpt2 = formData.cpt) === null || _formData$cpt2 === void 0 ? void 0 : _formData$cpt2.details, formData === null || formData === void 0 ? void 0 : formData.cpt, categoryOptions, propertyTypeOptions, usageTypeOptions, floorOptions, yearOptions, categoryTypeList, setValue]);
20824
20832
  const lastErrorState = React.useRef(null);
@@ -21001,7 +21009,7 @@ const PropertyWaterConnection = _ref => {
21001
21009
  })
21002
21010
  }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails9 = errors.useDetails) === null || _errors$useDetails9 === void 0 ? void 0 : _errors$useDetails9.SelectYearofConstruction) && /*#__PURE__*/React.createElement(CardLabelError, {
21003
21011
  style: errorStyle
21004
- }, errors.useDetails.SelectYearofConstruction.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_NUMBER_OF_DWELLING_UNITS")), /*#__PURE__*/React.createElement("div", {
21012
+ }, errors.useDetails.SelectYearofConstruction.message), isDwellingUnit ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_NUMBER_OF_DWELLING_UNITS")), /*#__PURE__*/React.createElement("div", {
21005
21013
  className: "form-field"
21006
21014
  }, /*#__PURE__*/React.createElement(TextInput, {
21007
21015
  t: t,
@@ -21013,7 +21021,7 @@ const PropertyWaterConnection = _ref => {
21013
21021
  }),
21014
21022
  name: "useDetails.NumberofDwellingUnits",
21015
21023
  disabled: isPropertyFound
21016
- }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails0 = errors.useDetails) === null || _errors$useDetails0 === void 0 ? void 0 : _errors$useDetails0.NumberofDwellingUnits) && /*#__PURE__*/React.createElement(CardLabelError, {
21024
+ }))) : null, isDwellingUnit && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails0 = errors.useDetails) === null || _errors$useDetails0 === void 0 ? void 0 : _errors$useDetails0.NumberofDwellingUnits) && /*#__PURE__*/React.createElement(CardLabelError, {
21017
21025
  style: errorStyle
21018
21026
  }, errors.useDetails.NumberofDwellingUnits.message), isHotelRestaurantProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_NUMBER_OF_ROOMS") + "*"), /*#__PURE__*/React.createElement("div", {
21019
21027
  className: "form-field"
@@ -21041,11 +21049,11 @@ const PropertyWaterConnection = _ref => {
21041
21049
  },
21042
21050
  required: isHospitalProperty ? t("REQUIRED_FIELD") : false
21043
21051
  }),
21044
- name: "useDetails.hospitalBeds",
21052
+ name: "useDetails.numberOfBeds",
21045
21053
  disabled: isPropertyFound
21046
- }))) : null, isHospitalProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails10 = errors.useDetails) === null || _errors$useDetails10 === void 0 ? void 0 : _errors$useDetails10.hospitalBeds) && /*#__PURE__*/React.createElement(CardLabelError, {
21054
+ }))) : null, isHospitalProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails10 = errors.useDetails) === null || _errors$useDetails10 === void 0 ? void 0 : _errors$useDetails10.numberOfBeds) && /*#__PURE__*/React.createElement(CardLabelError, {
21047
21055
  style: errorStyle
21048
- }, errors.useDetails.hospitalBeds.message), isSchoolCollegeProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_NUMBER_OF_STUDENTS")), /*#__PURE__*/React.createElement("div", {
21056
+ }, errors.useDetails.numberOfBeds.message), isSchoolCollegeProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_NUMBER_OF_STUDENTS")), /*#__PURE__*/React.createElement("div", {
21049
21057
  className: "form-field"
21050
21058
  }, /*#__PURE__*/React.createElement(TextInput, {
21051
21059
  t: t,
@@ -21055,11 +21063,25 @@ const PropertyWaterConnection = _ref => {
21055
21063
  message: t("ERR_INVALID_NUMBER")
21056
21064
  }
21057
21065
  }),
21058
- name: "useDetails.numnberOfStudents",
21066
+ name: "useDetails.numberOfStudents",
21059
21067
  disabled: isPropertyFound
21060
- }))) : null, isSchoolCollegeProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails11 = errors.useDetails) === null || _errors$useDetails11 === void 0 ? void 0 : _errors$useDetails11.numnberOfStudents) && /*#__PURE__*/React.createElement(CardLabelError, {
21068
+ }))) : null, isSchoolCollegeProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails11 = errors.useDetails) === null || _errors$useDetails11 === void 0 ? void 0 : _errors$useDetails11.numberOfStudents) && /*#__PURE__*/React.createElement(CardLabelError, {
21061
21069
  style: errorStyle
21062
- }, errors.useDetails.numnberOfStudents.message)));
21070
+ }, errors.useDetails.numberOfStudents.message), isServentHouse ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_SERVENT_HOUSE")), /*#__PURE__*/React.createElement("div", {
21071
+ className: "form-field"
21072
+ }, /*#__PURE__*/React.createElement(TextInput, {
21073
+ t: t,
21074
+ inputRef: register({
21075
+ pattern: {
21076
+ value: NUMBER_PATTERN,
21077
+ message: t("ERR_INVALID_NUMBER")
21078
+ }
21079
+ }),
21080
+ name: "useDetails.ServantQuartersRoom",
21081
+ disabled: isPropertyFound
21082
+ }))) : null, isServentHouse && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails12 = errors.useDetails) === null || _errors$useDetails12 === void 0 ? void 0 : _errors$useDetails12.ServantQuartersRoom) && /*#__PURE__*/React.createElement(CardLabelError, {
21083
+ style: errorStyle
21084
+ }, errors.useDetails.ServantQuartersRoom.message)));
21063
21085
  };
21064
21086
 
21065
21087
  const WSPropertyWaterConnection = props => {
@@ -28980,8 +29002,10 @@ const WSFeeEstimation = _ref => {
28980
29002
  };
28981
29003
 
28982
29004
  const ViewBreakup = _ref => {
28983
- var _wsAdditionalDetails$, _breakUpData$billSlab, _breakUpData$billSlab2, _breakUpData$billSlab3, _breakUpData$billSlab4, _breakUpData$billSlab5, _breakUpData$billSlab6;
28984
- let wsAdditionalDetails = _ref.wsAdditionalDetails;
29005
+ var _breakUpData$calculat, _breakUpData$calculat2, _wsAdditionalDetails$8, _breakUpData$billSlab4, _breakUpData$billSlab5, _breakUpData$billSlab6, _breakUpData$billSlab7, _breakUpData$billSlab8, _breakUpData$billSlab9;
29006
+ let wsAdditionalDetails = _ref.wsAdditionalDetails,
29007
+ print = _ref.print,
29008
+ download = _ref.download;
28985
29009
  const _useTranslation = useTranslation(),
28986
29010
  t = _useTranslation.t;
28987
29011
  const _useState = useState(false),
@@ -28990,6 +29014,44 @@ const ViewBreakup = _ref => {
28990
29014
  const _useState2 = useState({}),
28991
29015
  breakUpData = _useState2[0],
28992
29016
  setBreakUpData = _useState2[1];
29017
+ const breakupRef = useRef(null);
29018
+ const formatNumber = function (value, maximumFractionDigits) {
29019
+ if (maximumFractionDigits === void 0) {
29020
+ maximumFractionDigits = 2;
29021
+ }
29022
+ return Number(value || 0).toLocaleString("en-IN", {
29023
+ maximumFractionDigits
29024
+ });
29025
+ };
29026
+ const formatCurrency = value => /*#__PURE__*/React.createElement("span", null, "\u20B9", formatNumber(value));
29027
+ const DetailRows = _ref2 => {
29028
+ let rows = _ref2.rows;
29029
+ return rows.map(_ref3 => {
29030
+ let label = _ref3.label,
29031
+ value = _ref3.value,
29032
+ _ref3$currency = _ref3.currency,
29033
+ currency = _ref3$currency === void 0 ? false : _ref3$currency,
29034
+ _ref3$unit = _ref3.unit,
29035
+ unit = _ref3$unit === void 0 ? "" : _ref3$unit,
29036
+ _ref3$isText = _ref3.isText,
29037
+ isText = _ref3$isText === void 0 ? false : _ref3$isText;
29038
+ return /*#__PURE__*/React.createElement(Row, {
29039
+ className: "border-none",
29040
+ rowContainerStyle: {
29041
+ margin: "0px"
29042
+ },
29043
+ labelStyle: {
29044
+ width: "50%"
29045
+ },
29046
+ key: label,
29047
+ label: label,
29048
+ text: currency ? formatCurrency(value) : isText ? value || "-" : "" + formatNumber(value) + unit,
29049
+ textStyle: {
29050
+ textAlign: "right"
29051
+ }
29052
+ });
29053
+ });
29054
+ };
28993
29055
  const Heading = props => {
28994
29056
  return /*#__PURE__*/React.createElement("h1", {
28995
29057
  className: "heading-m"
@@ -29012,21 +29074,181 @@ const ViewBreakup = _ref => {
29012
29074
  }, /*#__PURE__*/React.createElement(Close, null));
29013
29075
  };
29014
29076
  const onPopupOpen = () => {
29015
- var _sessionBillFormData$;
29016
- let breakupData = wsAdditionalDetails.additionalDetails.data || {};
29077
+ var _wsAdditionalDetails$, _sessionBillFormData$;
29078
+ let breakupData = (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$ = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$ === void 0 ? void 0 : _wsAdditionalDetails$.data) || {};
29017
29079
  const sessionBillData = sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA");
29018
29080
  const sessionBillFormData = sessionBillData ? JSON.parse(sessionBillData) : {};
29019
29081
  if (sessionBillFormData !== null && sessionBillFormData !== void 0 && (_sessionBillFormData$ = sessionBillFormData.value) !== null && _sessionBillFormData$ !== void 0 && _sessionBillFormData$.totalAmount) breakupData = sessionBillFormData === null || sessionBillFormData === void 0 ? void 0 : sessionBillFormData.value;
29020
29082
  setBreakUpData(breakupData);
29021
29083
  showPopUp(true);
29022
29084
  };
29085
+ const getBreakupReportDetails = () => {
29086
+ var _wsAdditionalDetails$2, _wsAdditionalDetails$3, _wsAdditionalDetails$4, _wsAdditionalDetails$5, _wsAdditionalDetails$6, _wsAdditionalDetails$7, _breakUpData$billSlab, _breakUpData$billSlab2, _breakUpData$billSlab3;
29087
+ const amountRows = function (rows) {
29088
+ if (rows === void 0) {
29089
+ rows = [];
29090
+ }
29091
+ return rows.map(row => ({
29092
+ title: t(row === null || row === void 0 ? void 0 : row.taxHeadCode),
29093
+ value: "\u20B9" + formatNumber(row === null || row === void 0 ? void 0 : row.amount)
29094
+ }));
29095
+ };
29096
+ const connectionHolder = wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$2 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$2 === void 0 ? void 0 : (_wsAdditionalDetails$3 = _wsAdditionalDetails$2.appDetails) === null || _wsAdditionalDetails$3 === void 0 ? void 0 : (_wsAdditionalDetails$4 = _wsAdditionalDetails$3.connectionHolders) === null || _wsAdditionalDetails$4 === void 0 ? void 0 : _wsAdditionalDetails$4[0];
29097
+ const applicantName = [connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.name, connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.middleName, connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.lastName].filter(Boolean).join(" ") || "-";
29098
+ const mobileNumber = (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.mobileNumber) || "-";
29099
+ const appNumber = (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$5 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$5 === void 0 ? void 0 : (_wsAdditionalDetails$6 = _wsAdditionalDetails$5.data) === null || _wsAdditionalDetails$6 === void 0 ? void 0 : _wsAdditionalDetails$6.applicationNo) || (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$7 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$7 === void 0 ? void 0 : _wsAdditionalDetails$7.applicationNumber) || "-";
29100
+ return [{
29101
+ title: "Applicant Details",
29102
+ values: [{
29103
+ title: "Application Number",
29104
+ value: appNumber
29105
+ }, {
29106
+ title: "Applicant Name",
29107
+ value: applicantName
29108
+ }, {
29109
+ title: "Mobile Number",
29110
+ value: mobileNumber
29111
+ }]
29112
+ }, {
29113
+ title: t("WS_APPLICATION_FEE_HEADER"),
29114
+ values: amountRows([...((breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab = breakUpData.billSlabData) === null || _breakUpData$billSlab === void 0 ? void 0 : _breakUpData$billSlab.FEE) || []), ...((breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab2 = breakUpData.billSlabData) === null || _breakUpData$billSlab2 === void 0 ? void 0 : _breakUpData$billSlab2.CHARGES) || [])])
29115
+ }, {
29116
+ title: "Taxes",
29117
+ values: amountRows(breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab3 = breakUpData.billSlabData) === null || _breakUpData$billSlab3 === void 0 ? void 0 : _breakUpData$billSlab3.TAX)
29118
+ }, {
29119
+ title: "Water demand details",
29120
+ values: waterDemandRows.map(_ref4 => {
29121
+ let label = _ref4.label,
29122
+ value = _ref4.value,
29123
+ currency = _ref4.currency,
29124
+ unit = _ref4.unit,
29125
+ isText = _ref4.isText;
29126
+ return {
29127
+ title: label,
29128
+ value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
29129
+ };
29130
+ })
29131
+ }, {
29132
+ title: "Infrastructure charge details",
29133
+ values: infrastructureChargeRows.map(_ref5 => {
29134
+ let label = _ref5.label,
29135
+ value = _ref5.value,
29136
+ currency = _ref5.currency,
29137
+ unit = _ref5.unit,
29138
+ isText = _ref5.isText;
29139
+ return {
29140
+ title: label,
29141
+ value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
29142
+ };
29143
+ })
29144
+ }, {
29145
+ title: "Total",
29146
+ values: [{
29147
+ title: t("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),
29148
+ value: "\u20B9" + formatNumber(breakUpData === null || breakUpData === void 0 ? void 0 : breakUpData.totalAmount)
29149
+ }]
29150
+ }].filter(section => section.values.length > 0);
29151
+ };
29152
+ const generateBreakupReport = mode => {
29153
+ var _Digit$Utils, _Digit$Utils$pdf;
29154
+ const generateReport = (_Digit$Utils = Digit.Utils) === null || _Digit$Utils === void 0 ? void 0 : (_Digit$Utils$pdf = _Digit$Utils.pdf) === null || _Digit$Utils$pdf === void 0 ? void 0 : _Digit$Utils$pdf.generateCalculationBreakupReport;
29155
+ if (typeof generateReport === "function") {
29156
+ return generateReport({
29157
+ tenantId: Digit.ULBService.getCurrentTenantId(),
29158
+ heading: t("WS_CALCULATION_BREAKUP"),
29159
+ details: getBreakupReportDetails(),
29160
+ t,
29161
+ mode
29162
+ });
29163
+ }
29164
+ return mode === "download" ? Digit.Download.PDF(breakupRef, t("WS_CALCULATION_BREAKUP")) : null;
29165
+ };
29166
+ const handleDownload = () => generateBreakupReport("download");
29167
+ const handlePrint = () => {
29168
+ var _Digit$Utils2, _Digit$Utils2$pdf, _breakupRef$current, _window$mSewaApp, _window$mSewaApp$isMs;
29169
+ if ((_Digit$Utils2 = Digit.Utils) !== null && _Digit$Utils2 !== void 0 && (_Digit$Utils2$pdf = _Digit$Utils2.pdf) !== null && _Digit$Utils2$pdf !== void 0 && _Digit$Utils2$pdf.generateCalculationBreakupReport) {
29170
+ return generateBreakupReport("print");
29171
+ }
29172
+ const content = (_breakupRef$current = breakupRef.current) === null || _breakupRef$current === void 0 ? void 0 : _breakupRef$current.innerHTML;
29173
+ if (!content) return;
29174
+ if ((_window$mSewaApp = window.mSewaApp) !== null && _window$mSewaApp !== void 0 && (_window$mSewaApp$isMs = _window$mSewaApp.isMsewaApp) !== null && _window$mSewaApp$isMs !== void 0 && _window$mSewaApp$isMs.call(_window$mSewaApp)) {
29175
+ window.mSewaApp.downloadBase64File(window.btoa(unescape(encodeURIComponent(content))), t("WS_CALCULATION_BREAKUP"));
29176
+ return;
29177
+ }
29178
+ const printWindow = window.open("", "");
29179
+ if (!printWindow) return;
29180
+ printWindow.document.write("<html><body>" + content + "</body></html>");
29181
+ printWindow.document.close();
29182
+ printWindow.focus();
29183
+ printWindow.print();
29184
+ };
29185
+ const waterDemandDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat = breakUpData.calculationDetail) === null || _breakUpData$calculat === void 0 ? void 0 : _breakUpData$calculat.waterDemandDetail;
29186
+ const infrastructureChargeDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat2 = breakUpData.calculationDetail) === null || _breakUpData$calculat2 === void 0 ? void 0 : _breakUpData$calculat2.infrastructureChargeDetail;
29187
+ const waterDemandRows = waterDemandDetail ? [{
29188
+ label: "Calculated occupancy",
29189
+ value: waterDemandDetail.calculatedOccupancy,
29190
+ unit: " person"
29191
+ }, {
29192
+ label: "Applied LPCD",
29193
+ value: waterDemandDetail.chosenLpcd,
29194
+ unit: " LPD"
29195
+ }, {
29196
+ label: "Base demand",
29197
+ value: waterDemandDetail.baseDemand,
29198
+ unit: " LPD"
29199
+ }, {
29200
+ label: "Contingency/Floating Occupancy",
29201
+ value: waterDemandDetail.contingencyPercentage,
29202
+ unit: "%"
29203
+ }, {
29204
+ label: "Total water demand",
29205
+ value: waterDemandDetail.totalWaterDemandLPD,
29206
+ unit: " LPD"
29207
+ }] : [];
29208
+ const infrastructureChargeRows = infrastructureChargeDetail ? [{
29209
+ label: "Colony category",
29210
+ value: infrastructureChargeDetail.colonyCategory,
29211
+ isText: true
29212
+ }, {
29213
+ label: "Plot area",
29214
+ value: infrastructureChargeDetail.plotArea,
29215
+ unit: " (sq. meter.)"
29216
+ }, {
29217
+ label: "Water rate",
29218
+ value: infrastructureChargeDetail.waterRatePerLPD,
29219
+ currency: true
29220
+ }, {
29221
+ label: "Sewer rate",
29222
+ value: infrastructureChargeDetail.sewerRatePerLPD,
29223
+ currency: true
29224
+ }, {
29225
+ label: "Water Infra Charges",
29226
+ value: infrastructureChargeDetail.waterComponentIFC,
29227
+ currency: true
29228
+ }, {
29229
+ label: "Sewer Infra Charges",
29230
+ value: infrastructureChargeDetail.sewerComponentIFC,
29231
+ currency: true
29232
+ }, {
29233
+ label: "Rebate",
29234
+ value: infrastructureChargeDetail.rebatePercentage,
29235
+ unit: "%"
29236
+ }, {
29237
+ label: "Rebate amount",
29238
+ value: infrastructureChargeDetail.rebateAmount,
29239
+ currency: true
29240
+ }, {
29241
+ label: "Net IFC",
29242
+ value: infrastructureChargeDetail.netIFC,
29243
+ currency: true
29244
+ }] : [];
29023
29245
  return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement("div", {
29024
29246
  style: {
29025
29247
  lineHeight: "19px",
29026
29248
  maxWidth: "950px",
29027
29249
  minWidth: "280px"
29028
29250
  }
29029
- }, wsAdditionalDetails !== null && wsAdditionalDetails !== void 0 && (_wsAdditionalDetails$ = wsAdditionalDetails.additionalDetails) !== null && _wsAdditionalDetails$ !== void 0 && _wsAdditionalDetails$.isViewBreakup ? /*#__PURE__*/React.createElement("div", {
29251
+ }, wsAdditionalDetails !== null && wsAdditionalDetails !== void 0 && (_wsAdditionalDetails$8 = wsAdditionalDetails.additionalDetails) !== null && _wsAdditionalDetails$8 !== void 0 && _wsAdditionalDetails$8.isViewBreakup ? /*#__PURE__*/React.createElement("div", {
29030
29252
  onClick: e => onPopupOpen(),
29031
29253
  style: {
29032
29254
  marginTop: "12px"
@@ -29037,6 +29259,9 @@ const ViewBreakup = _ref => {
29037
29259
  headerBarMain: /*#__PURE__*/React.createElement(Heading, {
29038
29260
  label: t("WS_CALCULATION_BREAKUP")
29039
29261
  }),
29262
+ width: "950px",
29263
+ print: print || handlePrint,
29264
+ download: download || handleDownload,
29040
29265
  headerBarEnd: /*#__PURE__*/React.createElement(CloseBtn, {
29041
29266
  onClick: () => {
29042
29267
  showPopUp(false);
@@ -29052,16 +29277,13 @@ const ViewBreakup = _ref => {
29052
29277
  popupModuleMianStyles: {
29053
29278
  paddingTop: "0px"
29054
29279
  }
29055
- }, /*#__PURE__*/React.createElement(StatusTable, {
29056
- style: {
29057
- padding: "10px",
29058
- paddingTop: "0px"
29059
- }
29060
- }, /*#__PURE__*/React.createElement(CardSectionHeader, {
29280
+ }, /*#__PURE__*/React.createElement("div", {
29281
+ ref: breakupRef
29282
+ }, /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
29061
29283
  style: {
29062
29284
  margin: "10px 0px"
29063
29285
  }
29064
- }, t("WS_APPLICATION_FEE_HEADER")), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab = breakUpData.billSlabData) === null || _breakUpData$billSlab === void 0 ? void 0 : (_breakUpData$billSlab2 = _breakUpData$billSlab.FEE) === null || _breakUpData$billSlab2 === void 0 ? void 0 : _breakUpData$billSlab2.map(data => /*#__PURE__*/React.createElement(Row, {
29286
+ }, t("WS_APPLICATION_FEE_HEADER")), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab4 = breakUpData.billSlabData) === null || _breakUpData$billSlab4 === void 0 ? void 0 : (_breakUpData$billSlab5 = _breakUpData$billSlab4.FEE) === null || _breakUpData$billSlab5 === void 0 ? void 0 : _breakUpData$billSlab5.map(data => /*#__PURE__*/React.createElement(Row, {
29065
29287
  className: "border-none",
29066
29288
  rowContainerStyle: {
29067
29289
  margin: "0px"
@@ -29075,11 +29297,7 @@ const ViewBreakup = _ref => {
29075
29297
  textStyle: {
29076
29298
  textAlign: "right"
29077
29299
  }
29078
- })), /*#__PURE__*/React.createElement(CardSectionHeader, {
29079
- style: {
29080
- margin: "10px 0px"
29081
- }
29082
- }, t("WS_SERVICE_FEE_HEADER")), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab3 = breakUpData.billSlabData) === null || _breakUpData$billSlab3 === void 0 ? void 0 : (_breakUpData$billSlab4 = _breakUpData$billSlab3.CHARGES) === null || _breakUpData$billSlab4 === void 0 ? void 0 : _breakUpData$billSlab4.map(data => /*#__PURE__*/React.createElement(Row, {
29300
+ })), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab6 = breakUpData.billSlabData) === null || _breakUpData$billSlab6 === void 0 ? void 0 : (_breakUpData$billSlab7 = _breakUpData$billSlab6.CHARGES) === null || _breakUpData$billSlab7 === void 0 ? void 0 : _breakUpData$billSlab7.map(data => /*#__PURE__*/React.createElement(Row, {
29083
29301
  className: "border-none",
29084
29302
  rowContainerStyle: {
29085
29303
  margin: "0px"
@@ -29093,7 +29311,7 @@ const ViewBreakup = _ref => {
29093
29311
  textStyle: {
29094
29312
  textAlign: "right"
29095
29313
  }
29096
- })), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab5 = breakUpData.billSlabData) === null || _breakUpData$billSlab5 === void 0 ? void 0 : (_breakUpData$billSlab6 = _breakUpData$billSlab5.TAX) === null || _breakUpData$billSlab6 === void 0 ? void 0 : _breakUpData$billSlab6.map(data => /*#__PURE__*/React.createElement(Row, {
29314
+ })), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab8 = breakUpData.billSlabData) === null || _breakUpData$billSlab8 === void 0 ? void 0 : (_breakUpData$billSlab9 = _breakUpData$billSlab8.TAX) === null || _breakUpData$billSlab9 === void 0 ? void 0 : _breakUpData$billSlab9.map(data => /*#__PURE__*/React.createElement(Row, {
29097
29315
  className: "border-none",
29098
29316
  rowContainerStyle: {
29099
29317
  margin: "0px"
@@ -29107,6 +29325,18 @@ const ViewBreakup = _ref => {
29107
29325
  textStyle: {
29108
29326
  textAlign: "right"
29109
29327
  }
29328
+ })), waterDemandRows.length > 0 && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
29329
+ style: {
29330
+ margin: "10px 0px"
29331
+ }
29332
+ }, "Water demand details"), /*#__PURE__*/React.createElement(DetailRows, {
29333
+ rows: waterDemandRows
29334
+ })), infrastructureChargeRows.length > 0 && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
29335
+ style: {
29336
+ margin: "10px 0px"
29337
+ }
29338
+ }, "Infrastructure charge details"), /*#__PURE__*/React.createElement(DetailRows, {
29339
+ rows: infrastructureChargeRows
29110
29340
  })), /*#__PURE__*/React.createElement("hr", {
29111
29341
  style: {
29112
29342
  color: "#cccccc",
@@ -29129,7 +29359,7 @@ const ViewBreakup = _ref => {
29129
29359
  fontWeight: "700",
29130
29360
  fontSize: "24px"
29131
29361
  }
29132
- })))));
29362
+ }))))));
29133
29363
  };
29134
29364
 
29135
29365
  const checkForNA$1 = value => {
@@ -45850,9 +46080,11 @@ const ActivateConnection = () => {
45850
46080
  }
45851
46081
  }, []);
45852
46082
  useEffect(() => {
45853
- if (!isLoading) {
46083
+ if (!isLoading && newConfig && Array.isArray(newConfig)) {
45854
46084
  const config = newConfig.find(conf => conf.hideInCitizen);
45855
- setConfig(config);
46085
+ if (config) {
46086
+ setConfig(config);
46087
+ }
45856
46088
  }
45857
46089
  }, [newConfig]);
45858
46090
  useEffect(() => {
@@ -46361,16 +46593,18 @@ const EditApplication$1 = () => {
46361
46593
  }),
46362
46594
  propertyDetails = _Digit$Hooks$pt$usePr.data;
46363
46595
  useEffect(() => {
46364
- if (!isConfigLoading) {
46365
- var _config$body;
46596
+ if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
46366
46597
  const config = newConfig.find(conf => conf.hideInCitizen && conf.isEdit);
46367
- config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL";
46368
- let bodyDetails = [];
46369
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
46370
- if (data !== null && data !== void 0 && data.isEditConnection) bodyDetails.push(data);
46371
- });
46372
- config.body = bodyDetails;
46373
- setConfig(config);
46598
+ if (config) {
46599
+ var _config$body;
46600
+ config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL";
46601
+ let bodyDetails = [];
46602
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
46603
+ if (data !== null && data !== void 0 && data.isEditConnection) bodyDetails.push(data);
46604
+ });
46605
+ config.body = bodyDetails;
46606
+ setConfig(config);
46607
+ }
46374
46608
  }
46375
46609
  }, [newConfig]);
46376
46610
  useEffect(() => {
@@ -47023,19 +47257,21 @@ const ModifyApplication = () => {
47023
47257
  }),
47024
47258
  propertyDetails = _Digit$Hooks$pt$usePr.data;
47025
47259
  useEffect(() => {
47026
- if (!isConfigLoading) {
47027
- var _config$body;
47260
+ if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
47028
47261
  const config = newConfig.find(conf => conf.hideInCitizen && conf.isModify);
47029
- config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";
47030
- let bodyDetails = [];
47031
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
47032
- if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
47033
- });
47034
- bodyDetails.forEach(bdyData => {
47035
- if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
47036
- });
47037
- config.body = bodyDetails;
47038
- setConfig(config);
47262
+ if (config) {
47263
+ var _config$body;
47264
+ config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";
47265
+ let bodyDetails = [];
47266
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
47267
+ if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
47268
+ });
47269
+ bodyDetails.forEach(bdyData => {
47270
+ if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
47271
+ });
47272
+ config.body = bodyDetails;
47273
+ setConfig(config);
47274
+ }
47039
47275
  }
47040
47276
  }, [newConfig]);
47041
47277
  useEffect(() => {
@@ -47340,19 +47576,21 @@ const EditModifyApplication = () => {
47340
47576
  }),
47341
47577
  propertyDetails = _Digit$Hooks$pt$usePr.data;
47342
47578
  useEffect(() => {
47343
- if (!isConfigLoading) {
47344
- var _config$body;
47579
+ if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
47345
47580
  const config = newConfig.find(conf => conf.hideInCitizen && conf.isModify);
47346
- config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";
47347
- let bodyDetails = [];
47348
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
47349
- if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
47350
- });
47351
- bodyDetails.forEach(bdyData => {
47352
- if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
47353
- });
47354
- config.body = bodyDetails;
47355
- setConfig(config);
47581
+ if (config) {
47582
+ var _config$body;
47583
+ config.head = "WS_WATER_AND_SEWERAGE_MODIFY_CONNECTION_LABEL";
47584
+ let bodyDetails = [];
47585
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
47586
+ if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
47587
+ });
47588
+ bodyDetails.forEach(bdyData => {
47589
+ if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
47590
+ });
47591
+ config.body = bodyDetails;
47592
+ setConfig(config);
47593
+ }
47356
47594
  }
47357
47595
  }, [newConfig]);
47358
47596
  useEffect(() => {
@@ -47477,6 +47715,289 @@ const EditModifyApplication = () => {
47477
47715
  }));
47478
47716
  };
47479
47717
 
47718
+ const MutationApplication = () => {
47719
+ var _state, _details, _details2, _details2$application;
47720
+ const _useTranslation = useTranslation(),
47721
+ t = _useTranslation.t;
47722
+ let _useLocation = useLocation(),
47723
+ state = _useLocation.state;
47724
+ state = state ? typeof state === "string" ? JSON.parse(state) : state : {};
47725
+ const history = useHistory();
47726
+ let filters = getQueryStringParams(location.search);
47727
+ const _useState = useState(false),
47728
+ canSubmit = _useState[0],
47729
+ setSubmitValve = _useState[1];
47730
+ const _useState2 = useState(null),
47731
+ showToast = _useState2[0],
47732
+ setShowToast = _useState2[1];
47733
+ const _useState3 = useState({}),
47734
+ appData = _useState3[0],
47735
+ setAppData = _useState3[1];
47736
+ const _useState4 = useState({
47737
+ head: "",
47738
+ body: []
47739
+ }),
47740
+ config = _useState4[0],
47741
+ setConfig = _useState4[1];
47742
+ const _useState5 = useState(true),
47743
+ enabledLoader = _useState5[0],
47744
+ setEnabledLoader = _useState5[1];
47745
+ const _useState6 = useState(false),
47746
+ isAppDetailsPage = _useState6[0];
47747
+ const _useState7 = useState(false),
47748
+ isEnableLoader = _useState7[0],
47749
+ setIsEnableLoader = _useState7[1];
47750
+ let tenantId = Digit.ULBService.getCurrentTenantId();
47751
+ const serviceType = filters === null || filters === void 0 ? void 0 : filters.service;
47752
+ const stateId = Digit.ULBService.getStateId();
47753
+ let _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSConfigMDMS.WSCreateConfig(stateId, {}),
47754
+ newConfig = _Digit$Hooks$ws$useWS.data,
47755
+ isConfigLoading = _Digit$Hooks$ws$useWS.isLoading;
47756
+ let details = cloneDeep_1((_state = state) === null || _state === void 0 ? void 0 : _state.data);
47757
+ let _Digit$Hooks$ws$useWS2 = Digit.Hooks.ws.useWSDetailsPage(t, tenantId, (_details = details) === null || _details === void 0 ? void 0 : _details.applicationNo, (_details2 = details) === null || _details2 === void 0 ? void 0 : (_details2$application = _details2.applicationData) === null || _details2$application === void 0 ? void 0 : _details2$application.serviceType, {
47758
+ privacy: Digit.Utils.getPrivacyObject()
47759
+ }),
47760
+ applicationDetails = _Digit$Hooks$ws$useWS2.data;
47761
+ details = applicationDetails;
47762
+ const _useState8 = useState(new URLSearchParams(useLocation().search).get("propertyId")),
47763
+ propertyId = _useState8[0],
47764
+ setPropertyId = _useState8[1];
47765
+ const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("PT_CREATE_EMP_WS_NEW_FORM", {}),
47766
+ sessionFormData = _Digit$Hooks$useSessi[0],
47767
+ setSessionFormData = _Digit$Hooks$useSessi[1],
47768
+ clearSessionFormData = _Digit$Hooks$useSessi[2];
47769
+ const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertySearch({
47770
+ filters: {
47771
+ propertyIds: propertyId
47772
+ },
47773
+ tenantId: tenantId
47774
+ }, {
47775
+ filters: {
47776
+ propertyIds: propertyId
47777
+ },
47778
+ tenantId: tenantId,
47779
+ enabled: propertyId && propertyId != "" ? true : false,
47780
+ privacy: Digit.Utils.getPrivacyObject()
47781
+ }),
47782
+ propertyDetails = _Digit$Hooks$pt$usePr.data;
47783
+ useEffect(() => {
47784
+ if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
47785
+ const config = newConfig.find(conf => conf.hideInCitizen && conf.isModify);
47786
+ if (config) {
47787
+ var _config$body;
47788
+ config.head = "WS_WATER_AND_SEWERAGE_MUTATION_CONNECTION_LABEL";
47789
+ let bodyDetails = [];
47790
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
47791
+ if (data !== null && data !== void 0 && data.isModifyConnection) bodyDetails.push(data);
47792
+ });
47793
+ bodyDetails.forEach(bdyData => {
47794
+ if ((bdyData === null || bdyData === void 0 ? void 0 : bdyData.head) == "WS_COMMON_PROPERTY_DETAILS") bdyData.head = "";
47795
+ });
47796
+ config.body = bodyDetails;
47797
+ setConfig(config);
47798
+ }
47799
+ }
47800
+ }, [newConfig]);
47801
+ useEffect(() => {
47802
+ var _sessionFormData$cpt, _sessionFormData$cpt$, _sessionFormData$cpt2, _sessionFormData$cpt3;
47803
+ !propertyId && (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt = sessionFormData.cpt) === null || _sessionFormData$cpt === void 0 ? void 0 : (_sessionFormData$cpt$ = _sessionFormData$cpt.details) === null || _sessionFormData$cpt$ === void 0 ? void 0 : _sessionFormData$cpt$.propertyId) && setPropertyId(sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$cpt2 = sessionFormData.cpt) === null || _sessionFormData$cpt2 === void 0 ? void 0 : (_sessionFormData$cpt3 = _sessionFormData$cpt2.details) === null || _sessionFormData$cpt3 === void 0 ? void 0 : _sessionFormData$cpt3.propertyId);
47804
+ }, [sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
47805
+ useEffect(function () {
47806
+ try {
47807
+ const IsDetailsExists = sessionStorage.getItem("IsDetailsExists") ? JSON.parse(sessionStorage.getItem("IsDetailsExists")) : false;
47808
+ const _temp = function (_details3, _details3$application) {
47809
+ if ((_details3 = details) !== null && _details3 !== void 0 && (_details3$application = _details3.applicationData) !== null && _details3$application !== void 0 && _details3$application.id) {
47810
+ return Promise.resolve(convertApplicationData(details, serviceType, true, undefined, t)).then(function (convertAppData) {
47811
+ setSessionFormData(_extends({}, sessionFormData, convertAppData));
47812
+ setAppData(_extends({}, convertAppData));
47813
+ sessionStorage.setItem("IsDetailsExists", JSON.stringify(true));
47814
+ });
47815
+ }
47816
+ }();
47817
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
47818
+ } catch (e) {
47819
+ return Promise.reject(e);
47820
+ }
47821
+ }, [details, applicationDetails]);
47822
+ useEffect(() => {
47823
+ var _propertyDetails$Prop;
47824
+ setSessionFormData(_extends({}, sessionFormData, {
47825
+ cpt: {
47826
+ details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop[0]
47827
+ }
47828
+ }));
47829
+ }, [propertyDetails]);
47830
+ useEffect(() => {
47831
+ var _sessionFormData$Conn, _sessionFormData$Conn2;
47832
+ if (sessionFormData !== null && sessionFormData !== void 0 && (_sessionFormData$Conn = sessionFormData.ConnectionDetails) !== null && _sessionFormData$Conn !== void 0 && (_sessionFormData$Conn2 = _sessionFormData$Conn[0]) !== null && _sessionFormData$Conn2 !== void 0 && _sessionFormData$Conn2.applicationNo) {
47833
+ setEnabledLoader(false);
47834
+ }
47835
+ }, [propertyDetails, sessionFormData, sessionFormData === null || sessionFormData === void 0 ? void 0 : sessionFormData.cpt]);
47836
+ useEffect(() => {
47837
+ const timer = setTimeout(() => {
47838
+ var _sessionFormData$Conn3, _sessionFormData$Conn4, _sessionFormData$Conn5, _sessionFormData$Conn6, _sessionFormData$Conn7;
47839
+ if (isAppDetailsPage) window.location.href = window.location.origin + "/digit-ui/employee/ws/application-details?applicationNumber=" + (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$Conn3 = sessionFormData.ConnectionDetails) === null || _sessionFormData$Conn3 === void 0 ? void 0 : (_sessionFormData$Conn4 = _sessionFormData$Conn3[0]) === null || _sessionFormData$Conn4 === void 0 ? void 0 : _sessionFormData$Conn4.applicationNo) + "&service=" + (sessionFormData === null || sessionFormData === void 0 ? void 0 : (_sessionFormData$Conn5 = sessionFormData.ConnectionDetails) === null || _sessionFormData$Conn5 === void 0 ? void 0 : (_sessionFormData$Conn6 = _sessionFormData$Conn5[0]) === null || _sessionFormData$Conn6 === void 0 ? void 0 : (_sessionFormData$Conn7 = _sessionFormData$Conn6.serviceName) === null || _sessionFormData$Conn7 === void 0 ? void 0 : _sessionFormData$Conn7.toUpperCase());
47840
+ }, 3000);
47841
+ return () => clearTimeout(timer);
47842
+ }, [isAppDetailsPage]);
47843
+ const _Digit$Hooks$ws$useWa = Digit.Hooks.ws.useWaterCreateAPI("WATER"),
47844
+ waterMutation = _Digit$Hooks$ws$useWa.mutate;
47845
+ const _Digit$Hooks$ws$useWS3 = Digit.Hooks.ws.useWSApplicationActions("WATER");
47846
+ const _Digit$Hooks$ws$useWa2 = Digit.Hooks.ws.useWaterCreateAPI("SEWERAGE"),
47847
+ sewerageMutation = _Digit$Hooks$ws$useWa2.mutate;
47848
+ const _Digit$Hooks$ws$useWS4 = Digit.Hooks.ws.useWSApplicationActions("SEWERAGE");
47849
+ const onFormValueChange = (setValue, formData, formState) => {
47850
+ var _formData$cpt, _formData$cpt$details;
47851
+ if (!lodash.isEqual(sessionFormData, formData)) {
47852
+ setSessionFormData(_extends({}, sessionFormData, formData));
47853
+ }
47854
+ if (Object.keys(formState.errors).length > 0 && Object.keys(formState.errors).length == 1 && formState.errors["owners"] && Object.values(formState.errors["owners"].type).filter(ob => ob.type === "required").length == 0 && !(formData !== null && formData !== void 0 && (_formData$cpt = formData.cpt) !== null && _formData$cpt !== void 0 && (_formData$cpt$details = _formData$cpt.details) !== null && _formData$cpt$details !== void 0 && _formData$cpt$details.propertyId)) setSubmitValve(true);else setSubmitValve(!Object.keys(formState.errors).length);
47855
+ };
47856
+ const onSubmit = function (data) {
47857
+ try {
47858
+ var _data$cpt, _propertyDetails$Prop2;
47859
+ if (!(data !== null && data !== void 0 && (_data$cpt = data.cpt) !== null && _data$cpt !== void 0 && _data$cpt.id) && !(propertyDetails !== null && propertyDetails !== void 0 && (_propertyDetails$Prop2 = propertyDetails.Properties) !== null && _propertyDetails$Prop2 !== void 0 && _propertyDetails$Prop2[0])) {
47860
+ var _data$cpt2;
47861
+ if (!(data !== null && data !== void 0 && (_data$cpt2 = data.cpt) !== null && _data$cpt2 !== void 0 && _data$cpt2.details) || !propertyDetails) {
47862
+ setShowToast({
47863
+ key: "error",
47864
+ message: "ERR_INVALID_PROPERTY_ID"
47865
+ });
47866
+ return Promise.resolve();
47867
+ }
47868
+ }
47869
+ const _temp7 = function () {
47870
+ if (!canSubmit) {
47871
+ setShowToast({
47872
+ warning: true,
47873
+ message: "PLEASE_FILL_MANDATORY_DETAILS"
47874
+ });
47875
+ setTimeout(() => {
47876
+ setShowToast(false);
47877
+ }, 3000);
47878
+ } else {
47879
+ var _data$cpt3;
47880
+ if (!(data !== null && data !== void 0 && (_data$cpt3 = data.cpt) !== null && _data$cpt3 !== void 0 && _data$cpt3.details)) {
47881
+ var _propertyDetails$Prop3;
47882
+ data.cpt = {
47883
+ details: propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop3 = propertyDetails.Properties) === null || _propertyDetails$Prop3 === void 0 ? void 0 : _propertyDetails$Prop3[0]
47884
+ };
47885
+ }
47886
+ const details = sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS") ? JSON.parse(sessionStorage.getItem("WS_EDIT_APPLICATION_DETAILS")) : {};
47887
+ return Promise.resolve(convertModifyApplicationDetails(data, details, "APPLY_MUTATION")).then(function (convertAppData) {
47888
+ function _temp6() {
47889
+ const _temp4 = function () {
47890
+ if (serviceType !== "WATER") {
47891
+ const _temp3 = function () {
47892
+ if (sewerageMutation) {
47893
+ setIsEnableLoader(true);
47894
+ return Promise.resolve(sewerageMutation(reqDetails, {
47895
+ onError: (error, variables) => {
47896
+ var _error$response, _error$response$data, _error$response$data$, _error$response$data$2, _error$response2, _error$response2$data, _error$response2$data2, _error$response2$data3;
47897
+ setIsEnableLoader(false);
47898
+ setShowToast({
47899
+ key: "error",
47900
+ message: error !== null && error !== void 0 && (_error$response = error.response) !== null && _error$response !== void 0 && (_error$response$data = _error$response.data) !== null && _error$response$data !== void 0 && (_error$response$data$ = _error$response$data.Errors) !== null && _error$response$data$ !== void 0 && (_error$response$data$2 = _error$response$data$[0]) !== null && _error$response$data$2 !== void 0 && _error$response$data$2.message ? 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$data2 = _error$response2$data.Errors) === null || _error$response2$data2 === void 0 ? void 0 : (_error$response2$data3 = _error$response2$data2[0]) === null || _error$response2$data3 === void 0 ? void 0 : _error$response2$data3.message : error
47901
+ });
47902
+ setTimeout(closeToastOfError, 5000);
47903
+ },
47904
+ onSuccess: function (data, variables) {
47905
+ try {
47906
+ var _data$SewerageConnect, _data$SewerageConnect2;
47907
+ clearSessionFormData();
47908
+ history.push("/digit-ui/employee/ws/ws-response?applicationNumber1=" + (data === null || data === void 0 ? void 0 : (_data$SewerageConnect = data.SewerageConnections) === null || _data$SewerageConnect === void 0 ? void 0 : (_data$SewerageConnect2 = _data$SewerageConnect[0]) === null || _data$SewerageConnect2 === void 0 ? void 0 : _data$SewerageConnect2.applicationNo));
47909
+ return Promise.resolve();
47910
+ } catch (e) {
47911
+ return Promise.reject(e);
47912
+ }
47913
+ }
47914
+ })).then(function () {});
47915
+ }
47916
+ }();
47917
+ if (_temp3 && _temp3.then) return _temp3.then(function () {});
47918
+ }
47919
+ }();
47920
+ if (_temp4 && _temp4.then) return _temp4.then(function () {});
47921
+ }
47922
+ convertAppData.applicationType = serviceType == "WATER" ? "MUTATION_WATER_CONNECTION" : "MUTATION_SEWERAGE_CONNECTION";
47923
+ const reqDetails = serviceType == "WATER" ? {
47924
+ WaterConnection: convertAppData,
47925
+ reconnectRequest: false,
47926
+ disconnectRequest: false
47927
+ } : {
47928
+ SewerageConnection: convertAppData,
47929
+ reconnectRequest: false,
47930
+ disconnectRequest: false
47931
+ };
47932
+ const _temp5 = function () {
47933
+ if (serviceType == "WATER") {
47934
+ const _temp2 = function () {
47935
+ if (waterMutation) {
47936
+ setIsEnableLoader(true);
47937
+ return Promise.resolve(waterMutation(reqDetails, {
47938
+ onError: (error, variables) => {
47939
+ var _error$response3, _error$response3$data, _error$response3$data2, _error$response4, _error$response4$data, _error$response4$data2;
47940
+ setIsEnableLoader(false);
47941
+ setShowToast({
47942
+ key: "error",
47943
+ message: error !== null && error !== void 0 && (_error$response3 = error.response) !== null && _error$response3 !== void 0 && (_error$response3$data = _error$response3.data) !== null && _error$response3$data !== void 0 && (_error$response3$data2 = _error$response3$data.Errors) !== null && _error$response3$data2 !== void 0 && _error$response3$data2[0].message ? error === null || error === void 0 ? void 0 : (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : (_error$response4$data = _error$response4.data) === null || _error$response4$data === void 0 ? void 0 : (_error$response4$data2 = _error$response4$data.Errors) === null || _error$response4$data2 === void 0 ? void 0 : _error$response4$data2[0].message : error
47944
+ });
47945
+ setTimeout(closeToastOfError, 5000);
47946
+ },
47947
+ onSuccess: function (data, variables) {
47948
+ try {
47949
+ var _data$WaterConnection, _data$WaterConnection2;
47950
+ clearSessionFormData();
47951
+ history.push("/digit-ui/employee/ws/ws-response?applicationNumber=" + (data === null || data === void 0 ? void 0 : (_data$WaterConnection = data.WaterConnection) === null || _data$WaterConnection === void 0 ? void 0 : (_data$WaterConnection2 = _data$WaterConnection[0]) === null || _data$WaterConnection2 === void 0 ? void 0 : _data$WaterConnection2.applicationNo));
47952
+ return Promise.resolve();
47953
+ } catch (e) {
47954
+ return Promise.reject(e);
47955
+ }
47956
+ }
47957
+ })).then(function () {});
47958
+ }
47959
+ }();
47960
+ if (_temp2 && _temp2.then) return _temp2.then(function () {});
47961
+ }
47962
+ }();
47963
+ return _temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5);
47964
+ });
47965
+ }
47966
+ }();
47967
+ return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(function () {}) : void 0);
47968
+ } catch (e) {
47969
+ return Promise.reject(e);
47970
+ }
47971
+ };
47972
+ const closeToastOfError = () => {
47973
+ setShowToast(null);
47974
+ };
47975
+ const closeToast = () => {
47976
+ setShowToast(null);
47977
+ };
47978
+ if (enabledLoader || isEnableLoader || isConfigLoading) {
47979
+ return /*#__PURE__*/React.createElement(Loader, null);
47980
+ }
47981
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
47982
+ style: {
47983
+ marginLeft: "15px"
47984
+ }
47985
+ }, /*#__PURE__*/React.createElement(Header, null, t(config.head))), /*#__PURE__*/React.createElement(FormComposer, {
47986
+ config: config.body,
47987
+ userType: "employee",
47988
+ onFormValueChange: onFormValueChange,
47989
+ label: t("CS_COMMON_SUBMIT"),
47990
+ onSubmit: onSubmit,
47991
+ defaultValues: sessionFormData,
47992
+ appData: appData
47993
+ }), showToast && /*#__PURE__*/React.createElement(Toast, {
47994
+ isDleteBtn: true,
47995
+ error: (showToast === null || showToast === void 0 ? void 0 : showToast.key) === "error" ? true : false,
47996
+ label: t(showToast === null || showToast === void 0 ? void 0 : showToast.message),
47997
+ onClose: closeToast
47998
+ }));
47999
+ };
48000
+
47480
48001
  const getPath$5 = (path, params) => {
47481
48002
  params && Object.keys(params).map(key => {
47482
48003
  path = path.replace(":" + key, params[key]);
@@ -47719,16 +48240,18 @@ const WSEditApplicationByConfig = () => {
47719
48240
  }),
47720
48241
  propertyDetails = _Digit$Hooks$pt$usePr.data;
47721
48242
  useEffect(() => {
47722
- if (!isConfigLoading) {
47723
- var _config$body;
48243
+ if (!isConfigLoading && newConfig && Array.isArray(newConfig)) {
47724
48244
  const config = newConfig.find(conf => conf.hideInCitizen && conf.isEditByConfig);
47725
- config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL";
47726
- let bodyDetails = [];
47727
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
47728
- if (data !== null && data !== void 0 && data.isEditByConfigConnection) bodyDetails.push(data);
47729
- });
47730
- config.body = bodyDetails;
47731
- setConfig(config);
48245
+ if (config) {
48246
+ var _config$body;
48247
+ config.head = "WS_APP_FOR_WATER_AND_SEWERAGE_EDIT_LABEL";
48248
+ let bodyDetails = [];
48249
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
48250
+ if (data !== null && data !== void 0 && data.isEditByConfigConnection) bodyDetails.push(data);
48251
+ });
48252
+ config.body = bodyDetails;
48253
+ setConfig(config);
48254
+ }
47732
48255
  }
47733
48256
  }, [newConfig]);
47734
48257
  useEffect(() => {
@@ -48337,16 +48860,18 @@ const EditDisconnectionByConfig = () => {
48337
48860
  sessionFormData = _Digit$Hooks$useSessi[0],
48338
48861
  setSessionFormData = _Digit$Hooks$useSessi[1];
48339
48862
  useEffect(() => {
48340
- if (!isLoading && !isConfigLoading) {
48341
- var _config$body;
48863
+ if (!isLoading && !isConfigLoading && newConfig && Array.isArray(newConfig)) {
48342
48864
  const config = newConfig.find(conf => conf.isDisonnectionEdit);
48343
- config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
48344
- let bodyDetails = [];
48345
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
48346
- if (data !== null && data !== void 0 && data.isDisonnectionEdit) bodyDetails.push(data);
48347
- });
48348
- config.body = bodyDetails;
48349
- setConfig(config);
48865
+ if (config) {
48866
+ var _config$body;
48867
+ config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
48868
+ let bodyDetails = [];
48869
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
48870
+ if (data !== null && data !== void 0 && data.isDisonnectionEdit) bodyDetails.push(data);
48871
+ });
48872
+ config.body = bodyDetails;
48873
+ setConfig(config);
48874
+ }
48350
48875
  }
48351
48876
  }, [applicationDetails, isLoading, newConfig]);
48352
48877
  useEffect(function () {
@@ -48471,16 +48996,18 @@ const EditDisconnectionByConfig$1 = () => {
48471
48996
  sessionFormData = _Digit$Hooks$useSessi[0],
48472
48997
  setSessionFormData = _Digit$Hooks$useSessi[1];
48473
48998
  useEffect(() => {
48474
- if (!isLoading && !isConfigLoading) {
48475
- var _config$body;
48999
+ if (!isLoading && !isConfigLoading && newConfig && Array.isArray(newConfig)) {
48476
49000
  const config = newConfig.find(conf => conf.isDisonnectionEdit);
48477
- config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
48478
- let bodyDetails = [];
48479
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
48480
- if (data !== null && data !== void 0 && data.isDisonnectionEditByConfig) bodyDetails.push(data);
48481
- });
48482
- config.body = bodyDetails;
48483
- setConfig(config);
49001
+ if (config) {
49002
+ var _config$body;
49003
+ config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
49004
+ let bodyDetails = [];
49005
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
49006
+ if (data !== null && data !== void 0 && data.isDisonnectionEditByConfig) bodyDetails.push(data);
49007
+ });
49008
+ config.body = bodyDetails;
49009
+ setConfig(config);
49010
+ }
48484
49011
  }
48485
49012
  }, [applicationDetails, isLoading, newConfig]);
48486
49013
  useEffect(function () {
@@ -48610,16 +49137,18 @@ const ResubmitDisconnection = () => {
48610
49137
  const _Digit$Hooks$ws$useWS2 = Digit.Hooks.ws.useWSApplicationActions(serviceType),
48611
49138
  mutate = _Digit$Hooks$ws$useWS2.mutate;
48612
49139
  useEffect(() => {
48613
- if (!isLoading && !isConfigLoading) {
48614
- var _config$body;
49140
+ if (!isLoading && !isConfigLoading && newConfig && Array.isArray(newConfig)) {
48615
49141
  const config = newConfig.find(conf => conf.isDisonnectionEdit);
48616
- config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
48617
- let bodyDetails = [];
48618
- config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
48619
- if (data !== null && data !== void 0 && data.isDisonnectionEdit) bodyDetails.push(data);
48620
- });
48621
- config.body = bodyDetails;
48622
- setConfig(config);
49142
+ if (config) {
49143
+ var _config$body;
49144
+ config.head = "WS_WATER_SEWERAGE_DISCONNECTION_EDIT_LABEL";
49145
+ let bodyDetails = [];
49146
+ config === null || config === void 0 ? void 0 : (_config$body = config.body) === null || _config$body === void 0 ? void 0 : _config$body.forEach(data => {
49147
+ if (data !== null && data !== void 0 && data.isDisonnectionEdit) bodyDetails.push(data);
49148
+ });
49149
+ config.body = bodyDetails;
49150
+ setConfig(config);
49151
+ }
48623
49152
  }
48624
49153
  }, [applicationDetails, isLoading, newConfig]);
48625
49154
  useEffect(function () {
@@ -50405,6 +50934,7 @@ const componentsToRegister = {
50405
50934
  WSConsumptionDetails: ConsumptionDetails,
50406
50935
  WSModifyApplication: ModifyApplication,
50407
50936
  WSEditModifyApplication: EditModifyApplication,
50937
+ WSMutationApplication: MutationApplication,
50408
50938
  WSDisconnectionApplication: DisconnectionApplication,
50409
50939
  WSRestorationApplication: DisconnectionApplication$1,
50410
50940
  WSEditApplicationByConfig: WSEditApplicationByConfig,