@mseva/digit-ui-module-ptr 1.0.18 → 1.0.19

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 { LabelFieldPair, CardLabel, Dropdown, CardLabelError, TextInput, Toast, MobileNumber, TickMark, FormStep, Loader, UploadFile, RadioOrSelect, Card, CardHeader, CardText, CardSubHeader, SubmitBar, TelePhone, DisplayPhotos, CardSectionHeader, CheckPoint, ConnectingCheckPoints, AppContainer, BackButton, PrivateRoute, StatusTable, Row, CheckBox, LinkButton, Banner, KeyNote, Header, MultiLink, Table, PropertyHouse, CloseSvg, Label, LinkLabel, ActionBar, DatePicker, RadioButtons, DetailsCard, SearchAction, FilterAction, PopUp, ShippingTruck, SearchForm, SearchField, BreadCrumb, PTRIcon, EmployeeModuleCard, Localities, RemoveableTag, FormComposer, Modal, PDFSvg, MultiUploadWrapper, Close as Close$8, BreakLine, TextArea, InfoBannerIcon, Menu, ButtonSelector, OTPInput, Rating, CitizenHomeCard } from '@mseva/digit-ui-react-components';
1
+ import { LabelFieldPair, CardLabel, Dropdown, CardLabelError, TextInput, Toast, MobileNumber, TickMark, FormStep, Loader, UploadFile, RadioOrSelect, Card, CardHeader, CardText, CardSubHeader, SubmitBar, TelePhone, DisplayPhotos, CardSectionHeader, CheckPoint, ConnectingCheckPoints, AppContainer, BackButton, PrivateRoute, StatusTable, Row, CheckBox, LinkButton, Banner, KeyNote, Header, MultiLink, Table, PropertyHouse, CloseSvg, Label, LinkLabel, ActionBar, DatePicker, RadioButtons, DetailsCard, SearchAction, FilterAction, PopUp, ShippingTruck, SearchForm, SearchField, BreadCrumb, PTRIcon, EmployeeModuleCard, Localities, RemoveableTag, FormComposer, Modal, PDFSvg, MultiUploadWrapper, Close as Close$a, BreakLine, TextArea, InfoBannerIcon, Menu, ButtonSelector, OTPInput, Rating, CitizenHomeCard } from '@mseva/digit-ui-react-components';
2
2
  import React, { useState, useEffect, useMemo, Fragment, useCallback, useRef } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useLocation, useRouteMatch, useHistory, Switch, Route, Redirect, Link, useParams } from 'react-router-dom';
@@ -30754,6 +30754,99 @@ const configPTRApproverApplication = ({
30754
30754
  };
30755
30755
  };
30756
30756
 
30757
+ const configSVApproverApplication = ({
30758
+ t,
30759
+ action,
30760
+ selectFile,
30761
+ uploadedFile,
30762
+ setUploadedFile,
30763
+ approvers,
30764
+ selectedApprover,
30765
+ setSelectedApprover,
30766
+ isUploading
30767
+ }) => {
30768
+ const LoadingSpinner = () => /*#__PURE__*/React.createElement("div", {
30769
+ className: "loading-spinner"
30770
+ });
30771
+ console.log("isuploading ", isUploading);
30772
+ return {
30773
+ label: {
30774
+ heading: `WF_${action === null || action === void 0 ? void 0 : action.action}_APPLICATION`,
30775
+ submit: `SV_${action === null || action === void 0 ? void 0 : action.action}`,
30776
+ cancel: "SV_COMMON_CANCEL"
30777
+ },
30778
+ form: [{
30779
+ body: [(action === null || action === void 0 ? void 0 : action.action) === "APPROVE" || (action === null || action === void 0 ? void 0 : action.action) === "REJECT" || (action === null || action === void 0 ? void 0 : action.action) === "SENDBACKTOCITIZEN" ? "" : {
30780
+ label: t("SV_ASSIGNEE"),
30781
+ type: "dropdown",
30782
+ populators: /*#__PURE__*/React.createElement(Dropdown, {
30783
+ option: approvers,
30784
+ t: t,
30785
+ optionKey: "name",
30786
+ select: setSelectedApprover,
30787
+ selected: selectedApprover
30788
+ })
30789
+ }, {
30790
+ label: t("SV_ACTION_COMMENTS"),
30791
+ isMandatory: true,
30792
+ type: "textarea",
30793
+ populators: {
30794
+ name: "comments",
30795
+ validation: {
30796
+ required: true
30797
+ }
30798
+ }
30799
+ }, {
30800
+ label: `${t("SV_ATTATCH_FILE")}${action.docUploadRequired ? " *" : ""}`,
30801
+ populators: /*#__PURE__*/React.createElement(UploadFile, {
30802
+ id: "workflow-doc-sv",
30803
+ onUpload: selectFile,
30804
+ onDelete: () => {
30805
+ setUploadedFile(null);
30806
+ },
30807
+ message: isUploading ? /*#__PURE__*/React.createElement("div", {
30808
+ style: {
30809
+ display: "flex",
30810
+ alignItems: "center",
30811
+ gap: "8px"
30812
+ }
30813
+ }, /*#__PURE__*/React.createElement(LoadingSpinner, null), /*#__PURE__*/React.createElement("span", null, "Uploading...")) : uploadedFile ? `1 ${t(`SV_FILE_UPLOADED`)}` : t(`SV_NO_FILE`)
30814
+ })
30815
+ }]
30816
+ }]
30817
+ };
30818
+ };
30819
+
30820
+ const configTLDirectRenewApplication = ({
30821
+ t,
30822
+ action,
30823
+ years,
30824
+ selectedApprover,
30825
+ setSelectedApprover,
30826
+ assigneeLabel,
30827
+ businessService
30828
+ }) => {
30829
+ return {
30830
+ label: {
30831
+ heading: `WF_${action === null || action === void 0 ? void 0 : action.action}_APPLICATION`,
30832
+ submit: `WF_${businessService === null || businessService === void 0 ? void 0 : businessService.toUpperCase()}_${action === null || action === void 0 ? void 0 : action.action}`,
30833
+ cancel: "WF_EMPLOYEE_NEWTL_CANCEL"
30834
+ },
30835
+ form: [{
30836
+ body: [{
30837
+ label: t("TL_VALID_FOR_NO_OF_YEARS"),
30838
+ type: "dropdown",
30839
+ populators: /*#__PURE__*/React.createElement(Dropdown, {
30840
+ option: years,
30841
+ autoComplete: "off",
30842
+ select: setSelectedApprover,
30843
+ selected: selectedApprover
30844
+ })
30845
+ }]
30846
+ }]
30847
+ };
30848
+ };
30849
+
30757
30850
  const Heading = props => {
30758
30851
  return /*#__PURE__*/React.createElement("h1", {
30759
30852
  className: "heading-m"
@@ -32663,8 +32756,8 @@ var _DataView = DataView;
32663
32756
  var Promise$1 = _getNative$1(_root$1, 'Promise');
32664
32757
  var _Promise = Promise$1;
32665
32758
 
32666
- var Set = _getNative$1(_root$1, 'Set');
32667
- var _Set = Set;
32759
+ var Set$1 = _getNative$1(_root$1, 'Set');
32760
+ var _Set = Set$1;
32668
32761
 
32669
32762
  var WeakMap = _getNative$1(_root$1, 'WeakMap');
32670
32763
  var _WeakMap = WeakMap;
@@ -33419,16 +33512,284 @@ const ActionModal$6 = ({
33419
33512
  })) : /*#__PURE__*/React.createElement(Loader, null);
33420
33513
  };
33421
33514
 
33422
- const ActionModal$7 = props => {
33515
+ const Heading$7 = props => {
33516
+ return /*#__PURE__*/React.createElement("h1", {
33517
+ className: "heading-m"
33518
+ }, props.label);
33519
+ };
33520
+ const Close$7 = () => /*#__PURE__*/React.createElement("svg", {
33521
+ xmlns: "http://www.w3.org/2000/svg",
33522
+ viewBox: "0 0 24 24",
33523
+ fill: "#FFFFFF"
33524
+ }, /*#__PURE__*/React.createElement("path", {
33525
+ d: "M0 0h24v24H0V0z",
33526
+ fill: "none"
33527
+ }), /*#__PURE__*/React.createElement("path", {
33528
+ d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
33529
+ }));
33530
+ const CloseBtn$7 = props => {
33531
+ return /*#__PURE__*/React.createElement("div", {
33532
+ className: "icon-bg-secondary",
33533
+ onClick: props.onClick
33534
+ }, /*#__PURE__*/React.createElement(Close$7, null));
33535
+ };
33536
+ const ActionModal$7 = ({
33537
+ t,
33538
+ action,
33539
+ tenantId,
33540
+ state,
33541
+ id,
33542
+ closeModal,
33543
+ submitAction,
33544
+ actionData,
33545
+ applicationData,
33546
+ businessService,
33547
+ moduleCode
33548
+ }) => {
33549
+ var _tradeMdmsData$TradeL, _applicationData, _applicationData$trad;
33550
+ const stateId = Digit.ULBService.getStateId();
33551
+ const {
33552
+ data: tradeMdmsData,
33553
+ isLoading: tradeMdmsLoading
33554
+ } = Digit.Hooks.tl.useTradeLicenseMDMS(stateId, "TradeLicense", "TradeUnits", "[?(@.type=='TL')]");
33555
+ console.log("tradeMdmsData", tradeMdmsData === null || tradeMdmsData === void 0 ? void 0 : (_tradeMdmsData$TradeL = tradeMdmsData.TradeLicense) === null || _tradeMdmsData$TradeL === void 0 ? void 0 : _tradeMdmsData$TradeL.TradeType);
33556
+ console.log("applicationData", applicationData);
33557
+ const [config, setConfig] = useState({});
33558
+ const [defaultValues, setDefaultValues] = useState({});
33559
+ const [approvers, setApprovers] = useState([]);
33560
+ const [selectedApprover, setSelectedApprover] = useState("");
33561
+ const [financialYears, setFinancialYears] = useState([]);
33562
+ const [selectedFinancialYear, setSelectedFinancialYear] = useState(null);
33563
+ const tradeUnits = (_applicationData = applicationData) === null || _applicationData === void 0 ? void 0 : (_applicationData$trad = _applicationData.tradeLicenseDetail) === null || _applicationData$trad === void 0 ? void 0 : _applicationData$trad.tradeUnits;
33564
+ console.log("tradeUnits", tradeUnits);
33565
+ const years = useMemo(() => {
33566
+ var _tradeMdmsData$TradeL2;
33567
+ if (tradeMdmsLoading || !tradeMdmsData || !tradeUnits.length) return [];
33568
+ const tradeTypeCodes = new Set(tradeUnits.map(unit => unit.tradeType));
33569
+ const matchedTradeTypes = (_tradeMdmsData$TradeL2 = tradeMdmsData.TradeLicense) === null || _tradeMdmsData$TradeL2 === void 0 ? void 0 : _tradeMdmsData$TradeL2.TradeType.filter(type => tradeTypeCodes.has(type.code));
33570
+ const hasHazardous = matchedTradeTypes.some(unit => unit === null || unit === void 0 ? void 0 : unit.ishazardous);
33571
+ console.log("hasHazardous", hasHazardous);
33572
+ if (hasHazardous) return ['1'];else return ['1', '2', '3'];
33573
+ }, [tradeMdmsLoading, tradeMdmsData, tradeUnits]);
33574
+ console.log("years", years);
33575
+ function submit(data) {
33576
+ var _applicationData2;
33577
+ let financialYear = (_applicationData2 = applicationData) === null || _applicationData2 === void 0 ? void 0 : _applicationData2.financialYear;
33578
+ const financialYearDate = financialYear === null || financialYear === void 0 ? void 0 : financialYear.split('-')[1];
33579
+ const finalFinancialYear = `20${Number(financialYearDate)}-${Number(financialYearDate) + 1}`;
33580
+ applicationData = {
33581
+ ...applicationData,
33582
+ financialYear: finalFinancialYear,
33583
+ action: "INITIATE",
33584
+ additionalDetail: {
33585
+ ...applicationData.additionalDetail,
33586
+ validityYears: selectedApprover.length > 0 ? parseInt(selectedApprover) : ""
33587
+ }
33588
+ };
33589
+ submitAction({
33590
+ Licenses: [applicationData]
33591
+ });
33592
+ }
33593
+ useEffect(() => {
33594
+ if (action) {
33595
+ setConfig(configTLDirectRenewApplication({
33596
+ t,
33597
+ action,
33598
+ years,
33599
+ selectedApprover,
33600
+ setSelectedApprover,
33601
+ businessService
33602
+ }));
33603
+ }
33604
+ }, [action, years, financialYears, selectedFinancialYear]);
33605
+ return action && config.form ? /*#__PURE__*/React.createElement(Modal, {
33606
+ headerBarMain: /*#__PURE__*/React.createElement(Heading$7, {
33607
+ label: t(config.label.heading)
33608
+ }),
33609
+ headerBarEnd: /*#__PURE__*/React.createElement(CloseBtn$7, {
33610
+ onClick: closeModal
33611
+ }),
33612
+ actionCancelLabel: t(config.label.cancel),
33613
+ actionCancelOnSubmit: closeModal,
33614
+ actionSaveLabel: t(config.label.submit),
33615
+ actionSaveOnSubmit: () => {},
33616
+ formId: "modal-action"
33617
+ }, tradeMdmsLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(FormComposer, {
33618
+ config: config.form,
33619
+ noBoxShadow: true,
33620
+ inline: true,
33621
+ childrenAtTheBottom: true,
33622
+ onSubmit: submit,
33623
+ defaultValues: defaultValues,
33624
+ formId: "modal-action"
33625
+ })) : /*#__PURE__*/React.createElement(Loader, null);
33626
+ };
33627
+
33628
+ const Heading$8 = props => {
33629
+ return /*#__PURE__*/React.createElement("h1", {
33630
+ className: "heading-m"
33631
+ }, props.label);
33632
+ };
33633
+ const Close$8 = () => /*#__PURE__*/React.createElement("svg", {
33634
+ xmlns: "http://www.w3.org/2000/svg",
33635
+ viewBox: "0 0 24 24",
33636
+ fill: "#FFFFFF"
33637
+ }, /*#__PURE__*/React.createElement("path", {
33638
+ d: "M0 0h24v24H0V0z",
33639
+ fill: "none"
33640
+ }), /*#__PURE__*/React.createElement("path", {
33641
+ d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
33642
+ }));
33643
+ const CloseBtn$8 = props => {
33644
+ return /*#__PURE__*/React.createElement("div", {
33645
+ className: "icon-bg-secondary",
33646
+ onClick: props.onClick
33647
+ }, /*#__PURE__*/React.createElement(Close$8, null));
33648
+ };
33649
+ const ActionModal$8 = ({
33650
+ t,
33651
+ action,
33652
+ tenantId,
33653
+ state,
33654
+ id,
33655
+ closeModal,
33656
+ submitAction,
33657
+ actionData,
33658
+ applicationData,
33659
+ businessService,
33660
+ moduleCode
33661
+ }) => {
33662
+ var _action$assigneeRoles, _action$assigneeRoles2;
33663
+ const {
33664
+ data: approverData,
33665
+ isLoading: PTALoading
33666
+ } = Digit.Hooks.useEmployeeSearch(tenantId, {
33667
+ roles: action === null || action === void 0 ? void 0 : (_action$assigneeRoles = action.assigneeRoles) === null || _action$assigneeRoles === void 0 ? void 0 : (_action$assigneeRoles2 = _action$assigneeRoles.map) === null || _action$assigneeRoles2 === void 0 ? void 0 : _action$assigneeRoles2.call(_action$assigneeRoles, e => ({
33668
+ code: e
33669
+ })),
33670
+ isActive: true
33671
+ }, {
33672
+ enabled: action === null || action === void 0 ? void 0 : action.isTerminateState
33673
+ });
33674
+ const [config, setConfig] = useState({});
33675
+ const [defaultValues, setDefaultValues] = useState({});
33676
+ const [approvers, setApprovers] = useState([]);
33677
+ const [selectedApprover, setSelectedApprover] = useState(null);
33678
+ const [file, setFile] = useState(null);
33679
+ const [uploadedFile, setUploadedFile] = useState(null);
33680
+ const [error, setError] = useState(null);
33681
+ const [isUploading, setIsUploading] = useState(false);
33682
+ useEffect(() => {
33683
+ var _approverData$Employe;
33684
+ setApprovers(approverData === null || approverData === void 0 ? void 0 : (_approverData$Employe = approverData.Employees) === null || _approverData$Employe === void 0 ? void 0 : _approverData$Employe.map(employee => {
33685
+ var _employee$user;
33686
+ return {
33687
+ uuid: employee === null || employee === void 0 ? void 0 : employee.uuid,
33688
+ name: employee === null || employee === void 0 ? void 0 : (_employee$user = employee.user) === null || _employee$user === void 0 ? void 0 : _employee$user.name
33689
+ };
33690
+ }));
33691
+ }, [approverData]);
33692
+ function selectFile(e) {
33693
+ setIsUploading(true);
33694
+ setFile(e.target.files[0]);
33695
+ }
33696
+ useEffect(() => {
33697
+ (async () => {
33698
+ setError(null);
33699
+ if (file) {
33700
+ if (file.size >= 5242880) {
33701
+ setError(t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
33702
+ } else {
33703
+ try {
33704
+ var _response$data, _response$data$files;
33705
+ const response = await Digit.UploadServices.Filestorage("StreetVending", file, tenantId);
33706
+ if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$files = _response$data.files) === null || _response$data$files === void 0 ? void 0 : _response$data$files.length) > 0) {
33707
+ var _response$data2, _response$data2$files;
33708
+ setUploadedFile(response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$files = _response$data2.files[0]) === null || _response$data2$files === void 0 ? void 0 : _response$data2$files.fileStoreId);
33709
+ } else {
33710
+ setError(t("CS_FILE_UPLOAD_ERROR"));
33711
+ }
33712
+ } catch (err) {
33713
+ setError(t("CS_FILE_UPLOAD_ERROR"));
33714
+ } finally {
33715
+ setIsUploading(false);
33716
+ }
33717
+ }
33718
+ }
33719
+ })();
33720
+ }, [file]);
33721
+ console.log("actyhdesh,jhfsefsef", action, applicationData);
33722
+ function submit(data) {
33723
+ var _applicationData$audi;
33724
+ let workflow = {
33725
+ action: action === null || action === void 0 ? void 0 : action.action,
33726
+ comments: data === null || data === void 0 ? void 0 : data.comments,
33727
+ businessService,
33728
+ moduleName: moduleCode,
33729
+ assignes: (action === null || action === void 0 ? void 0 : action.action) === "SENDBACKTOCITIZEN" ? [applicationData === null || applicationData === void 0 ? void 0 : (_applicationData$audi = applicationData.auditDetails) === null || _applicationData$audi === void 0 ? void 0 : _applicationData$audi.createdBy] : selectedApprover !== null && selectedApprover !== void 0 && selectedApprover.uuid ? [selectedApprover === null || selectedApprover === void 0 ? void 0 : selectedApprover.uuid] : null
33730
+ };
33731
+ if (uploadedFile) workflow["documents"] = [{
33732
+ documentType: (action === null || action === void 0 ? void 0 : action.action) + " DOC",
33733
+ fileName: file === null || file === void 0 ? void 0 : file.name,
33734
+ fileStoreId: uploadedFile
33735
+ }];
33736
+ submitAction({
33737
+ streetVendingDetail: {
33738
+ ...applicationData,
33739
+ workflow
33740
+ }
33741
+ });
33742
+ }
33743
+ useEffect(() => {
33744
+ setConfig(configSVApproverApplication({
33745
+ t,
33746
+ action,
33747
+ approvers,
33748
+ selectedApprover,
33749
+ setSelectedApprover,
33750
+ selectFile,
33751
+ uploadedFile,
33752
+ setUploadedFile,
33753
+ businessService,
33754
+ isUploading
33755
+ }));
33756
+ }, [action, approvers, uploadedFile]);
33757
+ return action && config.form ? /*#__PURE__*/React.createElement(Modal, {
33758
+ headerBarMain: /*#__PURE__*/React.createElement(Heading$8, {
33759
+ label: t(config.label.heading)
33760
+ }),
33761
+ headerBarEnd: /*#__PURE__*/React.createElement(CloseBtn$8, {
33762
+ onClick: closeModal
33763
+ }),
33764
+ actionCancelLabel: t(config.label.cancel),
33765
+ actionCancelOnSubmit: closeModal,
33766
+ actionSaveLabel: t(config.label.submit),
33767
+ actionSaveOnSubmit: () => {},
33768
+ formId: "modal-action"
33769
+ }, /*#__PURE__*/React.createElement(FormComposer, {
33770
+ config: config.form,
33771
+ noBoxShadow: true,
33772
+ inline: true,
33773
+ childrenAtTheBottom: true,
33774
+ onSubmit: submit,
33775
+ defaultValues: defaultValues,
33776
+ formId: "modal-action"
33777
+ })) : /*#__PURE__*/React.createElement(Loader, null);
33778
+ };
33779
+
33780
+ const ActionModal$9 = props => {
33423
33781
  if (props !== null && props !== void 0 && props.businessService.includes("PT")) {
33424
33782
  return /*#__PURE__*/React.createElement(ActionModal, props);
33425
33783
  }
33426
33784
  if (props !== null && props !== void 0 && props.businessService.includes("ptr")) {
33427
33785
  return /*#__PURE__*/React.createElement(ActionModal$6, props);
33428
33786
  }
33429
- if (props !== null && props !== void 0 && props.businessService.includes("NewTL") || props !== null && props !== void 0 && props.businessService.includes("TL") || props !== null && props !== void 0 && props.businessService.includes("EDITRENEWAL") || props !== null && props !== void 0 && props.businessService.includes("DIRECTRENEWAL")) {
33787
+ if (props !== null && props !== void 0 && props.businessService.includes("NewTL") || props !== null && props !== void 0 && props.businessService.includes("TL") || props !== null && props !== void 0 && props.businessService.includes("EDITRENEWAL")) {
33430
33788
  return /*#__PURE__*/React.createElement(ActionModal$1, props);
33431
33789
  }
33790
+ if (props !== null && props !== void 0 && props.businessService.includes("DIRECTRENEWAL")) {
33791
+ return /*#__PURE__*/React.createElement(ActionModal$7, props);
33792
+ }
33432
33793
  if (props !== null && props !== void 0 && props.moduleCode.includes("BPAREG")) {
33433
33794
  return /*#__PURE__*/React.createElement(ActionModal$2, props);
33434
33795
  }
@@ -33441,6 +33802,821 @@ const ActionModal$7 = props => {
33441
33802
  if (props !== null && props !== void 0 && props.moduleCode.includes("WS")) {
33442
33803
  return /*#__PURE__*/React.createElement(ActionModal$5, props);
33443
33804
  }
33805
+ if (props !== null && props !== void 0 && props.businessService.includes("street-vending")) {
33806
+ return /*#__PURE__*/React.createElement(ActionModal$8, props);
33807
+ }
33808
+ };
33809
+
33810
+ var bind = function bind(fn, thisArg) {
33811
+ return function wrap() {
33812
+ var args = new Array(arguments.length);
33813
+ for (var i = 0; i < args.length; i++) {
33814
+ args[i] = arguments[i];
33815
+ }
33816
+ return fn.apply(thisArg, args);
33817
+ };
33818
+ };
33819
+
33820
+ var toString$1 = Object.prototype.toString;
33821
+ function isArray$2(val) {
33822
+ return toString$1.call(val) === '[object Array]';
33823
+ }
33824
+ function isUndefined(val) {
33825
+ return typeof val === 'undefined';
33826
+ }
33827
+ function isBuffer(val) {
33828
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
33829
+ }
33830
+ function isArrayBuffer(val) {
33831
+ return toString$1.call(val) === '[object ArrayBuffer]';
33832
+ }
33833
+ function isFormData(val) {
33834
+ return typeof FormData !== 'undefined' && val instanceof FormData;
33835
+ }
33836
+ function isArrayBufferView(val) {
33837
+ var result;
33838
+ if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
33839
+ result = ArrayBuffer.isView(val);
33840
+ } else {
33841
+ result = val && val.buffer && val.buffer instanceof ArrayBuffer;
33842
+ }
33843
+ return result;
33844
+ }
33845
+ function isString(val) {
33846
+ return typeof val === 'string';
33847
+ }
33848
+ function isNumber(val) {
33849
+ return typeof val === 'number';
33850
+ }
33851
+ function isObject$2(val) {
33852
+ return val !== null && typeof val === 'object';
33853
+ }
33854
+ function isPlainObject(val) {
33855
+ if (toString$1.call(val) !== '[object Object]') {
33856
+ return false;
33857
+ }
33858
+ var prototype = Object.getPrototypeOf(val);
33859
+ return prototype === null || prototype === Object.prototype;
33860
+ }
33861
+ function isDate(val) {
33862
+ return toString$1.call(val) === '[object Date]';
33863
+ }
33864
+ function isFile(val) {
33865
+ return toString$1.call(val) === '[object File]';
33866
+ }
33867
+ function isBlob(val) {
33868
+ return toString$1.call(val) === '[object Blob]';
33869
+ }
33870
+ function isFunction$2(val) {
33871
+ return toString$1.call(val) === '[object Function]';
33872
+ }
33873
+ function isStream(val) {
33874
+ return isObject$2(val) && isFunction$2(val.pipe);
33875
+ }
33876
+ function isURLSearchParams(val) {
33877
+ return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
33878
+ }
33879
+ function trim(str) {
33880
+ return str.replace(/^\s*/, '').replace(/\s*$/, '');
33881
+ }
33882
+ function isStandardBrowserEnv() {
33883
+ if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {
33884
+ return false;
33885
+ }
33886
+ return typeof window !== 'undefined' && typeof document !== 'undefined';
33887
+ }
33888
+ function forEach(obj, fn) {
33889
+ if (obj === null || typeof obj === 'undefined') {
33890
+ return;
33891
+ }
33892
+ if (typeof obj !== 'object') {
33893
+ obj = [obj];
33894
+ }
33895
+ if (isArray$2(obj)) {
33896
+ for (var i = 0, l = obj.length; i < l; i++) {
33897
+ fn.call(null, obj[i], i, obj);
33898
+ }
33899
+ } else {
33900
+ for (var key in obj) {
33901
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
33902
+ fn.call(null, obj[key], key, obj);
33903
+ }
33904
+ }
33905
+ }
33906
+ }
33907
+ function merge() {
33908
+ var result = {};
33909
+ function assignValue(val, key) {
33910
+ if (isPlainObject(result[key]) && isPlainObject(val)) {
33911
+ result[key] = merge(result[key], val);
33912
+ } else if (isPlainObject(val)) {
33913
+ result[key] = merge({}, val);
33914
+ } else if (isArray$2(val)) {
33915
+ result[key] = val.slice();
33916
+ } else {
33917
+ result[key] = val;
33918
+ }
33919
+ }
33920
+ for (var i = 0, l = arguments.length; i < l; i++) {
33921
+ forEach(arguments[i], assignValue);
33922
+ }
33923
+ return result;
33924
+ }
33925
+ function extend(a, b, thisArg) {
33926
+ forEach(b, function assignValue(val, key) {
33927
+ if (thisArg && typeof val === 'function') {
33928
+ a[key] = bind(val, thisArg);
33929
+ } else {
33930
+ a[key] = val;
33931
+ }
33932
+ });
33933
+ return a;
33934
+ }
33935
+ function stripBOM(content) {
33936
+ if (content.charCodeAt(0) === 0xFEFF) {
33937
+ content = content.slice(1);
33938
+ }
33939
+ return content;
33940
+ }
33941
+ var utils = {
33942
+ isArray: isArray$2,
33943
+ isArrayBuffer: isArrayBuffer,
33944
+ isBuffer: isBuffer,
33945
+ isFormData: isFormData,
33946
+ isArrayBufferView: isArrayBufferView,
33947
+ isString: isString,
33948
+ isNumber: isNumber,
33949
+ isObject: isObject$2,
33950
+ isPlainObject: isPlainObject,
33951
+ isUndefined: isUndefined,
33952
+ isDate: isDate,
33953
+ isFile: isFile,
33954
+ isBlob: isBlob,
33955
+ isFunction: isFunction$2,
33956
+ isStream: isStream,
33957
+ isURLSearchParams: isURLSearchParams,
33958
+ isStandardBrowserEnv: isStandardBrowserEnv,
33959
+ forEach: forEach,
33960
+ merge: merge,
33961
+ extend: extend,
33962
+ trim: trim,
33963
+ stripBOM: stripBOM
33964
+ };
33965
+
33966
+ function encode(val) {
33967
+ return encodeURIComponent(val).replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']');
33968
+ }
33969
+ var buildURL = function buildURL(url, params, paramsSerializer) {
33970
+ if (!params) {
33971
+ return url;
33972
+ }
33973
+ var serializedParams;
33974
+ if (paramsSerializer) {
33975
+ serializedParams = paramsSerializer(params);
33976
+ } else if (utils.isURLSearchParams(params)) {
33977
+ serializedParams = params.toString();
33978
+ } else {
33979
+ var parts = [];
33980
+ utils.forEach(params, function serialize(val, key) {
33981
+ if (val === null || typeof val === 'undefined') {
33982
+ return;
33983
+ }
33984
+ if (utils.isArray(val)) {
33985
+ key = key + '[]';
33986
+ } else {
33987
+ val = [val];
33988
+ }
33989
+ utils.forEach(val, function parseValue(v) {
33990
+ if (utils.isDate(v)) {
33991
+ v = v.toISOString();
33992
+ } else if (utils.isObject(v)) {
33993
+ v = JSON.stringify(v);
33994
+ }
33995
+ parts.push(encode(key) + '=' + encode(v));
33996
+ });
33997
+ });
33998
+ serializedParams = parts.join('&');
33999
+ }
34000
+ if (serializedParams) {
34001
+ var hashmarkIndex = url.indexOf('#');
34002
+ if (hashmarkIndex !== -1) {
34003
+ url = url.slice(0, hashmarkIndex);
34004
+ }
34005
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
34006
+ }
34007
+ return url;
34008
+ };
34009
+
34010
+ function InterceptorManager() {
34011
+ this.handlers = [];
34012
+ }
34013
+ InterceptorManager.prototype.use = function use(fulfilled, rejected) {
34014
+ this.handlers.push({
34015
+ fulfilled: fulfilled,
34016
+ rejected: rejected
34017
+ });
34018
+ return this.handlers.length - 1;
34019
+ };
34020
+ InterceptorManager.prototype.eject = function eject(id) {
34021
+ if (this.handlers[id]) {
34022
+ this.handlers[id] = null;
34023
+ }
34024
+ };
34025
+ InterceptorManager.prototype.forEach = function forEach(fn) {
34026
+ utils.forEach(this.handlers, function forEachHandler(h) {
34027
+ if (h !== null) {
34028
+ fn(h);
34029
+ }
34030
+ });
34031
+ };
34032
+ var InterceptorManager_1 = InterceptorManager;
34033
+
34034
+ var transformData = function transformData(data, headers, fns) {
34035
+ utils.forEach(fns, function transform(fn) {
34036
+ data = fn(data, headers);
34037
+ });
34038
+ return data;
34039
+ };
34040
+
34041
+ var isCancel = function isCancel(value) {
34042
+ return !!(value && value.__CANCEL__);
34043
+ };
34044
+
34045
+ var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) {
34046
+ utils.forEach(headers, function processHeader(value, name) {
34047
+ if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
34048
+ headers[normalizedName] = value;
34049
+ delete headers[name];
34050
+ }
34051
+ });
34052
+ };
34053
+
34054
+ var enhanceError = function enhanceError(error, config, code, request, response) {
34055
+ error.config = config;
34056
+ if (code) {
34057
+ error.code = code;
34058
+ }
34059
+ error.request = request;
34060
+ error.response = response;
34061
+ error.isAxiosError = true;
34062
+ error.toJSON = function toJSON() {
34063
+ return {
34064
+ message: this.message,
34065
+ name: this.name,
34066
+ description: this.description,
34067
+ number: this.number,
34068
+ fileName: this.fileName,
34069
+ lineNumber: this.lineNumber,
34070
+ columnNumber: this.columnNumber,
34071
+ stack: this.stack,
34072
+ config: this.config,
34073
+ code: this.code
34074
+ };
34075
+ };
34076
+ return error;
34077
+ };
34078
+
34079
+ var createError = function createError(message, config, code, request, response) {
34080
+ var error = new Error(message);
34081
+ return enhanceError(error, config, code, request, response);
34082
+ };
34083
+
34084
+ var settle = function settle(resolve, reject, response) {
34085
+ var validateStatus = response.config.validateStatus;
34086
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
34087
+ resolve(response);
34088
+ } else {
34089
+ reject(createError('Request failed with status code ' + response.status, response.config, null, response.request, response));
34090
+ }
34091
+ };
34092
+
34093
+ var cookies = utils.isStandardBrowserEnv() ? function standardBrowserEnv() {
34094
+ return {
34095
+ write: function write(name, value, expires, path, domain, secure) {
34096
+ var cookie = [];
34097
+ cookie.push(name + '=' + encodeURIComponent(value));
34098
+ if (utils.isNumber(expires)) {
34099
+ cookie.push('expires=' + new Date(expires).toGMTString());
34100
+ }
34101
+ if (utils.isString(path)) {
34102
+ cookie.push('path=' + path);
34103
+ }
34104
+ if (utils.isString(domain)) {
34105
+ cookie.push('domain=' + domain);
34106
+ }
34107
+ if (secure === true) {
34108
+ cookie.push('secure');
34109
+ }
34110
+ document.cookie = cookie.join('; ');
34111
+ },
34112
+ read: function read(name) {
34113
+ var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
34114
+ return match ? decodeURIComponent(match[3]) : null;
34115
+ },
34116
+ remove: function remove(name) {
34117
+ this.write(name, '', Date.now() - 86400000);
34118
+ }
34119
+ };
34120
+ }() : function nonStandardBrowserEnv() {
34121
+ return {
34122
+ write: function write() {},
34123
+ read: function read() {
34124
+ return null;
34125
+ },
34126
+ remove: function remove() {}
34127
+ };
34128
+ }();
34129
+
34130
+ var isAbsoluteURL = function isAbsoluteURL(url) {
34131
+ return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
34132
+ };
34133
+
34134
+ var combineURLs = function combineURLs(baseURL, relativeURL) {
34135
+ return relativeURL ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL;
34136
+ };
34137
+
34138
+ var buildFullPath = function buildFullPath(baseURL, requestedURL) {
34139
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
34140
+ return combineURLs(baseURL, requestedURL);
34141
+ }
34142
+ return requestedURL;
34143
+ };
34144
+
34145
+ var ignoreDuplicateOf = ['age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent'];
34146
+ var parseHeaders = function parseHeaders(headers) {
34147
+ var parsed = {};
34148
+ var key;
34149
+ var val;
34150
+ var i;
34151
+ if (!headers) {
34152
+ return parsed;
34153
+ }
34154
+ utils.forEach(headers.split('\n'), function parser(line) {
34155
+ i = line.indexOf(':');
34156
+ key = utils.trim(line.substr(0, i)).toLowerCase();
34157
+ val = utils.trim(line.substr(i + 1));
34158
+ if (key) {
34159
+ if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
34160
+ return;
34161
+ }
34162
+ if (key === 'set-cookie') {
34163
+ parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
34164
+ } else {
34165
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
34166
+ }
34167
+ }
34168
+ });
34169
+ return parsed;
34170
+ };
34171
+
34172
+ var isURLSameOrigin = utils.isStandardBrowserEnv() ? function standardBrowserEnv() {
34173
+ var msie = /(msie|trident)/i.test(navigator.userAgent);
34174
+ var urlParsingNode = document.createElement('a');
34175
+ var originURL;
34176
+ function resolveURL(url) {
34177
+ var href = url;
34178
+ if (msie) {
34179
+ urlParsingNode.setAttribute('href', href);
34180
+ href = urlParsingNode.href;
34181
+ }
34182
+ urlParsingNode.setAttribute('href', href);
34183
+ return {
34184
+ href: urlParsingNode.href,
34185
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
34186
+ host: urlParsingNode.host,
34187
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
34188
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
34189
+ hostname: urlParsingNode.hostname,
34190
+ port: urlParsingNode.port,
34191
+ pathname: urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname
34192
+ };
34193
+ }
34194
+ originURL = resolveURL(window.location.href);
34195
+ return function isURLSameOrigin(requestURL) {
34196
+ var parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL;
34197
+ return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
34198
+ };
34199
+ }() : function nonStandardBrowserEnv() {
34200
+ return function isURLSameOrigin() {
34201
+ return true;
34202
+ };
34203
+ }();
34204
+
34205
+ var xhr = function xhrAdapter(config) {
34206
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
34207
+ var requestData = config.data;
34208
+ var requestHeaders = config.headers;
34209
+ if (utils.isFormData(requestData)) {
34210
+ delete requestHeaders['Content-Type'];
34211
+ }
34212
+ var request = new XMLHttpRequest();
34213
+ if (config.auth) {
34214
+ var username = config.auth.username || '';
34215
+ var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
34216
+ requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
34217
+ }
34218
+ var fullPath = buildFullPath(config.baseURL, config.url);
34219
+ request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
34220
+ request.timeout = config.timeout;
34221
+ request.onreadystatechange = function handleLoad() {
34222
+ if (!request || request.readyState !== 4) {
34223
+ return;
34224
+ }
34225
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
34226
+ return;
34227
+ }
34228
+ var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
34229
+ var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
34230
+ var response = {
34231
+ data: responseData,
34232
+ status: request.status,
34233
+ statusText: request.statusText,
34234
+ headers: responseHeaders,
34235
+ config: config,
34236
+ request: request
34237
+ };
34238
+ settle(resolve, reject, response);
34239
+ request = null;
34240
+ };
34241
+ request.onabort = function handleAbort() {
34242
+ if (!request) {
34243
+ return;
34244
+ }
34245
+ reject(createError('Request aborted', config, 'ECONNABORTED', request));
34246
+ request = null;
34247
+ };
34248
+ request.onerror = function handleError() {
34249
+ reject(createError('Network Error', config, null, request));
34250
+ request = null;
34251
+ };
34252
+ request.ontimeout = function handleTimeout() {
34253
+ var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
34254
+ if (config.timeoutErrorMessage) {
34255
+ timeoutErrorMessage = config.timeoutErrorMessage;
34256
+ }
34257
+ reject(createError(timeoutErrorMessage, config, 'ECONNABORTED', request));
34258
+ request = null;
34259
+ };
34260
+ if (utils.isStandardBrowserEnv()) {
34261
+ var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : undefined;
34262
+ if (xsrfValue) {
34263
+ requestHeaders[config.xsrfHeaderName] = xsrfValue;
34264
+ }
34265
+ }
34266
+ if ('setRequestHeader' in request) {
34267
+ utils.forEach(requestHeaders, function setRequestHeader(val, key) {
34268
+ if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
34269
+ delete requestHeaders[key];
34270
+ } else {
34271
+ request.setRequestHeader(key, val);
34272
+ }
34273
+ });
34274
+ }
34275
+ if (!utils.isUndefined(config.withCredentials)) {
34276
+ request.withCredentials = !!config.withCredentials;
34277
+ }
34278
+ if (config.responseType) {
34279
+ try {
34280
+ request.responseType = config.responseType;
34281
+ } catch (e) {
34282
+ if (config.responseType !== 'json') {
34283
+ throw e;
34284
+ }
34285
+ }
34286
+ }
34287
+ if (typeof config.onDownloadProgress === 'function') {
34288
+ request.addEventListener('progress', config.onDownloadProgress);
34289
+ }
34290
+ if (typeof config.onUploadProgress === 'function' && request.upload) {
34291
+ request.upload.addEventListener('progress', config.onUploadProgress);
34292
+ }
34293
+ if (config.cancelToken) {
34294
+ config.cancelToken.promise.then(function onCanceled(cancel) {
34295
+ if (!request) {
34296
+ return;
34297
+ }
34298
+ request.abort();
34299
+ reject(cancel);
34300
+ request = null;
34301
+ });
34302
+ }
34303
+ if (!requestData) {
34304
+ requestData = null;
34305
+ }
34306
+ request.send(requestData);
34307
+ });
34308
+ };
34309
+
34310
+ var DEFAULT_CONTENT_TYPE = {
34311
+ 'Content-Type': 'application/x-www-form-urlencoded'
34312
+ };
34313
+ function setContentTypeIfUnset(headers, value) {
34314
+ if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
34315
+ headers['Content-Type'] = value;
34316
+ }
34317
+ }
34318
+ function getDefaultAdapter() {
34319
+ var adapter;
34320
+ if (typeof XMLHttpRequest !== 'undefined') {
34321
+ adapter = xhr;
34322
+ } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
34323
+ adapter = xhr;
34324
+ }
34325
+ return adapter;
34326
+ }
34327
+ var defaults = {
34328
+ adapter: getDefaultAdapter(),
34329
+ transformRequest: [function transformRequest(data, headers) {
34330
+ normalizeHeaderName(headers, 'Accept');
34331
+ normalizeHeaderName(headers, 'Content-Type');
34332
+ if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) {
34333
+ return data;
34334
+ }
34335
+ if (utils.isArrayBufferView(data)) {
34336
+ return data.buffer;
34337
+ }
34338
+ if (utils.isURLSearchParams(data)) {
34339
+ setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
34340
+ return data.toString();
34341
+ }
34342
+ if (utils.isObject(data)) {
34343
+ setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
34344
+ return JSON.stringify(data);
34345
+ }
34346
+ return data;
34347
+ }],
34348
+ transformResponse: [function transformResponse(data) {
34349
+ if (typeof data === 'string') {
34350
+ try {
34351
+ data = JSON.parse(data);
34352
+ } catch (e) {}
34353
+ }
34354
+ return data;
34355
+ }],
34356
+ timeout: 0,
34357
+ xsrfCookieName: 'XSRF-TOKEN',
34358
+ xsrfHeaderName: 'X-XSRF-TOKEN',
34359
+ maxContentLength: -1,
34360
+ maxBodyLength: -1,
34361
+ validateStatus: function validateStatus(status) {
34362
+ return status >= 200 && status < 300;
34363
+ }
34364
+ };
34365
+ defaults.headers = {
34366
+ common: {
34367
+ 'Accept': 'application/json, text/plain, */*'
34368
+ }
34369
+ };
34370
+ utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
34371
+ defaults.headers[method] = {};
34372
+ });
34373
+ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
34374
+ defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
34375
+ });
34376
+ var defaults_1 = defaults;
34377
+
34378
+ function throwIfCancellationRequested(config) {
34379
+ if (config.cancelToken) {
34380
+ config.cancelToken.throwIfRequested();
34381
+ }
34382
+ }
34383
+ var dispatchRequest = function dispatchRequest(config) {
34384
+ throwIfCancellationRequested(config);
34385
+ config.headers = config.headers || {};
34386
+ config.data = transformData(config.data, config.headers, config.transformRequest);
34387
+ config.headers = utils.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers);
34388
+ utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function cleanHeaderConfig(method) {
34389
+ delete config.headers[method];
34390
+ });
34391
+ var adapter = config.adapter || defaults_1.adapter;
34392
+ return adapter(config).then(function onAdapterResolution(response) {
34393
+ throwIfCancellationRequested(config);
34394
+ response.data = transformData(response.data, response.headers, config.transformResponse);
34395
+ return response;
34396
+ }, function onAdapterRejection(reason) {
34397
+ if (!isCancel(reason)) {
34398
+ throwIfCancellationRequested(config);
34399
+ if (reason && reason.response) {
34400
+ reason.response.data = transformData(reason.response.data, reason.response.headers, config.transformResponse);
34401
+ }
34402
+ }
34403
+ return Promise.reject(reason);
34404
+ });
34405
+ };
34406
+
34407
+ var mergeConfig = function mergeConfig(config1, config2) {
34408
+ config2 = config2 || {};
34409
+ var config = {};
34410
+ var valueFromConfig2Keys = ['url', 'method', 'data'];
34411
+ var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];
34412
+ var defaultToConfig2Keys = ['baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'];
34413
+ var directMergeKeys = ['validateStatus'];
34414
+ function getMergedValue(target, source) {
34415
+ if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
34416
+ return utils.merge(target, source);
34417
+ } else if (utils.isPlainObject(source)) {
34418
+ return utils.merge({}, source);
34419
+ } else if (utils.isArray(source)) {
34420
+ return source.slice();
34421
+ }
34422
+ return source;
34423
+ }
34424
+ function mergeDeepProperties(prop) {
34425
+ if (!utils.isUndefined(config2[prop])) {
34426
+ config[prop] = getMergedValue(config1[prop], config2[prop]);
34427
+ } else if (!utils.isUndefined(config1[prop])) {
34428
+ config[prop] = getMergedValue(undefined, config1[prop]);
34429
+ }
34430
+ }
34431
+ utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
34432
+ if (!utils.isUndefined(config2[prop])) {
34433
+ config[prop] = getMergedValue(undefined, config2[prop]);
34434
+ }
34435
+ });
34436
+ utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
34437
+ utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
34438
+ if (!utils.isUndefined(config2[prop])) {
34439
+ config[prop] = getMergedValue(undefined, config2[prop]);
34440
+ } else if (!utils.isUndefined(config1[prop])) {
34441
+ config[prop] = getMergedValue(undefined, config1[prop]);
34442
+ }
34443
+ });
34444
+ utils.forEach(directMergeKeys, function merge(prop) {
34445
+ if (prop in config2) {
34446
+ config[prop] = getMergedValue(config1[prop], config2[prop]);
34447
+ } else if (prop in config1) {
34448
+ config[prop] = getMergedValue(undefined, config1[prop]);
34449
+ }
34450
+ });
34451
+ var axiosKeys = valueFromConfig2Keys.concat(mergeDeepPropertiesKeys).concat(defaultToConfig2Keys).concat(directMergeKeys);
34452
+ var otherKeys = Object.keys(config1).concat(Object.keys(config2)).filter(function filterAxiosKeys(key) {
34453
+ return axiosKeys.indexOf(key) === -1;
34454
+ });
34455
+ utils.forEach(otherKeys, mergeDeepProperties);
34456
+ return config;
34457
+ };
34458
+
34459
+ function Axios(instanceConfig) {
34460
+ this.defaults = instanceConfig;
34461
+ this.interceptors = {
34462
+ request: new InterceptorManager_1(),
34463
+ response: new InterceptorManager_1()
34464
+ };
34465
+ }
34466
+ Axios.prototype.request = function request(config) {
34467
+ if (typeof config === 'string') {
34468
+ config = arguments[1] || {};
34469
+ config.url = arguments[0];
34470
+ } else {
34471
+ config = config || {};
34472
+ }
34473
+ config = mergeConfig(this.defaults, config);
34474
+ if (config.method) {
34475
+ config.method = config.method.toLowerCase();
34476
+ } else if (this.defaults.method) {
34477
+ config.method = this.defaults.method.toLowerCase();
34478
+ } else {
34479
+ config.method = 'get';
34480
+ }
34481
+ var chain = [dispatchRequest, undefined];
34482
+ var promise = Promise.resolve(config);
34483
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
34484
+ chain.unshift(interceptor.fulfilled, interceptor.rejected);
34485
+ });
34486
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
34487
+ chain.push(interceptor.fulfilled, interceptor.rejected);
34488
+ });
34489
+ while (chain.length) {
34490
+ promise = promise.then(chain.shift(), chain.shift());
34491
+ }
34492
+ return promise;
34493
+ };
34494
+ Axios.prototype.getUri = function getUri(config) {
34495
+ config = mergeConfig(this.defaults, config);
34496
+ return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
34497
+ };
34498
+ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
34499
+ Axios.prototype[method] = function (url, config) {
34500
+ return this.request(mergeConfig(config || {}, {
34501
+ method: method,
34502
+ url: url,
34503
+ data: (config || {}).data
34504
+ }));
34505
+ };
34506
+ });
34507
+ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
34508
+ Axios.prototype[method] = function (url, data, config) {
34509
+ return this.request(mergeConfig(config || {}, {
34510
+ method: method,
34511
+ url: url,
34512
+ data: data
34513
+ }));
34514
+ };
34515
+ });
34516
+ var Axios_1 = Axios;
34517
+
34518
+ function Cancel(message) {
34519
+ this.message = message;
34520
+ }
34521
+ Cancel.prototype.toString = function toString() {
34522
+ return 'Cancel' + (this.message ? ': ' + this.message : '');
34523
+ };
34524
+ Cancel.prototype.__CANCEL__ = true;
34525
+ var Cancel_1 = Cancel;
34526
+
34527
+ function CancelToken(executor) {
34528
+ if (typeof executor !== 'function') {
34529
+ throw new TypeError('executor must be a function.');
34530
+ }
34531
+ var resolvePromise;
34532
+ this.promise = new Promise(function promiseExecutor(resolve) {
34533
+ resolvePromise = resolve;
34534
+ });
34535
+ var token = this;
34536
+ executor(function cancel(message) {
34537
+ if (token.reason) {
34538
+ return;
34539
+ }
34540
+ token.reason = new Cancel_1(message);
34541
+ resolvePromise(token.reason);
34542
+ });
34543
+ }
34544
+ CancelToken.prototype.throwIfRequested = function throwIfRequested() {
34545
+ if (this.reason) {
34546
+ throw this.reason;
34547
+ }
34548
+ };
34549
+ CancelToken.source = function source() {
34550
+ var cancel;
34551
+ var token = new CancelToken(function executor(c) {
34552
+ cancel = c;
34553
+ });
34554
+ return {
34555
+ token: token,
34556
+ cancel: cancel
34557
+ };
34558
+ };
34559
+ var CancelToken_1 = CancelToken;
34560
+
34561
+ var spread = function spread(callback) {
34562
+ return function wrap(arr) {
34563
+ return callback.apply(null, arr);
34564
+ };
34565
+ };
34566
+
34567
+ var isAxiosError = function isAxiosError(payload) {
34568
+ return typeof payload === 'object' && payload.isAxiosError === true;
34569
+ };
34570
+
34571
+ function createInstance(defaultConfig) {
34572
+ var context = new Axios_1(defaultConfig);
34573
+ var instance = bind(Axios_1.prototype.request, context);
34574
+ utils.extend(instance, Axios_1.prototype, context);
34575
+ utils.extend(instance, context);
34576
+ return instance;
34577
+ }
34578
+ var axios = createInstance(defaults_1);
34579
+ axios.Axios = Axios_1;
34580
+ axios.create = function create(instanceConfig) {
34581
+ return createInstance(mergeConfig(axios.defaults, instanceConfig));
34582
+ };
34583
+ axios.Cancel = Cancel_1;
34584
+ axios.CancelToken = CancelToken_1;
34585
+ axios.isCancel = isCancel;
34586
+ axios.all = function all(promises) {
34587
+ return Promise.all(promises);
34588
+ };
34589
+ axios.spread = spread;
34590
+ axios.isAxiosError = isAxiosError;
34591
+ var axios_1 = axios;
34592
+ var _default = axios;
34593
+ axios_1.default = _default;
34594
+
34595
+ var axios$1 = axios_1;
34596
+
34597
+ axios$1.interceptors.response.use(res => res, err => {
34598
+ var _err$response, _err$response$data;
34599
+ const isEmployee = window.location.pathname.split("/").includes("employee");
34600
+ if (err !== null && err !== void 0 && (_err$response = err.response) !== null && _err$response !== void 0 && (_err$response$data = _err$response.data) !== null && _err$response$data !== void 0 && _err$response$data.Errors) {
34601
+ for (const error of err.response.data.Errors) {
34602
+ var _error$message, _error$message$toLowe, _error$message2, _error$message2$toLow;
34603
+ if (error.message.includes("InvalidAccessTokenException")) {
34604
+ localStorage.clear();
34605
+ sessionStorage.clear();
34606
+ window.location.href = (isEmployee ? "/digit-ui/employee/user/login" : "/digit-ui/citizen/login") + `?from=${encodeURIComponent(window.location.pathname + window.location.search)}`;
34607
+ } else if (error !== null && error !== void 0 && (_error$message = error.message) !== null && _error$message !== void 0 && (_error$message$toLowe = _error$message.toLowerCase()) !== null && _error$message$toLowe !== void 0 && _error$message$toLowe.includes("internal server error") || error !== null && error !== void 0 && (_error$message2 = error.message) !== null && _error$message2 !== void 0 && (_error$message2$toLow = _error$message2.toLowerCase()) !== null && _error$message2$toLow !== void 0 && _error$message2$toLow.includes("some error occured")) {
34608
+ window.location.href = (isEmployee ? "/digit-ui/employee/user/error" : "/digit-ui/citizen/error") + `?type=maintenance&from=${encodeURIComponent(window.location.pathname + window.location.search)}`;
34609
+ } else if (error.message.includes("ZuulRuntimeException")) {
34610
+ window.location.href = (isEmployee ? "/digit-ui/employee/user/error" : "/digit-ui/citizen/error") + `?type=notfound&from=${encodeURIComponent(window.location.pathname + window.location.search)}`;
34611
+ }
34612
+ }
34613
+ }
34614
+ throw err;
34615
+ });
34616
+ window.Digit = window.Digit || {};
34617
+ window.Digit = {
34618
+ ...window.Digit,
34619
+ RequestCache: window.Digit.RequestCache || {}
33444
34620
  };
33445
34621
 
33446
34622
  var lodash$1 = createCommonjsModule(function (module, exports) {
@@ -40132,7 +41308,7 @@ const PermissionCheck = ({
40132
41308
  } : {},
40133
41309
  placeholder: t("BPA_ENTER_PERMIT_CONDITIONS_LABEL")
40134
41310
  }), /*#__PURE__*/React.createElement(LinkButton, {
40135
- label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Close$8, {
41311
+ label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Close$a, {
40136
41312
  style: {
40137
41313
  float: "right",
40138
41314
  position: "relative",
@@ -42263,12 +43439,15 @@ function ApplicationDetailsContent({
42263
43439
  oldValue,
42264
43440
  isInfoLabel = false
42265
43441
  }) {
42266
- var _applicationDetails$a2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data12, _workflowDetails$data13, _workflowDetails$data21, _workflowDetails$data22;
43442
+ var _applicationDetails$a2, _applicationDetails$a3, _applicationDetails$a6, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data12, _workflowDetails$data13, _workflowDetails$data21, _workflowDetails$data22;
42267
43443
  const {
42268
43444
  t
42269
43445
  } = useTranslation();
43446
+ const history = useHistory();
43447
+ const tenantId = Digit.ULBService.getCurrentTenantId();
43448
+ const [showToast, setShowToast] = useState(null);
42270
43449
  let isEditApplication = window.location.href.includes("editApplication") && window.location.href.includes("bpa");
42271
- console.log("appl", applicationDetails);
43450
+ console.log("applicationDetails: ", applicationDetails);
42272
43451
  function OpenImage(imageSource, index, thumbnailsToShow) {
42273
43452
  var _thumbnailsToShow$ful;
42274
43453
  window.open(thumbnailsToShow === null || thumbnailsToShow === void 0 ? void 0 : (_thumbnailsToShow$ful = thumbnailsToShow.fullImage) === null || _thumbnailsToShow$ful === void 0 ? void 0 : _thumbnailsToShow$ful[0], "_blank");
@@ -42436,19 +43615,19 @@ function ApplicationDetailsContent({
42436
43615
  };
42437
43616
  const tableStyles = {
42438
43617
  table: {
42439
- border: '2px solid black',
42440
- width: '100%',
42441
- fontFamily: 'sans-serif'
43618
+ border: "2px solid black",
43619
+ width: "100%",
43620
+ fontFamily: "sans-serif"
42442
43621
  },
42443
43622
  td: {
42444
43623
  padding: "10px",
42445
- border: '1px solid black',
42446
- textAlign: 'center'
43624
+ border: "1px solid black",
43625
+ textAlign: "center"
42447
43626
  },
42448
43627
  th: {
42449
43628
  padding: "10px",
42450
- border: '1px solid black',
42451
- textAlign: 'center'
43629
+ border: "1px solid black",
43630
+ textAlign: "center"
42452
43631
  }
42453
43632
  };
42454
43633
  const getMainDivStyles = () => {
@@ -42498,6 +43677,74 @@ function ApplicationDetailsContent({
42498
43677
  const totalBalanceTax = demandData === null || demandData === void 0 ? void 0 : demandData.reduce((sum, item) => sum + item.balanceTax, 0);
42499
43678
  const totalBalanceInterest = demandData === null || demandData === void 0 ? void 0 : demandData.reduce((sum, item) => sum + item.balanceInterest, 0);
42500
43679
  const totalBalancePenality = demandData === null || demandData === void 0 ? void 0 : demandData.reduce((sum, item) => sum + item.balancePenality, 0);
43680
+ const closeToast = () => {
43681
+ setShowToast(null);
43682
+ };
43683
+ const updatePropertyStatus = async (propertyData, status, propertyIds) => {
43684
+ const confirm = window.confirm(`Are you sure you want to make this property ${status}?`);
43685
+ if (!confirm) return;
43686
+ const payload = {
43687
+ ...propertyData,
43688
+ status: status,
43689
+ isactive: status === "ACTIVE",
43690
+ isinactive: status === "INACTIVE",
43691
+ creationReason: "STATUS",
43692
+ additionalDetails: {
43693
+ ...propertyData.additionalDetails,
43694
+ propertytobestatus: status
43695
+ },
43696
+ workflow: {
43697
+ ...propertyData.workflow,
43698
+ businessService: "PT.CREATE",
43699
+ action: "OPEN",
43700
+ moduleName: "PT"
43701
+ }
43702
+ };
43703
+ const response = await Digit.PTService.updatePT({
43704
+ Property: {
43705
+ ...payload
43706
+ }
43707
+ }, tenantId, propertyIds);
43708
+ console.log("response from inactive/active", response);
43709
+ };
43710
+ const applicationData_pt = applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.applicationData;
43711
+ const propertyIds = (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a2 = applicationDetails.applicationData) === null || _applicationDetails$a2 === void 0 ? void 0 : _applicationDetails$a2.propertyId) || "";
43712
+ const checkPropertyStatus = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a3 = applicationDetails.additionalDetails) === null || _applicationDetails$a3 === void 0 ? void 0 : _applicationDetails$a3.propertytobestatus;
43713
+ const PropertyInActive = () => {
43714
+ if (checkPropertyStatus == "ACTIVE") {
43715
+ updatePropertyStatus(applicationData_pt, "INACTIVE", propertyIds);
43716
+ } else {
43717
+ alert("Property is already inactive.");
43718
+ }
43719
+ };
43720
+ const PropertyActive = () => {
43721
+ if (checkPropertyStatus == "INACTIVE") {
43722
+ updatePropertyStatus(applicationData_pt, "ACTIVE", propertyIds);
43723
+ } else {
43724
+ alert("Property is already active.");
43725
+ }
43726
+ };
43727
+ const EditProperty = () => {
43728
+ var _applicationDetails$a4;
43729
+ const canEditProperty = (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a4 = applicationDetails.applicationData) === null || _applicationDetails$a4 === void 0 ? void 0 : _applicationDetails$a4.status) === "ACTIVE";
43730
+ if (canEditProperty) {
43731
+ var _applicationDetails$a5;
43732
+ const pID = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a5 = applicationDetails.applicationData) === null || _applicationDetails$a5 === void 0 ? void 0 : _applicationDetails$a5.propertyId;
43733
+ if (pID) {
43734
+ history.push({
43735
+ pathname: `/digit-ui/employee/pt/edit-application/${pID}`
43736
+ });
43737
+ }
43738
+ } else {
43739
+ setShowToast({
43740
+ isError: true,
43741
+ label: " This action cannot be done on Inactive property or the property in workflow"
43742
+ });
43743
+ }
43744
+ };
43745
+ const AccessProperty = () => {
43746
+ alert("access property");
43747
+ };
42501
43748
  return /*#__PURE__*/React.createElement(Card, {
42502
43749
  style: {
42503
43750
  position: "relative"
@@ -42510,8 +43757,8 @@ function ApplicationDetailsContent({
42510
43757
  infoClickLable: "WS_CLICK_ON_LABEL",
42511
43758
  infoClickInfoLabel: getClickInfoDetails(),
42512
43759
  infoClickInfoLabel1: getClickInfoDetails1()
42513
- }) : null, applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a2 = applicationDetails.applicationDetails) === null || _applicationDetails$a2 === void 0 ? void 0 : _applicationDetails$a2.map((detail, index) => {
42514
- var _detail$values, _detail$additionalDet, _applicationDetails$a3, _applicationDetails$a4, _applicationDetails$a5, _applicationDetails$a6, _detail$additionalDet2, _applicationDetails$a7, _applicationDetails$a8, _detail$additionalDet3, _detail$additionalDet4, _detail$additionalDet5, _detail$additionalDet6, _detail$additionalDet7, _detail$additionalDet8, _detail$additionalDet9, _detail$additionalDet10, _detail$additionalDet11, _workflowDetails$data, _workflowDetails$data2, _detail$additionalDet12, _detail$additionalDet13, _detail$additionalDet14, _detail$additionalDet15, _detail$additionalDet16, _detail$additionalDet17, _detail$additionalDet18, _detail$additionalDet19, _detail$additionalDet20, _detail$additionalDet21, _detail$additionalDet22, _detail$additionalDet23, _detail$additionalDet24, _detail$additionalDet25, _detail$additionalDet26, _detail$additionalDet27, _detail$additionalDet28, _detail$additionalDet29, _detail$additionalDet30, _detail$additionalDet31;
43760
+ }) : null, applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a6 = applicationDetails.applicationDetails) === null || _applicationDetails$a6 === void 0 ? void 0 : _applicationDetails$a6.map((detail, index) => {
43761
+ var _detail$values, _detail$additionalDet, _applicationDetails$a7, _applicationDetails$a8, _applicationDetails$a9, _applicationDetails$a10, _detail$additionalDet2, _applicationDetails$a11, _applicationDetails$a12, _detail$additionalDet3, _detail$additionalDet4, _detail$additionalDet5, _detail$additionalDet6, _detail$additionalDet7, _detail$additionalDet8, _detail$additionalDet9, _detail$additionalDet10, _detail$additionalDet11, _workflowDetails$data, _workflowDetails$data2, _detail$additionalDet12, _detail$additionalDet13, _detail$additionalDet14, _detail$additionalDet15, _detail$additionalDet16, _detail$additionalDet17, _detail$additionalDet18, _detail$additionalDet19, _detail$additionalDet20, _detail$additionalDet21, _detail$additionalDet22, _detail$additionalDet23, _detail$additionalDet24, _detail$additionalDet25, _detail$additionalDet26, _detail$additionalDet27, _detail$additionalDet28, _detail$additionalDet29, _detail$additionalDet30, _detail$additionalDet31;
42515
43762
  return /*#__PURE__*/React.createElement(React.Fragment, {
42516
43763
  key: index
42517
43764
  }, /*#__PURE__*/React.createElement("div", {
@@ -42655,10 +43902,10 @@ function ApplicationDetailsContent({
42655
43902
  })))), (detail === null || detail === void 0 ? void 0 : detail.belowComponent) && /*#__PURE__*/React.createElement(detail.belowComponent, null), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet = detail.additionalDetails) === null || _detail$additionalDet === void 0 ? void 0 : _detail$additionalDet.inspectionReport) && /*#__PURE__*/React.createElement(ScruntinyDetails, {
42656
43903
  scrutinyDetails: detail === null || detail === void 0 ? void 0 : detail.additionalDetails,
42657
43904
  paymentsList: paymentsList,
42658
- additionalDetails: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a3 = applicationDetails.applicationData) === null || _applicationDetails$a3 === void 0 ? void 0 : _applicationDetails$a3.additionalDetails,
43905
+ additionalDetails: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a7 = applicationDetails.applicationData) === null || _applicationDetails$a7 === void 0 ? void 0 : _applicationDetails$a7.additionalDetails,
42659
43906
  applicationData: applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.applicationData
42660
- }), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a4 = applicationDetails.applicationData) === null || _applicationDetails$a4 === void 0 ? void 0 : (_applicationDetails$a5 = _applicationDetails$a4.additionalDetails) === null || _applicationDetails$a5 === void 0 ? void 0 : (_applicationDetails$a6 = _applicationDetails$a5.fieldinspection_pending) === null || _applicationDetails$a6 === void 0 ? void 0 : _applicationDetails$a6.length) > 0 && (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet2 = detail.additionalDetails) === null || _detail$additionalDet2 === void 0 ? void 0 : _detail$additionalDet2.fiReport) && /*#__PURE__*/React.createElement(InspectionReport, {
42661
- fiReport: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a7 = applicationDetails.applicationData) === null || _applicationDetails$a7 === void 0 ? void 0 : (_applicationDetails$a8 = _applicationDetails$a7.additionalDetails) === null || _applicationDetails$a8 === void 0 ? void 0 : _applicationDetails$a8.fieldinspection_pending
43907
+ }), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a8 = applicationDetails.applicationData) === null || _applicationDetails$a8 === void 0 ? void 0 : (_applicationDetails$a9 = _applicationDetails$a8.additionalDetails) === null || _applicationDetails$a9 === void 0 ? void 0 : (_applicationDetails$a10 = _applicationDetails$a9.fieldinspection_pending) === null || _applicationDetails$a10 === void 0 ? void 0 : _applicationDetails$a10.length) > 0 && (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet2 = detail.additionalDetails) === null || _detail$additionalDet2 === void 0 ? void 0 : _detail$additionalDet2.fiReport) && /*#__PURE__*/React.createElement(InspectionReport, {
43908
+ fiReport: applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$a11 = applicationDetails.applicationData) === null || _applicationDetails$a11 === void 0 ? void 0 : (_applicationDetails$a12 = _applicationDetails$a11.additionalDetails) === null || _applicationDetails$a12 === void 0 ? void 0 : _applicationDetails$a12.fieldinspection_pending
42662
43909
  }), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet3 = detail.additionalDetails) === null || _detail$additionalDet3 === void 0 ? void 0 : _detail$additionalDet3.floors) && /*#__PURE__*/React.createElement(PropertyFloors, {
42663
43910
  floors: detail === null || detail === void 0 ? void 0 : (_detail$additionalDet4 = detail.additionalDetails) === null || _detail$additionalDet4 === void 0 ? void 0 : _detail$additionalDet4.floors
42664
43911
  }), (detail === null || detail === void 0 ? void 0 : (_detail$additionalDet5 = detail.additionalDetails) === null || _detail$additionalDet5 === void 0 ? void 0 : _detail$additionalDet5.owners) && /*#__PURE__*/React.createElement(PropertyOwners, {
@@ -42757,9 +44004,9 @@ function ApplicationDetailsContent({
42757
44004
  onClick: toggleTimeline
42758
44005
  })))), /*#__PURE__*/React.createElement(CardSectionHeader, {
42759
44006
  style: {
42760
- marginBottom: '16px',
44007
+ marginBottom: "16px",
42761
44008
  marginTop: "16px",
42762
- fontSize: '24px'
44009
+ fontSize: "24px"
42763
44010
  }
42764
44011
  }, "DCB Details"), /*#__PURE__*/React.createElement("table", {
42765
44012
  border: "1px",
@@ -42883,7 +44130,41 @@ function ApplicationDetailsContent({
42883
44130
  style: tableStyles.th
42884
44131
  }, "Total Balance"), /*#__PURE__*/React.createElement("td", {
42885
44132
  style: tableStyles.td
42886
- }, totalBalanceTax)))));
44133
+ }, totalBalanceTax)))), /*#__PURE__*/React.createElement(ActionBar, {
44134
+ className: "clear-search-container",
44135
+ style: {
44136
+ display: "block"
44137
+ }
44138
+ }, /*#__PURE__*/React.createElement(SubmitBar, {
44139
+ label: "Make Property Active",
44140
+ style: {
44141
+ flex: 1
44142
+ },
44143
+ onSubmit: PropertyActive
44144
+ }), /*#__PURE__*/React.createElement(SubmitBar, {
44145
+ label: "Make Property Inactive",
44146
+ style: {
44147
+ marginLeft: "20px"
44148
+ },
44149
+ onSubmit: PropertyInActive
44150
+ }), /*#__PURE__*/React.createElement(SubmitBar, {
44151
+ label: "Edit Property",
44152
+ style: {
44153
+ marginLeft: "20px"
44154
+ },
44155
+ onSubmit: EditProperty
44156
+ }), /*#__PURE__*/React.createElement(SubmitBar, {
44157
+ label: "Access Property",
44158
+ style: {
44159
+ marginLeft: "20px"
44160
+ },
44161
+ onSubmit: AccessProperty
44162
+ })), showToast && /*#__PURE__*/React.createElement(Toast, {
44163
+ error: showToast.isError,
44164
+ label: t(showToast.label),
44165
+ onClose: closeToast,
44166
+ isDleteBtn: "false"
44167
+ }));
42887
44168
  }
42888
44169
 
42889
44170
  function ApplicationDetailsToast({
@@ -43022,6 +44303,7 @@ function ApplicationDetailsActionBar({
43022
44303
  isMenuBotton = true;
43023
44304
  isSingleButton = false;
43024
44305
  }
44306
+ console.log("workflow details: ", workflowDetails);
43025
44307
  return /*#__PURE__*/React.createElement(React.Fragment, null, !(workflowDetails !== null && workflowDetails !== void 0 && workflowDetails.isLoading) && isMenuBotton && !isSingleButton && /*#__PURE__*/React.createElement(ActionBar, {
43026
44308
  style: {
43027
44309
  ...ActionBarStyle
@@ -43055,7 +44337,7 @@ function ApplicationDetailsActionBar({
43055
44337
  }, t(`${forcedActionPrefix || `WF_EMPLOYEE_${businessService === null || businessService === void 0 ? void 0 : businessService.toUpperCase()}`}_${actions === null || actions === void 0 ? void 0 : (_actions$4 = actions[0]) === null || _actions$4 === void 0 ? void 0 : _actions$4.action}`))));
43056
44338
  }
43057
44339
 
43058
- const Close$7 = () => /*#__PURE__*/React.createElement("svg", {
44340
+ const Close$9 = () => /*#__PURE__*/React.createElement("svg", {
43059
44341
  xmlns: "http://www.w3.org/2000/svg",
43060
44342
  viewBox: "0 0 24 24",
43061
44343
  fill: "#FFFFFF"
@@ -43065,11 +44347,11 @@ const Close$7 = () => /*#__PURE__*/React.createElement("svg", {
43065
44347
  }), /*#__PURE__*/React.createElement("path", {
43066
44348
  d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
43067
44349
  }));
43068
- const CloseBtn$7 = props => {
44350
+ const CloseBtn$9 = props => {
43069
44351
  return /*#__PURE__*/React.createElement("div", {
43070
44352
  className: "icon-bg-secondary",
43071
44353
  onClick: props.onClick
43072
- }, /*#__PURE__*/React.createElement(Close$7, null));
44354
+ }, /*#__PURE__*/React.createElement(Close$9, null));
43073
44355
  };
43074
44356
  function ApplicationDetailsWarningPopup({
43075
44357
  action,
@@ -43086,7 +44368,7 @@ function ApplicationDetailsWarningPopup({
43086
44368
  headerBarMain: /*#__PURE__*/React.createElement("h1", {
43087
44369
  className: "heading-m"
43088
44370
  }, t("PT_DUES_ARE_PENDING")),
43089
- headerBarEnd: /*#__PURE__*/React.createElement(CloseBtn$7, {
44371
+ headerBarEnd: /*#__PURE__*/React.createElement(CloseBtn$9, {
43090
44372
  onClick: () => {
43091
44373
  closeWarningPopup();
43092
44374
  }
@@ -43203,6 +44485,7 @@ const ApplicationDetails = props => {
43203
44485
  }, [showToast]);
43204
44486
  function onActionSelect(action) {
43205
44487
  if (action) {
44488
+ var _action$redirectionUr8, _action$redirectionUr9, _action$redirectionUr10;
43206
44489
  if ((action === null || action === void 0 ? void 0 : action.action) == "EDIT PAY 2" && window.location.href.includes("bpa")) {
43207
44490
  window.location.assign(window.location.href.split("bpa")[0] + "editApplication/bpa" + window.location.href.split("bpa")[1]);
43208
44491
  }
@@ -43235,12 +44518,15 @@ const ApplicationDetails = props => {
43235
44518
  }
43236
44519
  } else if (!(action !== null && action !== void 0 && action.redirectionUrl) && (action === null || action === void 0 ? void 0 : action.action) != "EDIT PAY 2") {
43237
44520
  setShowModal(true);
44521
+ } else if ((action === null || action === void 0 ? void 0 : (_action$redirectionUr8 = action.redirectionUrl) === null || _action$redirectionUr8 === void 0 ? void 0 : (_action$redirectionUr9 = _action$redirectionUr8.state) === null || _action$redirectionUr9 === void 0 ? void 0 : (_action$redirectionUr10 = _action$redirectionUr9.applicationData) === null || _action$redirectionUr10 === void 0 ? void 0 : _action$redirectionUr10.workflowCode) === "DIRECTRENEWAL") {
44522
+ console.log("Got Inside Direct");
44523
+ setShowModal(true);
43238
44524
  } else {
43239
- var _action$redirectionUr8, _action$redirectionUr9;
44525
+ var _action$redirectionUr11, _action$redirectionUr12;
43240
44526
  history.push({
43241
- pathname: (_action$redirectionUr8 = action.redirectionUrl) === null || _action$redirectionUr8 === void 0 ? void 0 : _action$redirectionUr8.pathname,
44527
+ pathname: (_action$redirectionUr11 = action.redirectionUrl) === null || _action$redirectionUr11 === void 0 ? void 0 : _action$redirectionUr11.pathname,
43242
44528
  state: {
43243
- ...((_action$redirectionUr9 = action.redirectionUrl) === null || _action$redirectionUr9 === void 0 ? void 0 : _action$redirectionUr9.state)
44529
+ ...((_action$redirectionUr12 = action.redirectionUrl) === null || _action$redirectionUr12 === void 0 ? void 0 : _action$redirectionUr12.state)
43244
44530
  }
43245
44531
  });
43246
44532
  }
@@ -43257,9 +44543,14 @@ const ApplicationDetails = props => {
43257
44543
  setWarningPopUp(false);
43258
44544
  };
43259
44545
  const submitAction = async (data, nocData = false, isOBPS = {}) => {
43260
- var _data$Property, _data$Property$workfl, _data$Property$workfl2, _data$Licenses, _data$Licenses$, _data$Licenses$$comme, _data$WaterConnection, _data$WaterConnection2, _data$SewerageConnect, _data$SewerageConnect2, _data$BPA, _data$BPA$comment, _data$BPA2, _data$BPA3, _data$BPA3$additional, _data$BPA4, _data$BPA4$workflow;
43261
- if ((data === null || data === void 0 ? void 0 : (_data$Property = data.Property) === null || _data$Property === void 0 ? void 0 : (_data$Property$workfl = _data$Property.workflow) === null || _data$Property$workfl === void 0 ? void 0 : (_data$Property$workfl2 = _data$Property$workfl.comment) === null || _data$Property$workfl2 === void 0 ? void 0 : _data$Property$workfl2.length) == 0 || (data === null || data === void 0 ? void 0 : (_data$Licenses = data.Licenses) === null || _data$Licenses === void 0 ? void 0 : (_data$Licenses$ = _data$Licenses[0]) === null || _data$Licenses$ === void 0 ? void 0 : (_data$Licenses$$comme = _data$Licenses$.comment) === null || _data$Licenses$$comme === void 0 ? void 0 : _data$Licenses$$comme.length) == 0 || (data === null || data === void 0 ? void 0 : (_data$WaterConnection = data.WaterConnection) === null || _data$WaterConnection === void 0 ? void 0 : (_data$WaterConnection2 = _data$WaterConnection.comment) === null || _data$WaterConnection2 === void 0 ? void 0 : _data$WaterConnection2.length) == 0 || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect = data.SewerageConnection) === null || _data$SewerageConnect === void 0 ? void 0 : (_data$SewerageConnect2 = _data$SewerageConnect.comment) === null || _data$SewerageConnect2 === void 0 ? void 0 : _data$SewerageConnect2.length) == 0 || (data === null || data === void 0 ? void 0 : (_data$BPA = data.BPA) === null || _data$BPA === void 0 ? void 0 : (_data$BPA$comment = _data$BPA.comment) === null || _data$BPA$comment === void 0 ? void 0 : _data$BPA$comment.length) == 0) {
43262
- alert(t("Please fill in the comments before submitting"));
44546
+ var _data$Property, _data$Property$workfl, _data$Property$workfl2, _data$Licenses, _data$Licenses$, _data$Licenses2, _data$Licenses2$, _data$Licenses2$$addi, _data$Licenses2$$addi2, _data$Licenses3, _data$Licenses3$, _data$Licenses3$$comm, _data$WaterConnection, _data$WaterConnection2, _data$SewerageConnect, _data$SewerageConnect2, _data$BPA, _data$BPA$comment, _data$BPA2, _data$BPA3, _data$BPA3$additional, _data$BPA4, _data$BPA4$workflow;
44547
+ if ((data === null || data === void 0 ? void 0 : (_data$Property = data.Property) === null || _data$Property === void 0 ? void 0 : (_data$Property$workfl = _data$Property.workflow) === null || _data$Property$workfl === void 0 ? void 0 : (_data$Property$workfl2 = _data$Property$workfl.comment) === null || _data$Property$workfl2 === void 0 ? void 0 : _data$Property$workfl2.length) == 0 || ((data === null || data === void 0 ? void 0 : (_data$Licenses = data.Licenses) === null || _data$Licenses === void 0 ? void 0 : (_data$Licenses$ = _data$Licenses[0]) === null || _data$Licenses$ === void 0 ? void 0 : _data$Licenses$.action) === "INITIATE" ? (data === null || data === void 0 ? void 0 : (_data$Licenses2 = data.Licenses) === null || _data$Licenses2 === void 0 ? void 0 : (_data$Licenses2$ = _data$Licenses2[0]) === null || _data$Licenses2$ === void 0 ? void 0 : (_data$Licenses2$$addi = _data$Licenses2$.additionalDetail) === null || _data$Licenses2$$addi === void 0 ? void 0 : (_data$Licenses2$$addi2 = _data$Licenses2$$addi.validityYears) === null || _data$Licenses2$$addi2 === void 0 ? void 0 : _data$Licenses2$$addi2.length) == 0 : (data === null || data === void 0 ? void 0 : (_data$Licenses3 = data.Licenses) === null || _data$Licenses3 === void 0 ? void 0 : (_data$Licenses3$ = _data$Licenses3[0]) === null || _data$Licenses3$ === void 0 ? void 0 : (_data$Licenses3$$comm = _data$Licenses3$.comment) === null || _data$Licenses3$$comm === void 0 ? void 0 : _data$Licenses3$$comm.length) == 0) || (data === null || data === void 0 ? void 0 : (_data$WaterConnection = data.WaterConnection) === null || _data$WaterConnection === void 0 ? void 0 : (_data$WaterConnection2 = _data$WaterConnection.comment) === null || _data$WaterConnection2 === void 0 ? void 0 : _data$WaterConnection2.length) == 0 || (data === null || data === void 0 ? void 0 : (_data$SewerageConnect = data.SewerageConnection) === null || _data$SewerageConnect === void 0 ? void 0 : (_data$SewerageConnect2 = _data$SewerageConnect.comment) === null || _data$SewerageConnect2 === void 0 ? void 0 : _data$SewerageConnect2.length) == 0 || (data === null || data === void 0 ? void 0 : (_data$BPA = data.BPA) === null || _data$BPA === void 0 ? void 0 : (_data$BPA$comment = _data$BPA.comment) === null || _data$BPA$comment === void 0 ? void 0 : _data$BPA$comment.length) == 0) {
44548
+ var _data$Licenses4, _data$Licenses4$;
44549
+ if ((data === null || data === void 0 ? void 0 : (_data$Licenses4 = data.Licenses) === null || _data$Licenses4 === void 0 ? void 0 : (_data$Licenses4$ = _data$Licenses4[0]) === null || _data$Licenses4$ === void 0 ? void 0 : _data$Licenses4$.action) === "INITIATE") {
44550
+ alert(t("Please fill in the validity before submitting"));
44551
+ } else {
44552
+ alert(t("Please fill in the comments before submitting"));
44553
+ }
43263
44554
  } else if ((data === null || data === void 0 ? void 0 : (_data$BPA2 = data.BPA) === null || _data$BPA2 === void 0 ? void 0 : _data$BPA2.businessService) == "BPA" && !(data !== null && data !== void 0 && (_data$BPA3 = data.BPA) !== null && _data$BPA3 !== void 0 && (_data$BPA3$additional = _data$BPA3.additionalDetails) !== null && _data$BPA3$additional !== void 0 && _data$BPA3$additional.blockingReason) && (data === null || data === void 0 ? void 0 : (_data$BPA4 = data.BPA) === null || _data$BPA4 === void 0 ? void 0 : (_data$BPA4$workflow = _data$BPA4.workflow) === null || _data$BPA4$workflow === void 0 ? void 0 : _data$BPA4$workflow.action) == "BLOCK") {
43264
44555
  alert(t("Please select Blocking reason"));
43265
44556
  } else {
@@ -43307,7 +44598,7 @@ const ApplicationDetails = props => {
43307
44598
  setTimeout(closeToast, 5000);
43308
44599
  },
43309
44600
  onSuccess: (data, variables) => {
43310
- var _data$Amendments;
44601
+ var _data$Amendments, _data$Licenses5, _data$Licenses$2;
43311
44602
  sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS");
43312
44603
  setIsEnableLoader(false);
43313
44604
  if (isOBPS !== null && isOBPS !== void 0 && isOBPS.bpa) {
@@ -43352,6 +44643,15 @@ const ApplicationDetails = props => {
43352
44643
  }
43353
44644
  return;
43354
44645
  }
44646
+ if ((data === null || data === void 0 ? void 0 : (_data$Licenses5 = data.Licenses) === null || _data$Licenses5 === void 0 ? void 0 : _data$Licenses5.length) > 0 && data !== null && data !== void 0 && (_data$Licenses$2 = data.Licenses[0]) !== null && _data$Licenses$2 !== void 0 && _data$Licenses$2.applicationNumber) {
44647
+ var _data$Licenses$3;
44648
+ setShowToast({
44649
+ key: "success",
44650
+ action: selectedAction
44651
+ });
44652
+ history.replace(`/digit-ui/employee/tl/application-details/${data === null || data === void 0 ? void 0 : (_data$Licenses$3 = data.Licenses[0]) === null || _data$Licenses$3 === void 0 ? void 0 : _data$Licenses$3.applicationNumber}`);
44653
+ return;
44654
+ }
43355
44655
  setShowToast({
43356
44656
  key: "success",
43357
44657
  action: selectedAction
@@ -43413,7 +44713,7 @@ const ApplicationDetails = props => {
43413
44713
  showTimeLine: showTimeLine,
43414
44714
  oldValue: oldValue,
43415
44715
  isInfoLabel: isInfoLabel
43416
- }), showModal ? /*#__PURE__*/React.createElement(ActionModal$7, {
44716
+ }), showModal ? /*#__PURE__*/React.createElement(ActionModal$9, {
43417
44717
  t: t,
43418
44718
  action: selectedAction,
43419
44719
  tenantId: tenantId,