@djb25/digit-ui-module-fsm 1.0.15 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { AddNewIcon, ShippingTruck, EmployeeModuleCard, TickMark, FormStep as FormStep$1, RadioOrSelect, LabelFieldPair, CardLabel as CardLabel$1, Dropdown as Dropdown$2, TextInput as TextInput$1, RadioButtons, Loader, LocationSearchCard, TextArea as TextArea$1, CardLabelError as CardLabelError$1, CitizenInfoLabel, CardText as CardText$1, WrapUnMaskComponent, PitDimension, ImageUploadHandler, KeyNote, BackButton, PrivateRoute, LayoutWrapper, TelePhone, CardSectionHeader, CheckPoint, ConnectingCheckPoints, LinkButton as LinkButton$1, ActionLinks, Rating, SubmitBar as SubmitBar$1, Header, Card as Card$1, CardHeader as CardHeader$1, CardSubHeader, StatusTable, Row, Banner, RatingCard, ULBHomeCard, ViewReportIcon, InboxIcon, Table, CheckBox, CloseSvg, Localities, RemoveableTag, ActionBar, ApplyFilterBar, Label, LinkLabel, DatePicker as DatePicker$3, DetailsCard, SearchAction, FilterAction, PopUp, BreadCrumb, ModuleHeader, ArrowLeft, HomeIcon, Modal, FormComposer, UploadPitPhoto, ImageViewer, BreakLine, Toast, Menu, MultiUploadWrapper, AddIcon, ToggleSwitch, InfoIcon, EditIcon, DeleteIcon, VerticalTimeline, CustomTooltip, MobileNumber, CitizenHomeCard, CitizenTruck } from '@djb25/digit-ui-react-components';
1
+ import { AddNewIcon, ShippingTruck, EmployeeModuleCard, TickMark, FormStep as FormStep$1, RadioOrSelect, LabelFieldPair, CardLabel as CardLabel$1, Dropdown as Dropdown$1, TextInput as TextInput$1, RadioButtons, Loader, LocationSearchCard, TextArea as TextArea$1, CardLabelError as CardLabelError$1, CitizenInfoLabel, CardText as CardText$1, WrapUnMaskComponent, PitDimension, ImageUploadHandler, KeyNote, BackButton, PrivateRoute, LayoutWrapper, TelePhone, CardSectionHeader, CheckPoint, ConnectingCheckPoints, LinkButton as LinkButton$1, ActionLinks, Rating, SubmitBar as SubmitBar$1, Header, Card, CardHeader as CardHeader$1, CardSubHeader, StatusTable, Row, Banner, RatingCard, ULBHomeCard, ViewReportIcon, InboxIcon, Table, CheckBox, CloseSvg, Localities, RemoveableTag, ActionBar, ApplyFilterBar, Label, LinkLabel, DatePicker as DatePicker$2, DetailsCard, SearchAction, FilterAction, PopUp, BreadCrumb, ModuleHeader, ArrowLeft, HomeIcon, Modal, FormComposer, UploadPitPhoto, ImageViewer, BreakLine, Toast, Menu, MultiUploadWrapper, AddIcon, ToggleSwitch, InfoIcon, EditIcon, DeleteIcon, VerticalTimeline, CustomTooltip, MobileNumber, CitizenHomeCard, CitizenTruck } from '@djb25/digit-ui-react-components';
2
2
  import React, { useState, useEffect, Fragment as Fragment$1, forwardRef, useCallback, useMemo, useRef } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useLocation, useParams, Switch, Redirect, Link, useHistory, useRouteMatch, Route } from 'react-router-dom';
@@ -409,7 +409,7 @@ const FSMSelectAddress = ({
409
409
  var _formData$address7, _formData$address7$lo;
410
410
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
411
411
  className: "card-label-smaller"
412
- }, t("MYCITY_CODE_LABEL"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$2, {
412
+ }, t("MYCITY_CODE_LABEL"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$1, {
413
413
  className: "form-field",
414
414
  isMandatory: true,
415
415
  selected: (cities === null || cities === void 0 ? void 0 : cities.length) === 1 ? cities[0] : selectedCity,
@@ -420,7 +420,7 @@ const FSMSelectAddress = ({
420
420
  t: t
421
421
  })), !isUrcEnable || isNewVendor || isEditVendor ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
422
422
  className: "card-label-smaller"
423
- }, t("ES_NEW_APPLICATION_LOCATION_MOHALLA"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$2, {
423
+ }, t("ES_NEW_APPLICATION_LOCATION_MOHALLA"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$1, {
424
424
  className: "form-field",
425
425
  isMandatory: true,
426
426
  selected: selectedLocality,
@@ -497,7 +497,7 @@ const SelectChannel = ({
497
497
  setChannel(value);
498
498
  onSelect(config.key, value);
499
499
  }
500
- return channelMenu ? /*#__PURE__*/React.createElement(Dropdown$2, {
500
+ return channelMenu ? /*#__PURE__*/React.createElement(Dropdown$1, {
501
501
  option: channelMenu,
502
502
  optionKey: "i18nKey",
503
503
  id: "channel",
@@ -549,7 +549,7 @@ const SelectGender = ({
549
549
  return /*#__PURE__*/React.createElement(Loader, null);
550
550
  }
551
551
  if (userType === "employee") {
552
- return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, t(config.label)), /*#__PURE__*/React.createElement(Dropdown$2, {
552
+ return /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, t(config.label)), /*#__PURE__*/React.createElement(Dropdown$1, {
553
553
  className: "payment-form-text-input-correction",
554
554
  isMandatory: config.isMandatory,
555
555
  selected: genderType,
@@ -887,7 +887,7 @@ const SelectName = ({
887
887
  className: "card-label-smaller"
888
888
  }, t(input.label), input.isMandatory ? " * " : null), /*#__PURE__*/React.createElement("div", {
889
889
  className: "field"
890
- }, /*#__PURE__*/React.createElement(Dropdown$2, {
890
+ }, /*#__PURE__*/React.createElement(Dropdown$1, {
891
891
  option: (_input$options = input.options) === null || _input$options === void 0 ? void 0 : _input$options.sort((a, b) => a.code.localeCompare(b.code)),
892
892
  optionKey: "i18nKey",
893
893
  id: "dropdown",
@@ -1080,7 +1080,7 @@ const SelectPitType = ({
1080
1080
  return /*#__PURE__*/React.createElement(Loader, null);
1081
1081
  }
1082
1082
  if (userType === "employee") {
1083
- return /*#__PURE__*/React.createElement(Dropdown$2, {
1083
+ return /*#__PURE__*/React.createElement(Dropdown$1, {
1084
1084
  isMandatory: true,
1085
1085
  option: sanitationMenu === null || sanitationMenu === void 0 ? void 0 : sanitationMenu.sort((a, b) => a.name.localeCompare(b.name)),
1086
1086
  optionKey: "i18nKey",
@@ -2046,17 +2046,10 @@ const CardLabelError = props => {
2046
2046
  const TextInput = props => {
2047
2047
  var _props$validation, _props$validation2, _props$validation3, _props$validation4, _props$validation5, _props$validation6, _props$validation7;
2048
2048
  const user_type = Digit.SessionStorage.get("userType");
2049
- const [date, setDate] = useState();
2050
2049
  const data = props !== null && props !== void 0 && props.watch ? {
2051
2050
  fromDate: props === null || props === void 0 ? void 0 : props.watch("fromDate"),
2052
2051
  toDate: props === null || props === void 0 ? void 0 : props.watch("toDate")
2053
2052
  } : {};
2054
- const handleDate = event => {
2055
- const {
2056
- value
2057
- } = event.target;
2058
- setDate(getDDMMYYYY(value));
2059
- };
2060
2053
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2061
2054
  className: `text-input ${user_type === "employee" ? "" : "text-input-width"} ${props.className}`,
2062
2055
  style: props !== null && props !== void 0 && props.textInputStyle ? {
@@ -2072,9 +2065,6 @@ const TextInput = props => {
2072
2065
  if (props !== null && props !== void 0 && props.onChange) {
2073
2066
  props === null || props === void 0 ? void 0 : props.onChange(event);
2074
2067
  }
2075
- if (props.type === "date") {
2076
- handleDate(event);
2077
- }
2078
2068
  },
2079
2069
  ref: props.inputRef,
2080
2070
  value: props.value !== undefined ? props.value : undefined,
@@ -2104,9 +2094,6 @@ const TextInput = props => {
2104
2094
  if (props !== null && props !== void 0 && props.onChange) {
2105
2095
  props === null || props === void 0 ? void 0 : props.onChange(event);
2106
2096
  }
2107
- if (props.type === "date") {
2108
- handleDate(event);
2109
- }
2110
2097
  },
2111
2098
  ref: props.inputRef,
2112
2099
  value: props.value !== undefined ? props.value : undefined,
@@ -2142,28 +2129,6 @@ TextInput.propTypes = {
2142
2129
  TextInput.defaultProps = {
2143
2130
  isMandatory: false
2144
2131
  };
2145
- function getDDMMYYYY(date) {
2146
- if (!date) return "";
2147
- return new Date(date).toLocaleString("en-In").split(",")[0];
2148
- }
2149
-
2150
- const Card = ({
2151
- onClick,
2152
- style,
2153
- children,
2154
- className,
2155
- ReactRef,
2156
- ...props
2157
- }) => {
2158
- return /*#__PURE__*/React.createElement("div", Object.assign({
2159
- key: props.key,
2160
- className: `employeeCard ${className ? className : ""}`,
2161
- onClick: onClick,
2162
- style: style
2163
- }, props, {
2164
- ref: ReactRef
2165
- }), children);
2166
- };
2167
2132
 
2168
2133
  const CardHeader = props => {
2169
2134
  return /*#__PURE__*/React.createElement("header", {
@@ -2237,7 +2202,7 @@ const InputCard = ({
2237
2202
  className
2238
2203
  }) => {
2239
2204
  const isMobile = window.Digit.Utils.browser.isMobile();
2240
- return /*#__PURE__*/React.createElement(Card, {
2205
+ return /*#__PURE__*/React.createElement("div", {
2241
2206
  className: className || "",
2242
2207
  style: _cardStyle
2243
2208
  }, _texts.headerCaption && /*#__PURE__*/React.createElement(CardCaption, null, t(_texts.headerCaption)), (_texts === null || _texts === void 0 ? void 0 : _texts.header) && /*#__PURE__*/React.createElement(CardHeader, null, t(_texts.header)), (_texts === null || _texts === void 0 ? void 0 : _texts.cardText) && /*#__PURE__*/React.createElement(CardText, null, t(_texts.cardText)), /*#__PURE__*/React.createElement("div", {
@@ -2369,7 +2334,6 @@ const FormStep = ({
2369
2334
  var _config$inputs, _config$texts;
2370
2335
  const {
2371
2336
  register,
2372
- watch,
2373
2337
  errors,
2374
2338
  handleSubmit
2375
2339
  } = useForm({
@@ -8506,7 +8470,7 @@ const SelectPropertySubtype = ({
8506
8470
  return /*#__PURE__*/React.createElement(Loader, null);
8507
8471
  }
8508
8472
  if (userType === "employee") {
8509
- return /*#__PURE__*/React.createElement(Dropdown$2, {
8473
+ return /*#__PURE__*/React.createElement(Dropdown$1, {
8510
8474
  option: subtypeOptions === null || subtypeOptions === void 0 ? void 0 : subtypeOptions.sort((a, b) => a.name.localeCompare(b.name)),
8511
8475
  optionKey: "i18nKey",
8512
8476
  id: "propertySubType",
@@ -8612,7 +8576,7 @@ const SelectPropertyType = ({
8612
8576
  }
8613
8577
  if (userType === "employee") {
8614
8578
  var _propertyTypesData$da;
8615
- return /*#__PURE__*/React.createElement(Dropdown$2, {
8579
+ return /*#__PURE__*/React.createElement(Dropdown$1, {
8616
8580
  option: (_propertyTypesData$da = propertyTypesData.data) === null || _propertyTypesData$da === void 0 ? void 0 : _propertyTypesData$da.sort((a, b) => a.name.localeCompare(b.name)),
8617
8581
  optionKey: "i18nKey",
8618
8582
  id: "propertyType",
@@ -8931,7 +8895,7 @@ const SelectSlumName = ({
8931
8895
  if (slumDataLoading) return /*#__PURE__*/React.createElement(Loader, null);
8932
8896
  return userType === "employee" ? (formData === null || formData === void 0 ? void 0 : (_formData$address0 = formData.address) === null || _formData$address0 === void 0 ? void 0 : _formData$address0.propertyLocation) !== "FROM_GRAM_PANCHAYAT" && /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
8933
8897
  className: "card-label-smaller"
8934
- }, t("ES_NEW_APPLICATION_SLUM_NAME")), /*#__PURE__*/React.createElement(Dropdown$2, {
8898
+ }, t("ES_NEW_APPLICATION_SLUM_NAME")), /*#__PURE__*/React.createElement(Dropdown$1, {
8935
8899
  t: t,
8936
8900
  option: slumMenu,
8937
8901
  className: "form-field",
@@ -8947,7 +8911,7 @@ const SelectSlumName = ({
8947
8911
  config: config,
8948
8912
  onSelect: goNext,
8949
8913
  onSkip: onSkip
8950
- }, /*#__PURE__*/React.createElement(Dropdown$2, {
8914
+ }, /*#__PURE__*/React.createElement(Dropdown$1, {
8951
8915
  t: t,
8952
8916
  option: slumMenu,
8953
8917
  optionKey: "i18nKey",
@@ -9710,7 +9674,7 @@ const SelectVehicleType = ({
9710
9674
  type: type
9711
9675
  });
9712
9676
  };
9713
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, t("ES_FSM_REGISTRY_VEHICLE_MODEL"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$2, {
9677
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, t("ES_FSM_REGISTRY_VEHICLE_MODEL"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$1, {
9714
9678
  className: "form-field",
9715
9679
  isMandatory: true,
9716
9680
  selected: selectedModal,
@@ -9719,7 +9683,7 @@ const SelectVehicleType = ({
9719
9683
  select: selectModal,
9720
9684
  optionKey: "name",
9721
9685
  t: t
9722
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, t("ES_FSM_REGISTRY_VEHICLE_TYPE"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$2, {
9686
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, t("ES_FSM_REGISTRY_VEHICLE_TYPE"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$1, {
9723
9687
  className: "form-field",
9724
9688
  isMandatory: true,
9725
9689
  selected: selectedType,
@@ -10055,7 +10019,7 @@ const ApplicationDetails = () => {
10055
10019
  color: "#A52A2A"
10056
10020
  },
10057
10021
  onClick: handleViewTimeline
10058
- }))), /*#__PURE__*/React.createElement(Card$1, {
10022
+ }))), /*#__PURE__*/React.createElement(Card, {
10059
10023
  style: {
10060
10024
  position: "relative"
10061
10025
  }
@@ -10088,7 +10052,7 @@ const MyApplication = ({
10088
10052
  const {
10089
10053
  t
10090
10054
  } = useTranslation();
10091
- return /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(KeyNote, {
10055
+ return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(KeyNote, {
10092
10056
  keyValue: t("CS_FSM_APPLICATION_APPLICATION_NO"),
10093
10057
  note: application.applicationNo
10094
10058
  }), /*#__PURE__*/React.createElement(KeyNote, {
@@ -10137,7 +10101,7 @@ const MyApplications = () => {
10137
10101
  key: index
10138
10102
  }, /*#__PURE__*/React.createElement(MyApplication, {
10139
10103
  application: application
10140
- }))), applicationsList.length === 0 && /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement("p", {
10104
+ }))), applicationsList.length === 0 && /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("p", {
10141
10105
  style: {
10142
10106
  textAlign: "center"
10143
10107
  }
@@ -10205,7 +10169,7 @@ const CheckPage = ({
10205
10169
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Timeline, {
10206
10170
  currentStep: 4,
10207
10171
  flow: "APPLY"
10208
- }), /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(CardHeader$1, null, t("CS_CHECK_CHECK_YOUR_ANSWERS")), /*#__PURE__*/React.createElement(CardText$1, null, t("CS_CHECK_CHECK_YOUR_ANSWERS_TEXT")), /*#__PURE__*/React.createElement(CardSubHeader, null, t("CS_CHECK_PROPERTY_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, selectTripNo && (selectTripNo === null || selectTripNo === void 0 ? void 0 : selectTripNo.tripNo) && /*#__PURE__*/React.createElement(Row, {
10172
+ }), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardHeader$1, null, t("CS_CHECK_CHECK_YOUR_ANSWERS")), /*#__PURE__*/React.createElement(CardText$1, null, t("CS_CHECK_CHECK_YOUR_ANSWERS_TEXT")), /*#__PURE__*/React.createElement(CardSubHeader, null, t("CS_CHECK_PROPERTY_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, selectTripNo && (selectTripNo === null || selectTripNo === void 0 ? void 0 : selectTripNo.tripNo) && /*#__PURE__*/React.createElement(Row, {
10209
10173
  label: t("ES_FSM_ACTION_NUMBER_OF_TRIPS"),
10210
10174
  text: t(selectTripNo === null || selectTripNo === void 0 ? void 0 : (_selectTripNo$tripNo = selectTripNo.tripNo) === null || _selectTripNo$tripNo === void 0 ? void 0 : _selectTripNo$tripNo.i18nKey),
10211
10175
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
@@ -10628,7 +10592,7 @@ const Response = ({
10628
10592
  Digit.Utils.pdf.generate(data);
10629
10593
  };
10630
10594
  const isSuccess = !successData ? mutation === null || mutation === void 0 ? void 0 : mutation.isSuccess : true;
10631
- return mutation.isLoading || mutation.isIdle && !mutationHappened ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(BannerPicker, {
10595
+ return mutation.isLoading || mutation.isIdle && !mutationHappened ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(BannerPicker, {
10632
10596
  t: t,
10633
10597
  data: Data,
10634
10598
  isSuccess: isSuccess,
@@ -11091,7 +11055,7 @@ const RateView = props => {
11091
11055
  if (isLoading || isWorkflowLoading) {
11092
11056
  return /*#__PURE__*/React.createElement(Loader, null);
11093
11057
  }
11094
- return /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(CardHeader$1, null, t("CS_RATE_HELP_US")), /*#__PURE__*/React.createElement(KeyNote, {
11058
+ return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardHeader$1, null, t("CS_RATE_HELP_US")), /*#__PURE__*/React.createElement(KeyNote, {
11095
11059
  keyValue: t("CS_FSM_YOU_RATED")
11096
11060
  }, /*#__PURE__*/React.createElement(Rating, {
11097
11061
  currentRating: data === null || data === void 0 ? void 0 : (_data$timeline$ = data.timeline[0]) === null || _data$timeline$ === void 0 ? void 0 : _data$timeline$.rating
@@ -11391,7 +11355,7 @@ const FSMLink = ({
11391
11355
  }, /*#__PURE__*/React.createElement(ShippingTruck, null)), " ", /*#__PURE__*/React.createElement("span", {
11392
11356
  className: "text"
11393
11357
  }, t("ES_TITLE_FAECAL_SLUDGE_MGMT")));
11394
- return /*#__PURE__*/React.createElement(Card$1, {
11358
+ return /*#__PURE__*/React.createElement(Card, {
11395
11359
  className: "employeeCard inboxLinksFSM"
11396
11360
  }, /*#__PURE__*/React.createElement("div", {
11397
11361
  className: "complaint-links-container"
@@ -11670,7 +11634,7 @@ const DropdownStatus = ({
11670
11634
  applicationStatuses,
11671
11635
  areApplicationStatus
11672
11636
  }) => {
11673
- return areApplicationStatus ? /*#__PURE__*/React.createElement(Dropdown$2, {
11637
+ return areApplicationStatus ? /*#__PURE__*/React.createElement(Dropdown$1, {
11674
11638
  option: applicationStatuses,
11675
11639
  optionKey: "name",
11676
11640
  selected: value,
@@ -11752,7 +11716,7 @@ const SearchApplication = ({
11752
11716
  switch (input.type) {
11753
11717
  case "date":
11754
11718
  return /*#__PURE__*/React.createElement(Controller, {
11755
- render: props => /*#__PURE__*/React.createElement(DatePicker$3, {
11719
+ render: props => /*#__PURE__*/React.createElement(DatePicker$2, {
11756
11720
  date: props.value,
11757
11721
  onChange: props.onChange
11758
11722
  }),
@@ -12070,7 +12034,7 @@ const DesktopInbox = props => {
12070
12034
  if (props.isLoading) {
12071
12035
  result = /*#__PURE__*/React.createElement(Loader, null);
12072
12036
  } else if (props.isSearch && !props.shouldSearch || (props === null || props === void 0 ? void 0 : (_props$data = props.data) === null || _props$data === void 0 ? void 0 : (_props$data$table = _props$data.table) === null || _props$data$table === void 0 ? void 0 : _props$data$table.length) === 0) {
12073
- result = /*#__PURE__*/React.createElement(Card$1, {
12037
+ result = /*#__PURE__*/React.createElement(Card, {
12074
12038
  style: {
12075
12039
  marginTop: 20
12076
12040
  }
@@ -12261,7 +12225,7 @@ const ApplicationCard = ({
12261
12225
  }
12262
12226
  let result;
12263
12227
  if (!data || (data === null || data === void 0 ? void 0 : data.length) === 0) {
12264
- result = /*#__PURE__*/React.createElement(Card$1, {
12228
+ result = /*#__PURE__*/React.createElement(Card, {
12265
12229
  style: {
12266
12230
  marginTop: 20
12267
12231
  }
@@ -13165,7 +13129,7 @@ const configAssignDso = ({
13165
13129
  label: t("ES_FSM_ACTION_DSO_NAME"),
13166
13130
  isMandatory: true,
13167
13131
  type: "dropdown",
13168
- populators: /*#__PURE__*/React.createElement(React.Fragment, null, getFilteredDsoData(dsoData, vehicle, vehicleCapacity) && !getFilteredDsoData(dsoData, vehicle, vehicleCapacity).length ? /*#__PURE__*/React.createElement(CardLabelError$1, null, t("ES_COMMON_NO_DSO_AVAILABLE_WITH_SUCH_VEHICLE")) : null, /*#__PURE__*/React.createElement(Dropdown$2, {
13132
+ populators: /*#__PURE__*/React.createElement(React.Fragment, null, getFilteredDsoData(dsoData, vehicle, vehicleCapacity) && !getFilteredDsoData(dsoData, vehicle, vehicleCapacity).length ? /*#__PURE__*/React.createElement(CardLabelError$1, null, t("ES_COMMON_NO_DSO_AVAILABLE_WITH_SUCH_VEHICLE")) : null, /*#__PURE__*/React.createElement(Dropdown$1, {
13169
13133
  option: getFilteredDsoData(dsoData, vehicle, vehicleCapacity),
13170
13134
  autoComplete: "off",
13171
13135
  optionKey: "displayName",
@@ -13199,7 +13163,7 @@ const configAssignDso = ({
13199
13163
  max: Digit.Utils.date.getDate(Date.now() + 10 * 24 * 60 * 60 * 1000)
13200
13164
  },
13201
13165
  defaultValue: Digit.Utils.date.getDate(),
13202
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$3, Object.assign({
13166
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
13203
13167
  onChange: props.onChange,
13204
13168
  date: props.value
13205
13169
  }, customProps))
@@ -13237,7 +13201,7 @@ const configCompleteApplication = ({
13237
13201
  min: Digit.Utils.date.getDate(_applicationCreatedTime),
13238
13202
  max: Digit.Utils.date.getDate()
13239
13203
  },
13240
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$3, Object.assign({
13204
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
13241
13205
  disabled: true,
13242
13206
  onChange: props.onChange,
13243
13207
  date: props.value
@@ -13451,7 +13415,7 @@ const configReassignDSO = ({
13451
13415
  label: t("ES_FSM_ACTION_REASSIGN_REASON"),
13452
13416
  type: "dropdown",
13453
13417
  isMandatory: true,
13454
- populators: /*#__PURE__*/React.createElement(Dropdown$2, {
13418
+ populators: /*#__PURE__*/React.createElement(Dropdown$1, {
13455
13419
  option: reassignReasonMenu,
13456
13420
  optionKey: "i18nKey",
13457
13421
  id: "reassign-reason",
@@ -13463,7 +13427,7 @@ const configReassignDSO = ({
13463
13427
  label: t("ES_FSM_ACTION_DSO_NAME"),
13464
13428
  isMandatory: true,
13465
13429
  type: "dropdown",
13466
- populators: /*#__PURE__*/React.createElement(React.Fragment, null, getFilteredDsoData$1(dsoData, vehicle, vehicleCapacity) && !getFilteredDsoData$1(dsoData, vehicle, vehicleCapacity).length ? /*#__PURE__*/React.createElement(CardLabelError$1, null, t("ES_COMMON_NO_DSO_AVAILABLE_WITH_SUCH_VEHICLE")) : null, /*#__PURE__*/React.createElement(Dropdown$2, {
13430
+ populators: /*#__PURE__*/React.createElement(React.Fragment, null, getFilteredDsoData$1(dsoData, vehicle, vehicleCapacity) && !getFilteredDsoData$1(dsoData, vehicle, vehicleCapacity).length ? /*#__PURE__*/React.createElement(CardLabelError$1, null, t("ES_COMMON_NO_DSO_AVAILABLE_WITH_SUCH_VEHICLE")) : null, /*#__PURE__*/React.createElement(Dropdown$1, {
13467
13431
  option: getFilteredDsoData$1(dsoData, vehicle, vehicleCapacity),
13468
13432
  autoComplete: "off",
13469
13433
  optionKey: "displayName",
@@ -13494,7 +13458,7 @@ const configReassignDSO = ({
13494
13458
  min: Digit.Utils.date.getDate()
13495
13459
  },
13496
13460
  defaultValue: Digit.Utils.date.getDate(),
13497
- component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$3, Object.assign({
13461
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
13498
13462
  onChange: props.onChange,
13499
13463
  date: props.value
13500
13464
  }, customProps))
@@ -13520,7 +13484,7 @@ const configRejectApplication = ({
13520
13484
  body: [{
13521
13485
  label: t(`ES_FSM_ACTION_${action.toUpperCase()}_REASON`),
13522
13486
  type: "dropdown",
13523
- populators: /*#__PURE__*/React.createElement(Dropdown$2, {
13487
+ populators: /*#__PURE__*/React.createElement(Dropdown$1, {
13524
13488
  t: t,
13525
13489
  option: rejectMenu === null || rejectMenu === void 0 ? void 0 : rejectMenu.sort((a, b) => a.name.localeCompare(b.name)),
13526
13490
  id: "reason",
@@ -13562,7 +13526,7 @@ const configAcceptDso = ({
13562
13526
  label: t("ES_FSM_ACTION_VEHICLE_REGISTRATION_NO"),
13563
13527
  isMandatory: true,
13564
13528
  type: "dropdown",
13565
- populators: /*#__PURE__*/React.createElement(React.Fragment, null, !(vehicleNoList !== null && vehicleNoList !== void 0 && vehicleNoList.length) ? /*#__PURE__*/React.createElement(CardLabelError$1, null, t("ES_FSM_NO_VEHICLE_AVAILABLE")) : null, /*#__PURE__*/React.createElement(Dropdown$2, {
13529
+ populators: /*#__PURE__*/React.createElement(React.Fragment, null, !(vehicleNoList !== null && vehicleNoList !== void 0 && vehicleNoList.length) ? /*#__PURE__*/React.createElement(CardLabelError$1, null, t("ES_FSM_NO_VEHICLE_AVAILABLE")) : null, /*#__PURE__*/React.createElement(Dropdown$1, {
13566
13530
  option: vehicleNoList,
13567
13531
  autoComplete: "off",
13568
13532
  optionKey: "registrationNumber",
@@ -13617,7 +13581,7 @@ const configRejectFstpo = ({
13617
13581
  label: t("ES_FSM_ACTION_DECLINE_REASON"),
13618
13582
  isMandatory: true,
13619
13583
  type: "dropdown",
13620
- populators: /*#__PURE__*/React.createElement(Dropdown$2, {
13584
+ populators: /*#__PURE__*/React.createElement(Dropdown$1, {
13621
13585
  option: rejectMenu === null || rejectMenu === void 0 ? void 0 : rejectMenu.sort((a, b) => a.name.localeCompare(b.name)),
13622
13586
  autoComplete: "off",
13623
13587
  optionKey: "i18nKey",
@@ -14443,7 +14407,7 @@ const ApplicationDetails$1 = props => {
14443
14407
  color: "#A52A2A"
14444
14408
  },
14445
14409
  onClick: handleViewTimeline
14446
- })), /*#__PURE__*/React.createElement(Card$1, {
14410
+ })), /*#__PURE__*/React.createElement(Card, {
14447
14411
  className: "fsm",
14448
14412
  style: {
14449
14413
  position: "relative"
@@ -15974,7 +15938,7 @@ const FstpOperatorDetails = () => {
15974
15938
  styles: {
15975
15939
  marginLeft: "16px"
15976
15940
  }
15977
- }, t("ES_INBOX_VEHICLE_LOG")), /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(StatusTable, null, vehicleData === null || vehicleData === void 0 ? void 0 : vehicleData.map((row, index) => /*#__PURE__*/React.createElement(Row, {
15941
+ }, t("ES_INBOX_VEHICLE_LOG")), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(StatusTable, null, vehicleData === null || vehicleData === void 0 ? void 0 : vehicleData.map((row, index) => /*#__PURE__*/React.createElement(Row, {
15978
15942
  rowContainerStyle: isMobile && history.location.pathname.includes("new-vehicle-entry") ? {
15979
15943
  display: "block"
15980
15944
  } : {
@@ -16023,7 +15987,7 @@ const FstpOperatorDetails = () => {
16023
15987
  } : {},
16024
15988
  key: t("CS_GRAM_PANCHAYAT"),
16025
15989
  label: `${t("CS_GRAM_PANCHAYAT")} * `,
16026
- text: tripDetails && tripDetails.length > 0 ? (_tripDetails$5 = tripDetails[0]) === null || _tripDetails$5 === void 0 ? void 0 : (_tripDetails$5$addres = _tripDetails$5.address) === null || _tripDetails$5$addres === void 0 ? void 0 : (_tripDetails$5$addres2 = _tripDetails$5$addres.additionalDetails) === null || _tripDetails$5$addres2 === void 0 ? void 0 : (_tripDetails$5$addres3 = _tripDetails$5$addres2.gramPanchayat) === null || _tripDetails$5$addres3 === void 0 ? void 0 : _tripDetails$5$addres3.name : /*#__PURE__*/React.createElement(Dropdown$2, {
15990
+ text: tripDetails && tripDetails.length > 0 ? (_tripDetails$5 = tripDetails[0]) === null || _tripDetails$5 === void 0 ? void 0 : (_tripDetails$5$addres = _tripDetails$5.address) === null || _tripDetails$5$addres === void 0 ? void 0 : (_tripDetails$5$addres2 = _tripDetails$5$addres.additionalDetails) === null || _tripDetails$5$addres2 === void 0 ? void 0 : (_tripDetails$5$addres3 = _tripDetails$5$addres2.gramPanchayat) === null || _tripDetails$5$addres3 === void 0 ? void 0 : _tripDetails$5$addres3.name : /*#__PURE__*/React.createElement(Dropdown$1, {
16027
15991
  className: "form-field",
16028
15992
  isMandatory: true,
16029
15993
  selected: selectedGp,
@@ -16088,7 +16052,7 @@ const FstpOperatorDetails = () => {
16088
16052
  } : {},
16089
16053
  key: t("CS_VILLAGE_NAME"),
16090
16054
  label: `${t("CS_VILLAGE_NAME")}`,
16091
- text: tripDetails && tripDetails.length > 0 ? (_tripDetails$8 = tripDetails[0]) !== null && _tripDetails$8 !== void 0 && (_tripDetails$8$addres = _tripDetails$8.address) !== null && _tripDetails$8$addres !== void 0 && (_tripDetails$8$addres2 = _tripDetails$8$addres.additionalDetails) !== null && _tripDetails$8$addres2 !== void 0 && (_tripDetails$8$addres3 = _tripDetails$8$addres2.village) !== null && _tripDetails$8$addres3 !== void 0 && _tripDetails$8$addres3.name ? (_tripDetails$9 = tripDetails[0]) === null || _tripDetails$9 === void 0 ? void 0 : (_tripDetails$9$addres = _tripDetails$9.address) === null || _tripDetails$9$addres === void 0 ? void 0 : (_tripDetails$9$addres2 = _tripDetails$9$addres.additionalDetails) === null || _tripDetails$9$addres2 === void 0 ? void 0 : (_tripDetails$9$addres3 = _tripDetails$9$addres2.village) === null || _tripDetails$9$addres3 === void 0 ? void 0 : _tripDetails$9$addres3.name : "N/A" : villages.length > 0 ? /*#__PURE__*/React.createElement(Dropdown$2, {
16055
+ text: tripDetails && tripDetails.length > 0 ? (_tripDetails$8 = tripDetails[0]) !== null && _tripDetails$8 !== void 0 && (_tripDetails$8$addres = _tripDetails$8.address) !== null && _tripDetails$8$addres !== void 0 && (_tripDetails$8$addres2 = _tripDetails$8$addres.additionalDetails) !== null && _tripDetails$8$addres2 !== void 0 && (_tripDetails$8$addres3 = _tripDetails$8$addres2.village) !== null && _tripDetails$8$addres3 !== void 0 && _tripDetails$8$addres3.name ? (_tripDetails$9 = tripDetails[0]) === null || _tripDetails$9 === void 0 ? void 0 : (_tripDetails$9$addres = _tripDetails$9.address) === null || _tripDetails$9$addres === void 0 ? void 0 : (_tripDetails$9$addres2 = _tripDetails$9$addres.additionalDetails) === null || _tripDetails$9$addres2 === void 0 ? void 0 : (_tripDetails$9$addres3 = _tripDetails$9$addres2.village) === null || _tripDetails$9$addres3 === void 0 ? void 0 : _tripDetails$9$addres3.name : "N/A" : villages.length > 0 ? /*#__PURE__*/React.createElement(Dropdown$1, {
16092
16056
  className: "form-field",
16093
16057
  isMandatory: true,
16094
16058
  selected: selectedVillage,
@@ -16137,7 +16101,7 @@ const FstpOperatorDetails = () => {
16137
16101
  } : {},
16138
16102
  key: t("ES_INBOX_LOCALITY"),
16139
16103
  label: `${t("ES_INBOX_LOCALITY")} * `,
16140
- text: tripDetails && tripDetails.length > 0 ? (_tripDetails$10 = tripDetails[0]) === null || _tripDetails$10 === void 0 ? void 0 : (_tripDetails$10$addre = _tripDetails$10.address) === null || _tripDetails$10$addre === void 0 ? void 0 : (_tripDetails$10$addre2 = _tripDetails$10$addre.locality) === null || _tripDetails$10$addre2 === void 0 ? void 0 : _tripDetails$10$addre2.name : /*#__PURE__*/React.createElement(Dropdown$2, {
16104
+ text: tripDetails && tripDetails.length > 0 ? (_tripDetails$10 = tripDetails[0]) === null || _tripDetails$10 === void 0 ? void 0 : (_tripDetails$10$addre = _tripDetails$10.address) === null || _tripDetails$10$addre === void 0 ? void 0 : (_tripDetails$10$addre2 = _tripDetails$10$addre.locality) === null || _tripDetails$10$addre2 === void 0 ? void 0 : _tripDetails$10$addre2.name : /*#__PURE__*/React.createElement(Dropdown$1, {
16141
16105
  className: "form-field",
16142
16106
  isMandatory: true,
16143
16107
  selected: selectedLocality,
@@ -17268,7 +17232,7 @@ const Response$1 = props => {
17268
17232
  ACTIONS = [...ACTIONS, "ASSIGN_TO_DSO"];
17269
17233
  }
17270
17234
  const isSuccess = !successData ? mutation === null || mutation === void 0 ? void 0 : mutation.isSuccess : true;
17271
- return /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(BannerPicker$1, {
17235
+ return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(BannerPicker$1, {
17272
17236
  t: t,
17273
17237
  data: Data,
17274
17238
  action: state.action,
@@ -17399,7 +17363,7 @@ const SearchApplication$1 = ({
17399
17363
  switch (input.type) {
17400
17364
  case "date":
17401
17365
  return /*#__PURE__*/React.createElement(Controller, {
17402
- render: props => /*#__PURE__*/React.createElement(DatePicker$3, {
17366
+ render: props => /*#__PURE__*/React.createElement(DatePicker$2, {
17403
17367
  date: props.value,
17404
17368
  onChange: props.onChange
17405
17369
  }),
@@ -17980,7 +17944,7 @@ const RegisryInbox = props => {
17980
17944
  Cell: ({
17981
17945
  row
17982
17946
  }) => {
17983
- return /*#__PURE__*/React.createElement(Dropdown$2, {
17947
+ return /*#__PURE__*/React.createElement(Dropdown$1, {
17984
17948
  className: "fsm-registry-dropdown",
17985
17949
  selected: row.original.vendor,
17986
17950
  option: vendors,
@@ -18032,7 +17996,7 @@ const RegisryInbox = props => {
18032
17996
  emptyCardText = "ES_FSM_REGISTRY_EMPTY_CARD_DRIVER";
18033
17997
  emptyButtonText = "ES_FSM_REGISTRY_EMPTY_BUTTON_DRIVER";
18034
17998
  }
18035
- result = /*#__PURE__*/React.createElement(Card$1, {
17999
+ result = /*#__PURE__*/React.createElement(Card, {
18036
18000
  style: {
18037
18001
  display: "flex",
18038
18002
  justifyContent: "center",
@@ -18665,7 +18629,7 @@ const VehicleDetails = props => {
18665
18629
  });
18666
18630
  }
18667
18631
  if (selectedAction === "ADD_VENDOR" || selectedAction === "EDIT_VENDOR") {
18668
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText$1, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$2, {
18632
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText$1, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$1, {
18669
18633
  t: t,
18670
18634
  option: vendors,
18671
18635
  value: selectedOption,
@@ -18680,7 +18644,7 @@ const VehicleDetails = props => {
18680
18644
  }
18681
18645
  return !isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
18682
18646
  className: "employee-form-content"
18683
- }, /*#__PURE__*/React.createElement(Card$1, {
18647
+ }, /*#__PURE__*/React.createElement(Card, {
18684
18648
  style: {
18685
18649
  position: "relative",
18686
18650
  backgroundColor: "#fff"
@@ -18694,7 +18658,7 @@ const VehicleDetails = props => {
18694
18658
  marginBottom: "16px",
18695
18659
  marginTop: "32px"
18696
18660
  }
18697
- }, t(detail.title)), /*#__PURE__*/React.createElement(Card$1, {
18661
+ }, t(detail.title)), /*#__PURE__*/React.createElement(Card, {
18698
18662
  className: "card-with-background",
18699
18663
  style: {
18700
18664
  margin: "10px 16px",
@@ -18759,7 +18723,7 @@ const VehicleDetails = props => {
18759
18723
  actionSaveLabel: t(selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? "ES_EVENT_DELETE" : "CS_COMMON_SUBMIT"),
18760
18724
  actionSaveOnSubmit: handleModalAction,
18761
18725
  formId: "modal-action"
18762
- }, selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? renderModalContent() : /*#__PURE__*/React.createElement(Card$1, {
18726
+ }, selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? renderModalContent() : /*#__PURE__*/React.createElement(Card, {
18763
18727
  style: {
18764
18728
  boxShadow: "none"
18765
18729
  }
@@ -19625,7 +19589,7 @@ const DriverDetails = props => {
19625
19589
  });
19626
19590
  }
19627
19591
  if (selectedAction === "ADD_VENDOR") {
19628
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText$1, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$2, {
19592
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText$1, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$1, {
19629
19593
  t: t,
19630
19594
  option: vendors,
19631
19595
  value: selectedOption,
@@ -19635,7 +19599,7 @@ const DriverDetails = props => {
19635
19599
  }));
19636
19600
  }
19637
19601
  if (selectedAction === "EDIT_VENDOR") {
19638
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText$1, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$2, {
19602
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CardText$1, null, t(`ES_FSM_REGISTRY_SELECT_VENODOR`)), /*#__PURE__*/React.createElement(Dropdown$1, {
19639
19603
  t: t,
19640
19604
  option: vendors,
19641
19605
  value: selectedOption,
@@ -19650,7 +19614,7 @@ const DriverDetails = props => {
19650
19614
  }
19651
19615
  return !isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
19652
19616
  className: "employee-form-content"
19653
- }, /*#__PURE__*/React.createElement(Card$1, {
19617
+ }, /*#__PURE__*/React.createElement(Card, {
19654
19618
  style: {
19655
19619
  position: "relative",
19656
19620
  backgroundColor: "#fff"
@@ -19664,7 +19628,7 @@ const DriverDetails = props => {
19664
19628
  marginBottom: "16px",
19665
19629
  marginTop: "32px"
19666
19630
  }
19667
- }, t(detail.title)), /*#__PURE__*/React.createElement(Card$1, {
19631
+ }, t(detail.title)), /*#__PURE__*/React.createElement(Card, {
19668
19632
  className: "card-with-background",
19669
19633
  style: {
19670
19634
  margin: "10px 16px",
@@ -19729,7 +19693,7 @@ const DriverDetails = props => {
19729
19693
  actionSaveLabel: t(selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? "ES_EVENT_DELETE" : "CS_COMMON_SUBMIT"),
19730
19694
  actionSaveOnSubmit: handleModalAction,
19731
19695
  formId: "modal-action"
19732
- }, selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? renderModalContent() : /*#__PURE__*/React.createElement(Card$1, {
19696
+ }, selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? renderModalContent() : /*#__PURE__*/React.createElement(Card, {
19733
19697
  style: {
19734
19698
  boxShadow: "none"
19735
19699
  }
@@ -20437,7 +20401,7 @@ const SelectTrips = ({
20437
20401
  }, [_formData === null || _formData === void 0 ? void 0 : _formData.propertyType, _formData === null || _formData === void 0 ? void 0 : _formData.subtype, _formData === null || _formData === void 0 ? void 0 : _formData.address, _formData === null || _formData === void 0 ? void 0 : (_formData$tripData9 = _formData.tripData) === null || _formData$tripData9 === void 0 ? void 0 : (_formData$tripData9$v = _formData$tripData9.vehicleType) === null || _formData$tripData9$v === void 0 ? void 0 : _formData$tripData9$v.capacity, _formData === null || _formData === void 0 ? void 0 : (_formData$tripData0 = _formData.tripData) === null || _formData$tripData0 === void 0 ? void 0 : _formData$tripData0.noOfTrips, _formData === null || _formData === void 0 ? void 0 : (_formData$address3 = _formData.address) === null || _formData$address3 === void 0 ? void 0 : (_formData$address3$pr = _formData$address3.propertyLocation) === null || _formData$address3$pr === void 0 ? void 0 : _formData$address3$pr.code]);
20438
20402
  return isVehicleMenuLoading && isDsoLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
20439
20403
  className: "card-label-smaller"
20440
- }, t("ES_NEW_APPLICATION_LOCATION_VEHICLE_REQUESTED") + " * "), /*#__PURE__*/React.createElement(Dropdown$2, {
20404
+ }, t("ES_NEW_APPLICATION_LOCATION_VEHICLE_REQUESTED") + " * "), /*#__PURE__*/React.createElement(Dropdown$1, {
20441
20405
  className: "form-field",
20442
20406
  style: styles,
20443
20407
  isMandatory: true,
@@ -20705,7 +20669,7 @@ const SelectLocalityOrGramPanchayat = ({
20705
20669
  var _formData$address18, _formData$address18$l;
20706
20670
  return /*#__PURE__*/React.createElement("div", null, (propertyLocation === null || propertyLocation === void 0 ? void 0 : propertyLocation.code) === "FROM_GRAM_PANCHAYAT" ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
20707
20671
  className: "card-label-smaller"
20708
- }, t("CS_GRAM_PANCHAYAT"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$2, {
20672
+ }, t("CS_GRAM_PANCHAYAT"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$1, {
20709
20673
  className: "form-field",
20710
20674
  isMandatory: true,
20711
20675
  selected: selectedGp,
@@ -20724,7 +20688,7 @@ const SelectLocalityOrGramPanchayat = ({
20724
20688
  onChange: e => onNewGpChange(e.target.value)
20725
20689
  }))), villages.length > 0 && /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
20726
20690
  className: "card-label-smaller"
20727
- }, t("CS_VILLAGE_NAME")), /*#__PURE__*/React.createElement(Dropdown$2, {
20691
+ }, t("CS_VILLAGE_NAME")), /*#__PURE__*/React.createElement(Dropdown$1, {
20728
20692
  className: "form-field",
20729
20693
  isMandatory: true,
20730
20694
  selected: selectedVillage,
@@ -20743,7 +20707,7 @@ const SelectLocalityOrGramPanchayat = ({
20743
20707
  onChange: e => onChangeVillage(e.target.value)
20744
20708
  })))) : isUrcEnable && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
20745
20709
  className: "card-label-smaller"
20746
- }, t("CS_CREATECOMPLAINT_MOHALLA"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$2, {
20710
+ }, t("CS_CREATECOMPLAINT_MOHALLA"), config.isMandatory ? " * " : null), /*#__PURE__*/React.createElement(Dropdown$1, {
20747
20711
  className: "form-field",
20748
20712
  isMandatory: true,
20749
20713
  selected: selectedLocality,
@@ -20772,7 +20736,7 @@ const SelectLocalityOrGramPanchayat = ({
20772
20736
  t: t
20773
20737
  }, (propertyLocation === null || propertyLocation === void 0 ? void 0 : propertyLocation.code) === "WITHIN_ULB_LIMITS" ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
20774
20738
  className: "card-label-smaller"
20775
- }, `${t("CS_CREATECOMPLAINT_MOHALLA")} *`), /*#__PURE__*/React.createElement(Dropdown$2, {
20739
+ }, `${t("CS_CREATECOMPLAINT_MOHALLA")} *`), /*#__PURE__*/React.createElement(Dropdown$1, {
20776
20740
  className: "form-field",
20777
20741
  isMandatory: true,
20778
20742
  selected: selectedLocality,
@@ -20793,7 +20757,7 @@ const SelectLocalityOrGramPanchayat = ({
20793
20757
  onChange: e => onNewLocality(e.target.value)
20794
20758
  }))) : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
20795
20759
  className: "card-label-smaller"
20796
- }, `${t("CS_GRAM_PANCHAYAT")} *`), /*#__PURE__*/React.createElement(Dropdown$2, {
20760
+ }, `${t("CS_GRAM_PANCHAYAT")} *`), /*#__PURE__*/React.createElement(Dropdown$1, {
20797
20761
  className: "form-field",
20798
20762
  isMandatory: true,
20799
20763
  selected: selectedGp,
@@ -20814,7 +20778,7 @@ const SelectLocalityOrGramPanchayat = ({
20814
20778
  onChange: e => onNewGpChange(e.target.value)
20815
20779
  })), villages.length > 0 && /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
20816
20780
  className: "card-label-smaller"
20817
- }, t("CS_VILLAGE_NAME")), /*#__PURE__*/React.createElement(Dropdown$2, {
20781
+ }, t("CS_VILLAGE_NAME")), /*#__PURE__*/React.createElement(Dropdown$1, {
20818
20782
  className: "form-field",
20819
20783
  isMandatory: true,
20820
20784
  selected: selectedVillage,
@@ -20836,13 +20800,27 @@ const SelectLocalityOrGramPanchayat = ({
20836
20800
  })))));
20837
20801
  };
20838
20802
 
20839
- const {
20840
- DatePicker: DatePicker$2,
20841
- Dropdown: Dropdown$1
20842
- } = require("@djb25/digit-ui-react-components");
20843
- const VendorConfig = (t, disabled = false) => {
20803
+ const convertEpochToDate$1 = (dateEpoch, businessService) => {
20804
+ const dateFromApi = new Date(dateEpoch);
20805
+ if (dateEpoch) {
20806
+ let month = dateFromApi.getMonth() + 1;
20807
+ let day = dateFromApi.getDate();
20808
+ let year = dateFromApi.getFullYear();
20809
+ month = (month > 9 ? "" : "0") + month;
20810
+ day = (day > 9 ? "" : "0") + day;
20811
+ if (businessService === "asset-create") return `${day}-${month}-${year}`;else return `${day}/${month}/${year}`;
20812
+ } else {
20813
+ return null;
20814
+ }
20815
+ };
20816
+
20817
+ const VendorConfig = (t, disabled = false, formData = {}) => {
20818
+ var _formData$serviceType;
20819
+ const isEkyc = (formData === null || formData === void 0 ? void 0 : (_formData$serviceType = formData.serviceType) === null || _formData$serviceType === void 0 ? void 0 : _formData$serviceType.code) === "EKYC";
20844
20820
  return [{
20845
20821
  head: "ES_VRNDOR_NEW_VENDOR_DETAILS",
20822
+ isCollapsible: true,
20823
+ isDefaultOpen: true,
20846
20824
  body: [{
20847
20825
  label: "ES_FSM_REGISTRY_NEW_VENDOR_NAME",
20848
20826
  isMandatory: true,
@@ -20912,86 +20890,104 @@ const VendorConfig = (t, disabled = false) => {
20912
20890
  header: "CS_COMMON_CHOOSE_SERVICE_TYPE",
20913
20891
  submitBarLabel: "CS_COMMON_NEXT"
20914
20892
  }
20915
- }]
20916
- }, {
20917
- head: "ES_FSM_REGISTRY_NEW_ADDRESS_DETAILS",
20918
- body: [{
20919
- label: "HOUSE_NO",
20920
- isMandatory: false,
20921
- type: "text",
20922
- key: "doorNo",
20893
+ }, ...(isEkyc ? [{
20894
+ label: "ES_VENDOR_CONTRACT_START_DATE",
20895
+ isMandatory: true,
20896
+ type: "custom",
20897
+ key: "contractStartDate",
20923
20898
  populators: {
20924
- name: "doorNo",
20925
- defaultValue: "",
20926
- className: "payment-form-text-input-correction"
20899
+ name: "contractStartDate",
20900
+ validation: {
20901
+ required: true
20902
+ },
20903
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
20904
+ onChange: props.onChange,
20905
+ date: props.value
20906
+ }, customProps))
20927
20907
  }
20928
20908
  }, {
20929
- label: "ES_FSM_REGISTRY_NEW_PLOT",
20930
- isMandatory: false,
20931
- type: "text",
20932
- key: "plotNo",
20909
+ label: "ES_VENDOR_CONTRACT_END_DATE",
20910
+ isMandatory: true,
20911
+ type: "custom",
20912
+ key: "contractEndDate",
20933
20913
  populators: {
20934
- name: "plotNo",
20935
- defaultValue: "",
20936
- className: "payment-form-text-input-correction"
20914
+ name: "contractEndDate",
20915
+ validation: {
20916
+ required: true
20917
+ },
20918
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
20919
+ onChange: props.onChange,
20920
+ date: props.value
20921
+ }, customProps))
20937
20922
  }
20938
20923
  }, {
20939
- label: "ES_FSM_REGISTRY_NEW_BUILDING_NAME",
20940
- isMandatory: false,
20924
+ label: "ES_VENDOR_ZONE",
20925
+ isMandatory: true,
20926
+ type: "component",
20927
+ key: "zoneIds",
20928
+ component: "SelectEkycZones"
20929
+ }, {
20930
+ label: "ES_FSM_REGISTRY_NEW_OWNER_NAME",
20931
+ isMandatory: true,
20941
20932
  type: "text",
20942
- key: "buildingName",
20943
20933
  populators: {
20944
- name: "buildingName",
20945
- defaultValue: "",
20934
+ name: "ownerName",
20935
+ validation: {
20936
+ required: true,
20937
+ pattern: /^[A-Za-z\s.,/]+$/
20938
+ },
20939
+ error: t("FSM_REGISTRY_INVALID_NAME"),
20946
20940
  className: "payment-form-text-input-correction"
20947
20941
  }
20948
20942
  }, {
20949
- label: "ES_FSM_REGISTRY_NEW_STREET",
20950
- isMandatory: false,
20951
- type: "text",
20952
- key: "street",
20943
+ label: "ES_FSM_REGISTRY_NEW_GENDER",
20944
+ isMandatory: true,
20945
+ type: "component",
20946
+ key: "gender",
20947
+ component: "SelectEkycDropdown",
20953
20948
  populators: {
20954
- name: "street",
20955
- defaultValue: "",
20956
- className: "payment-form-text-input-correction"
20949
+ name: "gender",
20950
+ options: [{
20951
+ code: "MALE",
20952
+ name: "ES_COMMON_GENDER_MALE"
20953
+ }, {
20954
+ code: "FEMALE",
20955
+ name: "ES_COMMON_GENDER_FEMALE"
20956
+ }, {
20957
+ code: "OTHER",
20958
+ name: "ES_COMMON_GENDER_OTHER"
20959
+ }],
20960
+ optionsKey: "name"
20957
20961
  }
20958
20962
  }, {
20959
- label: "ES_FSM_REGISTRY_NEW_PINCODE",
20960
- isMandatory: false,
20961
- type: "text",
20962
- key: "pincode",
20963
+ label: "ES_FSM_REGISTRY_NEW_DOB",
20964
+ isMandatory: true,
20965
+ type: "custom",
20966
+ key: "dob",
20963
20967
  populators: {
20964
- name: "pincode",
20968
+ name: "dob",
20965
20969
  validation: {
20966
- required: false,
20967
- pattern: /^[1-9][0-9]{5}$/
20970
+ required: true
20968
20971
  },
20969
- error: t("FSM_REGISTRY_INVALID_PINCODE"),
20970
- defaultValue: "",
20971
- className: "payment-form-text-input-correction"
20972
+ component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
20973
+ onChange: props.onChange,
20974
+ date: props.value
20975
+ }, customProps, {
20976
+ max: convertEpochToDate$1(new Date().setFullYear(new Date().getFullYear()))
20977
+ }))
20972
20978
  }
20973
- }, {
20974
- route: "address",
20975
- component: "VendorSelectAddress",
20979
+ }] : [])]
20980
+ }, {
20981
+ isCreateConnection: true,
20982
+ className: "new-application-card",
20983
+ body: [{
20984
+ type: "component",
20985
+ key: "propertyAddress",
20986
+ component: "CPTPropertyLocationDetails",
20976
20987
  withoutLabel: true,
20977
- texts: {
20978
- headerCaption: "CS_FILE_APPLICATION_PROPERTY_LOCATION_LABEL",
20979
- header: "CS_FILE_APPLICATION_PROPERTY_LOCATION_ADDRESS_TEXT",
20980
- cardText: "CS_FILE_APPLICATION_PROPERTY_LOCATION_CITY_MOHALLA_TEXT",
20981
- submitBarLabel: "CS_COMMON_NEXT"
20982
- },
20983
- key: "address",
20984
- isMandatory: true,
20985
- type: "component"
20986
- }, {
20987
- label: "ES_FSM_REGISTRY_NEW_LANDMARK",
20988
- isMandatory: false,
20989
- type: "text",
20990
- key: "landmark",
20991
- populators: {
20992
- name: "landmark",
20993
- defaultValue: "",
20994
- className: "payment-form-text-input-correction"
20988
+ props: {
20989
+ hidePropertySearch: true,
20990
+ hideZRO: true
20995
20991
  }
20996
20992
  }]
20997
20993
  }];
@@ -21632,7 +21628,7 @@ const VendorDetails = ({
21632
21628
  rules: {
21633
21629
  required: t("CORE_COMMON_REQUIRED_ERRMSG")
21634
21630
  },
21635
- render: props => /*#__PURE__*/React.createElement(Dropdown$2, {
21631
+ render: props => /*#__PURE__*/React.createElement(Dropdown$1, {
21636
21632
  selected: VendorType,
21637
21633
  select: setVendorType,
21638
21634
  option: [{
@@ -21672,7 +21668,7 @@ const VendorDetails = ({
21672
21668
  rules: {
21673
21669
  required: t("CORE_COMMON_REQUIRED_ERRMSG")
21674
21670
  },
21675
- render: props => /*#__PURE__*/React.createElement(Dropdown$2, {
21671
+ render: props => /*#__PURE__*/React.createElement(Dropdown$1, {
21676
21672
  selected: VendorCategory,
21677
21673
  select: setVendorCategory,
21678
21674
  option: [{
@@ -21712,7 +21708,7 @@ const VendorDetails = ({
21712
21708
  rules: {
21713
21709
  required: t("CORE_COMMON_REQUIRED_ERRMSG")
21714
21710
  },
21715
- render: props => /*#__PURE__*/React.createElement(Dropdown$2, {
21711
+ render: props => /*#__PURE__*/React.createElement(Dropdown$1, {
21716
21712
  selected: Status,
21717
21713
  select: setStatus,
21718
21714
  option: [{
@@ -21734,14 +21730,12 @@ const AddVendor = ({
21734
21730
  heading
21735
21731
  }) => {
21736
21732
  const tenantId = Digit.ULBService.getCurrentTenantId();
21737
- const stateId = Digit.ULBService.getStateId();
21738
21733
  const {
21739
21734
  t
21740
21735
  } = useTranslation();
21741
21736
  const history = useHistory();
21742
21737
  const [currentStep, setCurrentStep] = useState(1);
21743
21738
  const [showToast, setShowToast] = useState(null);
21744
- const [canSubmit, setCanSubmit] = useState(false);
21745
21739
  const [, setMutationHappened] = Digit.Hooks.useSessionStorage("FSM_MUTATION_HAPPENED", false);
21746
21740
  const [,, clearError] = Digit.Hooks.useSessionStorage("FSM_ERROR_DATA", false);
21747
21741
  const [,, clearSuccessData] = Digit.Hooks.useSessionStorage("FSM_MUTATION_SUCCESS_DATA", false);
@@ -21753,7 +21747,6 @@ const AddVendor = ({
21753
21747
  clearSuccessData();
21754
21748
  clearError();
21755
21749
  }, []);
21756
- const Config = VendorConfig(t);
21757
21750
  const defaultValues = {
21758
21751
  serviceType: {
21759
21752
  code: "WT",
@@ -21766,15 +21759,29 @@ const AddVendor = ({
21766
21759
  amount: null
21767
21760
  }
21768
21761
  };
21769
- const onFormValueChange = (setValue, formData) => {
21770
- var _formData$serviceType, _formData$address, _formData$address2;
21771
- const isVendorDetailsFilled = (formData === null || formData === void 0 ? void 0 : formData.vendorName) && (formData === null || formData === void 0 ? void 0 : formData.phone) && (formData === null || formData === void 0 ? void 0 : (_formData$serviceType = formData.serviceType) === null || _formData$serviceType === void 0 ? void 0 : _formData$serviceType.code);
21772
- const isAddressFilled = (formData === null || formData === void 0 ? void 0 : (_formData$address = formData.address) === null || _formData$address === void 0 ? void 0 : _formData$address.city) && (formData === null || formData === void 0 ? void 0 : (_formData$address2 = formData.address) === null || _formData$address2 === void 0 ? void 0 : _formData$address2.locality);
21773
- if (isVendorDetailsFilled && isAddressFilled) {
21774
- setCanSubmit(true);
21775
- } else {
21776
- setCanSubmit(false);
21762
+ const [formData, setFormData] = useState(defaultValues);
21763
+ const Config = VendorConfig(t, false, formData);
21764
+ const onFormValueChange = (setValue, data) => {
21765
+ var _data$zoneIds, _data$serviceType, _formData$serviceType, _data$serviceType2;
21766
+ const currentZoneCodes = (data === null || data === void 0 ? void 0 : (_data$zoneIds = data.zoneIds) === null || _data$zoneIds === void 0 ? void 0 : _data$zoneIds.map(item => {
21767
+ var _item$;
21768
+ return item === null || item === void 0 ? void 0 : (_item$ = item[1]) === null || _item$ === void 0 ? void 0 : _item$.code;
21769
+ })) || [];
21770
+ const previousZoneCodes = (formData === null || formData === void 0 ? void 0 : formData.zoneIds) || [];
21771
+ const zoneChanged = currentZoneCodes.join(",") !== previousZoneCodes.join(",");
21772
+ if ((data === null || data === void 0 ? void 0 : (_data$serviceType = data.serviceType) === null || _data$serviceType === void 0 ? void 0 : _data$serviceType.code) !== (formData === null || formData === void 0 ? void 0 : (_formData$serviceType = formData.serviceType) === null || _formData$serviceType === void 0 ? void 0 : _formData$serviceType.code) || zoneChanged) {
21773
+ setFormData(prev => ({
21774
+ ...prev,
21775
+ serviceType: data === null || data === void 0 ? void 0 : data.serviceType
21776
+ }));
21777
+ }
21778
+ if (zoneChanged) {
21779
+ setFormData(prev => ({
21780
+ ...prev,
21781
+ zoneIds: currentZoneCodes
21782
+ }));
21777
21783
  }
21784
+ const isVendorDetailsFilled = (data === null || data === void 0 ? void 0 : data.vendorName) && (data === null || data === void 0 ? void 0 : data.phone) && (data === null || data === void 0 ? void 0 : (_data$serviceType2 = data.serviceType) === null || _data$serviceType2 === void 0 ? void 0 : _data$serviceType2.code);
21778
21785
  if (isVendorDetailsFilled) {
21779
21786
  if (currentStep === 1) {
21780
21787
  setCurrentStep(2);
@@ -21809,75 +21816,106 @@ const AddVendor = ({
21809
21816
  setShowToast(null);
21810
21817
  };
21811
21818
  const onSubmit = data => {
21812
- var _mergedData$street, _mergedData$doorNo, _mergedData$plotNo, _mergedData$landmark, _mergedData$address, _mergedData$address$c, _mergedData$address2, _mergedData$address2$, _mergedData$address3, _mergedData$address3$, _mergedData$address4, _mergedData$address4$, _mergedData$buildingN, _mergedData$address5, _mergedData$address5$, _mergedData$address6, _mergedData$address6$, _mergedData$address7, _mergedData$address7$, _mergedData$serviceTy, _mergedData$address8, _mergedData$address9;
21819
+ var _address$city, _address$city2, _address$city3, _address$city4, _address$locality, _address$locality2, _address$ward, _address$ward2, _mergedData$plotNo, _mergedData$buildingN, _mergedData$serviceTy, _mergedData$address, _mergedData$address2, _mergedData$relations, _mergedData$gender, _mergedData$serviceTy2;
21820
+ console.log("-=-=-=-=-=-==-", data);
21813
21821
  const mergedData = data;
21822
+ const address = mergedData === null || mergedData === void 0 ? void 0 : mergedData.propertyAddress;
21823
+ const pincode = address === null || address === void 0 ? void 0 : address.pincode;
21824
+ const street = address === null || address === void 0 ? void 0 : address.streetName;
21825
+ const doorNo = address === null || address === void 0 ? void 0 : address.houseNo;
21826
+ const landmark = address === null || address === void 0 ? void 0 : address.landmark;
21827
+ const city = address === null || address === void 0 ? void 0 : (_address$city = address.city) === null || _address$city === void 0 ? void 0 : _address$city.name;
21828
+ const state = address === null || address === void 0 ? void 0 : (_address$city2 = address.city) === null || _address$city2 === void 0 ? void 0 : _address$city2.name;
21829
+ const district = address === null || address === void 0 ? void 0 : (_address$city3 = address.city) === null || _address$city3 === void 0 ? void 0 : _address$city3.name;
21830
+ const region = address === null || address === void 0 ? void 0 : (_address$city4 = address.city) === null || _address$city4 === void 0 ? void 0 : _address$city4.name;
21831
+ const localityCode = address === null || address === void 0 ? void 0 : (_address$locality = address.locality) === null || _address$locality === void 0 ? void 0 : _address$locality.code;
21832
+ const localityName = address === null || address === void 0 ? void 0 : (_address$locality2 = address.locality) === null || _address$locality2 === void 0 ? void 0 : _address$locality2.name;
21833
+ const localityArea = address === null || address === void 0 ? void 0 : address.subLocality;
21834
+ const wardCode = address === null || address === void 0 ? void 0 : (_address$ward = address.ward) === null || _address$ward === void 0 ? void 0 : _address$ward.code;
21835
+ const wardName = address === null || address === void 0 ? void 0 : (_address$ward2 = address.ward) === null || _address$ward2 === void 0 ? void 0 : _address$ward2.name;
21814
21836
  const name = mergedData === null || mergedData === void 0 ? void 0 : mergedData.vendorName;
21815
- const pincode = mergedData === null || mergedData === void 0 ? void 0 : mergedData.pincode;
21816
- const street = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$street = mergedData.street) === null || _mergedData$street === void 0 ? void 0 : _mergedData$street.trim();
21817
- const doorNo = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$doorNo = mergedData.doorNo) === null || _mergedData$doorNo === void 0 ? void 0 : _mergedData$doorNo.trim();
21818
21837
  const plotNo = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$plotNo = mergedData.plotNo) === null || _mergedData$plotNo === void 0 ? void 0 : _mergedData$plotNo.trim();
21819
- const landmark = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$landmark = mergedData.landmark) === null || _mergedData$landmark === void 0 ? void 0 : _mergedData$landmark.trim();
21820
- const city = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address = mergedData.address) === null || _mergedData$address === void 0 ? void 0 : (_mergedData$address$c = _mergedData$address.city) === null || _mergedData$address$c === void 0 ? void 0 : _mergedData$address$c.name;
21821
- const state = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address2 = mergedData.address) === null || _mergedData$address2 === void 0 ? void 0 : (_mergedData$address2$ = _mergedData$address2.city) === null || _mergedData$address2$ === void 0 ? void 0 : _mergedData$address2$.state;
21822
- const district = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address3 = mergedData.address) === null || _mergedData$address3 === void 0 ? void 0 : (_mergedData$address3$ = _mergedData$address3.city) === null || _mergedData$address3$ === void 0 ? void 0 : _mergedData$address3$.name;
21823
- const region = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address4 = mergedData.address) === null || _mergedData$address4 === void 0 ? void 0 : (_mergedData$address4$ = _mergedData$address4.city) === null || _mergedData$address4$ === void 0 ? void 0 : _mergedData$address4$.name;
21824
21838
  const buildingName = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$buildingN = mergedData.buildingName) === null || _mergedData$buildingN === void 0 ? void 0 : _mergedData$buildingN.trim();
21825
- const localityCode = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address5 = mergedData.address) === null || _mergedData$address5 === void 0 ? void 0 : (_mergedData$address5$ = _mergedData$address5.locality) === null || _mergedData$address5$ === void 0 ? void 0 : _mergedData$address5$.code;
21826
- const localityName = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address6 = mergedData.address) === null || _mergedData$address6 === void 0 ? void 0 : (_mergedData$address6$ = _mergedData$address6.locality) === null || _mergedData$address6$ === void 0 ? void 0 : _mergedData$address6$.name;
21827
- const localityArea = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address7 = mergedData.address) === null || _mergedData$address7 === void 0 ? void 0 : (_mergedData$address7$ = _mergedData$address7.locality) === null || _mergedData$address7$ === void 0 ? void 0 : _mergedData$address7$.area;
21828
- const gender = "MALE";
21829
21839
  const emailId = mergedData === null || mergedData === void 0 ? void 0 : mergedData.emailId;
21830
21840
  const phone = mergedData === null || mergedData === void 0 ? void 0 : mergedData.phone;
21831
- const additionalDetails = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$serviceTy = mergedData.serviceType) === null || _mergedData$serviceTy === void 0 ? void 0 : _mergedData$serviceTy.code;
21832
- const formData = {
21833
- vendor: {
21841
+ const isEkyc = (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$serviceTy = mergedData.serviceType) === null || _mergedData$serviceTy === void 0 ? void 0 : _mergedData$serviceTy.code) === "EKYC";
21842
+ let vendorData = {
21843
+ tenantId: tenantId,
21844
+ name,
21845
+ agencyType: "ULB",
21846
+ paymentPreference: "post-service",
21847
+ address: {
21834
21848
  tenantId: tenantId,
21835
- name,
21836
- agencyType: "ULB",
21837
- paymentPreference: "post-service",
21838
- address: {
21839
- tenantId: tenantId,
21840
- landmark,
21841
- doorNo,
21842
- plotNo,
21843
- street,
21844
- city,
21845
- district,
21846
- region,
21847
- state,
21848
- country: "in",
21849
- pincode,
21850
- buildingName,
21851
- locality: {
21852
- code: localityCode || "",
21853
- name: localityName || "",
21854
- label: "Locality",
21855
- area: localityArea || ""
21856
- },
21857
- geoLocation: {
21858
- latitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address8 = mergedData.address) === null || _mergedData$address8 === void 0 ? void 0 : _mergedData$address8.latitude) || 0,
21859
- longitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address9 = mergedData.address) === null || _mergedData$address9 === void 0 ? void 0 : _mergedData$address9.longitude) || 0
21860
- }
21861
- },
21862
- owner: {
21863
- tenantId: stateId,
21864
- name: name,
21865
- fatherOrHusbandName: name,
21866
- relationship: "OTHER",
21867
- gender: gender,
21868
- dob: "915148800",
21869
- emailId: emailId || "abc@egov.com",
21870
- mobileNumber: phone
21871
- },
21872
- additionalDetails: {
21873
- serviceType: additionalDetails
21849
+ landmark,
21850
+ doorNo,
21851
+ plotNo,
21852
+ street,
21853
+ city,
21854
+ district,
21855
+ region,
21856
+ state,
21857
+ country: "india",
21858
+ pincode,
21859
+ buildingName,
21860
+ locality: {
21861
+ code: localityCode || "",
21862
+ name: localityName || "",
21863
+ label: "Locality",
21864
+ area: localityArea || ""
21874
21865
  },
21875
- vehicle: [],
21876
- drivers: [],
21877
- source: "WhatsApp"
21878
- }
21866
+ ward: wardCode ? {
21867
+ code: wardCode,
21868
+ name: wardName
21869
+ } : undefined,
21870
+ geoLocation: {
21871
+ latitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address = mergedData.address) === null || _mergedData$address === void 0 ? void 0 : _mergedData$address.latitude) || 28.6139,
21872
+ longitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address2 = mergedData.address) === null || _mergedData$address2 === void 0 ? void 0 : _mergedData$address2.longitude) || 77.209
21873
+ }
21874
+ },
21875
+ owner: {
21876
+ tenantId: "dl",
21877
+ name: (mergedData === null || mergedData === void 0 ? void 0 : mergedData.ownerName) || name,
21878
+ fatherOrHusbandName: (mergedData === null || mergedData === void 0 ? void 0 : mergedData.fatherOrHusbandName) || name,
21879
+ relationship: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$relations = mergedData.relationship) === null || _mergedData$relations === void 0 ? void 0 : _mergedData$relations.code) || "OTHER",
21880
+ gender: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$gender = mergedData.gender) === null || _mergedData$gender === void 0 ? void 0 : _mergedData$gender.code) || "MALE",
21881
+ dob: mergedData !== null && mergedData !== void 0 && mergedData.dob ? new Date(mergedData.dob).getTime() : new Date(`1/1/1970`).getTime(),
21882
+ emailId: emailId || "",
21883
+ mobileNumber: phone
21884
+ },
21885
+ additionalDetails: {
21886
+ serviceType: isEkyc ? "ekyc" : mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$serviceTy2 = mergedData.serviceType) === null || _mergedData$serviceTy2 === void 0 ? void 0 : _mergedData$serviceTy2.code
21887
+ },
21888
+ vehicles: [],
21889
+ drivers: [],
21890
+ source: isEkyc ? "eKYC Portal" : "WhatsApp"
21879
21891
  };
21880
- mutate(formData, {
21892
+ if (isEkyc) {
21893
+ var _mergedData$zoneIds, _mergedData$clusterId;
21894
+ vendorData = {
21895
+ ...vendorData,
21896
+ zoneIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$zoneIds = mergedData.zoneIds) === null || _mergedData$zoneIds === void 0 ? void 0 : _mergedData$zoneIds.map(z => {
21897
+ var _z$;
21898
+ return z === null || z === void 0 ? void 0 : (_z$ = z[1]) === null || _z$ === void 0 ? void 0 : _z$.code;
21899
+ })) || [],
21900
+ clusterIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$clusterId = mergedData.clusterIds) === null || _mergedData$clusterId === void 0 ? void 0 : _mergedData$clusterId.map(c => {
21901
+ var _c$;
21902
+ return c === null || c === void 0 ? void 0 : (_c$ = c[1]) === null || _c$ === void 0 ? void 0 : _c$.code;
21903
+ })) || [],
21904
+ contractStartDate: mergedData.contractStartDate ? new Date(mergedData.contractStartDate).getTime() : null,
21905
+ contractEndDate: mergedData.contractEndDate ? new Date(mergedData.contractEndDate).getTime() : null
21906
+ };
21907
+ }
21908
+ console.log(vendorData);
21909
+ const payload = {
21910
+ vendor: vendorData
21911
+ };
21912
+ if (isEkyc) {
21913
+ payload.RequestInfo = {
21914
+ apiId: "Rainmaker",
21915
+ msgId: "ekyc-vendor-create"
21916
+ };
21917
+ }
21918
+ mutate(payload, {
21881
21919
  onError: error => {
21882
21920
  setShowToast({
21883
21921
  key: "error",
@@ -21919,19 +21957,14 @@ const AddVendor = ({
21919
21957
  overflowY: "auto"
21920
21958
  }
21921
21959
  }, /*#__PURE__*/React.createElement(FormComposer, {
21960
+ config: Config,
21961
+ userType: "employee",
21962
+ onFormValueChange: onFormValueChange,
21922
21963
  label: t("ES_COMMON_APPLICATION_SUBMIT"),
21923
- config: Config.filter(i => !i.hideInEmployee).map(config => ({
21924
- ...config,
21925
- isCollapsible: true,
21926
- isDefaultOpen: true,
21927
- body: config.body.filter(a => !a.hideInEmployee)
21928
- })),
21929
21964
  onSubmit: onSubmit,
21930
21965
  defaultValues: defaultValues,
21931
- onFormValueChange: onFormValueChange,
21932
- noBreakLine: true,
21933
21966
  noCard: true,
21934
- isDisabled: !canSubmit
21967
+ noBreakLine: true
21935
21968
  }), showToast && /*#__PURE__*/React.createElement(Toast, {
21936
21969
  error: showToast.key === "error",
21937
21970
  label: t(showToast.key === "success" ? `ES_FSM_REGISTRY_${showToast.action}_SUCCESS` : showToast.action),