@mseva/upyog-ui-module-chb 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2210 -2204
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +2168 -2146
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -45608,2368 +45608,2295 @@ const NewADSStepperForm = () => {
|
|
|
45608
45608
|
}));
|
|
45609
45609
|
};
|
|
45610
45610
|
|
|
45611
|
-
|
|
45612
|
-
|
|
45613
|
-
|
|
45614
|
-
|
|
45615
|
-
|
|
45616
|
-
|
|
45617
|
-
|
|
45618
|
-
|
|
45619
|
-
|
|
45620
|
-
|
|
45621
|
-
|
|
45622
|
-
|
|
45623
|
-
|
|
45624
|
-
|
|
45625
|
-
|
|
45626
|
-
|
|
45627
|
-
|
|
45628
|
-
|
|
45629
|
-
|
|
45630
|
-
|
|
45631
|
-
|
|
45632
|
-
|
|
45633
|
-
}
|
|
45634
|
-
|
|
45635
|
-
|
|
45636
|
-
|
|
45637
|
-
|
|
45638
|
-
|
|
45639
|
-
|
|
45640
|
-
|
|
45641
|
-
|
|
45642
|
-
|
|
45611
|
+
const CHBCitizenSecond = _ref => {
|
|
45612
|
+
let {
|
|
45613
|
+
onGoBack,
|
|
45614
|
+
goNext,
|
|
45615
|
+
currentStepData,
|
|
45616
|
+
t
|
|
45617
|
+
} = _ref;
|
|
45618
|
+
const tenantId = window.location.href.includes("employee") ? Digit.ULBService.getCurrentPermanentCity() : localStorage.getItem("CITIZEN.CITY");
|
|
45619
|
+
const isCitizen = window.location.href.includes("citizen");
|
|
45620
|
+
const [getHallDetails, setHallDetails] = React.useState([]);
|
|
45621
|
+
const [getHallCodes, setHallCodes] = React.useState([]);
|
|
45622
|
+
const [getSlots, setSlots] = React.useState([]);
|
|
45623
|
+
const [loader, setLoader] = React.useState(false);
|
|
45624
|
+
const [showInfo, setShowInfo] = React.useState(false);
|
|
45625
|
+
const [error, setError] = React.useState(null);
|
|
45626
|
+
const {
|
|
45627
|
+
control,
|
|
45628
|
+
handleSubmit,
|
|
45629
|
+
setValue,
|
|
45630
|
+
reset,
|
|
45631
|
+
formState: {
|
|
45632
|
+
errors
|
|
45633
|
+
},
|
|
45634
|
+
getValues,
|
|
45635
|
+
watch
|
|
45636
|
+
} = reactHookForm.useForm({
|
|
45637
|
+
defaultValues: {
|
|
45638
|
+
shouldUnregister: false,
|
|
45639
|
+
halls: [{
|
|
45640
|
+
startDate: "",
|
|
45641
|
+
endDate: "",
|
|
45642
|
+
startTime: "",
|
|
45643
|
+
endTime: ""
|
|
45644
|
+
}]
|
|
45643
45645
|
}
|
|
45644
|
-
return true;
|
|
45645
|
-
}
|
|
45646
|
-
function focusable(element, isTabIndexNotNaN) {
|
|
45647
|
-
var nodeName = element.nodeName.toLowerCase();
|
|
45648
|
-
var res = tabbableNode.test(nodeName) && !element.disabled || (nodeName === "a" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN);
|
|
45649
|
-
return res && visible(element);
|
|
45650
|
-
}
|
|
45651
|
-
function tabbable(element) {
|
|
45652
|
-
var tabIndex = element.getAttribute("tabindex");
|
|
45653
|
-
if (tabIndex === null) tabIndex = undefined;
|
|
45654
|
-
var isTabIndexNaN = isNaN(tabIndex);
|
|
45655
|
-
return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN);
|
|
45656
|
-
}
|
|
45657
|
-
function findTabbableDescendants(element) {
|
|
45658
|
-
var descendants = [].slice.call(element.querySelectorAll("*"), 0).reduce(function (finished, el) {
|
|
45659
|
-
return finished.concat(!el.shadowRoot ? [el] : findTabbableDescendants(el.shadowRoot));
|
|
45660
|
-
}, []);
|
|
45661
|
-
return descendants.filter(tabbable);
|
|
45662
|
-
}
|
|
45663
|
-
module.exports = exports["default"];
|
|
45664
|
-
});
|
|
45665
|
-
unwrapExports(tabbable_1);
|
|
45666
|
-
|
|
45667
|
-
var focusManager = createCommonjsModule(function (module, exports) {
|
|
45668
|
-
|
|
45669
|
-
Object.defineProperty(exports, "__esModule", {
|
|
45670
|
-
value: true
|
|
45671
45646
|
});
|
|
45672
|
-
|
|
45673
|
-
|
|
45674
|
-
|
|
45675
|
-
|
|
45676
|
-
|
|
45677
|
-
|
|
45678
|
-
|
|
45679
|
-
|
|
45680
|
-
|
|
45681
|
-
|
|
45682
|
-
|
|
45683
|
-
|
|
45684
|
-
|
|
45685
|
-
|
|
45686
|
-
|
|
45687
|
-
|
|
45688
|
-
|
|
45689
|
-
|
|
45690
|
-
|
|
45691
|
-
|
|
45692
|
-
|
|
45693
|
-
|
|
45694
|
-
|
|
45695
|
-
|
|
45696
|
-
|
|
45697
|
-
|
|
45698
|
-
|
|
45699
|
-
|
|
45700
|
-
|
|
45701
|
-
|
|
45702
|
-
|
|
45703
|
-
|
|
45704
|
-
|
|
45705
|
-
}
|
|
45706
|
-
|
|
45707
|
-
|
|
45708
|
-
|
|
45709
|
-
|
|
45710
|
-
|
|
45711
|
-
|
|
45712
|
-
|
|
45713
|
-
|
|
45714
|
-
|
|
45715
|
-
|
|
45716
|
-
|
|
45717
|
-
|
|
45718
|
-
|
|
45719
|
-
|
|
45720
|
-
|
|
45721
|
-
|
|
45722
|
-
|
|
45723
|
-
}
|
|
45724
|
-
function returnFocus() {
|
|
45725
|
-
var preventScroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
45726
|
-
var toFocus = null;
|
|
45647
|
+
const {
|
|
45648
|
+
data: CHBLocations = [],
|
|
45649
|
+
isLoading: CHBLocationLoading
|
|
45650
|
+
} = Digit.Hooks.useCustomMDMS(tenantId, "CHB", [{
|
|
45651
|
+
name: "Location"
|
|
45652
|
+
}]);
|
|
45653
|
+
const {
|
|
45654
|
+
data: CHBDetails = [],
|
|
45655
|
+
isLoading: CHBLoading
|
|
45656
|
+
} = Digit.Hooks.useCustomMDMS(tenantId, "CHB", [{
|
|
45657
|
+
name: "CommunityHalls"
|
|
45658
|
+
}]);
|
|
45659
|
+
const {
|
|
45660
|
+
data: CHBPurpose = [],
|
|
45661
|
+
isLoading: CHBPurposeLoading
|
|
45662
|
+
} = Digit.Hooks.useCustomMDMS(tenantId, "CHB", [{
|
|
45663
|
+
name: "Purpose"
|
|
45664
|
+
}]);
|
|
45665
|
+
const {
|
|
45666
|
+
data: SpecialCategory = [],
|
|
45667
|
+
isLoading: CHBSpecialCategoryLoading
|
|
45668
|
+
} = Digit.Hooks.useCustomMDMS(tenantId, "CHB", [{
|
|
45669
|
+
name: "SpecialCategory"
|
|
45670
|
+
}]);
|
|
45671
|
+
const {
|
|
45672
|
+
data: CHBHallCode = [],
|
|
45673
|
+
isLoading: CHBHallCodeLoading
|
|
45674
|
+
} = Digit.Hooks.useCustomMDMS(tenantId, "CHB", [{
|
|
45675
|
+
name: "HallCode"
|
|
45676
|
+
}]);
|
|
45677
|
+
const {
|
|
45678
|
+
data: CHBReason = [],
|
|
45679
|
+
isLoading: CHBReasonLoading
|
|
45680
|
+
} = Digit.Hooks.useCustomMDMS(tenantId, "CHB", [{
|
|
45681
|
+
name: "DiscountReason"
|
|
45682
|
+
}]);
|
|
45683
|
+
const {
|
|
45684
|
+
data: CHBCalculationType = [],
|
|
45685
|
+
isLoading: CHBCalcLoading
|
|
45686
|
+
} = Digit.Hooks.useCustomMDMS(tenantId, "CHB", [{
|
|
45687
|
+
name: "CalculationType"
|
|
45688
|
+
}]);
|
|
45689
|
+
const fiterHalls = selected => {
|
|
45690
|
+
var _CHBDetails$CHB, _CHBDetails$CHB$Commu, _CHBHallCode$CHB;
|
|
45691
|
+
const filteredHalls = (CHBDetails === null || CHBDetails === void 0 ? void 0 : (_CHBDetails$CHB = CHBDetails.CHB) === null || _CHBDetails$CHB === void 0 ? void 0 : (_CHBDetails$CHB$Commu = _CHBDetails$CHB.CommunityHalls) === null || _CHBDetails$CHB$Commu === void 0 ? void 0 : _CHBDetails$CHB$Commu.filter(hall => hall.locationCode === (selected === null || selected === void 0 ? void 0 : selected.code))) || [];
|
|
45692
|
+
setHallDetails(filteredHalls);
|
|
45693
|
+
const hallInfo = CHBHallCode === null || CHBHallCode === void 0 ? void 0 : (_CHBHallCode$CHB = CHBHallCode.CHB) === null || _CHBHallCode$CHB === void 0 ? void 0 : _CHBHallCode$CHB.HallCode;
|
|
45694
|
+
const getHallCodesData = hallInfo === null || hallInfo === void 0 ? void 0 : hallInfo.filter(item => (item === null || item === void 0 ? void 0 : item.communityHallId) == (selected === null || selected === void 0 ? void 0 : selected.communityHallId));
|
|
45695
|
+
setHallCodes(getHallCodesData);
|
|
45696
|
+
};
|
|
45697
|
+
const slotsSearch = function (data) {
|
|
45727
45698
|
try {
|
|
45728
|
-
|
|
45729
|
-
|
|
45730
|
-
|
|
45731
|
-
|
|
45699
|
+
var _getValues, _getValues2;
|
|
45700
|
+
setLoader(true);
|
|
45701
|
+
const payload = {
|
|
45702
|
+
tenantId: tenantId,
|
|
45703
|
+
communityHallCode: data.communityHallId,
|
|
45704
|
+
hallCode: data === null || data === void 0 ? void 0 : data.HallCode,
|
|
45705
|
+
bookingStartDate: (_getValues = getValues()) === null || _getValues === void 0 ? void 0 : _getValues.startDate,
|
|
45706
|
+
bookingEndDate: (_getValues2 = getValues()) === null || _getValues2 === void 0 ? void 0 : _getValues2.endDate,
|
|
45707
|
+
isTimerRequired: false
|
|
45708
|
+
};
|
|
45709
|
+
return Promise.resolve(_catch(function () {
|
|
45710
|
+
return Promise.resolve(Digit.CHBServices.slot_search({
|
|
45711
|
+
filters: payload
|
|
45712
|
+
})).then(function (response) {
|
|
45713
|
+
setLoader(false);
|
|
45714
|
+
setSlots(response === null || response === void 0 ? void 0 : response.hallSlotAvailabiltityDetails);
|
|
45715
|
+
return response;
|
|
45732
45716
|
});
|
|
45733
|
-
}
|
|
45734
|
-
|
|
45717
|
+
}, function () {
|
|
45718
|
+
setLoader(false);
|
|
45719
|
+
}));
|
|
45735
45720
|
} catch (e) {
|
|
45736
|
-
|
|
45737
|
-
}
|
|
45738
|
-
}
|
|
45739
|
-
function popWithoutFocus() {
|
|
45740
|
-
focusLaterElements.length > 0 && focusLaterElements.pop();
|
|
45741
|
-
}
|
|
45742
|
-
function setupScopedFocus(element) {
|
|
45743
|
-
modalElement = element;
|
|
45744
|
-
if (window.addEventListener) {
|
|
45745
|
-
window.addEventListener("blur", handleBlur, false);
|
|
45746
|
-
document.addEventListener("focus", handleFocus, true);
|
|
45747
|
-
} else {
|
|
45748
|
-
window.attachEvent("onBlur", handleBlur);
|
|
45749
|
-
document.attachEvent("onFocus", handleFocus);
|
|
45750
|
-
}
|
|
45751
|
-
}
|
|
45752
|
-
function teardownScopedFocus() {
|
|
45753
|
-
modalElement = null;
|
|
45754
|
-
if (window.addEventListener) {
|
|
45755
|
-
window.removeEventListener("blur", handleBlur);
|
|
45756
|
-
document.removeEventListener("focus", handleFocus);
|
|
45757
|
-
} else {
|
|
45758
|
-
window.detachEvent("onBlur", handleBlur);
|
|
45759
|
-
document.detachEvent("onFocus", handleFocus);
|
|
45721
|
+
return Promise.reject(e);
|
|
45760
45722
|
}
|
|
45761
|
-
}
|
|
45762
|
-
|
|
45763
|
-
|
|
45764
|
-
|
|
45765
|
-
|
|
45766
|
-
|
|
45767
|
-
|
|
45768
|
-
|
|
45769
|
-
|
|
45770
|
-
|
|
45771
|
-
|
|
45772
|
-
|
|
45773
|
-
|
|
45774
|
-
|
|
45723
|
+
};
|
|
45724
|
+
const onSubmit = data => {
|
|
45725
|
+
var _Digit$UserService$ge, _data$reason, _data$slots, _CHBCalculationType$C, _match$getHallDetails, _match$getHallDetails2, _getHallDetails$2, _getHallDetails$3, _data$siteId, _data$purpose, _data$specialCategory;
|
|
45726
|
+
const userInfo = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {};
|
|
45727
|
+
const now = Date.now();
|
|
45728
|
+
const additionalDetails = _extends({}, (data === null || data === void 0 ? void 0 : (_data$reason = data.reason) === null || _data$reason === void 0 ? void 0 : _data$reason.reasonName) && {
|
|
45729
|
+
reason: data.reason.reasonName
|
|
45730
|
+
}, (data === null || data === void 0 ? void 0 : data.discountAmount) && {
|
|
45731
|
+
discountAmount: data.discountAmount
|
|
45732
|
+
});
|
|
45733
|
+
const bookingSlotDetails = data === null || data === void 0 ? void 0 : (_data$slots = data.slots) === null || _data$slots === void 0 ? void 0 : _data$slots.map(slot => {
|
|
45734
|
+
var _CHBHallCode$CHB2, _CHBHallCode$CHB2$Hal;
|
|
45735
|
+
const hallInfo = CHBHallCode === null || CHBHallCode === void 0 ? void 0 : (_CHBHallCode$CHB2 = CHBHallCode.CHB) === null || _CHBHallCode$CHB2 === void 0 ? void 0 : (_CHBHallCode$CHB2$Hal = _CHBHallCode$CHB2.HallCode) === null || _CHBHallCode$CHB2$Hal === void 0 ? void 0 : _CHBHallCode$CHB2$Hal.find(h => h.HallCode === slot.hallCode);
|
|
45736
|
+
const formattedDate = slot !== null && slot !== void 0 && slot.bookingDate ? format(parse(slot.bookingDate, "dd-MM-yyyy", new Date()), "yyyy-MM-dd") : null;
|
|
45737
|
+
return {
|
|
45738
|
+
bookingDate: formattedDate,
|
|
45739
|
+
bookingEndDate: formattedDate,
|
|
45740
|
+
bookingFromTime: (slot === null || slot === void 0 ? void 0 : slot.fromTime) || "00:00",
|
|
45741
|
+
bookingToTime: (slot === null || slot === void 0 ? void 0 : slot.toTime) || "23:59",
|
|
45742
|
+
hallCode: slot === null || slot === void 0 ? void 0 : slot.hallCode,
|
|
45743
|
+
status: "INITIATE",
|
|
45744
|
+
capacity: (hallInfo === null || hallInfo === void 0 ? void 0 : hallInfo.capacity) || null
|
|
45745
|
+
};
|
|
45746
|
+
});
|
|
45747
|
+
const match = (_CHBCalculationType$C = CHBCalculationType.CHB.CalculationType) === null || _CHBCalculationType$C === void 0 ? void 0 : _CHBCalculationType$C.find(item => {
|
|
45748
|
+
var _getHallDetails$;
|
|
45749
|
+
return Object.keys(item).includes(getHallDetails === null || getHallDetails === void 0 ? void 0 : (_getHallDetails$ = getHallDetails[0]) === null || _getHallDetails$ === void 0 ? void 0 : _getHallDetails$.communityHallId);
|
|
45750
|
+
});
|
|
45751
|
+
const amount = (match === null || match === void 0 ? void 0 : (_match$getHallDetails = match[getHallDetails === null || getHallDetails === void 0 ? void 0 : (_getHallDetails$2 = getHallDetails[0]) === null || _getHallDetails$2 === void 0 ? void 0 : _getHallDetails$2.communityHallId]) === null || _match$getHallDetails === void 0 ? void 0 : (_match$getHallDetails2 = _match$getHallDetails[0]) === null || _match$getHallDetails2 === void 0 ? void 0 : _match$getHallDetails2.amount) || null;
|
|
45752
|
+
const slotCount = Array.isArray(bookingSlotDetails) ? bookingSlotDetails.length : 0;
|
|
45753
|
+
const numericAmount = Number(amount) || 0;
|
|
45754
|
+
const finalAmount = numericAmount * slotCount;
|
|
45755
|
+
const payload = {
|
|
45756
|
+
hallsBookingApplication: _extends({
|
|
45757
|
+
tenantId
|
|
45758
|
+
}, additionalDetails && {
|
|
45759
|
+
additionalDetails
|
|
45760
|
+
}, {
|
|
45761
|
+
bookingStatus: "INITIATED",
|
|
45762
|
+
applicationDate: now,
|
|
45763
|
+
communityHallCode: (getHallDetails === null || getHallDetails === void 0 ? void 0 : (_getHallDetails$3 = getHallDetails[0]) === null || _getHallDetails$3 === void 0 ? void 0 : _getHallDetails$3.communityHallId) || "",
|
|
45764
|
+
communityHallName: data === null || data === void 0 ? void 0 : (_data$siteId = data.siteId) === null || _data$siteId === void 0 ? void 0 : _data$siteId.name,
|
|
45765
|
+
purpose: {
|
|
45766
|
+
purpose: data === null || data === void 0 ? void 0 : (_data$purpose = data.purpose) === null || _data$purpose === void 0 ? void 0 : _data$purpose.code
|
|
45767
|
+
},
|
|
45768
|
+
amount: finalAmount,
|
|
45769
|
+
specialCategory: {
|
|
45770
|
+
category: data === null || data === void 0 ? void 0 : (_data$specialCategory = data.specialCategory) === null || _data$specialCategory === void 0 ? void 0 : _data$specialCategory.code
|
|
45771
|
+
},
|
|
45772
|
+
purposeDescription: data === null || data === void 0 ? void 0 : data.purposeDescription,
|
|
45773
|
+
bookingSlotDetails,
|
|
45774
|
+
owners: [{
|
|
45775
|
+
name: userInfo === null || userInfo === void 0 ? void 0 : userInfo.name,
|
|
45776
|
+
mobileNumber: userInfo === null || userInfo === void 0 ? void 0 : userInfo.mobileNumber,
|
|
45777
|
+
emailId: userInfo === null || userInfo === void 0 ? void 0 : userInfo.emailId,
|
|
45778
|
+
type: userInfo === null || userInfo === void 0 ? void 0 : userInfo.type
|
|
45779
|
+
}],
|
|
45780
|
+
workflow: {
|
|
45781
|
+
action: "INITIATE",
|
|
45782
|
+
businessService: "CommunityHallBooking",
|
|
45783
|
+
moduleName: "CommunityHallModule"
|
|
45784
|
+
}
|
|
45785
|
+
})
|
|
45775
45786
|
};
|
|
45776
|
-
|
|
45777
|
-
|
|
45778
|
-
|
|
45779
|
-
|
|
45780
|
-
|
|
45781
|
-
|
|
45782
|
-
|
|
45783
|
-
|
|
45784
|
-
|
|
45785
|
-
|
|
45786
|
-
|
|
45787
|
-
|
|
45788
|
-
|
|
45789
|
-
|
|
45790
|
-
|
|
45791
|
-
|
|
45792
|
-
|
|
45793
|
-
|
|
45794
|
-
|
|
45795
|
-
|
|
45796
|
-
|
|
45797
|
-
|
|
45798
|
-
|
|
45799
|
-
|
|
45800
|
-
|
|
45787
|
+
console.log("finalpayload", payload);
|
|
45788
|
+
goNext(payload);
|
|
45789
|
+
};
|
|
45790
|
+
React.useEffect(() => {
|
|
45791
|
+
var _currentStepData$owne;
|
|
45792
|
+
const formattedData = currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$owne = currentStepData.ownerDetails) === null || _currentStepData$owne === void 0 ? void 0 : _currentStepData$owne.hallsBookingApplication;
|
|
45793
|
+
if (formattedData) {
|
|
45794
|
+
var _CHBHallCode$CHB3, _CHBReason$CHB, _formattedData$bookin3, _formattedData$bookin4, _formattedData$bookin5, _formattedData$additi2;
|
|
45795
|
+
const communityHallsOptions = CHBLocations.CHB.CommunityHalls || [];
|
|
45796
|
+
const purposeOptions = CHBPurpose.CHB.Purpose || [];
|
|
45797
|
+
const specialCategoryOptions = SpecialCategory.CHB.SpecialCategory || [];
|
|
45798
|
+
const hallCodeOptions = CHBHallCode === null || CHBHallCode === void 0 ? void 0 : (_CHBHallCode$CHB3 = CHBHallCode.CHB) === null || _CHBHallCode$CHB3 === void 0 ? void 0 : _CHBHallCode$CHB3.HallCode;
|
|
45799
|
+
const discReasonOptions = CHBReason === null || CHBReason === void 0 ? void 0 : (_CHBReason$CHB = CHBReason.CHB) === null || _CHBReason$CHB === void 0 ? void 0 : _CHBReason$CHB.DiscountReason;
|
|
45800
|
+
const selectedCommHall = communityHallsOptions === null || communityHallsOptions === void 0 ? void 0 : communityHallsOptions.find(item => (item === null || item === void 0 ? void 0 : item.communityHallId) == (formattedData === null || formattedData === void 0 ? void 0 : formattedData.communityHallCode));
|
|
45801
|
+
const selectedPurpose = purposeOptions === null || purposeOptions === void 0 ? void 0 : purposeOptions.find(item => {
|
|
45802
|
+
var _formattedData$purpos;
|
|
45803
|
+
return (item === null || item === void 0 ? void 0 : item.code) == (formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$purpos = formattedData.purpose) === null || _formattedData$purpos === void 0 ? void 0 : _formattedData$purpos.purpose);
|
|
45804
|
+
});
|
|
45805
|
+
const selectedSpecialCat = specialCategoryOptions === null || specialCategoryOptions === void 0 ? void 0 : specialCategoryOptions.find(item => {
|
|
45806
|
+
var _formattedData$specia;
|
|
45807
|
+
return (item === null || item === void 0 ? void 0 : item.code) == (formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$specia = formattedData.specialCategory) === null || _formattedData$specia === void 0 ? void 0 : _formattedData$specia.category);
|
|
45808
|
+
});
|
|
45809
|
+
const selectHallCode = hallCodeOptions === null || hallCodeOptions === void 0 ? void 0 : hallCodeOptions.find(item => {
|
|
45810
|
+
var _formattedData$bookin, _formattedData$bookin2;
|
|
45811
|
+
return (item === null || item === void 0 ? void 0 : item.HallCode) == (formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$bookin = formattedData.bookingSlotDetails) === null || _formattedData$bookin === void 0 ? void 0 : (_formattedData$bookin2 = _formattedData$bookin[0]) === null || _formattedData$bookin2 === void 0 ? void 0 : _formattedData$bookin2.hallCode);
|
|
45812
|
+
});
|
|
45813
|
+
const selectReason = discReasonOptions === null || discReasonOptions === void 0 ? void 0 : discReasonOptions.find(item => {
|
|
45814
|
+
var _formattedData$additi;
|
|
45815
|
+
return (item === null || item === void 0 ? void 0 : item.reasonName) == (formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$additi = formattedData.additionalDetails) === null || _formattedData$additi === void 0 ? void 0 : _formattedData$additi.reason);
|
|
45816
|
+
});
|
|
45817
|
+
setValue("siteId", selectedCommHall || null);
|
|
45818
|
+
setValue("hallCode", selectHallCode || null);
|
|
45819
|
+
setValue("startDate", formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$bookin3 = formattedData.bookingSlotDetails) === null || _formattedData$bookin3 === void 0 ? void 0 : (_formattedData$bookin4 = _formattedData$bookin3[0]) === null || _formattedData$bookin4 === void 0 ? void 0 : _formattedData$bookin4.bookingDate);
|
|
45820
|
+
setValue("endDate", formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$bookin5 = formattedData.bookingSlotDetails.at(-1)) === null || _formattedData$bookin5 === void 0 ? void 0 : _formattedData$bookin5.bookingEndDate);
|
|
45821
|
+
setShowInfo(true);
|
|
45822
|
+
fiterHalls(selectedCommHall);
|
|
45823
|
+
slotsSearch(selectHallCode).then(response => {
|
|
45824
|
+
const slotsData = (response === null || response === void 0 ? void 0 : response.hallSlotAvailabiltityDetails) || [];
|
|
45825
|
+
setSlots(slotsData);
|
|
45826
|
+
setValue("slots", slotsData);
|
|
45827
|
+
});
|
|
45828
|
+
setValue("purpose", selectedPurpose || null);
|
|
45829
|
+
setValue("specialCategory", selectedSpecialCat || null);
|
|
45830
|
+
setValue("purposeDescription", formattedData.purposeDescription || "");
|
|
45831
|
+
setValue("discountAmount", (formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$additi2 = formattedData.additionalDetails) === null || _formattedData$additi2 === void 0 ? void 0 : _formattedData$additi2.discountAmount) || "");
|
|
45832
|
+
setValue("reason", selectReason || null);
|
|
45801
45833
|
}
|
|
45802
|
-
|
|
45803
|
-
|
|
45804
|
-
|
|
45805
|
-
|
|
45834
|
+
}, [currentStepData, setValue]);
|
|
45835
|
+
const startDate = watch("startDate");
|
|
45836
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("form", {
|
|
45837
|
+
onSubmit: handleSubmit(onSubmit)
|
|
45838
|
+
}, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("SELECT_HALL_NAME"), " ", /*#__PURE__*/React__default.createElement("span", {
|
|
45839
|
+
style: {
|
|
45840
|
+
color: "red"
|
|
45806
45841
|
}
|
|
45807
|
-
|
|
45808
|
-
|
|
45809
|
-
|
|
45810
|
-
|
|
45811
|
-
|
|
45812
|
-
|
|
45842
|
+
}, "*")), /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
45843
|
+
control: control,
|
|
45844
|
+
name: "siteId",
|
|
45845
|
+
rules: {
|
|
45846
|
+
required: t("HALL_NAME_REQ")
|
|
45847
|
+
},
|
|
45848
|
+
render: props => {
|
|
45849
|
+
var _CHBLocations$CHB;
|
|
45850
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
45851
|
+
style: {
|
|
45852
|
+
marginBottom: 0
|
|
45853
|
+
},
|
|
45854
|
+
className: "form-field",
|
|
45855
|
+
select: e => {
|
|
45856
|
+
props.onChange(e);
|
|
45857
|
+
fiterHalls(e);
|
|
45858
|
+
setValue("hallCode", null);
|
|
45859
|
+
setValue("startDate", "");
|
|
45860
|
+
setValue("endDate", "");
|
|
45861
|
+
setSlots([]);
|
|
45862
|
+
setShowInfo(false);
|
|
45863
|
+
},
|
|
45864
|
+
selected: props.value,
|
|
45865
|
+
option: CHBLocations === null || CHBLocations === void 0 ? void 0 : (_CHBLocations$CHB = CHBLocations.CHB) === null || _CHBLocations$CHB === void 0 ? void 0 : _CHBLocations$CHB.CommunityHalls,
|
|
45866
|
+
optionKey: "name"
|
|
45867
|
+
});
|
|
45813
45868
|
}
|
|
45814
|
-
|
|
45815
|
-
|
|
45816
|
-
|
|
45817
|
-
target = shiftKey ? tail : head;
|
|
45818
|
-
target.focus();
|
|
45819
|
-
return;
|
|
45869
|
+
}), errors.siteId && /*#__PURE__*/React__default.createElement("p", {
|
|
45870
|
+
style: {
|
|
45871
|
+
color: "red"
|
|
45820
45872
|
}
|
|
45821
|
-
|
|
45822
|
-
|
|
45823
|
-
|
|
45824
|
-
module.exports = exports["default"];
|
|
45825
|
-
});
|
|
45826
|
-
unwrapExports(scopeTab_1);
|
|
45827
|
-
|
|
45828
|
-
var __DEV__ = process.env.NODE_ENV !== 'production';
|
|
45829
|
-
var warning = function () {};
|
|
45830
|
-
if (__DEV__) {
|
|
45831
|
-
var printWarning$2 = function printWarning(format, args) {
|
|
45832
|
-
var len = arguments.length;
|
|
45833
|
-
args = new Array(len > 1 ? len - 1 : 0);
|
|
45834
|
-
for (var key = 1; key < len; key++) {
|
|
45835
|
-
args[key - 1] = arguments[key];
|
|
45873
|
+
}, errors.siteId.message)), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, {
|
|
45874
|
+
style: {
|
|
45875
|
+
marginTop: "20px"
|
|
45836
45876
|
}
|
|
45837
|
-
|
|
45838
|
-
|
|
45839
|
-
|
|
45840
|
-
});
|
|
45841
|
-
if (typeof console !== 'undefined') {
|
|
45842
|
-
console.error(message);
|
|
45877
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("SELECT_DATE"), " ", /*#__PURE__*/React__default.createElement("span", {
|
|
45878
|
+
style: {
|
|
45879
|
+
color: "red"
|
|
45843
45880
|
}
|
|
45844
|
-
|
|
45845
|
-
|
|
45846
|
-
|
|
45847
|
-
|
|
45848
|
-
|
|
45849
|
-
|
|
45850
|
-
|
|
45851
|
-
|
|
45852
|
-
|
|
45881
|
+
}, "*")), /*#__PURE__*/React__default.createElement("div", {
|
|
45882
|
+
style: {
|
|
45883
|
+
width: "50%"
|
|
45884
|
+
},
|
|
45885
|
+
className: "field"
|
|
45886
|
+
}, /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
45887
|
+
control: control,
|
|
45888
|
+
name: "startDate",
|
|
45889
|
+
rules: {
|
|
45890
|
+
required: t("START_DATE_REQ")
|
|
45891
|
+
},
|
|
45892
|
+
render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
45893
|
+
style: {
|
|
45894
|
+
marginBottom: 0
|
|
45895
|
+
},
|
|
45896
|
+
type: "date",
|
|
45897
|
+
className: "form-field",
|
|
45898
|
+
value: props.value,
|
|
45899
|
+
min: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString().split("T")[0],
|
|
45900
|
+
onChange: e => {
|
|
45901
|
+
props.onChange(e.target.value);
|
|
45902
|
+
},
|
|
45903
|
+
onBlur: e => {
|
|
45904
|
+
props.onBlur(e);
|
|
45905
|
+
}
|
|
45906
|
+
})
|
|
45907
|
+
}), errors.startDate && /*#__PURE__*/React__default.createElement("p", {
|
|
45908
|
+
style: {
|
|
45909
|
+
color: "red"
|
|
45853
45910
|
}
|
|
45854
|
-
|
|
45855
|
-
|
|
45911
|
+
}, errors.startDate.message))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, {
|
|
45912
|
+
style: {
|
|
45913
|
+
marginTop: "20px"
|
|
45856
45914
|
}
|
|
45857
|
-
|
|
45858
|
-
|
|
45915
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("SELECT_END_DATE"), " ", /*#__PURE__*/React__default.createElement("span", {
|
|
45916
|
+
style: {
|
|
45917
|
+
color: "red"
|
|
45859
45918
|
}
|
|
45860
|
-
}
|
|
45861
|
-
|
|
45862
|
-
|
|
45863
|
-
|
|
45864
|
-
|
|
45865
|
-
|
|
45866
|
-
|
|
45867
|
-
|
|
45868
|
-
|
|
45869
|
-
|
|
45870
|
-
|
|
45871
|
-
|
|
45872
|
-
|
|
45873
|
-
|
|
45874
|
-
|
|
45875
|
-
|
|
45876
|
-
|
|
45877
|
-
|
|
45878
|
-
|
|
45879
|
-
|
|
45880
|
-
|
|
45881
|
-
|
|
45882
|
-
|
|
45883
|
-
|
|
45884
|
-
|
|
45885
|
-
|
|
45886
|
-
|
|
45887
|
-
|
|
45888
|
-
var _exenv2 = _interopRequireDefault(exenv);
|
|
45889
|
-
function _interopRequireDefault(obj) {
|
|
45890
|
-
return obj && obj.__esModule ? obj : {
|
|
45891
|
-
default: obj
|
|
45892
|
-
};
|
|
45893
|
-
}
|
|
45894
|
-
var EE = _exenv2.default;
|
|
45895
|
-
var SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {};
|
|
45896
|
-
var SafeHTMLCollection = exports.SafeHTMLCollection = EE.canUseDOM ? window.HTMLCollection : {};
|
|
45897
|
-
var SafeNodeList = exports.SafeNodeList = EE.canUseDOM ? window.NodeList : {};
|
|
45898
|
-
var canUseDOM = exports.canUseDOM = EE.canUseDOM;
|
|
45899
|
-
exports.default = SafeHTMLElement;
|
|
45900
|
-
});
|
|
45901
|
-
unwrapExports(safeHTMLElement);
|
|
45902
|
-
|
|
45903
|
-
var ariaAppHider = createCommonjsModule(function (module, exports) {
|
|
45904
|
-
|
|
45905
|
-
Object.defineProperty(exports, "__esModule", {
|
|
45906
|
-
value: true
|
|
45907
|
-
});
|
|
45908
|
-
exports.resetState = resetState;
|
|
45909
|
-
exports.log = log;
|
|
45910
|
-
exports.assertNodeList = assertNodeList;
|
|
45911
|
-
exports.setElement = setElement;
|
|
45912
|
-
exports.validateElement = validateElement;
|
|
45913
|
-
exports.hide = hide;
|
|
45914
|
-
exports.show = show;
|
|
45915
|
-
exports.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting;
|
|
45916
|
-
var _warning2 = _interopRequireDefault(warning_1);
|
|
45917
|
-
function _interopRequireDefault(obj) {
|
|
45918
|
-
return obj && obj.__esModule ? obj : {
|
|
45919
|
-
default: obj
|
|
45920
|
-
};
|
|
45921
|
-
}
|
|
45922
|
-
var globalElement = null;
|
|
45923
|
-
function resetState() {
|
|
45924
|
-
if (globalElement) {
|
|
45925
|
-
if (globalElement.removeAttribute) {
|
|
45926
|
-
globalElement.removeAttribute("aria-hidden");
|
|
45927
|
-
} else if (globalElement.length != null) {
|
|
45928
|
-
globalElement.forEach(function (element) {
|
|
45929
|
-
return element.removeAttribute("aria-hidden");
|
|
45930
|
-
});
|
|
45931
|
-
} else {
|
|
45932
|
-
document.querySelectorAll(globalElement).forEach(function (element) {
|
|
45933
|
-
return element.removeAttribute("aria-hidden");
|
|
45934
|
-
});
|
|
45935
|
-
}
|
|
45919
|
+
}, "*")), /*#__PURE__*/React__default.createElement("div", {
|
|
45920
|
+
style: {
|
|
45921
|
+
width: "50%"
|
|
45922
|
+
},
|
|
45923
|
+
className: "field"
|
|
45924
|
+
}, /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
45925
|
+
control: control,
|
|
45926
|
+
name: "endDate",
|
|
45927
|
+
render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
45928
|
+
style: {
|
|
45929
|
+
marginBottom: 0
|
|
45930
|
+
},
|
|
45931
|
+
type: "date",
|
|
45932
|
+
className: "form-field",
|
|
45933
|
+
value: props.value,
|
|
45934
|
+
min: startDate ? new Date(new Date(startDate).getTime() + 24 * 60 * 60 * 1000).toISOString().split("T")[0] : new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString().split("T")[0],
|
|
45935
|
+
max: startDate ? new Date(new Date(startDate).getTime() + 6 * 24 * 60 * 60 * 1000).toISOString().split("T")[0] : null,
|
|
45936
|
+
onChange: e => {
|
|
45937
|
+
props.onChange(e.target.value);
|
|
45938
|
+
},
|
|
45939
|
+
onBlur: e => {
|
|
45940
|
+
props.onBlur(e);
|
|
45941
|
+
},
|
|
45942
|
+
disabled: !startDate
|
|
45943
|
+
})
|
|
45944
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
45945
|
+
style: {
|
|
45946
|
+
marginTop: "20px"
|
|
45936
45947
|
}
|
|
45937
|
-
|
|
45938
|
-
|
|
45939
|
-
|
|
45940
|
-
if (process.env.NODE_ENV !== "production") {
|
|
45941
|
-
var check = globalElement || {};
|
|
45942
|
-
console.log("ariaAppHider ----------");
|
|
45943
|
-
console.log(check.nodeName, check.className, check.id);
|
|
45944
|
-
console.log("end ariaAppHider ----------");
|
|
45948
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("HALL_CODE"), " ", /*#__PURE__*/React__default.createElement("span", {
|
|
45949
|
+
style: {
|
|
45950
|
+
color: "red"
|
|
45945
45951
|
}
|
|
45946
|
-
}
|
|
45947
|
-
|
|
45948
|
-
|
|
45949
|
-
|
|
45952
|
+
}, "*")), /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
45953
|
+
control: control,
|
|
45954
|
+
name: "hallCode",
|
|
45955
|
+
rules: {
|
|
45956
|
+
required: t("HALL_CODE_REQ")
|
|
45957
|
+
},
|
|
45958
|
+
render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
45959
|
+
style: {
|
|
45960
|
+
marginBottom: 0
|
|
45961
|
+
},
|
|
45962
|
+
className: "form-field",
|
|
45963
|
+
select: e => {
|
|
45964
|
+
props.onChange(e);
|
|
45965
|
+
slotsSearch(e);
|
|
45966
|
+
setShowInfo(true);
|
|
45967
|
+
},
|
|
45968
|
+
selected: props.value,
|
|
45969
|
+
option: getHallCodes,
|
|
45970
|
+
optionKey: "HallCode"
|
|
45971
|
+
})
|
|
45972
|
+
}), errors.hallCode && /*#__PURE__*/React__default.createElement("p", {
|
|
45973
|
+
style: {
|
|
45974
|
+
color: "red"
|
|
45950
45975
|
}
|
|
45951
|
-
}
|
|
45952
|
-
|
|
45953
|
-
|
|
45954
|
-
|
|
45955
|
-
var el = document.querySelectorAll(useElement);
|
|
45956
|
-
assertNodeList(el, useElement);
|
|
45957
|
-
useElement = el;
|
|
45976
|
+
}, errors.hallCode.message)), (getSlots === null || getSlots === void 0 ? void 0 : getSlots.length) > 0 && /*#__PURE__*/React__default.createElement("div", {
|
|
45977
|
+
style: {
|
|
45978
|
+
marginTop: "20px",
|
|
45979
|
+
marginBottom: "20px"
|
|
45958
45980
|
}
|
|
45959
|
-
|
|
45960
|
-
|
|
45961
|
-
|
|
45962
|
-
function validateElement(appElement) {
|
|
45963
|
-
var el = appElement || globalElement;
|
|
45964
|
-
if (el) {
|
|
45965
|
-
return Array.isArray(el) || el instanceof HTMLCollection || el instanceof NodeList ? el : [el];
|
|
45966
|
-
} else {
|
|
45967
|
-
(0, _warning2.default)(false, ["react-modal: App element is not defined.", "Please use `Modal.setAppElement(el)` or set `appElement={el}`.", "This is needed so screen readers don't see main content", "when modal is opened. It is not recommended, but you can opt-out", "by setting `ariaHideApp={false}`."].join(" "));
|
|
45968
|
-
return [];
|
|
45981
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("AVAILABLE_SLOTS"), " ", /*#__PURE__*/React__default.createElement("span", {
|
|
45982
|
+
style: {
|
|
45983
|
+
color: "red"
|
|
45969
45984
|
}
|
|
45970
|
-
}
|
|
45971
|
-
|
|
45972
|
-
|
|
45973
|
-
|
|
45974
|
-
|
|
45975
|
-
|
|
45976
|
-
|
|
45977
|
-
var el = _step.value;
|
|
45978
|
-
el.setAttribute("aria-hidden", "true");
|
|
45979
|
-
}
|
|
45980
|
-
} catch (err) {
|
|
45981
|
-
_didIteratorError = true;
|
|
45982
|
-
_iteratorError = err;
|
|
45983
|
-
} finally {
|
|
45984
|
-
try {
|
|
45985
|
-
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
45986
|
-
_iterator.return();
|
|
45987
|
-
}
|
|
45988
|
-
} finally {
|
|
45989
|
-
if (_didIteratorError) {
|
|
45990
|
-
throw _iteratorError;
|
|
45985
|
+
}, "*")), /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
45986
|
+
control: control,
|
|
45987
|
+
name: "slots",
|
|
45988
|
+
rules: {
|
|
45989
|
+
validate: value => {
|
|
45990
|
+
if (!value || value.length === 0) {
|
|
45991
|
+
return t("PLEASE_SELECT_AT_LEAST_ONE_SLOT");
|
|
45991
45992
|
}
|
|
45993
|
+
return true;
|
|
45992
45994
|
}
|
|
45993
|
-
}
|
|
45994
|
-
|
|
45995
|
-
|
|
45996
|
-
|
|
45997
|
-
|
|
45998
|
-
|
|
45999
|
-
|
|
46000
|
-
|
|
46001
|
-
var el = _step2.value;
|
|
46002
|
-
el.removeAttribute("aria-hidden");
|
|
45995
|
+
},
|
|
45996
|
+
render: field => /*#__PURE__*/React__default.createElement("div", {
|
|
45997
|
+
style: {
|
|
45998
|
+
display: "grid",
|
|
45999
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(250px, 1fr))",
|
|
46000
|
+
gap: "16px",
|
|
46001
|
+
marginTop: "20px",
|
|
46002
|
+
width: "50%"
|
|
46003
46003
|
}
|
|
46004
|
-
}
|
|
46005
|
-
|
|
46006
|
-
|
|
46007
|
-
|
|
46008
|
-
|
|
46009
|
-
|
|
46010
|
-
|
|
46004
|
+
}, getSlots === null || getSlots === void 0 ? void 0 : getSlots.map((slot, idx) => {
|
|
46005
|
+
var _field$value, _slot$slotStaus;
|
|
46006
|
+
const slotKey = slot.hallCode + "-" + slot.bookingDate + "-" + (slot.fromTime || "") + "-" + (slot.toTime || "");
|
|
46007
|
+
const isChecked = (_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value.some(s => s.hallCode === slot.hallCode && s.bookingDate === slot.bookingDate && s.fromTime === slot.fromTime && s.toTime === slot.toTime);
|
|
46008
|
+
const isAvailable = ((_slot$slotStaus = slot.slotStaus) === null || _slot$slotStaus === void 0 ? void 0 : _slot$slotStaus.toLowerCase()) === "available";
|
|
46009
|
+
return /*#__PURE__*/React__default.createElement("label", {
|
|
46010
|
+
key: slotKey,
|
|
46011
|
+
style: {
|
|
46012
|
+
border: "1px solid #ccc",
|
|
46013
|
+
borderRadius: "8px",
|
|
46014
|
+
padding: "12px",
|
|
46015
|
+
backgroundColor: isAvailable ? "#e6ffed" : "#ffe6e6",
|
|
46016
|
+
cursor: isAvailable ? "pointer" : "not-allowed",
|
|
46017
|
+
opacity: isAvailable ? 1 : 0.6,
|
|
46018
|
+
flexDirection: "column",
|
|
46019
|
+
gap: "6px"
|
|
46011
46020
|
}
|
|
46012
|
-
}
|
|
46013
|
-
|
|
46014
|
-
|
|
46021
|
+
}, /*#__PURE__*/React__default.createElement("input", {
|
|
46022
|
+
type: "checkbox",
|
|
46023
|
+
checked: isChecked,
|
|
46024
|
+
disabled: !isAvailable,
|
|
46025
|
+
onChange: e => {
|
|
46026
|
+
if (!isAvailable) return;
|
|
46027
|
+
let updatedSlots = [...(field.value || [])];
|
|
46028
|
+
if (e.target.checked) {
|
|
46029
|
+
updatedSlots.push(slot);
|
|
46030
|
+
const sortedSlots = [...getSlots].sort((a, b) => new Date(a.bookingDate) - new Date(b.bookingDate) || (a.fromTime || "00:00").localeCompare(b.fromTime || "00:00"));
|
|
46031
|
+
const allSelectedKeys = updatedSlots.map(s => s.hallCode + "-" + s.bookingDate + "-" + s.fromTime + "-" + s.toTime);
|
|
46032
|
+
const firstIndex = sortedSlots.findIndex(s => s.hallCode + "-" + s.bookingDate + "-" + s.fromTime + "-" + s.toTime === allSelectedKeys[0]);
|
|
46033
|
+
const lastIndex = sortedSlots.findIndex(s => s.hallCode + "-" + s.bookingDate + "-" + s.fromTime + "-" + s.toTime === allSelectedKeys[allSelectedKeys.length - 1]);
|
|
46034
|
+
const minIndex = Math.min(firstIndex, lastIndex);
|
|
46035
|
+
const maxIndex = Math.max(firstIndex, lastIndex);
|
|
46036
|
+
const continuousSlots = sortedSlots.slice(minIndex, maxIndex + 1).filter(s => {
|
|
46037
|
+
var _s$slotStaus;
|
|
46038
|
+
return ((_s$slotStaus = s.slotStaus) === null || _s$slotStaus === void 0 ? void 0 : _s$slotStaus.toLowerCase()) === "available";
|
|
46039
|
+
});
|
|
46040
|
+
field.onChange(continuousSlots);
|
|
46041
|
+
} else {
|
|
46042
|
+
updatedSlots = updatedSlots.filter(s => !(s.hallCode === slot.hallCode && s.bookingDate === slot.bookingDate && s.fromTime === slot.fromTime && s.toTime === slot.toTime));
|
|
46043
|
+
field.onChange(updatedSlots);
|
|
46044
|
+
}
|
|
46015
46045
|
}
|
|
46016
|
-
}
|
|
46017
|
-
|
|
46018
|
-
|
|
46019
|
-
|
|
46020
|
-
|
|
46021
|
-
|
|
46022
|
-
|
|
46023
|
-
|
|
46024
|
-
|
|
46025
|
-
|
|
46026
|
-
|
|
46027
|
-
|
|
46028
|
-
|
|
46029
|
-
|
|
46030
|
-
exports.resetState = resetState;
|
|
46031
|
-
exports.log = log;
|
|
46032
|
-
var htmlClassList = {};
|
|
46033
|
-
var docBodyClassList = {};
|
|
46034
|
-
function removeClass(at, cls) {
|
|
46035
|
-
at.classList.remove(cls);
|
|
46036
|
-
}
|
|
46037
|
-
function resetState() {
|
|
46038
|
-
var htmlElement = document.getElementsByTagName("html")[0];
|
|
46039
|
-
for (var cls in htmlClassList) {
|
|
46040
|
-
removeClass(htmlElement, htmlClassList[cls]);
|
|
46046
|
+
}), /*#__PURE__*/React__default.createElement("span", {
|
|
46047
|
+
style: {
|
|
46048
|
+
marginLeft: "10px"
|
|
46049
|
+
}
|
|
46050
|
+
}, slot.bookingDate, " (", slot.hallCode, ") \u2013", " ", /*#__PURE__*/React__default.createElement("span", {
|
|
46051
|
+
style: {
|
|
46052
|
+
color: slot.slotStaus === "AVAILABLE" ? "green" : "red",
|
|
46053
|
+
fontWeight: "bold"
|
|
46054
|
+
}
|
|
46055
|
+
}, slot.slotStaus ? slot.slotStaus.charAt(0).toUpperCase() + slot.slotStaus.slice(1).toLowerCase() : "")));
|
|
46056
|
+
}))
|
|
46057
|
+
}), errors.slots && /*#__PURE__*/React__default.createElement("p", {
|
|
46058
|
+
style: {
|
|
46059
|
+
color: "red"
|
|
46041
46060
|
}
|
|
46042
|
-
|
|
46043
|
-
|
|
46044
|
-
|
|
46061
|
+
}, errors.slots.message)), /*#__PURE__*/React__default.createElement("div", {
|
|
46062
|
+
style: {
|
|
46063
|
+
display: showInfo ? "block" : "none"
|
|
46045
46064
|
}
|
|
46046
|
-
|
|
46047
|
-
|
|
46048
|
-
|
|
46049
|
-
|
|
46050
|
-
if (process.env.NODE_ENV !== "production") {
|
|
46051
|
-
var classes = document.getElementsByTagName("html")[0].className;
|
|
46052
|
-
var buffer = "Show tracked classes:\n\n";
|
|
46053
|
-
buffer += "<html /> (" + classes + "):\n ";
|
|
46054
|
-
for (var x in htmlClassList) {
|
|
46055
|
-
buffer += " " + x + " " + htmlClassList[x] + "\n ";
|
|
46056
|
-
}
|
|
46057
|
-
classes = document.body.className;
|
|
46058
|
-
buffer += "\n\ndoc.body (" + classes + "):\n ";
|
|
46059
|
-
for (var _x in docBodyClassList) {
|
|
46060
|
-
buffer += " " + _x + " " + docBodyClassList[_x] + "\n ";
|
|
46061
|
-
}
|
|
46062
|
-
buffer += "\n";
|
|
46063
|
-
console.log(buffer);
|
|
46065
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
46066
|
+
style: {
|
|
46067
|
+
marginTop: "20px",
|
|
46068
|
+
marginBottom: "20px"
|
|
46064
46069
|
}
|
|
46065
|
-
}
|
|
46066
|
-
|
|
46067
|
-
|
|
46068
|
-
poll[className] = 0;
|
|
46070
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("CHB_PURPOSE"), " ", /*#__PURE__*/React__default.createElement("span", {
|
|
46071
|
+
style: {
|
|
46072
|
+
color: "red"
|
|
46069
46073
|
}
|
|
46070
|
-
|
|
46071
|
-
|
|
46072
|
-
|
|
46073
|
-
|
|
46074
|
-
|
|
46075
|
-
|
|
46074
|
+
}, "*")), /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
46075
|
+
control: control,
|
|
46076
|
+
name: "purpose",
|
|
46077
|
+
defaultValue: null,
|
|
46078
|
+
rules: {
|
|
46079
|
+
required: t("CHB_PURPOSE_REQUIRED")
|
|
46080
|
+
},
|
|
46081
|
+
render: props => {
|
|
46082
|
+
var _CHBPurpose$CHB;
|
|
46083
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
46084
|
+
style: {
|
|
46085
|
+
marginBottom: 0
|
|
46086
|
+
},
|
|
46087
|
+
className: "form-field",
|
|
46088
|
+
select: props.onChange,
|
|
46089
|
+
selected: props.value,
|
|
46090
|
+
option: CHBPurpose === null || CHBPurpose === void 0 ? void 0 : (_CHBPurpose$CHB = CHBPurpose.CHB) === null || _CHBPurpose$CHB === void 0 ? void 0 : _CHBPurpose$CHB.Purpose,
|
|
46091
|
+
optionKey: "name"
|
|
46092
|
+
});
|
|
46076
46093
|
}
|
|
46077
|
-
|
|
46078
|
-
|
|
46079
|
-
|
|
46080
|
-
classes.forEach(function (className) {
|
|
46081
|
-
incrementReference(poll, className);
|
|
46082
|
-
classListRef.add(className);
|
|
46083
|
-
});
|
|
46084
|
-
};
|
|
46085
|
-
var untrackClass = function untrackClass(classListRef, poll, classes) {
|
|
46086
|
-
classes.forEach(function (className) {
|
|
46087
|
-
decrementReference(poll, className);
|
|
46088
|
-
poll[className] === 0 && classListRef.remove(className);
|
|
46089
|
-
});
|
|
46090
|
-
};
|
|
46091
|
-
var add = exports.add = function add(element, classString) {
|
|
46092
|
-
return trackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" "));
|
|
46093
|
-
};
|
|
46094
|
-
var remove = exports.remove = function remove(element, classString) {
|
|
46095
|
-
return untrackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" "));
|
|
46096
|
-
};
|
|
46097
|
-
});
|
|
46098
|
-
unwrapExports(classList);
|
|
46099
|
-
|
|
46100
|
-
var portalOpenInstances_1 = createCommonjsModule(function (module, exports) {
|
|
46101
|
-
|
|
46102
|
-
Object.defineProperty(exports, "__esModule", {
|
|
46103
|
-
value: true
|
|
46104
|
-
});
|
|
46105
|
-
exports.log = log;
|
|
46106
|
-
exports.resetState = resetState;
|
|
46107
|
-
function _classCallCheck(instance, Constructor) {
|
|
46108
|
-
if (!(instance instanceof Constructor)) {
|
|
46109
|
-
throw new TypeError("Cannot call a class as a function");
|
|
46094
|
+
}), errors.purpose && /*#__PURE__*/React__default.createElement("p", {
|
|
46095
|
+
style: {
|
|
46096
|
+
color: "red"
|
|
46110
46097
|
}
|
|
46111
|
-
}
|
|
46112
|
-
|
|
46113
|
-
|
|
46114
|
-
|
|
46115
|
-
|
|
46116
|
-
|
|
46117
|
-
|
|
46118
|
-
|
|
46119
|
-
|
|
46120
|
-
|
|
46121
|
-
|
|
46122
|
-
|
|
46123
|
-
|
|
46124
|
-
|
|
46125
|
-
|
|
46126
|
-
|
|
46127
|
-
|
|
46128
|
-
|
|
46129
|
-
|
|
46130
|
-
|
|
46131
|
-
|
|
46132
|
-
|
|
46133
|
-
|
|
46134
|
-
|
|
46135
|
-
|
|
46136
|
-
|
|
46137
|
-
_this.subscribers.push(callback);
|
|
46138
|
-
};
|
|
46139
|
-
this.emit = function (eventType) {
|
|
46140
|
-
_this.subscribers.forEach(function (subscriber) {
|
|
46141
|
-
return subscriber(eventType, _this.openInstances.slice());
|
|
46098
|
+
}, errors.purpose.message)), /*#__PURE__*/React__default.createElement("div", {
|
|
46099
|
+
style: {
|
|
46100
|
+
marginBottom: "20px"
|
|
46101
|
+
}
|
|
46102
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("CHB_SPECIAL_CATEGORY"), " ", /*#__PURE__*/React__default.createElement("span", {
|
|
46103
|
+
style: {
|
|
46104
|
+
color: "red"
|
|
46105
|
+
}
|
|
46106
|
+
}, "*")), /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
46107
|
+
control: control,
|
|
46108
|
+
name: "specialCategory",
|
|
46109
|
+
defaultValue: null,
|
|
46110
|
+
rules: {
|
|
46111
|
+
required: t("CHB_SPECIAL_CATEGORY_REQUIRED")
|
|
46112
|
+
},
|
|
46113
|
+
render: props => {
|
|
46114
|
+
var _SpecialCategory$CHB;
|
|
46115
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
46116
|
+
style: {
|
|
46117
|
+
marginBottom: 0
|
|
46118
|
+
},
|
|
46119
|
+
className: "form-field",
|
|
46120
|
+
select: props.onChange,
|
|
46121
|
+
selected: props.value,
|
|
46122
|
+
option: SpecialCategory === null || SpecialCategory === void 0 ? void 0 : (_SpecialCategory$CHB = SpecialCategory.CHB) === null || _SpecialCategory$CHB === void 0 ? void 0 : _SpecialCategory$CHB.SpecialCategory,
|
|
46123
|
+
optionKey: "name"
|
|
46142
46124
|
});
|
|
46143
|
-
};
|
|
46144
|
-
this.openInstances = [];
|
|
46145
|
-
this.subscribers = [];
|
|
46146
|
-
};
|
|
46147
|
-
var portalOpenInstances = new PortalOpenInstances();
|
|
46148
|
-
function log() {
|
|
46149
|
-
console.log("portalOpenInstances ----------");
|
|
46150
|
-
console.log(portalOpenInstances.openInstances.length);
|
|
46151
|
-
portalOpenInstances.openInstances.forEach(function (p) {
|
|
46152
|
-
return console.log(p);
|
|
46153
|
-
});
|
|
46154
|
-
console.log("end portalOpenInstances ----------");
|
|
46155
|
-
}
|
|
46156
|
-
function resetState() {
|
|
46157
|
-
portalOpenInstances = new PortalOpenInstances();
|
|
46158
|
-
}
|
|
46159
|
-
exports.default = portalOpenInstances;
|
|
46160
|
-
});
|
|
46161
|
-
unwrapExports(portalOpenInstances_1);
|
|
46162
|
-
|
|
46163
|
-
var bodyTrap_1 = createCommonjsModule(function (module, exports) {
|
|
46164
|
-
|
|
46165
|
-
Object.defineProperty(exports, "__esModule", {
|
|
46166
|
-
value: true
|
|
46167
|
-
});
|
|
46168
|
-
exports.resetState = resetState;
|
|
46169
|
-
exports.log = log;
|
|
46170
|
-
var _portalOpenInstances2 = _interopRequireDefault(portalOpenInstances_1);
|
|
46171
|
-
function _interopRequireDefault(obj) {
|
|
46172
|
-
return obj && obj.__esModule ? obj : {
|
|
46173
|
-
default: obj
|
|
46174
|
-
};
|
|
46175
|
-
}
|
|
46176
|
-
var before = void 0,
|
|
46177
|
-
after = void 0,
|
|
46178
|
-
instances = [];
|
|
46179
|
-
function resetState() {
|
|
46180
|
-
var _arr = [before, after];
|
|
46181
|
-
for (var _i = 0; _i < _arr.length; _i++) {
|
|
46182
|
-
var item = _arr[_i];
|
|
46183
|
-
if (!item) continue;
|
|
46184
|
-
item.parentNode && item.parentNode.removeChild(item);
|
|
46185
46125
|
}
|
|
46186
|
-
|
|
46187
|
-
|
|
46188
|
-
|
|
46189
|
-
function log() {
|
|
46190
|
-
console.log("bodyTrap ----------");
|
|
46191
|
-
console.log(instances.length);
|
|
46192
|
-
var _arr2 = [before, after];
|
|
46193
|
-
for (var _i2 = 0; _i2 < _arr2.length; _i2++) {
|
|
46194
|
-
var item = _arr2[_i2];
|
|
46195
|
-
var check = item || {};
|
|
46196
|
-
console.log(check.nodeName, check.className, check.id);
|
|
46126
|
+
}), errors.specialCategory && /*#__PURE__*/React__default.createElement("p", {
|
|
46127
|
+
style: {
|
|
46128
|
+
color: "red"
|
|
46197
46129
|
}
|
|
46198
|
-
|
|
46199
|
-
|
|
46200
|
-
|
|
46201
|
-
if (instances.length === 0) {
|
|
46202
|
-
if (process.env.NODE_ENV !== "production") {
|
|
46203
|
-
console.warn("React-Modal: Open instances > 0 expected");
|
|
46204
|
-
}
|
|
46205
|
-
return;
|
|
46130
|
+
}, errors.specialCategory.message)), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, {
|
|
46131
|
+
style: {
|
|
46132
|
+
marginBottom: "20px"
|
|
46206
46133
|
}
|
|
46207
|
-
|
|
46208
|
-
|
|
46209
|
-
|
|
46210
|
-
|
|
46211
|
-
|
|
46212
|
-
before.setAttribute("data-react-modal-body-trap", "");
|
|
46213
|
-
before.style.position = "absolute";
|
|
46214
|
-
before.style.opacity = "0";
|
|
46215
|
-
before.setAttribute("tabindex", "0");
|
|
46216
|
-
before.addEventListener("focus", focusContent);
|
|
46217
|
-
after = before.cloneNode();
|
|
46218
|
-
after.addEventListener("focus", focusContent);
|
|
46134
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
|
|
46135
|
+
className: "card-label-smaller"
|
|
46136
|
+
}, t("CHB_PURPOSE_DESCRIPTION"), " ", /*#__PURE__*/React__default.createElement("span", {
|
|
46137
|
+
style: {
|
|
46138
|
+
color: "red"
|
|
46219
46139
|
}
|
|
46220
|
-
|
|
46221
|
-
|
|
46222
|
-
|
|
46223
|
-
|
|
46224
|
-
|
|
46225
|
-
|
|
46226
|
-
|
|
46227
|
-
|
|
46228
|
-
|
|
46229
|
-
|
|
46230
|
-
|
|
46140
|
+
}, "*")), /*#__PURE__*/React__default.createElement("div", {
|
|
46141
|
+
className: "field",
|
|
46142
|
+
style: {
|
|
46143
|
+
width: "50%"
|
|
46144
|
+
}
|
|
46145
|
+
}, /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
46146
|
+
control: control,
|
|
46147
|
+
name: "purposeDescription",
|
|
46148
|
+
defaultValue: "",
|
|
46149
|
+
rules: {
|
|
46150
|
+
required: t("CHB_PURPOSE_DESCRIPTION_REQUIRED"),
|
|
46151
|
+
minLength: {
|
|
46152
|
+
value: 5,
|
|
46153
|
+
message: t("CHB_PURPOSE_DESCRIPTION_REQUIRED_MIN")
|
|
46231
46154
|
}
|
|
46232
|
-
|
|
46233
|
-
|
|
46155
|
+
},
|
|
46156
|
+
render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextArea, {
|
|
46157
|
+
style: {
|
|
46158
|
+
marginBottom: 0,
|
|
46159
|
+
marginTop: 0
|
|
46160
|
+
},
|
|
46161
|
+
type: "textarea",
|
|
46162
|
+
value: props.value,
|
|
46163
|
+
onChange: e => {
|
|
46164
|
+
props.onChange(e.target.value);
|
|
46165
|
+
},
|
|
46166
|
+
onBlur: e => {
|
|
46167
|
+
props.onBlur(e);
|
|
46234
46168
|
}
|
|
46169
|
+
})
|
|
46170
|
+
}), errors.purposeDescription && /*#__PURE__*/React__default.createElement("p", {
|
|
46171
|
+
style: {
|
|
46172
|
+
color: "red"
|
|
46173
|
+
}
|
|
46174
|
+
}, errors.purposeDescription.message))), !isCitizen && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
46175
|
+
style: {
|
|
46176
|
+
marginBottom: "20px",
|
|
46177
|
+
width: "50%"
|
|
46178
|
+
}
|
|
46179
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("CHB_DISCOUNT_AMOUNT")), /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
46180
|
+
control: control,
|
|
46181
|
+
name: "discountAmount",
|
|
46182
|
+
render: props => {
|
|
46183
|
+
var _errors$name;
|
|
46184
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
46185
|
+
type: "number",
|
|
46186
|
+
style: {
|
|
46187
|
+
marginBottom: 0,
|
|
46188
|
+
width: "100%"
|
|
46189
|
+
},
|
|
46190
|
+
value: props.value,
|
|
46191
|
+
error: errors === null || errors === void 0 ? void 0 : (_errors$name = errors.name) === null || _errors$name === void 0 ? void 0 : _errors$name.message,
|
|
46192
|
+
onChange: e => {
|
|
46193
|
+
props.onChange(e.target.value);
|
|
46194
|
+
},
|
|
46195
|
+
onBlur: e => {
|
|
46196
|
+
props.onBlur(e);
|
|
46197
|
+
},
|
|
46198
|
+
t: t
|
|
46199
|
+
});
|
|
46200
|
+
}
|
|
46201
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
46202
|
+
style: {
|
|
46203
|
+
marginBottom: "20px"
|
|
46204
|
+
}
|
|
46205
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("CHB_DISCOUNT_REASON"), " ", /*#__PURE__*/React__default.createElement("span", {
|
|
46206
|
+
style: {
|
|
46207
|
+
color: "red"
|
|
46208
|
+
}
|
|
46209
|
+
}, "*")), /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
46210
|
+
control: control,
|
|
46211
|
+
name: "reason",
|
|
46212
|
+
defaultValue: null,
|
|
46213
|
+
render: props => {
|
|
46214
|
+
var _CHBReason$CHB2;
|
|
46215
|
+
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
46216
|
+
style: {
|
|
46217
|
+
marginBottom: 0
|
|
46218
|
+
},
|
|
46219
|
+
className: "form-field",
|
|
46220
|
+
select: props.onChange,
|
|
46221
|
+
selected: props.value,
|
|
46222
|
+
option: CHBReason === null || CHBReason === void 0 ? void 0 : (_CHBReason$CHB2 = CHBReason.CHB) === null || _CHBReason$CHB2 === void 0 ? void 0 : _CHBReason$CHB2.DiscountReason,
|
|
46223
|
+
optionKey: "reasonName"
|
|
46224
|
+
});
|
|
46235
46225
|
}
|
|
46226
|
+
}))))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
|
|
46227
|
+
label: "Next",
|
|
46228
|
+
submit: "submit"
|
|
46229
|
+
}))), (CHBCalcLoading || CHBReasonLoading || CHBLocationLoading || CHBLoading || CHBPurposeLoading || CHBSpecialCategoryLoading || CHBHallCodeLoading || loader) && /*#__PURE__*/React__default.createElement(Loader, {
|
|
46230
|
+
page: true
|
|
46231
|
+
}));
|
|
46232
|
+
};
|
|
46233
|
+
|
|
46234
|
+
const NewADSStepFormOne = _ref => {
|
|
46235
|
+
let {
|
|
46236
|
+
config,
|
|
46237
|
+
onGoNext,
|
|
46238
|
+
onBackClick
|
|
46239
|
+
} = _ref;
|
|
46240
|
+
const dispatch = reactRedux.useDispatch();
|
|
46241
|
+
const {
|
|
46242
|
+
t
|
|
46243
|
+
} = reactI18next.useTranslation();
|
|
46244
|
+
const [showToast, setShowToast] = React.useState(false);
|
|
46245
|
+
const [error, setError] = React.useState("");
|
|
46246
|
+
const currentStepData = reactRedux.useSelector(function (state) {
|
|
46247
|
+
return state.chb.CHBApplicationFormReducer.formData;
|
|
46248
|
+
});
|
|
46249
|
+
function goNext(data) {
|
|
46250
|
+
console.log("data aa rea", data);
|
|
46251
|
+
dispatch(UPDATE_CHBApplication_FORM(config.key, data));
|
|
46252
|
+
onGoNext();
|
|
46236
46253
|
}
|
|
46237
|
-
|
|
46238
|
-
|
|
46239
|
-
|
|
46254
|
+
function onGoBack(data) {
|
|
46255
|
+
onBackClick(config.key, data);
|
|
46256
|
+
}
|
|
46257
|
+
const closeToast = () => {
|
|
46258
|
+
setShowToast(false);
|
|
46259
|
+
setError("");
|
|
46260
|
+
};
|
|
46261
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(CHBCitizenSecond, {
|
|
46262
|
+
onGoBack: onGoBack,
|
|
46263
|
+
goNext: goNext,
|
|
46264
|
+
currentStepData: currentStepData,
|
|
46265
|
+
t: t
|
|
46266
|
+
}), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
46267
|
+
isDleteBtn: true,
|
|
46268
|
+
error: true,
|
|
46269
|
+
label: error,
|
|
46270
|
+
onClose: closeToast
|
|
46271
|
+
}));
|
|
46272
|
+
};
|
|
46240
46273
|
|
|
46241
|
-
var
|
|
46274
|
+
var tabbable_1 = createCommonjsModule(function (module, exports) {
|
|
46242
46275
|
|
|
46243
46276
|
Object.defineProperty(exports, "__esModule", {
|
|
46244
46277
|
value: true
|
|
46245
46278
|
});
|
|
46246
|
-
|
|
46247
|
-
|
|
46248
|
-
|
|
46249
|
-
|
|
46250
|
-
|
|
46251
|
-
|
|
46252
|
-
}
|
|
46253
|
-
}
|
|
46254
|
-
}
|
|
46255
|
-
return target;
|
|
46256
|
-
};
|
|
46257
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
|
|
46258
|
-
return typeof obj;
|
|
46259
|
-
} : function (obj) {
|
|
46260
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
46261
|
-
};
|
|
46262
|
-
var _createClass = function () {
|
|
46263
|
-
function defineProperties(target, props) {
|
|
46264
|
-
for (var i = 0; i < props.length; i++) {
|
|
46265
|
-
var descriptor = props[i];
|
|
46266
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
46267
|
-
descriptor.configurable = true;
|
|
46268
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
46269
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
46270
|
-
}
|
|
46271
|
-
}
|
|
46272
|
-
return function (Constructor, protoProps, staticProps) {
|
|
46273
|
-
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
46274
|
-
if (staticProps) defineProperties(Constructor, staticProps);
|
|
46275
|
-
return Constructor;
|
|
46276
|
-
};
|
|
46277
|
-
}();
|
|
46278
|
-
var _propTypes2 = _interopRequireDefault(propTypes);
|
|
46279
|
-
var focusManager$1 = _interopRequireWildcard(focusManager);
|
|
46280
|
-
var _scopeTab2 = _interopRequireDefault(scopeTab_1);
|
|
46281
|
-
var ariaAppHider$1 = _interopRequireWildcard(ariaAppHider);
|
|
46282
|
-
var classList$1 = _interopRequireWildcard(classList);
|
|
46283
|
-
var _safeHTMLElement2 = _interopRequireDefault(safeHTMLElement);
|
|
46284
|
-
var _portalOpenInstances2 = _interopRequireDefault(portalOpenInstances_1);
|
|
46285
|
-
function _interopRequireWildcard(obj) {
|
|
46286
|
-
if (obj && obj.__esModule) {
|
|
46287
|
-
return obj;
|
|
46288
|
-
} else {
|
|
46289
|
-
var newObj = {};
|
|
46290
|
-
if (obj != null) {
|
|
46291
|
-
for (var key in obj) {
|
|
46292
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
|
|
46293
|
-
}
|
|
46294
|
-
}
|
|
46295
|
-
newObj.default = obj;
|
|
46296
|
-
return newObj;
|
|
46297
|
-
}
|
|
46298
|
-
}
|
|
46299
|
-
function _interopRequireDefault(obj) {
|
|
46300
|
-
return obj && obj.__esModule ? obj : {
|
|
46301
|
-
default: obj
|
|
46302
|
-
};
|
|
46279
|
+
exports.default = findTabbableDescendants;
|
|
46280
|
+
var DISPLAY_NONE = "none";
|
|
46281
|
+
var DISPLAY_CONTENTS = "contents";
|
|
46282
|
+
var tabbableNode = /^(input|select|textarea|button|object|iframe)$/;
|
|
46283
|
+
function isNotOverflowing(element, style) {
|
|
46284
|
+
return style.getPropertyValue("overflow") !== "visible" || element.scrollWidth <= 0 && element.scrollHeight <= 0;
|
|
46303
46285
|
}
|
|
46304
|
-
function
|
|
46305
|
-
|
|
46306
|
-
|
|
46286
|
+
function hidesContents(element) {
|
|
46287
|
+
var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0;
|
|
46288
|
+
if (zeroSize && !element.innerHTML) return true;
|
|
46289
|
+
try {
|
|
46290
|
+
var style = window.getComputedStyle(element);
|
|
46291
|
+
var displayValue = style.getPropertyValue("display");
|
|
46292
|
+
return zeroSize ? displayValue !== DISPLAY_CONTENTS && isNotOverflowing(element, style) : displayValue === DISPLAY_NONE;
|
|
46293
|
+
} catch (exception) {
|
|
46294
|
+
console.warn("Failed to inspect element style");
|
|
46295
|
+
return false;
|
|
46307
46296
|
}
|
|
46308
46297
|
}
|
|
46309
|
-
function
|
|
46310
|
-
|
|
46311
|
-
|
|
46298
|
+
function visible(element) {
|
|
46299
|
+
var parentElement = element;
|
|
46300
|
+
var rootNode = element.getRootNode && element.getRootNode();
|
|
46301
|
+
while (parentElement) {
|
|
46302
|
+
if (parentElement === document.body) break;
|
|
46303
|
+
if (rootNode && parentElement === rootNode) parentElement = rootNode.host.parentNode;
|
|
46304
|
+
if (hidesContents(parentElement)) return false;
|
|
46305
|
+
parentElement = parentElement.parentNode;
|
|
46312
46306
|
}
|
|
46313
|
-
return
|
|
46307
|
+
return true;
|
|
46314
46308
|
}
|
|
46315
|
-
function
|
|
46316
|
-
|
|
46317
|
-
|
|
46318
|
-
|
|
46319
|
-
|
|
46320
|
-
|
|
46321
|
-
|
|
46322
|
-
|
|
46323
|
-
|
|
46324
|
-
|
|
46325
|
-
|
|
46326
|
-
|
|
46327
|
-
|
|
46309
|
+
function focusable(element, isTabIndexNotNaN) {
|
|
46310
|
+
var nodeName = element.nodeName.toLowerCase();
|
|
46311
|
+
var res = tabbableNode.test(nodeName) && !element.disabled || (nodeName === "a" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN);
|
|
46312
|
+
return res && visible(element);
|
|
46313
|
+
}
|
|
46314
|
+
function tabbable(element) {
|
|
46315
|
+
var tabIndex = element.getAttribute("tabindex");
|
|
46316
|
+
if (tabIndex === null) tabIndex = undefined;
|
|
46317
|
+
var isTabIndexNaN = isNaN(tabIndex);
|
|
46318
|
+
return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN);
|
|
46319
|
+
}
|
|
46320
|
+
function findTabbableDescendants(element) {
|
|
46321
|
+
var descendants = [].slice.call(element.querySelectorAll("*"), 0).reduce(function (finished, el) {
|
|
46322
|
+
return finished.concat(!el.shadowRoot ? [el] : findTabbableDescendants(el.shadowRoot));
|
|
46323
|
+
}, []);
|
|
46324
|
+
return descendants.filter(tabbable);
|
|
46328
46325
|
}
|
|
46329
|
-
var CLASS_NAMES = {
|
|
46330
|
-
overlay: "ReactModal__Overlay",
|
|
46331
|
-
content: "ReactModal__Content"
|
|
46332
|
-
};
|
|
46333
|
-
var isTabKey = function isTabKey(event) {
|
|
46334
|
-
return event.code === "Tab" || event.keyCode === 9;
|
|
46335
|
-
};
|
|
46336
|
-
var isEscKey = function isEscKey(event) {
|
|
46337
|
-
return event.code === "Escape" || event.keyCode === 27;
|
|
46338
|
-
};
|
|
46339
|
-
var ariaHiddenInstances = 0;
|
|
46340
|
-
var ModalPortal = function (_Component) {
|
|
46341
|
-
_inherits(ModalPortal, _Component);
|
|
46342
|
-
function ModalPortal(props) {
|
|
46343
|
-
_classCallCheck(this, ModalPortal);
|
|
46344
|
-
var _this = _possibleConstructorReturn(this, (ModalPortal.__proto__ || Object.getPrototypeOf(ModalPortal)).call(this, props));
|
|
46345
|
-
_this.setOverlayRef = function (overlay) {
|
|
46346
|
-
_this.overlay = overlay;
|
|
46347
|
-
_this.props.overlayRef && _this.props.overlayRef(overlay);
|
|
46348
|
-
};
|
|
46349
|
-
_this.setContentRef = function (content) {
|
|
46350
|
-
_this.content = content;
|
|
46351
|
-
_this.props.contentRef && _this.props.contentRef(content);
|
|
46352
|
-
};
|
|
46353
|
-
_this.afterClose = function () {
|
|
46354
|
-
var _this$props = _this.props,
|
|
46355
|
-
appElement = _this$props.appElement,
|
|
46356
|
-
ariaHideApp = _this$props.ariaHideApp,
|
|
46357
|
-
htmlOpenClassName = _this$props.htmlOpenClassName,
|
|
46358
|
-
bodyOpenClassName = _this$props.bodyOpenClassName,
|
|
46359
|
-
parentSelector = _this$props.parentSelector;
|
|
46360
|
-
var parentDocument = parentSelector && parentSelector().ownerDocument || document;
|
|
46361
|
-
bodyOpenClassName && classList$1.remove(parentDocument.body, bodyOpenClassName);
|
|
46362
|
-
htmlOpenClassName && classList$1.remove(parentDocument.getElementsByTagName("html")[0], htmlOpenClassName);
|
|
46363
|
-
if (ariaHideApp && ariaHiddenInstances > 0) {
|
|
46364
|
-
ariaHiddenInstances -= 1;
|
|
46365
|
-
if (ariaHiddenInstances === 0) {
|
|
46366
|
-
ariaAppHider$1.show(appElement);
|
|
46367
|
-
}
|
|
46368
|
-
}
|
|
46369
|
-
if (_this.props.shouldFocusAfterRender) {
|
|
46370
|
-
if (_this.props.shouldReturnFocusAfterClose) {
|
|
46371
|
-
focusManager$1.returnFocus(_this.props.preventScroll);
|
|
46372
|
-
focusManager$1.teardownScopedFocus();
|
|
46373
|
-
} else {
|
|
46374
|
-
focusManager$1.popWithoutFocus();
|
|
46375
|
-
}
|
|
46376
|
-
}
|
|
46377
|
-
if (_this.props.onAfterClose) {
|
|
46378
|
-
_this.props.onAfterClose();
|
|
46379
|
-
}
|
|
46380
|
-
_portalOpenInstances2.default.deregister(_this);
|
|
46381
|
-
};
|
|
46382
|
-
_this.open = function () {
|
|
46383
|
-
_this.beforeOpen();
|
|
46384
|
-
if (_this.state.afterOpen && _this.state.beforeClose) {
|
|
46385
|
-
clearTimeout(_this.closeTimer);
|
|
46386
|
-
_this.setState({
|
|
46387
|
-
beforeClose: false
|
|
46388
|
-
});
|
|
46389
|
-
} else {
|
|
46390
|
-
if (_this.props.shouldFocusAfterRender) {
|
|
46391
|
-
focusManager$1.setupScopedFocus(_this.node);
|
|
46392
|
-
focusManager$1.markForFocusLater();
|
|
46393
|
-
}
|
|
46394
|
-
_this.setState({
|
|
46395
|
-
isOpen: true
|
|
46396
|
-
}, function () {
|
|
46397
|
-
_this.openAnimationFrame = requestAnimationFrame(function () {
|
|
46398
|
-
_this.setState({
|
|
46399
|
-
afterOpen: true
|
|
46400
|
-
});
|
|
46401
|
-
if (_this.props.isOpen && _this.props.onAfterOpen) {
|
|
46402
|
-
_this.props.onAfterOpen({
|
|
46403
|
-
overlayEl: _this.overlay,
|
|
46404
|
-
contentEl: _this.content
|
|
46405
|
-
});
|
|
46406
|
-
}
|
|
46407
|
-
});
|
|
46408
|
-
});
|
|
46409
|
-
}
|
|
46410
|
-
};
|
|
46411
|
-
_this.close = function () {
|
|
46412
|
-
if (_this.props.closeTimeoutMS > 0) {
|
|
46413
|
-
_this.closeWithTimeout();
|
|
46414
|
-
} else {
|
|
46415
|
-
_this.closeWithoutTimeout();
|
|
46416
|
-
}
|
|
46417
|
-
};
|
|
46418
|
-
_this.focusContent = function () {
|
|
46419
|
-
return _this.content && !_this.contentHasFocus() && _this.content.focus({
|
|
46420
|
-
preventScroll: true
|
|
46421
|
-
});
|
|
46422
|
-
};
|
|
46423
|
-
_this.closeWithTimeout = function () {
|
|
46424
|
-
var closesAt = Date.now() + _this.props.closeTimeoutMS;
|
|
46425
|
-
_this.setState({
|
|
46426
|
-
beforeClose: true,
|
|
46427
|
-
closesAt: closesAt
|
|
46428
|
-
}, function () {
|
|
46429
|
-
_this.closeTimer = setTimeout(_this.closeWithoutTimeout, _this.state.closesAt - Date.now());
|
|
46430
|
-
});
|
|
46431
|
-
};
|
|
46432
|
-
_this.closeWithoutTimeout = function () {
|
|
46433
|
-
_this.setState({
|
|
46434
|
-
beforeClose: false,
|
|
46435
|
-
isOpen: false,
|
|
46436
|
-
afterOpen: false,
|
|
46437
|
-
closesAt: null
|
|
46438
|
-
}, _this.afterClose);
|
|
46439
|
-
};
|
|
46440
|
-
_this.handleKeyDown = function (event) {
|
|
46441
|
-
if (isTabKey(event)) {
|
|
46442
|
-
(0, _scopeTab2.default)(_this.content, event);
|
|
46443
|
-
}
|
|
46444
|
-
if (_this.props.shouldCloseOnEsc && isEscKey(event)) {
|
|
46445
|
-
event.stopPropagation();
|
|
46446
|
-
_this.requestClose(event);
|
|
46447
|
-
}
|
|
46448
|
-
};
|
|
46449
|
-
_this.handleOverlayOnClick = function (event) {
|
|
46450
|
-
if (_this.shouldClose === null) {
|
|
46451
|
-
_this.shouldClose = true;
|
|
46452
|
-
}
|
|
46453
|
-
if (_this.shouldClose && _this.props.shouldCloseOnOverlayClick) {
|
|
46454
|
-
if (_this.ownerHandlesClose()) {
|
|
46455
|
-
_this.requestClose(event);
|
|
46456
|
-
} else {
|
|
46457
|
-
_this.focusContent();
|
|
46458
|
-
}
|
|
46459
|
-
}
|
|
46460
|
-
_this.shouldClose = null;
|
|
46461
|
-
};
|
|
46462
|
-
_this.handleContentOnMouseUp = function () {
|
|
46463
|
-
_this.shouldClose = false;
|
|
46464
|
-
};
|
|
46465
|
-
_this.handleOverlayOnMouseDown = function (event) {
|
|
46466
|
-
if (!_this.props.shouldCloseOnOverlayClick && event.target == _this.overlay) {
|
|
46467
|
-
event.preventDefault();
|
|
46468
|
-
}
|
|
46469
|
-
};
|
|
46470
|
-
_this.handleContentOnClick = function () {
|
|
46471
|
-
_this.shouldClose = false;
|
|
46472
|
-
};
|
|
46473
|
-
_this.handleContentOnMouseDown = function () {
|
|
46474
|
-
_this.shouldClose = false;
|
|
46475
|
-
};
|
|
46476
|
-
_this.requestClose = function (event) {
|
|
46477
|
-
return _this.ownerHandlesClose() && _this.props.onRequestClose(event);
|
|
46478
|
-
};
|
|
46479
|
-
_this.ownerHandlesClose = function () {
|
|
46480
|
-
return _this.props.onRequestClose;
|
|
46481
|
-
};
|
|
46482
|
-
_this.shouldBeClosed = function () {
|
|
46483
|
-
return !_this.state.isOpen && !_this.state.beforeClose;
|
|
46484
|
-
};
|
|
46485
|
-
_this.contentHasFocus = function () {
|
|
46486
|
-
return document.activeElement === _this.content || _this.content.contains(document.activeElement);
|
|
46487
|
-
};
|
|
46488
|
-
_this.buildClassName = function (which, additional) {
|
|
46489
|
-
var classNames = (typeof additional === "undefined" ? "undefined" : _typeof(additional)) === "object" ? additional : {
|
|
46490
|
-
base: CLASS_NAMES[which],
|
|
46491
|
-
afterOpen: CLASS_NAMES[which] + "--after-open",
|
|
46492
|
-
beforeClose: CLASS_NAMES[which] + "--before-close"
|
|
46493
|
-
};
|
|
46494
|
-
var className = classNames.base;
|
|
46495
|
-
if (_this.state.afterOpen) {
|
|
46496
|
-
className = className + " " + classNames.afterOpen;
|
|
46497
|
-
}
|
|
46498
|
-
if (_this.state.beforeClose) {
|
|
46499
|
-
className = className + " " + classNames.beforeClose;
|
|
46500
|
-
}
|
|
46501
|
-
return typeof additional === "string" && additional ? className + " " + additional : className;
|
|
46502
|
-
};
|
|
46503
|
-
_this.attributesFromObject = function (prefix, items) {
|
|
46504
|
-
return Object.keys(items).reduce(function (acc, name) {
|
|
46505
|
-
acc[prefix + "-" + name] = items[name];
|
|
46506
|
-
return acc;
|
|
46507
|
-
}, {});
|
|
46508
|
-
};
|
|
46509
|
-
_this.state = {
|
|
46510
|
-
afterOpen: false,
|
|
46511
|
-
beforeClose: false
|
|
46512
|
-
};
|
|
46513
|
-
_this.shouldClose = null;
|
|
46514
|
-
_this.moveFromContentToOverlay = null;
|
|
46515
|
-
return _this;
|
|
46516
|
-
}
|
|
46517
|
-
_createClass(ModalPortal, [{
|
|
46518
|
-
key: "componentDidMount",
|
|
46519
|
-
value: function componentDidMount() {
|
|
46520
|
-
if (this.props.isOpen) {
|
|
46521
|
-
this.open();
|
|
46522
|
-
}
|
|
46523
|
-
}
|
|
46524
|
-
}, {
|
|
46525
|
-
key: "componentDidUpdate",
|
|
46526
|
-
value: function componentDidUpdate(prevProps, prevState) {
|
|
46527
|
-
if (process.env.NODE_ENV !== "production") {
|
|
46528
|
-
if (prevProps.bodyOpenClassName !== this.props.bodyOpenClassName) {
|
|
46529
|
-
console.warn('React-Modal: "bodyOpenClassName" prop has been modified. ' + "This may cause unexpected behavior when multiple modals are open.");
|
|
46530
|
-
}
|
|
46531
|
-
if (prevProps.htmlOpenClassName !== this.props.htmlOpenClassName) {
|
|
46532
|
-
console.warn('React-Modal: "htmlOpenClassName" prop has been modified. ' + "This may cause unexpected behavior when multiple modals are open.");
|
|
46533
|
-
}
|
|
46534
|
-
}
|
|
46535
|
-
if (this.props.isOpen && !prevProps.isOpen) {
|
|
46536
|
-
this.open();
|
|
46537
|
-
} else if (!this.props.isOpen && prevProps.isOpen) {
|
|
46538
|
-
this.close();
|
|
46539
|
-
}
|
|
46540
|
-
if (this.props.shouldFocusAfterRender && this.state.isOpen && !prevState.isOpen) {
|
|
46541
|
-
this.focusContent();
|
|
46542
|
-
}
|
|
46543
|
-
}
|
|
46544
|
-
}, {
|
|
46545
|
-
key: "componentWillUnmount",
|
|
46546
|
-
value: function componentWillUnmount() {
|
|
46547
|
-
if (this.state.isOpen) {
|
|
46548
|
-
this.afterClose();
|
|
46549
|
-
}
|
|
46550
|
-
clearTimeout(this.closeTimer);
|
|
46551
|
-
cancelAnimationFrame(this.openAnimationFrame);
|
|
46552
|
-
}
|
|
46553
|
-
}, {
|
|
46554
|
-
key: "beforeOpen",
|
|
46555
|
-
value: function beforeOpen() {
|
|
46556
|
-
var _props = this.props,
|
|
46557
|
-
appElement = _props.appElement,
|
|
46558
|
-
ariaHideApp = _props.ariaHideApp,
|
|
46559
|
-
htmlOpenClassName = _props.htmlOpenClassName,
|
|
46560
|
-
bodyOpenClassName = _props.bodyOpenClassName,
|
|
46561
|
-
parentSelector = _props.parentSelector;
|
|
46562
|
-
var parentDocument = parentSelector && parentSelector().ownerDocument || document;
|
|
46563
|
-
bodyOpenClassName && classList$1.add(parentDocument.body, bodyOpenClassName);
|
|
46564
|
-
htmlOpenClassName && classList$1.add(parentDocument.getElementsByTagName("html")[0], htmlOpenClassName);
|
|
46565
|
-
if (ariaHideApp) {
|
|
46566
|
-
ariaHiddenInstances += 1;
|
|
46567
|
-
ariaAppHider$1.hide(appElement);
|
|
46568
|
-
}
|
|
46569
|
-
_portalOpenInstances2.default.register(this);
|
|
46570
|
-
}
|
|
46571
|
-
}, {
|
|
46572
|
-
key: "render",
|
|
46573
|
-
value: function render() {
|
|
46574
|
-
var _props2 = this.props,
|
|
46575
|
-
id = _props2.id,
|
|
46576
|
-
className = _props2.className,
|
|
46577
|
-
overlayClassName = _props2.overlayClassName,
|
|
46578
|
-
defaultStyles = _props2.defaultStyles,
|
|
46579
|
-
children = _props2.children;
|
|
46580
|
-
var contentStyles = className ? {} : defaultStyles.content;
|
|
46581
|
-
var overlayStyles = overlayClassName ? {} : defaultStyles.overlay;
|
|
46582
|
-
if (this.shouldBeClosed()) {
|
|
46583
|
-
return null;
|
|
46584
|
-
}
|
|
46585
|
-
var overlayProps = {
|
|
46586
|
-
ref: this.setOverlayRef,
|
|
46587
|
-
className: this.buildClassName("overlay", overlayClassName),
|
|
46588
|
-
style: _extends({}, overlayStyles, this.props.style.overlay),
|
|
46589
|
-
onClick: this.handleOverlayOnClick,
|
|
46590
|
-
onMouseDown: this.handleOverlayOnMouseDown
|
|
46591
|
-
};
|
|
46592
|
-
var contentProps = _extends({
|
|
46593
|
-
id: id,
|
|
46594
|
-
ref: this.setContentRef,
|
|
46595
|
-
style: _extends({}, contentStyles, this.props.style.content),
|
|
46596
|
-
className: this.buildClassName("content", className),
|
|
46597
|
-
tabIndex: "-1",
|
|
46598
|
-
onKeyDown: this.handleKeyDown,
|
|
46599
|
-
onMouseDown: this.handleContentOnMouseDown,
|
|
46600
|
-
onMouseUp: this.handleContentOnMouseUp,
|
|
46601
|
-
onClick: this.handleContentOnClick,
|
|
46602
|
-
role: this.props.role,
|
|
46603
|
-
"aria-label": this.props.contentLabel
|
|
46604
|
-
}, this.attributesFromObject("aria", _extends({
|
|
46605
|
-
modal: true
|
|
46606
|
-
}, this.props.aria)), this.attributesFromObject("data", this.props.data || {}), {
|
|
46607
|
-
"data-testid": this.props.testId
|
|
46608
|
-
});
|
|
46609
|
-
var contentElement = this.props.contentElement(contentProps, children);
|
|
46610
|
-
return this.props.overlayElement(overlayProps, contentElement);
|
|
46611
|
-
}
|
|
46612
|
-
}]);
|
|
46613
|
-
return ModalPortal;
|
|
46614
|
-
}(React__default.Component);
|
|
46615
|
-
ModalPortal.defaultProps = {
|
|
46616
|
-
style: {
|
|
46617
|
-
overlay: {},
|
|
46618
|
-
content: {}
|
|
46619
|
-
},
|
|
46620
|
-
defaultStyles: {}
|
|
46621
|
-
};
|
|
46622
|
-
ModalPortal.propTypes = {
|
|
46623
|
-
isOpen: _propTypes2.default.bool.isRequired,
|
|
46624
|
-
defaultStyles: _propTypes2.default.shape({
|
|
46625
|
-
content: _propTypes2.default.object,
|
|
46626
|
-
overlay: _propTypes2.default.object
|
|
46627
|
-
}),
|
|
46628
|
-
style: _propTypes2.default.shape({
|
|
46629
|
-
content: _propTypes2.default.object,
|
|
46630
|
-
overlay: _propTypes2.default.object
|
|
46631
|
-
}),
|
|
46632
|
-
className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
|
|
46633
|
-
overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
|
|
46634
|
-
parentSelector: _propTypes2.default.func,
|
|
46635
|
-
bodyOpenClassName: _propTypes2.default.string,
|
|
46636
|
-
htmlOpenClassName: _propTypes2.default.string,
|
|
46637
|
-
ariaHideApp: _propTypes2.default.bool,
|
|
46638
|
-
appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),
|
|
46639
|
-
onAfterOpen: _propTypes2.default.func,
|
|
46640
|
-
onAfterClose: _propTypes2.default.func,
|
|
46641
|
-
onRequestClose: _propTypes2.default.func,
|
|
46642
|
-
closeTimeoutMS: _propTypes2.default.number,
|
|
46643
|
-
shouldFocusAfterRender: _propTypes2.default.bool,
|
|
46644
|
-
shouldCloseOnOverlayClick: _propTypes2.default.bool,
|
|
46645
|
-
shouldReturnFocusAfterClose: _propTypes2.default.bool,
|
|
46646
|
-
preventScroll: _propTypes2.default.bool,
|
|
46647
|
-
role: _propTypes2.default.string,
|
|
46648
|
-
contentLabel: _propTypes2.default.string,
|
|
46649
|
-
aria: _propTypes2.default.object,
|
|
46650
|
-
data: _propTypes2.default.object,
|
|
46651
|
-
children: _propTypes2.default.node,
|
|
46652
|
-
shouldCloseOnEsc: _propTypes2.default.bool,
|
|
46653
|
-
overlayRef: _propTypes2.default.func,
|
|
46654
|
-
contentRef: _propTypes2.default.func,
|
|
46655
|
-
id: _propTypes2.default.string,
|
|
46656
|
-
overlayElement: _propTypes2.default.func,
|
|
46657
|
-
contentElement: _propTypes2.default.func,
|
|
46658
|
-
testId: _propTypes2.default.string
|
|
46659
|
-
};
|
|
46660
|
-
exports.default = ModalPortal;
|
|
46661
46326
|
module.exports = exports["default"];
|
|
46662
46327
|
});
|
|
46663
|
-
unwrapExports(
|
|
46328
|
+
unwrapExports(tabbable_1);
|
|
46664
46329
|
|
|
46665
|
-
function
|
|
46666
|
-
|
|
46667
|
-
|
|
46668
|
-
|
|
46669
|
-
}
|
|
46670
|
-
|
|
46671
|
-
|
|
46672
|
-
|
|
46673
|
-
|
|
46674
|
-
|
|
46330
|
+
var focusManager = createCommonjsModule(function (module, exports) {
|
|
46331
|
+
|
|
46332
|
+
Object.defineProperty(exports, "__esModule", {
|
|
46333
|
+
value: true
|
|
46334
|
+
});
|
|
46335
|
+
exports.resetState = resetState;
|
|
46336
|
+
exports.log = log;
|
|
46337
|
+
exports.handleBlur = handleBlur;
|
|
46338
|
+
exports.handleFocus = handleFocus;
|
|
46339
|
+
exports.markForFocusLater = markForFocusLater;
|
|
46340
|
+
exports.returnFocus = returnFocus;
|
|
46341
|
+
exports.popWithoutFocus = popWithoutFocus;
|
|
46342
|
+
exports.setupScopedFocus = setupScopedFocus;
|
|
46343
|
+
exports.teardownScopedFocus = teardownScopedFocus;
|
|
46344
|
+
var _tabbable2 = _interopRequireDefault(tabbable_1);
|
|
46345
|
+
function _interopRequireDefault(obj) {
|
|
46346
|
+
return obj && obj.__esModule ? obj : {
|
|
46347
|
+
default: obj
|
|
46348
|
+
};
|
|
46675
46349
|
}
|
|
46676
|
-
|
|
46677
|
-
|
|
46678
|
-
|
|
46679
|
-
|
|
46680
|
-
|
|
46681
|
-
var prevState = this.state;
|
|
46682
|
-
this.props = nextProps;
|
|
46683
|
-
this.state = nextState;
|
|
46684
|
-
this.__reactInternalSnapshotFlag = true;
|
|
46685
|
-
this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(prevProps, prevState);
|
|
46686
|
-
} finally {
|
|
46687
|
-
this.props = prevProps;
|
|
46688
|
-
this.state = prevState;
|
|
46350
|
+
var focusLaterElements = [];
|
|
46351
|
+
var modalElement = null;
|
|
46352
|
+
var needToFocus = false;
|
|
46353
|
+
function resetState() {
|
|
46354
|
+
focusLaterElements = [];
|
|
46689
46355
|
}
|
|
46690
|
-
|
|
46691
|
-
|
|
46692
|
-
|
|
46693
|
-
|
|
46694
|
-
|
|
46695
|
-
|
|
46696
|
-
|
|
46697
|
-
|
|
46356
|
+
function log() {
|
|
46357
|
+
if (process.env.NODE_ENV !== "production") {
|
|
46358
|
+
console.log("focusManager ----------");
|
|
46359
|
+
focusLaterElements.forEach(function (f) {
|
|
46360
|
+
var check = f || {};
|
|
46361
|
+
console.log(check.nodeName, check.className, check.id);
|
|
46362
|
+
});
|
|
46363
|
+
console.log("end focusManager ----------");
|
|
46364
|
+
}
|
|
46698
46365
|
}
|
|
46699
|
-
|
|
46700
|
-
|
|
46366
|
+
function handleBlur() {
|
|
46367
|
+
needToFocus = true;
|
|
46701
46368
|
}
|
|
46702
|
-
|
|
46703
|
-
|
|
46704
|
-
|
|
46705
|
-
|
|
46706
|
-
|
|
46707
|
-
|
|
46708
|
-
|
|
46369
|
+
function handleFocus() {
|
|
46370
|
+
if (needToFocus) {
|
|
46371
|
+
needToFocus = false;
|
|
46372
|
+
if (!modalElement) {
|
|
46373
|
+
return;
|
|
46374
|
+
}
|
|
46375
|
+
setTimeout(function () {
|
|
46376
|
+
if (modalElement.contains(document.activeElement)) {
|
|
46377
|
+
return;
|
|
46378
|
+
}
|
|
46379
|
+
var el = (0, _tabbable2.default)(modalElement)[0] || modalElement;
|
|
46380
|
+
el.focus();
|
|
46381
|
+
}, 0);
|
|
46382
|
+
}
|
|
46709
46383
|
}
|
|
46710
|
-
|
|
46711
|
-
|
|
46712
|
-
} else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
|
|
46713
|
-
foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
|
|
46384
|
+
function markForFocusLater() {
|
|
46385
|
+
focusLaterElements.push(document.activeElement);
|
|
46714
46386
|
}
|
|
46715
|
-
|
|
46716
|
-
|
|
46717
|
-
|
|
46718
|
-
|
|
46387
|
+
function returnFocus() {
|
|
46388
|
+
var preventScroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
46389
|
+
var toFocus = null;
|
|
46390
|
+
try {
|
|
46391
|
+
if (focusLaterElements.length !== 0) {
|
|
46392
|
+
toFocus = focusLaterElements.pop();
|
|
46393
|
+
toFocus.focus({
|
|
46394
|
+
preventScroll: preventScroll
|
|
46395
|
+
});
|
|
46396
|
+
}
|
|
46397
|
+
return;
|
|
46398
|
+
} catch (e) {
|
|
46399
|
+
console.warn(["You tried to return focus to", toFocus, "but it is not in the DOM anymore"].join(" "));
|
|
46400
|
+
}
|
|
46719
46401
|
}
|
|
46720
|
-
|
|
46721
|
-
|
|
46722
|
-
var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
|
|
46723
|
-
throw Error('Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + componentName + ' uses ' + newApiName + ' but also contains the following legacy lifecycles:' + (foundWillMountName !== null ? '\n ' + foundWillMountName : '') + (foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '') + (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') + '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks');
|
|
46402
|
+
function popWithoutFocus() {
|
|
46403
|
+
focusLaterElements.length > 0 && focusLaterElements.pop();
|
|
46724
46404
|
}
|
|
46725
|
-
|
|
46726
|
-
|
|
46727
|
-
|
|
46405
|
+
function setupScopedFocus(element) {
|
|
46406
|
+
modalElement = element;
|
|
46407
|
+
if (window.addEventListener) {
|
|
46408
|
+
window.addEventListener("blur", handleBlur, false);
|
|
46409
|
+
document.addEventListener("focus", handleFocus, true);
|
|
46410
|
+
} else {
|
|
46411
|
+
window.attachEvent("onBlur", handleBlur);
|
|
46412
|
+
document.attachEvent("onFocus", handleFocus);
|
|
46413
|
+
}
|
|
46728
46414
|
}
|
|
46729
|
-
|
|
46730
|
-
|
|
46731
|
-
|
|
46415
|
+
function teardownScopedFocus() {
|
|
46416
|
+
modalElement = null;
|
|
46417
|
+
if (window.addEventListener) {
|
|
46418
|
+
window.removeEventListener("blur", handleBlur);
|
|
46419
|
+
document.removeEventListener("focus", handleFocus);
|
|
46420
|
+
} else {
|
|
46421
|
+
window.detachEvent("onBlur", handleBlur);
|
|
46422
|
+
document.detachEvent("onFocus", handleFocus);
|
|
46732
46423
|
}
|
|
46733
|
-
prototype.componentWillUpdate = componentWillUpdate;
|
|
46734
|
-
var componentDidUpdate = prototype.componentDidUpdate;
|
|
46735
|
-
prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) {
|
|
46736
|
-
var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot;
|
|
46737
|
-
componentDidUpdate.call(this, prevProps, prevState, snapshot);
|
|
46738
|
-
};
|
|
46739
46424
|
}
|
|
46740
|
-
|
|
46741
|
-
|
|
46742
|
-
|
|
46743
|
-
var reactLifecyclesCompat_es = {
|
|
46744
|
-
__proto__: null,
|
|
46745
|
-
polyfill: polyfill
|
|
46746
|
-
};
|
|
46425
|
+
});
|
|
46426
|
+
unwrapExports(focusManager);
|
|
46747
46427
|
|
|
46748
|
-
var
|
|
46428
|
+
var scopeTab_1 = createCommonjsModule(function (module, exports) {
|
|
46749
46429
|
|
|
46750
46430
|
Object.defineProperty(exports, "__esModule", {
|
|
46751
46431
|
value: true
|
|
46752
46432
|
});
|
|
46753
|
-
exports.
|
|
46754
|
-
var
|
|
46755
|
-
|
|
46756
|
-
|
|
46757
|
-
|
|
46758
|
-
|
|
46759
|
-
|
|
46760
|
-
|
|
46761
|
-
|
|
46433
|
+
exports.default = scopeTab;
|
|
46434
|
+
var _tabbable2 = _interopRequireDefault(tabbable_1);
|
|
46435
|
+
function _interopRequireDefault(obj) {
|
|
46436
|
+
return obj && obj.__esModule ? obj : {
|
|
46437
|
+
default: obj
|
|
46438
|
+
};
|
|
46439
|
+
}
|
|
46440
|
+
function getActiveElement() {
|
|
46441
|
+
var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
46442
|
+
return el.activeElement.shadowRoot ? getActiveElement(el.activeElement.shadowRoot) : el.activeElement;
|
|
46443
|
+
}
|
|
46444
|
+
function scopeTab(node, event) {
|
|
46445
|
+
var tabbable = (0, _tabbable2.default)(node);
|
|
46446
|
+
if (!tabbable.length) {
|
|
46447
|
+
event.preventDefault();
|
|
46448
|
+
return;
|
|
46762
46449
|
}
|
|
46763
|
-
|
|
46450
|
+
var target = void 0;
|
|
46451
|
+
var shiftKey = event.shiftKey;
|
|
46452
|
+
var head = tabbable[0];
|
|
46453
|
+
var tail = tabbable[tabbable.length - 1];
|
|
46454
|
+
var activeElement = getActiveElement();
|
|
46455
|
+
if (node === activeElement) {
|
|
46456
|
+
if (!shiftKey) return;
|
|
46457
|
+
target = tail;
|
|
46458
|
+
}
|
|
46459
|
+
if (tail === activeElement && !shiftKey) {
|
|
46460
|
+
target = head;
|
|
46461
|
+
}
|
|
46462
|
+
if (head === activeElement && shiftKey) {
|
|
46463
|
+
target = tail;
|
|
46464
|
+
}
|
|
46465
|
+
if (target) {
|
|
46466
|
+
event.preventDefault();
|
|
46467
|
+
target.focus();
|
|
46468
|
+
return;
|
|
46469
|
+
}
|
|
46470
|
+
var checkSafari = /(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);
|
|
46471
|
+
var isSafariDesktop = checkSafari != null && checkSafari[1] != "Chrome" && /\biPod\b|\biPad\b/g.exec(navigator.userAgent) == null;
|
|
46472
|
+
if (!isSafariDesktop) return;
|
|
46473
|
+
var x = tabbable.indexOf(activeElement);
|
|
46474
|
+
if (x > -1) {
|
|
46475
|
+
x += shiftKey ? -1 : 1;
|
|
46476
|
+
}
|
|
46477
|
+
target = tabbable[x];
|
|
46478
|
+
if (typeof target === "undefined") {
|
|
46479
|
+
event.preventDefault();
|
|
46480
|
+
target = shiftKey ? tail : head;
|
|
46481
|
+
target.focus();
|
|
46482
|
+
return;
|
|
46483
|
+
}
|
|
46484
|
+
event.preventDefault();
|
|
46485
|
+
target.focus();
|
|
46486
|
+
}
|
|
46487
|
+
module.exports = exports["default"];
|
|
46488
|
+
});
|
|
46489
|
+
unwrapExports(scopeTab_1);
|
|
46490
|
+
|
|
46491
|
+
var __DEV__ = process.env.NODE_ENV !== 'production';
|
|
46492
|
+
var warning = function () {};
|
|
46493
|
+
if (__DEV__) {
|
|
46494
|
+
var printWarning$2 = function printWarning(format, args) {
|
|
46495
|
+
var len = arguments.length;
|
|
46496
|
+
args = new Array(len > 1 ? len - 1 : 0);
|
|
46497
|
+
for (var key = 1; key < len; key++) {
|
|
46498
|
+
args[key - 1] = arguments[key];
|
|
46499
|
+
}
|
|
46500
|
+
var argIndex = 0;
|
|
46501
|
+
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
|
46502
|
+
return args[argIndex++];
|
|
46503
|
+
});
|
|
46504
|
+
if (typeof console !== 'undefined') {
|
|
46505
|
+
console.error(message);
|
|
46506
|
+
}
|
|
46507
|
+
try {
|
|
46508
|
+
throw new Error(message);
|
|
46509
|
+
} catch (x) {}
|
|
46764
46510
|
};
|
|
46765
|
-
|
|
46766
|
-
|
|
46767
|
-
|
|
46768
|
-
|
|
46769
|
-
|
|
46770
|
-
descriptor.configurable = true;
|
|
46771
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
46772
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
46773
|
-
}
|
|
46511
|
+
warning = function (condition, format, args) {
|
|
46512
|
+
var len = arguments.length;
|
|
46513
|
+
args = new Array(len > 2 ? len - 2 : 0);
|
|
46514
|
+
for (var key = 2; key < len; key++) {
|
|
46515
|
+
args[key - 2] = arguments[key];
|
|
46774
46516
|
}
|
|
46775
|
-
|
|
46776
|
-
|
|
46777
|
-
|
|
46778
|
-
|
|
46517
|
+
if (format === undefined) {
|
|
46518
|
+
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
|
46519
|
+
}
|
|
46520
|
+
if (!condition) {
|
|
46521
|
+
printWarning$2.apply(null, [format].concat(args));
|
|
46522
|
+
}
|
|
46523
|
+
};
|
|
46524
|
+
}
|
|
46525
|
+
var warning_1 = warning;
|
|
46526
|
+
|
|
46527
|
+
var exenv = createCommonjsModule(function (module) {
|
|
46528
|
+
(function () {
|
|
46529
|
+
|
|
46530
|
+
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
46531
|
+
var ExecutionEnvironment = {
|
|
46532
|
+
canUseDOM: canUseDOM,
|
|
46533
|
+
canUseWorkers: typeof Worker !== 'undefined',
|
|
46534
|
+
canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
|
|
46535
|
+
canUseViewport: canUseDOM && !!window.screen
|
|
46779
46536
|
};
|
|
46780
|
-
|
|
46781
|
-
|
|
46782
|
-
var _reactDom2 = _interopRequireDefault(reactDom);
|
|
46783
|
-
var _propTypes2 = _interopRequireDefault(propTypes);
|
|
46784
|
-
var _ModalPortal2 = _interopRequireDefault(ModalPortal_1);
|
|
46785
|
-
var ariaAppHider$1 = _interopRequireWildcard(ariaAppHider);
|
|
46786
|
-
var _safeHTMLElement2 = _interopRequireDefault(safeHTMLElement);
|
|
46787
|
-
function _interopRequireWildcard(obj) {
|
|
46788
|
-
if (obj && obj.__esModule) {
|
|
46789
|
-
return obj;
|
|
46537
|
+
if ( module.exports) {
|
|
46538
|
+
module.exports = ExecutionEnvironment;
|
|
46790
46539
|
} else {
|
|
46791
|
-
|
|
46792
|
-
if (obj != null) {
|
|
46793
|
-
for (var key in obj) {
|
|
46794
|
-
if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
|
|
46795
|
-
}
|
|
46796
|
-
}
|
|
46797
|
-
newObj.default = obj;
|
|
46798
|
-
return newObj;
|
|
46540
|
+
window.ExecutionEnvironment = ExecutionEnvironment;
|
|
46799
46541
|
}
|
|
46542
|
+
})();
|
|
46543
|
+
});
|
|
46544
|
+
|
|
46545
|
+
var safeHTMLElement = createCommonjsModule(function (module, exports) {
|
|
46546
|
+
|
|
46547
|
+
Object.defineProperty(exports, "__esModule", {
|
|
46548
|
+
value: true
|
|
46549
|
+
});
|
|
46550
|
+
exports.canUseDOM = exports.SafeNodeList = exports.SafeHTMLCollection = undefined;
|
|
46551
|
+
var _exenv2 = _interopRequireDefault(exenv);
|
|
46552
|
+
function _interopRequireDefault(obj) {
|
|
46553
|
+
return obj && obj.__esModule ? obj : {
|
|
46554
|
+
default: obj
|
|
46555
|
+
};
|
|
46800
46556
|
}
|
|
46557
|
+
var EE = _exenv2.default;
|
|
46558
|
+
var SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {};
|
|
46559
|
+
var SafeHTMLCollection = exports.SafeHTMLCollection = EE.canUseDOM ? window.HTMLCollection : {};
|
|
46560
|
+
var SafeNodeList = exports.SafeNodeList = EE.canUseDOM ? window.NodeList : {};
|
|
46561
|
+
var canUseDOM = exports.canUseDOM = EE.canUseDOM;
|
|
46562
|
+
exports.default = SafeHTMLElement;
|
|
46563
|
+
});
|
|
46564
|
+
unwrapExports(safeHTMLElement);
|
|
46565
|
+
|
|
46566
|
+
var ariaAppHider = createCommonjsModule(function (module, exports) {
|
|
46567
|
+
|
|
46568
|
+
Object.defineProperty(exports, "__esModule", {
|
|
46569
|
+
value: true
|
|
46570
|
+
});
|
|
46571
|
+
exports.resetState = resetState;
|
|
46572
|
+
exports.log = log;
|
|
46573
|
+
exports.assertNodeList = assertNodeList;
|
|
46574
|
+
exports.setElement = setElement;
|
|
46575
|
+
exports.validateElement = validateElement;
|
|
46576
|
+
exports.hide = hide;
|
|
46577
|
+
exports.show = show;
|
|
46578
|
+
exports.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting;
|
|
46579
|
+
var _warning2 = _interopRequireDefault(warning_1);
|
|
46801
46580
|
function _interopRequireDefault(obj) {
|
|
46802
46581
|
return obj && obj.__esModule ? obj : {
|
|
46803
46582
|
default: obj
|
|
46804
46583
|
};
|
|
46805
46584
|
}
|
|
46806
|
-
|
|
46807
|
-
|
|
46808
|
-
|
|
46585
|
+
var globalElement = null;
|
|
46586
|
+
function resetState() {
|
|
46587
|
+
if (globalElement) {
|
|
46588
|
+
if (globalElement.removeAttribute) {
|
|
46589
|
+
globalElement.removeAttribute("aria-hidden");
|
|
46590
|
+
} else if (globalElement.length != null) {
|
|
46591
|
+
globalElement.forEach(function (element) {
|
|
46592
|
+
return element.removeAttribute("aria-hidden");
|
|
46593
|
+
});
|
|
46594
|
+
} else {
|
|
46595
|
+
document.querySelectorAll(globalElement).forEach(function (element) {
|
|
46596
|
+
return element.removeAttribute("aria-hidden");
|
|
46597
|
+
});
|
|
46598
|
+
}
|
|
46599
|
+
}
|
|
46600
|
+
globalElement = null;
|
|
46601
|
+
}
|
|
46602
|
+
function log() {
|
|
46603
|
+
if (process.env.NODE_ENV !== "production") {
|
|
46604
|
+
var check = globalElement || {};
|
|
46605
|
+
console.log("ariaAppHider ----------");
|
|
46606
|
+
console.log(check.nodeName, check.className, check.id);
|
|
46607
|
+
console.log("end ariaAppHider ----------");
|
|
46809
46608
|
}
|
|
46810
46609
|
}
|
|
46811
|
-
function
|
|
46812
|
-
if (!
|
|
46813
|
-
throw new
|
|
46610
|
+
function assertNodeList(nodeList, selector) {
|
|
46611
|
+
if (!nodeList || !nodeList.length) {
|
|
46612
|
+
throw new Error("react-modal: No elements were found for selector " + selector + ".");
|
|
46814
46613
|
}
|
|
46815
|
-
return call && (typeof call === "object" || typeof call === "function") ? call : self;
|
|
46816
46614
|
}
|
|
46817
|
-
function
|
|
46818
|
-
|
|
46819
|
-
|
|
46615
|
+
function setElement(element) {
|
|
46616
|
+
var useElement = element;
|
|
46617
|
+
if (typeof useElement === "string" && safeHTMLElement.canUseDOM) {
|
|
46618
|
+
var el = document.querySelectorAll(useElement);
|
|
46619
|
+
assertNodeList(el, useElement);
|
|
46620
|
+
useElement = el;
|
|
46820
46621
|
}
|
|
46821
|
-
|
|
46822
|
-
|
|
46823
|
-
value: subClass,
|
|
46824
|
-
enumerable: false,
|
|
46825
|
-
writable: true,
|
|
46826
|
-
configurable: true
|
|
46827
|
-
}
|
|
46828
|
-
});
|
|
46829
|
-
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
|
46830
|
-
}
|
|
46831
|
-
var portalClassName = exports.portalClassName = "ReactModalPortal";
|
|
46832
|
-
var bodyOpenClassName = exports.bodyOpenClassName = "ReactModal__Body--open";
|
|
46833
|
-
var isReact16 = safeHTMLElement.canUseDOM && _reactDom2.default.createPortal !== undefined;
|
|
46834
|
-
var createHTMLElement = function createHTMLElement(name) {
|
|
46835
|
-
return document.createElement(name);
|
|
46836
|
-
};
|
|
46837
|
-
var getCreatePortal = function getCreatePortal() {
|
|
46838
|
-
return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer;
|
|
46839
|
-
};
|
|
46840
|
-
function getParentElement(parentSelector) {
|
|
46841
|
-
return parentSelector();
|
|
46622
|
+
globalElement = useElement || globalElement;
|
|
46623
|
+
return globalElement;
|
|
46842
46624
|
}
|
|
46843
|
-
|
|
46844
|
-
|
|
46845
|
-
|
|
46846
|
-
|
|
46847
|
-
|
|
46848
|
-
|
|
46849
|
-
|
|
46850
|
-
args[_key] = arguments[_key];
|
|
46851
|
-
}
|
|
46852
|
-
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () {
|
|
46853
|
-
!isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node);
|
|
46854
|
-
var parent = getParentElement(_this.props.parentSelector);
|
|
46855
|
-
if (parent && parent.contains(_this.node)) {
|
|
46856
|
-
parent.removeChild(_this.node);
|
|
46857
|
-
} else {
|
|
46858
|
-
console.warn('React-Modal: "parentSelector" prop did not returned any DOM ' + "element. Make sure that the parent element is unmounted to " + "avoid any memory leaks.");
|
|
46859
|
-
}
|
|
46860
|
-
}, _this.portalRef = function (ref) {
|
|
46861
|
-
_this.portal = ref;
|
|
46862
|
-
}, _this.renderPortal = function (props) {
|
|
46863
|
-
var createPortal = getCreatePortal();
|
|
46864
|
-
var portal = createPortal(_this, _react2.default.createElement(_ModalPortal2.default, _extends({
|
|
46865
|
-
defaultStyles: Modal.defaultStyles
|
|
46866
|
-
}, props)), _this.node);
|
|
46867
|
-
_this.portalRef(portal);
|
|
46868
|
-
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
46625
|
+
function validateElement(appElement) {
|
|
46626
|
+
var el = appElement || globalElement;
|
|
46627
|
+
if (el) {
|
|
46628
|
+
return Array.isArray(el) || el instanceof HTMLCollection || el instanceof NodeList ? el : [el];
|
|
46629
|
+
} else {
|
|
46630
|
+
(0, _warning2.default)(false, ["react-modal: App element is not defined.", "Please use `Modal.setAppElement(el)` or set `appElement={el}`.", "This is needed so screen readers don't see main content", "when modal is opened. It is not recommended, but you can opt-out", "by setting `ariaHideApp={false}`."].join(" "));
|
|
46631
|
+
return [];
|
|
46869
46632
|
}
|
|
46870
|
-
|
|
46871
|
-
|
|
46872
|
-
|
|
46873
|
-
|
|
46874
|
-
|
|
46875
|
-
|
|
46876
|
-
|
|
46877
|
-
|
|
46878
|
-
|
|
46879
|
-
parent.appendChild(this.node);
|
|
46880
|
-
!isReact16 && this.renderPortal(this.props);
|
|
46881
|
-
}
|
|
46882
|
-
}, {
|
|
46883
|
-
key: "getSnapshotBeforeUpdate",
|
|
46884
|
-
value: function getSnapshotBeforeUpdate(prevProps) {
|
|
46885
|
-
var prevParent = getParentElement(prevProps.parentSelector);
|
|
46886
|
-
var nextParent = getParentElement(this.props.parentSelector);
|
|
46887
|
-
return {
|
|
46888
|
-
prevParent: prevParent,
|
|
46889
|
-
nextParent: nextParent
|
|
46890
|
-
};
|
|
46891
|
-
}
|
|
46892
|
-
}, {
|
|
46893
|
-
key: "componentDidUpdate",
|
|
46894
|
-
value: function componentDidUpdate(prevProps, _, snapshot) {
|
|
46895
|
-
if (!safeHTMLElement.canUseDOM) return;
|
|
46896
|
-
var _props = this.props,
|
|
46897
|
-
isOpen = _props.isOpen,
|
|
46898
|
-
portalClassName = _props.portalClassName;
|
|
46899
|
-
if (prevProps.portalClassName !== portalClassName) {
|
|
46900
|
-
this.node.className = portalClassName;
|
|
46901
|
-
}
|
|
46902
|
-
var prevParent = snapshot.prevParent,
|
|
46903
|
-
nextParent = snapshot.nextParent;
|
|
46904
|
-
if (nextParent !== prevParent) {
|
|
46905
|
-
prevParent.removeChild(this.node);
|
|
46906
|
-
nextParent.appendChild(this.node);
|
|
46907
|
-
}
|
|
46908
|
-
if (!prevProps.isOpen && !isOpen) return;
|
|
46909
|
-
!isReact16 && this.renderPortal(this.props);
|
|
46910
|
-
}
|
|
46911
|
-
}, {
|
|
46912
|
-
key: "componentWillUnmount",
|
|
46913
|
-
value: function componentWillUnmount() {
|
|
46914
|
-
if (!safeHTMLElement.canUseDOM || !this.node || !this.portal) return;
|
|
46915
|
-
var state = this.portal.state;
|
|
46916
|
-
var now = Date.now();
|
|
46917
|
-
var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS);
|
|
46918
|
-
if (closesAt) {
|
|
46919
|
-
if (!state.beforeClose) {
|
|
46920
|
-
this.portal.closeWithTimeout();
|
|
46921
|
-
}
|
|
46922
|
-
setTimeout(this.removePortal, closesAt - now);
|
|
46923
|
-
} else {
|
|
46924
|
-
this.removePortal();
|
|
46925
|
-
}
|
|
46633
|
+
}
|
|
46634
|
+
function hide(appElement) {
|
|
46635
|
+
var _iteratorNormalCompletion = true;
|
|
46636
|
+
var _didIteratorError = false;
|
|
46637
|
+
var _iteratorError = undefined;
|
|
46638
|
+
try {
|
|
46639
|
+
for (var _iterator = validateElement(appElement)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
46640
|
+
var el = _step.value;
|
|
46641
|
+
el.setAttribute("aria-hidden", "true");
|
|
46926
46642
|
}
|
|
46927
|
-
}
|
|
46928
|
-
|
|
46929
|
-
|
|
46930
|
-
|
|
46931
|
-
|
|
46643
|
+
} catch (err) {
|
|
46644
|
+
_didIteratorError = true;
|
|
46645
|
+
_iteratorError = err;
|
|
46646
|
+
} finally {
|
|
46647
|
+
try {
|
|
46648
|
+
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
46649
|
+
_iterator.return();
|
|
46932
46650
|
}
|
|
46933
|
-
|
|
46934
|
-
|
|
46651
|
+
} finally {
|
|
46652
|
+
if (_didIteratorError) {
|
|
46653
|
+
throw _iteratorError;
|
|
46935
46654
|
}
|
|
46936
|
-
var createPortal = getCreatePortal();
|
|
46937
|
-
return createPortal(_react2.default.createElement(_ModalPortal2.default, _extends({
|
|
46938
|
-
ref: this.portalRef,
|
|
46939
|
-
defaultStyles: Modal.defaultStyles
|
|
46940
|
-
}, this.props)), this.node);
|
|
46941
46655
|
}
|
|
46942
|
-
}], [{
|
|
46943
|
-
key: "setAppElement",
|
|
46944
|
-
value: function setAppElement(element) {
|
|
46945
|
-
ariaAppHider$1.setElement(element);
|
|
46946
|
-
}
|
|
46947
|
-
}]);
|
|
46948
|
-
return Modal;
|
|
46949
|
-
}(React__default.Component);
|
|
46950
|
-
Modal.propTypes = {
|
|
46951
|
-
isOpen: _propTypes2.default.bool.isRequired,
|
|
46952
|
-
style: _propTypes2.default.shape({
|
|
46953
|
-
content: _propTypes2.default.object,
|
|
46954
|
-
overlay: _propTypes2.default.object
|
|
46955
|
-
}),
|
|
46956
|
-
portalClassName: _propTypes2.default.string,
|
|
46957
|
-
bodyOpenClassName: _propTypes2.default.string,
|
|
46958
|
-
htmlOpenClassName: _propTypes2.default.string,
|
|
46959
|
-
className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({
|
|
46960
|
-
base: _propTypes2.default.string.isRequired,
|
|
46961
|
-
afterOpen: _propTypes2.default.string.isRequired,
|
|
46962
|
-
beforeClose: _propTypes2.default.string.isRequired
|
|
46963
|
-
})]),
|
|
46964
|
-
overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({
|
|
46965
|
-
base: _propTypes2.default.string.isRequired,
|
|
46966
|
-
afterOpen: _propTypes2.default.string.isRequired,
|
|
46967
|
-
beforeClose: _propTypes2.default.string.isRequired
|
|
46968
|
-
})]),
|
|
46969
|
-
appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),
|
|
46970
|
-
onAfterOpen: _propTypes2.default.func,
|
|
46971
|
-
onRequestClose: _propTypes2.default.func,
|
|
46972
|
-
closeTimeoutMS: _propTypes2.default.number,
|
|
46973
|
-
ariaHideApp: _propTypes2.default.bool,
|
|
46974
|
-
shouldFocusAfterRender: _propTypes2.default.bool,
|
|
46975
|
-
shouldCloseOnOverlayClick: _propTypes2.default.bool,
|
|
46976
|
-
shouldReturnFocusAfterClose: _propTypes2.default.bool,
|
|
46977
|
-
preventScroll: _propTypes2.default.bool,
|
|
46978
|
-
parentSelector: _propTypes2.default.func,
|
|
46979
|
-
aria: _propTypes2.default.object,
|
|
46980
|
-
data: _propTypes2.default.object,
|
|
46981
|
-
role: _propTypes2.default.string,
|
|
46982
|
-
contentLabel: _propTypes2.default.string,
|
|
46983
|
-
shouldCloseOnEsc: _propTypes2.default.bool,
|
|
46984
|
-
overlayRef: _propTypes2.default.func,
|
|
46985
|
-
contentRef: _propTypes2.default.func,
|
|
46986
|
-
id: _propTypes2.default.string,
|
|
46987
|
-
overlayElement: _propTypes2.default.func,
|
|
46988
|
-
contentElement: _propTypes2.default.func
|
|
46989
|
-
};
|
|
46990
|
-
Modal.defaultProps = {
|
|
46991
|
-
isOpen: false,
|
|
46992
|
-
portalClassName: portalClassName,
|
|
46993
|
-
bodyOpenClassName: bodyOpenClassName,
|
|
46994
|
-
role: "dialog",
|
|
46995
|
-
ariaHideApp: true,
|
|
46996
|
-
closeTimeoutMS: 0,
|
|
46997
|
-
shouldFocusAfterRender: true,
|
|
46998
|
-
shouldCloseOnEsc: true,
|
|
46999
|
-
shouldCloseOnOverlayClick: true,
|
|
47000
|
-
shouldReturnFocusAfterClose: true,
|
|
47001
|
-
preventScroll: false,
|
|
47002
|
-
parentSelector: function parentSelector() {
|
|
47003
|
-
return document.body;
|
|
47004
|
-
},
|
|
47005
|
-
overlayElement: function overlayElement(props, contentEl) {
|
|
47006
|
-
return _react2.default.createElement("div", props, contentEl);
|
|
47007
|
-
},
|
|
47008
|
-
contentElement: function contentElement(props, children) {
|
|
47009
|
-
return _react2.default.createElement("div", props, children);
|
|
47010
46656
|
}
|
|
47011
|
-
}
|
|
47012
|
-
|
|
47013
|
-
|
|
47014
|
-
|
|
47015
|
-
|
|
47016
|
-
|
|
47017
|
-
|
|
47018
|
-
|
|
47019
|
-
|
|
47020
|
-
|
|
47021
|
-
|
|
47022
|
-
|
|
47023
|
-
|
|
47024
|
-
|
|
47025
|
-
|
|
47026
|
-
|
|
47027
|
-
|
|
47028
|
-
|
|
47029
|
-
|
|
47030
|
-
|
|
47031
|
-
|
|
47032
|
-
|
|
47033
|
-
|
|
46657
|
+
}
|
|
46658
|
+
function show(appElement) {
|
|
46659
|
+
var _iteratorNormalCompletion2 = true;
|
|
46660
|
+
var _didIteratorError2 = false;
|
|
46661
|
+
var _iteratorError2 = undefined;
|
|
46662
|
+
try {
|
|
46663
|
+
for (var _iterator2 = validateElement(appElement)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
46664
|
+
var el = _step2.value;
|
|
46665
|
+
el.removeAttribute("aria-hidden");
|
|
46666
|
+
}
|
|
46667
|
+
} catch (err) {
|
|
46668
|
+
_didIteratorError2 = true;
|
|
46669
|
+
_iteratorError2 = err;
|
|
46670
|
+
} finally {
|
|
46671
|
+
try {
|
|
46672
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return) {
|
|
46673
|
+
_iterator2.return();
|
|
46674
|
+
}
|
|
46675
|
+
} finally {
|
|
46676
|
+
if (_didIteratorError2) {
|
|
46677
|
+
throw _iteratorError2;
|
|
46678
|
+
}
|
|
46679
|
+
}
|
|
47034
46680
|
}
|
|
47035
|
-
};
|
|
47036
|
-
(0, reactLifecyclesCompat_es.polyfill)(Modal);
|
|
47037
|
-
if (process.env.NODE_ENV !== "production") {
|
|
47038
|
-
Modal.setCreateHTMLElement = function (fn) {
|
|
47039
|
-
return createHTMLElement = fn;
|
|
47040
|
-
};
|
|
47041
46681
|
}
|
|
47042
|
-
|
|
46682
|
+
function documentNotReadyOrSSRTesting() {
|
|
46683
|
+
globalElement = null;
|
|
46684
|
+
}
|
|
47043
46685
|
});
|
|
47044
|
-
unwrapExports(
|
|
46686
|
+
unwrapExports(ariaAppHider);
|
|
47045
46687
|
|
|
47046
|
-
var
|
|
46688
|
+
var classList = createCommonjsModule(function (module, exports) {
|
|
47047
46689
|
|
|
47048
46690
|
Object.defineProperty(exports, "__esModule", {
|
|
47049
46691
|
value: true
|
|
47050
46692
|
});
|
|
47051
|
-
|
|
47052
|
-
|
|
47053
|
-
|
|
47054
|
-
|
|
47055
|
-
|
|
46693
|
+
exports.resetState = resetState;
|
|
46694
|
+
exports.log = log;
|
|
46695
|
+
var htmlClassList = {};
|
|
46696
|
+
var docBodyClassList = {};
|
|
46697
|
+
function removeClass(at, cls) {
|
|
46698
|
+
at.classList.remove(cls);
|
|
47056
46699
|
}
|
|
47057
|
-
|
|
47058
|
-
|
|
47059
|
-
|
|
47060
|
-
|
|
47061
|
-
|
|
47062
|
-
|
|
47063
|
-
|
|
47064
|
-
|
|
47065
|
-
|
|
47066
|
-
|
|
47067
|
-
|
|
47068
|
-
}
|
|
47069
|
-
|
|
47070
|
-
|
|
47071
|
-
|
|
47072
|
-
|
|
47073
|
-
|
|
47074
|
-
|
|
47075
|
-
|
|
47076
|
-
|
|
47077
|
-
|
|
47078
|
-
|
|
47079
|
-
|
|
47080
|
-
|
|
47081
|
-
|
|
47082
|
-
|
|
47083
|
-
|
|
47084
|
-
|
|
47085
|
-
|
|
47086
|
-
|
|
47087
|
-
|
|
47088
|
-
|
|
47089
|
-
|
|
47090
|
-
|
|
47091
|
-
|
|
47092
|
-
TimeStamp: otpVerifiedTimestamp
|
|
47093
|
-
});
|
|
47094
|
-
const updatedData = {
|
|
47095
|
-
applicationNo: data === null || data === void 0 ? void 0 : data.applicationNo,
|
|
47096
|
-
tenantId: data === null || data === void 0 ? void 0 : data.tenantId,
|
|
47097
|
-
applicationData: _extends({}, updatedAdditionalDetails)
|
|
47098
|
-
};
|
|
47099
|
-
const selfdeclarationform = "\n <div style=\"font-family:'Times New Roman', Times, serif; color:#000; font-size:16px; line-height:1.18; margin-top:-100px; padding:0;\">\n\n <h2 style=\"text-align:center; font-size:20px; margin:0 0 6px 0; font-weight:700; text-transform:uppercase;\">\n OWNER'S DECLARATION\n </h2>\n\n <div style=\"margin-top:-52px;\">\n <p style=\"margin-bottom:-32px;\"><strong>To,</strong></p>\n <p style=\"margin-bottom:-32px;\"><strong>Local Urban Bodies</strong></p>\n </div>\n\n <p style=\"margin-top:-20px;\"><strong>Dear Sir/Madam,</strong></p>\n\n <p style=\"margin-top:-52px;margin-bottom:-32px; text-align:justify;\">\n I/We further declare that I am/We are aware of all the actions taken have been authorized by me/us.\n </p>\n\n <ol style=\"margin-top:-52px;margin-bottom:-32px; padding:0;\">\n <li style=\"margin-top:-5px;margin-bottom:-25px;\">1. That I am/We are sole owner(s) of the site.</li>\n <li style=\"margin-top:-5px;margin-bottom:-25px;\">2. That there is no dispute regarding the site and if any dispute arises, then I/We shall be solely responsible for the same.</li>\n <li style=\"margin-top:-5px;margin-bottom:-25px;\">3. That construction of the building will be undertaken as per the approved building plans and structural design given by the Structural Engineer.</li>\n <li style=\"margin-top:-5px;margin-bottom:-25px;\">4. That above stated facts are true and the requisite documents have been uploaded with this building plan and nothing has been concealed thereof.</li>\n </ol>\n\n <!-- Signature / details table -->\n <table style=\"width:100%; border-collapse:collapse; margin-top:6px; font-size:14px;\">\n <tr>\n <td style=\"width:48%; vertical-align:top; padding:6px; border:1px dotted #000;\">\n <div style=\"font-weight:700; margin-bottom:4px;\">Date:</div>\n <div style=\"min-height:60px;\">" + (DateOnly || "<Date of Sign>") + "</div>\n </td>\n\n <td style=\"width:52%; vertical-align:top; border:1px dotted #000;\">\n <table style=\"width:100%; border-collapse:collapse;\">\n <tr>\n <td style=\"padding:6px; border-bottom:1px dotted #000; width:40%; font-weight:700;\">Name of Owner:</td>\n <td style=\"padding:6px; border-bottom:1px dotted #000;\">" + ownername + "</td>\n </tr>\n <tr>\n <td style=\"padding:6px; border-bottom:1px dotted #000; font-weight:700;\">e-Mail:</td>\n <td style=\"padding:6px; border-bottom:1px dotted #000;\">" + ownerEmail + "</td>\n </tr>\n <tr>\n <td style=\"padding:6px; border-bottom:1px dotted #000; font-weight:700;\">Mobile:</td>\n <td style=\"padding:6px; border-bottom:1px dotted #000;\">" + ownermobileNumber + "</td>\n </tr>\n <tr>\n <td style=\"padding:6px; font-weight:700;\">Signature:</td>\n <td style=\"padding:6px;\">Verified through OTP</b></td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </div>\n";
|
|
47100
|
-
const closeModal = () => {
|
|
47101
|
-
setShowTermsPopupOwner(false);
|
|
46700
|
+
function resetState() {
|
|
46701
|
+
var htmlElement = document.getElementsByTagName("html")[0];
|
|
46702
|
+
for (var cls in htmlClassList) {
|
|
46703
|
+
removeClass(htmlElement, htmlClassList[cls]);
|
|
46704
|
+
}
|
|
46705
|
+
var body = document.body;
|
|
46706
|
+
for (var _cls in docBodyClassList) {
|
|
46707
|
+
removeClass(body, docBodyClassList[_cls]);
|
|
46708
|
+
}
|
|
46709
|
+
htmlClassList = {};
|
|
46710
|
+
docBodyClassList = {};
|
|
46711
|
+
}
|
|
46712
|
+
function log() {
|
|
46713
|
+
if (process.env.NODE_ENV !== "production") {
|
|
46714
|
+
var classes = document.getElementsByTagName("html")[0].className;
|
|
46715
|
+
var buffer = "Show tracked classes:\n\n";
|
|
46716
|
+
buffer += "<html /> (" + classes + "):\n ";
|
|
46717
|
+
for (var x in htmlClassList) {
|
|
46718
|
+
buffer += " " + x + " " + htmlClassList[x] + "\n ";
|
|
46719
|
+
}
|
|
46720
|
+
classes = document.body.className;
|
|
46721
|
+
buffer += "\n\ndoc.body (" + classes + "):\n ";
|
|
46722
|
+
for (var _x in docBodyClassList) {
|
|
46723
|
+
buffer += " " + _x + " " + docBodyClassList[_x] + "\n ";
|
|
46724
|
+
}
|
|
46725
|
+
buffer += "\n";
|
|
46726
|
+
console.log(buffer);
|
|
46727
|
+
}
|
|
46728
|
+
}
|
|
46729
|
+
var incrementReference = function incrementReference(poll, className) {
|
|
46730
|
+
if (!poll[className]) {
|
|
46731
|
+
poll[className] = 0;
|
|
46732
|
+
}
|
|
46733
|
+
poll[className] += 1;
|
|
46734
|
+
return className;
|
|
47102
46735
|
};
|
|
47103
|
-
|
|
47104
|
-
|
|
47105
|
-
|
|
47106
|
-
const Chb = [{
|
|
47107
|
-
applicationNo: "CHB-0001",
|
|
47108
|
-
tenantId: "pb.amritsar",
|
|
47109
|
-
approvalDate: "2025-10-28",
|
|
47110
|
-
TimeStamp: "2025-10-28T12:30:00Z"
|
|
47111
|
-
}];
|
|
47112
|
-
const _temp = _finallyRethrows(function () {
|
|
47113
|
-
return _catch(function () {
|
|
47114
|
-
setIsUploading(true);
|
|
47115
|
-
return Promise.resolve(Digit.PaymentService.generatePdf(Digit.ULBService.getStateId(), {
|
|
47116
|
-
Chb: Chb
|
|
47117
|
-
}, "communityhallowner")).then(function (result) {
|
|
47118
|
-
var _result$filestoreIds$;
|
|
47119
|
-
console.log(result, "RESULT");
|
|
47120
|
-
setLoader(false);
|
|
47121
|
-
if ((result === null || result === void 0 ? void 0 : (_result$filestoreIds$ = result.filestoreIds[0]) === null || _result$filestoreIds$ === void 0 ? void 0 : _result$filestoreIds$.length) > 0) {
|
|
47122
|
-
alert("File Uploaded Successfully");
|
|
47123
|
-
sessionStorage.setItem("CitizenConsentdocFilestoreidCHB", result === null || result === void 0 ? void 0 : result.filestoreIds[0]);
|
|
47124
|
-
setIsFileUploaded(true);
|
|
47125
|
-
} else {
|
|
47126
|
-
alert("File Upload Failed");
|
|
47127
|
-
}
|
|
47128
|
-
});
|
|
47129
|
-
}, function (error) {
|
|
47130
|
-
alert("Error Uploading PDF:", error);
|
|
47131
|
-
setLoader(false);
|
|
47132
|
-
});
|
|
47133
|
-
}, function (_wasThrown, _result) {
|
|
47134
|
-
setLoader(false);
|
|
47135
|
-
setIsUploading(false);
|
|
47136
|
-
if (_wasThrown) throw _result;
|
|
47137
|
-
return _result;
|
|
47138
|
-
});
|
|
47139
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
47140
|
-
} catch (e) {
|
|
47141
|
-
return Promise.reject(e);
|
|
46736
|
+
var decrementReference = function decrementReference(poll, className) {
|
|
46737
|
+
if (poll[className]) {
|
|
46738
|
+
poll[className] -= 1;
|
|
47142
46739
|
}
|
|
46740
|
+
return className;
|
|
47143
46741
|
};
|
|
47144
|
-
|
|
47145
|
-
|
|
47146
|
-
|
|
47147
|
-
|
|
47148
|
-
|
|
47149
|
-
|
|
47150
|
-
|
|
47151
|
-
|
|
47152
|
-
|
|
47153
|
-
|
|
47154
|
-
}
|
|
47155
|
-
|
|
47156
|
-
|
|
47157
|
-
|
|
47158
|
-
|
|
47159
|
-
|
|
47160
|
-
|
|
47161
|
-
|
|
47162
|
-
|
|
47163
|
-
|
|
47164
|
-
|
|
47165
|
-
|
|
47166
|
-
|
|
47167
|
-
|
|
47168
|
-
|
|
47169
|
-
|
|
47170
|
-
|
|
47171
|
-
|
|
47172
|
-
|
|
47173
|
-
|
|
47174
|
-
|
|
47175
|
-
lineHeight: "2"
|
|
47176
|
-
},
|
|
47177
|
-
heading: {
|
|
47178
|
-
textAlign: "center",
|
|
47179
|
-
fontWeight: "bold",
|
|
47180
|
-
marginBottom: "10px"
|
|
47181
|
-
},
|
|
47182
|
-
subheading: {
|
|
47183
|
-
textAlign: "center",
|
|
47184
|
-
fontWeight: "bold",
|
|
47185
|
-
marginBottom: "20px"
|
|
47186
|
-
},
|
|
47187
|
-
rightAlignedText: {
|
|
47188
|
-
textAlign: "right",
|
|
47189
|
-
whiteSpace: "pre-wrap",
|
|
47190
|
-
wordWrap: "break-word",
|
|
47191
|
-
fontFamily: "Roboto, serif",
|
|
47192
|
-
lineHeight: "2"
|
|
46742
|
+
var trackClass = function trackClass(classListRef, poll, classes) {
|
|
46743
|
+
classes.forEach(function (className) {
|
|
46744
|
+
incrementReference(poll, className);
|
|
46745
|
+
classListRef.add(className);
|
|
46746
|
+
});
|
|
46747
|
+
};
|
|
46748
|
+
var untrackClass = function untrackClass(classListRef, poll, classes) {
|
|
46749
|
+
classes.forEach(function (className) {
|
|
46750
|
+
decrementReference(poll, className);
|
|
46751
|
+
poll[className] === 0 && classListRef.remove(className);
|
|
46752
|
+
});
|
|
46753
|
+
};
|
|
46754
|
+
var add = exports.add = function add(element, classString) {
|
|
46755
|
+
return trackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" "));
|
|
46756
|
+
};
|
|
46757
|
+
var remove = exports.remove = function remove(element, classString) {
|
|
46758
|
+
return untrackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" "));
|
|
46759
|
+
};
|
|
46760
|
+
});
|
|
46761
|
+
unwrapExports(classList);
|
|
46762
|
+
|
|
46763
|
+
var portalOpenInstances_1 = createCommonjsModule(function (module, exports) {
|
|
46764
|
+
|
|
46765
|
+
Object.defineProperty(exports, "__esModule", {
|
|
46766
|
+
value: true
|
|
46767
|
+
});
|
|
46768
|
+
exports.log = log;
|
|
46769
|
+
exports.resetState = resetState;
|
|
46770
|
+
function _classCallCheck(instance, Constructor) {
|
|
46771
|
+
if (!(instance instanceof Constructor)) {
|
|
46772
|
+
throw new TypeError("Cannot call a class as a function");
|
|
47193
46773
|
}
|
|
46774
|
+
}
|
|
46775
|
+
var PortalOpenInstances = function PortalOpenInstances() {
|
|
46776
|
+
var _this = this;
|
|
46777
|
+
_classCallCheck(this, PortalOpenInstances);
|
|
46778
|
+
this.register = function (openInstance) {
|
|
46779
|
+
if (_this.openInstances.indexOf(openInstance) !== -1) {
|
|
46780
|
+
if (process.env.NODE_ENV !== "production") {
|
|
46781
|
+
console.warn("React-Modal: Cannot register modal instance that's already open");
|
|
46782
|
+
}
|
|
46783
|
+
return;
|
|
46784
|
+
}
|
|
46785
|
+
_this.openInstances.push(openInstance);
|
|
46786
|
+
_this.emit("register");
|
|
46787
|
+
};
|
|
46788
|
+
this.deregister = function (openInstance) {
|
|
46789
|
+
var index = _this.openInstances.indexOf(openInstance);
|
|
46790
|
+
if (index === -1) {
|
|
46791
|
+
if (process.env.NODE_ENV !== "production") {
|
|
46792
|
+
console.warn("React-Modal: Unable to deregister " + openInstance + " as " + "it was never registered");
|
|
46793
|
+
}
|
|
46794
|
+
return;
|
|
46795
|
+
}
|
|
46796
|
+
_this.openInstances.splice(index, 1);
|
|
46797
|
+
_this.emit("deregister");
|
|
46798
|
+
};
|
|
46799
|
+
this.subscribe = function (callback) {
|
|
46800
|
+
_this.subscribers.push(callback);
|
|
46801
|
+
};
|
|
46802
|
+
this.emit = function (eventType) {
|
|
46803
|
+
_this.subscribers.forEach(function (subscriber) {
|
|
46804
|
+
return subscriber(eventType, _this.openInstances.slice());
|
|
46805
|
+
});
|
|
46806
|
+
};
|
|
46807
|
+
this.openInstances = [];
|
|
46808
|
+
this.subscribers = [];
|
|
47194
46809
|
};
|
|
47195
|
-
|
|
47196
|
-
|
|
47197
|
-
|
|
47198
|
-
|
|
47199
|
-
|
|
47200
|
-
|
|
47201
|
-
|
|
47202
|
-
|
|
46810
|
+
var portalOpenInstances = new PortalOpenInstances();
|
|
46811
|
+
function log() {
|
|
46812
|
+
console.log("portalOpenInstances ----------");
|
|
46813
|
+
console.log(portalOpenInstances.openInstances.length);
|
|
46814
|
+
portalOpenInstances.openInstances.forEach(function (p) {
|
|
46815
|
+
return console.log(p);
|
|
46816
|
+
});
|
|
46817
|
+
console.log("end portalOpenInstances ----------");
|
|
46818
|
+
}
|
|
46819
|
+
function resetState() {
|
|
46820
|
+
portalOpenInstances = new PortalOpenInstances();
|
|
46821
|
+
}
|
|
46822
|
+
exports.default = portalOpenInstances;
|
|
46823
|
+
});
|
|
46824
|
+
unwrapExports(portalOpenInstances_1);
|
|
46825
|
+
|
|
46826
|
+
var bodyTrap_1 = createCommonjsModule(function (module, exports) {
|
|
46827
|
+
|
|
46828
|
+
Object.defineProperty(exports, "__esModule", {
|
|
46829
|
+
value: true
|
|
46830
|
+
});
|
|
46831
|
+
exports.resetState = resetState;
|
|
46832
|
+
exports.log = log;
|
|
46833
|
+
var _portalOpenInstances2 = _interopRequireDefault(portalOpenInstances_1);
|
|
46834
|
+
function _interopRequireDefault(obj) {
|
|
46835
|
+
return obj && obj.__esModule ? obj : {
|
|
46836
|
+
default: obj
|
|
46837
|
+
};
|
|
46838
|
+
}
|
|
46839
|
+
var before = void 0,
|
|
46840
|
+
after = void 0,
|
|
46841
|
+
instances = [];
|
|
46842
|
+
function resetState() {
|
|
46843
|
+
var _arr = [before, after];
|
|
46844
|
+
for (var _i = 0; _i < _arr.length; _i++) {
|
|
46845
|
+
var item = _arr[_i];
|
|
46846
|
+
if (!item) continue;
|
|
46847
|
+
item.parentNode && item.parentNode.removeChild(item);
|
|
47203
46848
|
}
|
|
47204
|
-
|
|
47205
|
-
|
|
47206
|
-
|
|
47207
|
-
|
|
47208
|
-
|
|
47209
|
-
|
|
46849
|
+
before = after = null;
|
|
46850
|
+
instances = [];
|
|
46851
|
+
}
|
|
46852
|
+
function log() {
|
|
46853
|
+
console.log("bodyTrap ----------");
|
|
46854
|
+
console.log(instances.length);
|
|
46855
|
+
var _arr2 = [before, after];
|
|
46856
|
+
for (var _i2 = 0; _i2 < _arr2.length; _i2++) {
|
|
46857
|
+
var item = _arr2[_i2];
|
|
46858
|
+
var check = item || {};
|
|
46859
|
+
console.log(check.nodeName, check.className, check.id);
|
|
47210
46860
|
}
|
|
47211
|
-
|
|
47212
|
-
|
|
47213
|
-
|
|
46861
|
+
console.log("edn bodyTrap ----------");
|
|
46862
|
+
}
|
|
46863
|
+
function focusContent() {
|
|
46864
|
+
if (instances.length === 0) {
|
|
46865
|
+
if (process.env.NODE_ENV !== "production") {
|
|
46866
|
+
console.warn("React-Modal: Open instances > 0 expected");
|
|
46867
|
+
}
|
|
46868
|
+
return;
|
|
47214
46869
|
}
|
|
47215
|
-
|
|
47216
|
-
|
|
47217
|
-
|
|
47218
|
-
|
|
46870
|
+
instances[instances.length - 1].focusContent();
|
|
46871
|
+
}
|
|
46872
|
+
function bodyTrap(eventType, openInstances) {
|
|
46873
|
+
if (!before && !after) {
|
|
46874
|
+
before = document.createElement("div");
|
|
46875
|
+
before.setAttribute("data-react-modal-body-trap", "");
|
|
46876
|
+
before.style.position = "absolute";
|
|
46877
|
+
before.style.opacity = "0";
|
|
46878
|
+
before.setAttribute("tabindex", "0");
|
|
46879
|
+
before.addEventListener("focus", focusContent);
|
|
46880
|
+
after = before.cloneNode();
|
|
46881
|
+
after.addEventListener("focus", focusContent);
|
|
47219
46882
|
}
|
|
47220
|
-
|
|
47221
|
-
|
|
47222
|
-
|
|
47223
|
-
|
|
47224
|
-
|
|
47225
|
-
|
|
47226
|
-
|
|
46883
|
+
instances = openInstances;
|
|
46884
|
+
if (instances.length > 0) {
|
|
46885
|
+
if (document.body.firstChild !== before) {
|
|
46886
|
+
document.body.insertBefore(before, document.body.firstChild);
|
|
46887
|
+
}
|
|
46888
|
+
if (document.body.lastChild !== after) {
|
|
46889
|
+
document.body.appendChild(after);
|
|
46890
|
+
}
|
|
46891
|
+
} else {
|
|
46892
|
+
if (before.parentElement) {
|
|
46893
|
+
before.parentElement.removeChild(before);
|
|
46894
|
+
}
|
|
46895
|
+
if (after.parentElement) {
|
|
46896
|
+
after.parentElement.removeChild(after);
|
|
46897
|
+
}
|
|
47227
46898
|
}
|
|
47228
|
-
}
|
|
47229
|
-
|
|
47230
|
-
|
|
47231
|
-
|
|
47232
|
-
})))), loader && /*#__PURE__*/React__default.createElement(Loader, {
|
|
47233
|
-
page: true
|
|
47234
|
-
}));
|
|
47235
|
-
};
|
|
46899
|
+
}
|
|
46900
|
+
_portalOpenInstances2.default.subscribe(bodyTrap);
|
|
46901
|
+
});
|
|
46902
|
+
unwrapExports(bodyTrap_1);
|
|
47236
46903
|
|
|
47237
|
-
|
|
47238
|
-
|
|
47239
|
-
|
|
47240
|
-
|
|
47241
|
-
currentStepData,
|
|
47242
|
-
t
|
|
47243
|
-
} = _ref;
|
|
47244
|
-
const tenantId = window.location.href.includes("employee") ? Digit.ULBService.getCurrentPermanentCity() : localStorage.getItem("CITIZEN.CITY");
|
|
47245
|
-
const isCitizen = window.location.href.includes("citizen");
|
|
47246
|
-
const [getHallDetails, setHallDetails] = React.useState([]);
|
|
47247
|
-
const [getHallCodes, setHallCodes] = React.useState([]);
|
|
47248
|
-
const [getSlots, setSlots] = React.useState([]);
|
|
47249
|
-
const [loader, setLoader] = React.useState(false);
|
|
47250
|
-
const [showInfo, setShowInfo] = React.useState(false);
|
|
47251
|
-
const [uploadedFile, setUploadedFile] = React.useState(null);
|
|
47252
|
-
const [file, setFile] = React.useState(null);
|
|
47253
|
-
const [error, setError] = React.useState(null);
|
|
47254
|
-
const [showTermsPopup, setShowTermsPopup] = React.useState(false);
|
|
47255
|
-
const {
|
|
47256
|
-
control,
|
|
47257
|
-
handleSubmit,
|
|
47258
|
-
setValue,
|
|
47259
|
-
reset,
|
|
47260
|
-
formState: {
|
|
47261
|
-
errors
|
|
47262
|
-
},
|
|
47263
|
-
getValues,
|
|
47264
|
-
watch
|
|
47265
|
-
} = reactHookForm.useForm({
|
|
47266
|
-
defaultValues: {
|
|
47267
|
-
shouldUnregister: false,
|
|
47268
|
-
halls: [{
|
|
47269
|
-
startDate: "",
|
|
47270
|
-
endDate: "",
|
|
47271
|
-
startTime: "",
|
|
47272
|
-
endTime: ""
|
|
47273
|
-
}]
|
|
47274
|
-
}
|
|
46904
|
+
var ModalPortal_1 = createCommonjsModule(function (module, exports) {
|
|
46905
|
+
|
|
46906
|
+
Object.defineProperty(exports, "__esModule", {
|
|
46907
|
+
value: true
|
|
47275
46908
|
});
|
|
47276
|
-
|
|
47277
|
-
|
|
47278
|
-
|
|
47279
|
-
|
|
47280
|
-
|
|
47281
|
-
|
|
47282
|
-
|
|
47283
|
-
|
|
47284
|
-
isLoading: CHBLoading
|
|
47285
|
-
} = Digit.Hooks.useCustomMDMS(tenantId, "CHB", [{
|
|
47286
|
-
name: "CommunityHalls"
|
|
47287
|
-
}]);
|
|
47288
|
-
const {
|
|
47289
|
-
data: CHBPurpose = [],
|
|
47290
|
-
isLoading: CHBPurposeLoading
|
|
47291
|
-
} = Digit.Hooks.useCustomMDMS(tenantId, "CHB", [{
|
|
47292
|
-
name: "Purpose"
|
|
47293
|
-
}]);
|
|
47294
|
-
const {
|
|
47295
|
-
data: SpecialCategory = [],
|
|
47296
|
-
isLoading: CHBSpecialCategoryLoading
|
|
47297
|
-
} = Digit.Hooks.useCustomMDMS(tenantId, "CHB", [{
|
|
47298
|
-
name: "SpecialCategory"
|
|
47299
|
-
}]);
|
|
47300
|
-
const {
|
|
47301
|
-
data: CHBHallCode = [],
|
|
47302
|
-
isLoading: CHBHallCodeLoading
|
|
47303
|
-
} = Digit.Hooks.useCustomMDMS(tenantId, "CHB", [{
|
|
47304
|
-
name: "HallCode"
|
|
47305
|
-
}]);
|
|
47306
|
-
const {
|
|
47307
|
-
data: CHBReason = [],
|
|
47308
|
-
isLoading: CHBReasonLoading
|
|
47309
|
-
} = Digit.Hooks.useCustomMDMS(tenantId, "CHB", [{
|
|
47310
|
-
name: "DiscountReason"
|
|
47311
|
-
}]);
|
|
47312
|
-
const fiterHalls = selected => {
|
|
47313
|
-
var _CHBDetails$CHB, _CHBDetails$CHB$Commu, _CHBHallCode$CHB;
|
|
47314
|
-
const filteredHalls = (CHBDetails === null || CHBDetails === void 0 ? void 0 : (_CHBDetails$CHB = CHBDetails.CHB) === null || _CHBDetails$CHB === void 0 ? void 0 : (_CHBDetails$CHB$Commu = _CHBDetails$CHB.CommunityHalls) === null || _CHBDetails$CHB$Commu === void 0 ? void 0 : _CHBDetails$CHB$Commu.filter(hall => hall.locationCode === (selected === null || selected === void 0 ? void 0 : selected.code))) || [];
|
|
47315
|
-
setHallDetails(filteredHalls);
|
|
47316
|
-
const hallInfo = CHBHallCode === null || CHBHallCode === void 0 ? void 0 : (_CHBHallCode$CHB = CHBHallCode.CHB) === null || _CHBHallCode$CHB === void 0 ? void 0 : _CHBHallCode$CHB.HallCode;
|
|
47317
|
-
const getHallCodesData = hallInfo === null || hallInfo === void 0 ? void 0 : hallInfo.filter(item => (item === null || item === void 0 ? void 0 : item.communityHallId) == (selected === null || selected === void 0 ? void 0 : selected.communityHallId));
|
|
47318
|
-
setHallCodes(getHallCodesData);
|
|
47319
|
-
};
|
|
47320
|
-
const slotsSearch = function (data) {
|
|
47321
|
-
try {
|
|
47322
|
-
var _getValues, _getValues2;
|
|
47323
|
-
setLoader(true);
|
|
47324
|
-
console.log("data", data);
|
|
47325
|
-
console.log("getValues", getValues());
|
|
47326
|
-
const payload = {
|
|
47327
|
-
tenantId: tenantId,
|
|
47328
|
-
communityHallCode: data.communityHallId,
|
|
47329
|
-
hallCode: data === null || data === void 0 ? void 0 : data.HallCode,
|
|
47330
|
-
bookingStartDate: (_getValues = getValues()) === null || _getValues === void 0 ? void 0 : _getValues.startDate,
|
|
47331
|
-
bookingEndDate: (_getValues2 = getValues()) === null || _getValues2 === void 0 ? void 0 : _getValues2.endDate,
|
|
47332
|
-
isTimerRequired: false
|
|
47333
|
-
};
|
|
47334
|
-
return Promise.resolve(_catch(function () {
|
|
47335
|
-
return Promise.resolve(Digit.CHBServices.slot_search({
|
|
47336
|
-
filters: payload
|
|
47337
|
-
})).then(function (response) {
|
|
47338
|
-
setLoader(false);
|
|
47339
|
-
setSlots(response === null || response === void 0 ? void 0 : response.hallSlotAvailabiltityDetails);
|
|
47340
|
-
return response;
|
|
47341
|
-
});
|
|
47342
|
-
}, function () {
|
|
47343
|
-
setLoader(false);
|
|
47344
|
-
}));
|
|
47345
|
-
} catch (e) {
|
|
47346
|
-
return Promise.reject(e);
|
|
46909
|
+
var _extends = Object.assign || function (target) {
|
|
46910
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
46911
|
+
var source = arguments[i];
|
|
46912
|
+
for (var key in source) {
|
|
46913
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
46914
|
+
target[key] = source[key];
|
|
46915
|
+
}
|
|
46916
|
+
}
|
|
47347
46917
|
}
|
|
46918
|
+
return target;
|
|
47348
46919
|
};
|
|
47349
|
-
|
|
47350
|
-
|
|
47351
|
-
|
|
47352
|
-
|
|
47353
|
-
|
|
47354
|
-
|
|
47355
|
-
|
|
47356
|
-
|
|
47357
|
-
|
|
47358
|
-
|
|
46920
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
|
|
46921
|
+
return typeof obj;
|
|
46922
|
+
} : function (obj) {
|
|
46923
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
46924
|
+
};
|
|
46925
|
+
var _createClass = function () {
|
|
46926
|
+
function defineProperties(target, props) {
|
|
46927
|
+
for (var i = 0; i < props.length; i++) {
|
|
46928
|
+
var descriptor = props[i];
|
|
46929
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
46930
|
+
descriptor.configurable = true;
|
|
46931
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
46932
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
46933
|
+
}
|
|
47359
46934
|
}
|
|
47360
|
-
|
|
47361
|
-
|
|
47362
|
-
|
|
47363
|
-
|
|
47364
|
-
}
|
|
47365
|
-
|
|
47366
|
-
|
|
47367
|
-
|
|
47368
|
-
|
|
47369
|
-
|
|
47370
|
-
|
|
47371
|
-
|
|
47372
|
-
|
|
47373
|
-
|
|
47374
|
-
|
|
47375
|
-
|
|
47376
|
-
|
|
47377
|
-
|
|
47378
|
-
|
|
47379
|
-
|
|
47380
|
-
|
|
47381
|
-
const payload = {
|
|
47382
|
-
hallsBookingApplication: _extends({
|
|
47383
|
-
tenantId
|
|
47384
|
-
}, additionalDetails && {
|
|
47385
|
-
additionalDetails
|
|
47386
|
-
}, {
|
|
47387
|
-
bookingStatus: "INITIATED",
|
|
47388
|
-
applicationDate: now,
|
|
47389
|
-
communityHallCode: (getHallDetails === null || getHallDetails === void 0 ? void 0 : (_getHallDetails$ = getHallDetails[0]) === null || _getHallDetails$ === void 0 ? void 0 : _getHallDetails$.communityHallId) || "",
|
|
47390
|
-
communityHallName: data === null || data === void 0 ? void 0 : (_data$siteId = data.siteId) === null || _data$siteId === void 0 ? void 0 : _data$siteId.name,
|
|
47391
|
-
purpose: {
|
|
47392
|
-
purpose: data === null || data === void 0 ? void 0 : (_data$purpose = data.purpose) === null || _data$purpose === void 0 ? void 0 : _data$purpose.code
|
|
47393
|
-
},
|
|
47394
|
-
specialCategory: {
|
|
47395
|
-
category: data === null || data === void 0 ? void 0 : (_data$specialCategory = data.specialCategory) === null || _data$specialCategory === void 0 ? void 0 : _data$specialCategory.code
|
|
47396
|
-
},
|
|
47397
|
-
purposeDescription: data === null || data === void 0 ? void 0 : data.purposeDescription,
|
|
47398
|
-
bookingSlotDetails,
|
|
47399
|
-
owners: [{
|
|
47400
|
-
name: userInfo === null || userInfo === void 0 ? void 0 : userInfo.name,
|
|
47401
|
-
mobileNumber: userInfo === null || userInfo === void 0 ? void 0 : userInfo.mobileNumber,
|
|
47402
|
-
emailId: userInfo === null || userInfo === void 0 ? void 0 : userInfo.emailId,
|
|
47403
|
-
type: userInfo === null || userInfo === void 0 ? void 0 : userInfo.type
|
|
47404
|
-
}],
|
|
47405
|
-
workflow: {
|
|
47406
|
-
action: "INITIATE",
|
|
47407
|
-
businessService: "CommunityHallBooking",
|
|
47408
|
-
moduleName: "CommunityHallModule"
|
|
46935
|
+
return function (Constructor, protoProps, staticProps) {
|
|
46936
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
46937
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
|
46938
|
+
return Constructor;
|
|
46939
|
+
};
|
|
46940
|
+
}();
|
|
46941
|
+
var _propTypes2 = _interopRequireDefault(propTypes);
|
|
46942
|
+
var focusManager$1 = _interopRequireWildcard(focusManager);
|
|
46943
|
+
var _scopeTab2 = _interopRequireDefault(scopeTab_1);
|
|
46944
|
+
var ariaAppHider$1 = _interopRequireWildcard(ariaAppHider);
|
|
46945
|
+
var classList$1 = _interopRequireWildcard(classList);
|
|
46946
|
+
var _safeHTMLElement2 = _interopRequireDefault(safeHTMLElement);
|
|
46947
|
+
var _portalOpenInstances2 = _interopRequireDefault(portalOpenInstances_1);
|
|
46948
|
+
function _interopRequireWildcard(obj) {
|
|
46949
|
+
if (obj && obj.__esModule) {
|
|
46950
|
+
return obj;
|
|
46951
|
+
} else {
|
|
46952
|
+
var newObj = {};
|
|
46953
|
+
if (obj != null) {
|
|
46954
|
+
for (var key in obj) {
|
|
46955
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
|
|
47409
46956
|
}
|
|
47410
|
-
}
|
|
46957
|
+
}
|
|
46958
|
+
newObj.default = obj;
|
|
46959
|
+
return newObj;
|
|
46960
|
+
}
|
|
46961
|
+
}
|
|
46962
|
+
function _interopRequireDefault(obj) {
|
|
46963
|
+
return obj && obj.__esModule ? obj : {
|
|
46964
|
+
default: obj
|
|
47411
46965
|
};
|
|
47412
|
-
|
|
47413
|
-
|
|
47414
|
-
|
|
47415
|
-
|
|
47416
|
-
const formattedData = currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$owne = currentStepData.ownerDetails) === null || _currentStepData$owne === void 0 ? void 0 : _currentStepData$owne.hallsBookingApplication;
|
|
47417
|
-
if (formattedData) {
|
|
47418
|
-
var _CHBHallCode$CHB3, _CHBReason$CHB, _formattedData$bookin3, _formattedData$bookin4, _formattedData$bookin5, _formattedData$additi2;
|
|
47419
|
-
const communityHallsOptions = CHBLocations.CHB.CommunityHalls || [];
|
|
47420
|
-
const purposeOptions = CHBPurpose.CHB.Purpose || [];
|
|
47421
|
-
const specialCategoryOptions = SpecialCategory.CHB.SpecialCategory || [];
|
|
47422
|
-
const hallCodeOptions = CHBHallCode === null || CHBHallCode === void 0 ? void 0 : (_CHBHallCode$CHB3 = CHBHallCode.CHB) === null || _CHBHallCode$CHB3 === void 0 ? void 0 : _CHBHallCode$CHB3.HallCode;
|
|
47423
|
-
const discReasonOptions = CHBReason === null || CHBReason === void 0 ? void 0 : (_CHBReason$CHB = CHBReason.CHB) === null || _CHBReason$CHB === void 0 ? void 0 : _CHBReason$CHB.DiscountReason;
|
|
47424
|
-
console.log("discReasonOptions", discReasonOptions);
|
|
47425
|
-
const selectedCommHall = communityHallsOptions === null || communityHallsOptions === void 0 ? void 0 : communityHallsOptions.find(item => (item === null || item === void 0 ? void 0 : item.communityHallId) == (formattedData === null || formattedData === void 0 ? void 0 : formattedData.communityHallCode));
|
|
47426
|
-
const selectedPurpose = purposeOptions === null || purposeOptions === void 0 ? void 0 : purposeOptions.find(item => {
|
|
47427
|
-
var _formattedData$purpos;
|
|
47428
|
-
return (item === null || item === void 0 ? void 0 : item.code) == (formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$purpos = formattedData.purpose) === null || _formattedData$purpos === void 0 ? void 0 : _formattedData$purpos.purpose);
|
|
47429
|
-
});
|
|
47430
|
-
const selectedSpecialCat = specialCategoryOptions === null || specialCategoryOptions === void 0 ? void 0 : specialCategoryOptions.find(item => {
|
|
47431
|
-
var _formattedData$specia;
|
|
47432
|
-
return (item === null || item === void 0 ? void 0 : item.code) == (formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$specia = formattedData.specialCategory) === null || _formattedData$specia === void 0 ? void 0 : _formattedData$specia.category);
|
|
47433
|
-
});
|
|
47434
|
-
const selectHallCode = hallCodeOptions === null || hallCodeOptions === void 0 ? void 0 : hallCodeOptions.find(item => {
|
|
47435
|
-
var _formattedData$bookin, _formattedData$bookin2;
|
|
47436
|
-
return (item === null || item === void 0 ? void 0 : item.HallCode) == (formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$bookin = formattedData.bookingSlotDetails) === null || _formattedData$bookin === void 0 ? void 0 : (_formattedData$bookin2 = _formattedData$bookin[0]) === null || _formattedData$bookin2 === void 0 ? void 0 : _formattedData$bookin2.hallCode);
|
|
47437
|
-
});
|
|
47438
|
-
const selectReason = discReasonOptions === null || discReasonOptions === void 0 ? void 0 : discReasonOptions.find(item => {
|
|
47439
|
-
var _formattedData$additi;
|
|
47440
|
-
return (item === null || item === void 0 ? void 0 : item.reasonName) == (formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$additi = formattedData.additionalDetails) === null || _formattedData$additi === void 0 ? void 0 : _formattedData$additi.reason);
|
|
47441
|
-
});
|
|
47442
|
-
console.log("formattedData", formattedData);
|
|
47443
|
-
setValue("siteId", selectedCommHall || null);
|
|
47444
|
-
setValue("hallCode", selectHallCode || null);
|
|
47445
|
-
setValue("startDate", formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$bookin3 = formattedData.bookingSlotDetails) === null || _formattedData$bookin3 === void 0 ? void 0 : (_formattedData$bookin4 = _formattedData$bookin3[0]) === null || _formattedData$bookin4 === void 0 ? void 0 : _formattedData$bookin4.bookingDate);
|
|
47446
|
-
setValue("endDate", formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$bookin5 = formattedData.bookingSlotDetails.at(-1)) === null || _formattedData$bookin5 === void 0 ? void 0 : _formattedData$bookin5.bookingEndDate);
|
|
47447
|
-
setShowInfo(true);
|
|
47448
|
-
fiterHalls(selectedCommHall);
|
|
47449
|
-
slotsSearch(selectHallCode).then(response => {
|
|
47450
|
-
console.log("response", response);
|
|
47451
|
-
const slotsData = (response === null || response === void 0 ? void 0 : response.hallSlotAvailabiltityDetails) || [];
|
|
47452
|
-
setSlots(slotsData);
|
|
47453
|
-
setValue("slots", slotsData);
|
|
47454
|
-
});
|
|
47455
|
-
setValue("purpose", selectedPurpose || null);
|
|
47456
|
-
setValue("specialCategory", selectedSpecialCat || null);
|
|
47457
|
-
setValue("purposeDescription", formattedData.purposeDescription || "");
|
|
47458
|
-
setValue("discountAmount", (formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$additi2 = formattedData.additionalDetails) === null || _formattedData$additi2 === void 0 ? void 0 : _formattedData$additi2.discountAmount) || "");
|
|
47459
|
-
setValue("reason", selectReason || null);
|
|
46966
|
+
}
|
|
46967
|
+
function _classCallCheck(instance, Constructor) {
|
|
46968
|
+
if (!(instance instanceof Constructor)) {
|
|
46969
|
+
throw new TypeError("Cannot call a class as a function");
|
|
47460
46970
|
}
|
|
47461
|
-
}
|
|
47462
|
-
|
|
47463
|
-
|
|
47464
|
-
|
|
47465
|
-
|
|
47466
|
-
(function
|
|
47467
|
-
|
|
47468
|
-
|
|
47469
|
-
|
|
47470
|
-
|
|
47471
|
-
|
|
47472
|
-
|
|
47473
|
-
|
|
47474
|
-
|
|
47475
|
-
|
|
47476
|
-
|
|
47477
|
-
|
|
47478
|
-
|
|
47479
|
-
|
|
47480
|
-
|
|
47481
|
-
|
|
47482
|
-
|
|
47483
|
-
|
|
47484
|
-
|
|
47485
|
-
|
|
47486
|
-
|
|
47487
|
-
|
|
47488
|
-
|
|
47489
|
-
|
|
47490
|
-
|
|
46971
|
+
}
|
|
46972
|
+
function _possibleConstructorReturn(self, call) {
|
|
46973
|
+
if (!self) {
|
|
46974
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
46975
|
+
}
|
|
46976
|
+
return call && (typeof call === "object" || typeof call === "function") ? call : self;
|
|
46977
|
+
}
|
|
46978
|
+
function _inherits(subClass, superClass) {
|
|
46979
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
46980
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
|
46981
|
+
}
|
|
46982
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
46983
|
+
constructor: {
|
|
46984
|
+
value: subClass,
|
|
46985
|
+
enumerable: false,
|
|
46986
|
+
writable: true,
|
|
46987
|
+
configurable: true
|
|
46988
|
+
}
|
|
46989
|
+
});
|
|
46990
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
|
46991
|
+
}
|
|
46992
|
+
var CLASS_NAMES = {
|
|
46993
|
+
overlay: "ReactModal__Overlay",
|
|
46994
|
+
content: "ReactModal__Content"
|
|
46995
|
+
};
|
|
46996
|
+
var isTabKey = function isTabKey(event) {
|
|
46997
|
+
return event.code === "Tab" || event.keyCode === 9;
|
|
46998
|
+
};
|
|
46999
|
+
var isEscKey = function isEscKey(event) {
|
|
47000
|
+
return event.code === "Escape" || event.keyCode === 27;
|
|
47001
|
+
};
|
|
47002
|
+
var ariaHiddenInstances = 0;
|
|
47003
|
+
var ModalPortal = function (_Component) {
|
|
47004
|
+
_inherits(ModalPortal, _Component);
|
|
47005
|
+
function ModalPortal(props) {
|
|
47006
|
+
_classCallCheck(this, ModalPortal);
|
|
47007
|
+
var _this = _possibleConstructorReturn(this, (ModalPortal.__proto__ || Object.getPrototypeOf(ModalPortal)).call(this, props));
|
|
47008
|
+
_this.setOverlayRef = function (overlay) {
|
|
47009
|
+
_this.overlay = overlay;
|
|
47010
|
+
_this.props.overlayRef && _this.props.overlayRef(overlay);
|
|
47011
|
+
};
|
|
47012
|
+
_this.setContentRef = function (content) {
|
|
47013
|
+
_this.content = content;
|
|
47014
|
+
_this.props.contentRef && _this.props.contentRef(content);
|
|
47015
|
+
};
|
|
47016
|
+
_this.afterClose = function () {
|
|
47017
|
+
var _this$props = _this.props,
|
|
47018
|
+
appElement = _this$props.appElement,
|
|
47019
|
+
ariaHideApp = _this$props.ariaHideApp,
|
|
47020
|
+
htmlOpenClassName = _this$props.htmlOpenClassName,
|
|
47021
|
+
bodyOpenClassName = _this$props.bodyOpenClassName,
|
|
47022
|
+
parentSelector = _this$props.parentSelector;
|
|
47023
|
+
var parentDocument = parentSelector && parentSelector().ownerDocument || document;
|
|
47024
|
+
bodyOpenClassName && classList$1.remove(parentDocument.body, bodyOpenClassName);
|
|
47025
|
+
htmlOpenClassName && classList$1.remove(parentDocument.getElementsByTagName("html")[0], htmlOpenClassName);
|
|
47026
|
+
if (ariaHideApp && ariaHiddenInstances > 0) {
|
|
47027
|
+
ariaHiddenInstances -= 1;
|
|
47028
|
+
if (ariaHiddenInstances === 0) {
|
|
47029
|
+
ariaAppHider$1.show(appElement);
|
|
47030
|
+
}
|
|
47031
|
+
}
|
|
47032
|
+
if (_this.props.shouldFocusAfterRender) {
|
|
47033
|
+
if (_this.props.shouldReturnFocusAfterClose) {
|
|
47034
|
+
focusManager$1.returnFocus(_this.props.preventScroll);
|
|
47035
|
+
focusManager$1.teardownScopedFocus();
|
|
47036
|
+
} else {
|
|
47037
|
+
focusManager$1.popWithoutFocus();
|
|
47038
|
+
}
|
|
47039
|
+
}
|
|
47040
|
+
if (_this.props.onAfterClose) {
|
|
47041
|
+
_this.props.onAfterClose();
|
|
47042
|
+
}
|
|
47043
|
+
_portalOpenInstances2.default.deregister(_this);
|
|
47044
|
+
};
|
|
47045
|
+
_this.open = function () {
|
|
47046
|
+
_this.beforeOpen();
|
|
47047
|
+
if (_this.state.afterOpen && _this.state.beforeClose) {
|
|
47048
|
+
clearTimeout(_this.closeTimer);
|
|
47049
|
+
_this.setState({
|
|
47050
|
+
beforeClose: false
|
|
47051
|
+
});
|
|
47052
|
+
} else {
|
|
47053
|
+
if (_this.props.shouldFocusAfterRender) {
|
|
47054
|
+
focusManager$1.setupScopedFocus(_this.node);
|
|
47055
|
+
focusManager$1.markForFocusLater();
|
|
47056
|
+
}
|
|
47057
|
+
_this.setState({
|
|
47058
|
+
isOpen: true
|
|
47059
|
+
}, function () {
|
|
47060
|
+
_this.openAnimationFrame = requestAnimationFrame(function () {
|
|
47061
|
+
_this.setState({
|
|
47062
|
+
afterOpen: true
|
|
47063
|
+
});
|
|
47064
|
+
if (_this.props.isOpen && _this.props.onAfterOpen) {
|
|
47065
|
+
_this.props.onAfterOpen({
|
|
47066
|
+
overlayEl: _this.overlay,
|
|
47067
|
+
contentEl: _this.content
|
|
47491
47068
|
});
|
|
47492
|
-
if (_temp && _temp.then) return _temp.then(function () {});
|
|
47493
47069
|
}
|
|
47494
|
-
}
|
|
47495
|
-
|
|
47070
|
+
});
|
|
47071
|
+
});
|
|
47072
|
+
}
|
|
47073
|
+
};
|
|
47074
|
+
_this.close = function () {
|
|
47075
|
+
if (_this.props.closeTimeoutMS > 0) {
|
|
47076
|
+
_this.closeWithTimeout();
|
|
47077
|
+
} else {
|
|
47078
|
+
_this.closeWithoutTimeout();
|
|
47079
|
+
}
|
|
47080
|
+
};
|
|
47081
|
+
_this.focusContent = function () {
|
|
47082
|
+
return _this.content && !_this.contentHasFocus() && _this.content.focus({
|
|
47083
|
+
preventScroll: true
|
|
47084
|
+
});
|
|
47085
|
+
};
|
|
47086
|
+
_this.closeWithTimeout = function () {
|
|
47087
|
+
var closesAt = Date.now() + _this.props.closeTimeoutMS;
|
|
47088
|
+
_this.setState({
|
|
47089
|
+
beforeClose: true,
|
|
47090
|
+
closesAt: closesAt
|
|
47091
|
+
}, function () {
|
|
47092
|
+
_this.closeTimer = setTimeout(_this.closeWithoutTimeout, _this.state.closesAt - Date.now());
|
|
47093
|
+
});
|
|
47094
|
+
};
|
|
47095
|
+
_this.closeWithoutTimeout = function () {
|
|
47096
|
+
_this.setState({
|
|
47097
|
+
beforeClose: false,
|
|
47098
|
+
isOpen: false,
|
|
47099
|
+
afterOpen: false,
|
|
47100
|
+
closesAt: null
|
|
47101
|
+
}, _this.afterClose);
|
|
47102
|
+
};
|
|
47103
|
+
_this.handleKeyDown = function (event) {
|
|
47104
|
+
if (isTabKey(event)) {
|
|
47105
|
+
(0, _scopeTab2.default)(_this.content, event);
|
|
47106
|
+
}
|
|
47107
|
+
if (_this.props.shouldCloseOnEsc && isEscKey(event)) {
|
|
47108
|
+
event.stopPropagation();
|
|
47109
|
+
_this.requestClose(event);
|
|
47110
|
+
}
|
|
47111
|
+
};
|
|
47112
|
+
_this.handleOverlayOnClick = function (event) {
|
|
47113
|
+
if (_this.shouldClose === null) {
|
|
47114
|
+
_this.shouldClose = true;
|
|
47115
|
+
}
|
|
47116
|
+
if (_this.shouldClose && _this.props.shouldCloseOnOverlayClick) {
|
|
47117
|
+
if (_this.ownerHandlesClose()) {
|
|
47118
|
+
_this.requestClose(event);
|
|
47119
|
+
} else {
|
|
47120
|
+
_this.focusContent();
|
|
47496
47121
|
}
|
|
47497
|
-
}
|
|
47498
|
-
|
|
47499
|
-
}
|
|
47500
|
-
|
|
47501
|
-
|
|
47502
|
-
|
|
47503
|
-
|
|
47504
|
-
|
|
47505
|
-
|
|
47506
|
-
|
|
47507
|
-
|
|
47508
|
-
|
|
47509
|
-
|
|
47510
|
-
|
|
47511
|
-
|
|
47512
|
-
|
|
47513
|
-
|
|
47514
|
-
|
|
47515
|
-
|
|
47516
|
-
|
|
47517
|
-
|
|
47518
|
-
|
|
47519
|
-
|
|
47520
|
-
|
|
47521
|
-
|
|
47522
|
-
|
|
47523
|
-
|
|
47524
|
-
|
|
47525
|
-
|
|
47526
|
-
|
|
47527
|
-
|
|
47528
|
-
|
|
47529
|
-
|
|
47530
|
-
|
|
47531
|
-
}
|
|
47532
|
-
|
|
47533
|
-
|
|
47534
|
-
|
|
47535
|
-
|
|
47536
|
-
|
|
47537
|
-
|
|
47538
|
-
|
|
47539
|
-
|
|
47540
|
-
|
|
47541
|
-
|
|
47542
|
-
|
|
47543
|
-
|
|
47544
|
-
|
|
47545
|
-
|
|
47546
|
-
|
|
47547
|
-
|
|
47122
|
+
}
|
|
47123
|
+
_this.shouldClose = null;
|
|
47124
|
+
};
|
|
47125
|
+
_this.handleContentOnMouseUp = function () {
|
|
47126
|
+
_this.shouldClose = false;
|
|
47127
|
+
};
|
|
47128
|
+
_this.handleOverlayOnMouseDown = function (event) {
|
|
47129
|
+
if (!_this.props.shouldCloseOnOverlayClick && event.target == _this.overlay) {
|
|
47130
|
+
event.preventDefault();
|
|
47131
|
+
}
|
|
47132
|
+
};
|
|
47133
|
+
_this.handleContentOnClick = function () {
|
|
47134
|
+
_this.shouldClose = false;
|
|
47135
|
+
};
|
|
47136
|
+
_this.handleContentOnMouseDown = function () {
|
|
47137
|
+
_this.shouldClose = false;
|
|
47138
|
+
};
|
|
47139
|
+
_this.requestClose = function (event) {
|
|
47140
|
+
return _this.ownerHandlesClose() && _this.props.onRequestClose(event);
|
|
47141
|
+
};
|
|
47142
|
+
_this.ownerHandlesClose = function () {
|
|
47143
|
+
return _this.props.onRequestClose;
|
|
47144
|
+
};
|
|
47145
|
+
_this.shouldBeClosed = function () {
|
|
47146
|
+
return !_this.state.isOpen && !_this.state.beforeClose;
|
|
47147
|
+
};
|
|
47148
|
+
_this.contentHasFocus = function () {
|
|
47149
|
+
return document.activeElement === _this.content || _this.content.contains(document.activeElement);
|
|
47150
|
+
};
|
|
47151
|
+
_this.buildClassName = function (which, additional) {
|
|
47152
|
+
var classNames = (typeof additional === "undefined" ? "undefined" : _typeof(additional)) === "object" ? additional : {
|
|
47153
|
+
base: CLASS_NAMES[which],
|
|
47154
|
+
afterOpen: CLASS_NAMES[which] + "--after-open",
|
|
47155
|
+
beforeClose: CLASS_NAMES[which] + "--before-close"
|
|
47156
|
+
};
|
|
47157
|
+
var className = classNames.base;
|
|
47158
|
+
if (_this.state.afterOpen) {
|
|
47159
|
+
className = className + " " + classNames.afterOpen;
|
|
47160
|
+
}
|
|
47161
|
+
if (_this.state.beforeClose) {
|
|
47162
|
+
className = className + " " + classNames.beforeClose;
|
|
47163
|
+
}
|
|
47164
|
+
return typeof additional === "string" && additional ? className + " " + additional : className;
|
|
47165
|
+
};
|
|
47166
|
+
_this.attributesFromObject = function (prefix, items) {
|
|
47167
|
+
return Object.keys(items).reduce(function (acc, name) {
|
|
47168
|
+
acc[prefix + "-" + name] = items[name];
|
|
47169
|
+
return acc;
|
|
47170
|
+
}, {});
|
|
47171
|
+
};
|
|
47172
|
+
_this.state = {
|
|
47173
|
+
afterOpen: false,
|
|
47174
|
+
beforeClose: false
|
|
47175
|
+
};
|
|
47176
|
+
_this.shouldClose = null;
|
|
47177
|
+
_this.moveFromContentToOverlay = null;
|
|
47178
|
+
return _this;
|
|
47548
47179
|
}
|
|
47549
|
-
|
|
47550
|
-
|
|
47551
|
-
|
|
47552
|
-
|
|
47553
|
-
|
|
47554
|
-
|
|
47555
|
-
|
|
47556
|
-
|
|
47557
|
-
|
|
47558
|
-
|
|
47559
|
-
|
|
47560
|
-
|
|
47561
|
-
|
|
47562
|
-
|
|
47563
|
-
|
|
47564
|
-
|
|
47565
|
-
|
|
47566
|
-
|
|
47567
|
-
|
|
47568
|
-
|
|
47569
|
-
props.
|
|
47570
|
-
|
|
47571
|
-
|
|
47572
|
-
props.
|
|
47180
|
+
_createClass(ModalPortal, [{
|
|
47181
|
+
key: "componentDidMount",
|
|
47182
|
+
value: function componentDidMount() {
|
|
47183
|
+
if (this.props.isOpen) {
|
|
47184
|
+
this.open();
|
|
47185
|
+
}
|
|
47186
|
+
}
|
|
47187
|
+
}, {
|
|
47188
|
+
key: "componentDidUpdate",
|
|
47189
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
47190
|
+
if (process.env.NODE_ENV !== "production") {
|
|
47191
|
+
if (prevProps.bodyOpenClassName !== this.props.bodyOpenClassName) {
|
|
47192
|
+
console.warn('React-Modal: "bodyOpenClassName" prop has been modified. ' + "This may cause unexpected behavior when multiple modals are open.");
|
|
47193
|
+
}
|
|
47194
|
+
if (prevProps.htmlOpenClassName !== this.props.htmlOpenClassName) {
|
|
47195
|
+
console.warn('React-Modal: "htmlOpenClassName" prop has been modified. ' + "This may cause unexpected behavior when multiple modals are open.");
|
|
47196
|
+
}
|
|
47197
|
+
}
|
|
47198
|
+
if (this.props.isOpen && !prevProps.isOpen) {
|
|
47199
|
+
this.open();
|
|
47200
|
+
} else if (!this.props.isOpen && prevProps.isOpen) {
|
|
47201
|
+
this.close();
|
|
47202
|
+
}
|
|
47203
|
+
if (this.props.shouldFocusAfterRender && this.state.isOpen && !prevState.isOpen) {
|
|
47204
|
+
this.focusContent();
|
|
47205
|
+
}
|
|
47206
|
+
}
|
|
47207
|
+
}, {
|
|
47208
|
+
key: "componentWillUnmount",
|
|
47209
|
+
value: function componentWillUnmount() {
|
|
47210
|
+
if (this.state.isOpen) {
|
|
47211
|
+
this.afterClose();
|
|
47212
|
+
}
|
|
47213
|
+
clearTimeout(this.closeTimer);
|
|
47214
|
+
cancelAnimationFrame(this.openAnimationFrame);
|
|
47215
|
+
}
|
|
47216
|
+
}, {
|
|
47217
|
+
key: "beforeOpen",
|
|
47218
|
+
value: function beforeOpen() {
|
|
47219
|
+
var _props = this.props,
|
|
47220
|
+
appElement = _props.appElement,
|
|
47221
|
+
ariaHideApp = _props.ariaHideApp,
|
|
47222
|
+
htmlOpenClassName = _props.htmlOpenClassName,
|
|
47223
|
+
bodyOpenClassName = _props.bodyOpenClassName,
|
|
47224
|
+
parentSelector = _props.parentSelector;
|
|
47225
|
+
var parentDocument = parentSelector && parentSelector().ownerDocument || document;
|
|
47226
|
+
bodyOpenClassName && classList$1.add(parentDocument.body, bodyOpenClassName);
|
|
47227
|
+
htmlOpenClassName && classList$1.add(parentDocument.getElementsByTagName("html")[0], htmlOpenClassName);
|
|
47228
|
+
if (ariaHideApp) {
|
|
47229
|
+
ariaHiddenInstances += 1;
|
|
47230
|
+
ariaAppHider$1.hide(appElement);
|
|
47231
|
+
}
|
|
47232
|
+
_portalOpenInstances2.default.register(this);
|
|
47233
|
+
}
|
|
47234
|
+
}, {
|
|
47235
|
+
key: "render",
|
|
47236
|
+
value: function render() {
|
|
47237
|
+
var _props2 = this.props,
|
|
47238
|
+
id = _props2.id,
|
|
47239
|
+
className = _props2.className,
|
|
47240
|
+
overlayClassName = _props2.overlayClassName,
|
|
47241
|
+
defaultStyles = _props2.defaultStyles,
|
|
47242
|
+
children = _props2.children;
|
|
47243
|
+
var contentStyles = className ? {} : defaultStyles.content;
|
|
47244
|
+
var overlayStyles = overlayClassName ? {} : defaultStyles.overlay;
|
|
47245
|
+
if (this.shouldBeClosed()) {
|
|
47246
|
+
return null;
|
|
47247
|
+
}
|
|
47248
|
+
var overlayProps = {
|
|
47249
|
+
ref: this.setOverlayRef,
|
|
47250
|
+
className: this.buildClassName("overlay", overlayClassName),
|
|
47251
|
+
style: _extends({}, overlayStyles, this.props.style.overlay),
|
|
47252
|
+
onClick: this.handleOverlayOnClick,
|
|
47253
|
+
onMouseDown: this.handleOverlayOnMouseDown
|
|
47254
|
+
};
|
|
47255
|
+
var contentProps = _extends({
|
|
47256
|
+
id: id,
|
|
47257
|
+
ref: this.setContentRef,
|
|
47258
|
+
style: _extends({}, contentStyles, this.props.style.content),
|
|
47259
|
+
className: this.buildClassName("content", className),
|
|
47260
|
+
tabIndex: "-1",
|
|
47261
|
+
onKeyDown: this.handleKeyDown,
|
|
47262
|
+
onMouseDown: this.handleContentOnMouseDown,
|
|
47263
|
+
onMouseUp: this.handleContentOnMouseUp,
|
|
47264
|
+
onClick: this.handleContentOnClick,
|
|
47265
|
+
role: this.props.role,
|
|
47266
|
+
"aria-label": this.props.contentLabel
|
|
47267
|
+
}, this.attributesFromObject("aria", _extends({
|
|
47268
|
+
modal: true
|
|
47269
|
+
}, this.props.aria)), this.attributesFromObject("data", this.props.data || {}), {
|
|
47270
|
+
"data-testid": this.props.testId
|
|
47271
|
+
});
|
|
47272
|
+
var contentElement = this.props.contentElement(contentProps, children);
|
|
47273
|
+
return this.props.overlayElement(overlayProps, contentElement);
|
|
47573
47274
|
}
|
|
47574
|
-
})
|
|
47575
|
-
|
|
47275
|
+
}]);
|
|
47276
|
+
return ModalPortal;
|
|
47277
|
+
}(React__default.Component);
|
|
47278
|
+
ModalPortal.defaultProps = {
|
|
47576
47279
|
style: {
|
|
47577
|
-
|
|
47280
|
+
overlay: {},
|
|
47281
|
+
content: {}
|
|
47282
|
+
},
|
|
47283
|
+
defaultStyles: {}
|
|
47284
|
+
};
|
|
47285
|
+
ModalPortal.propTypes = {
|
|
47286
|
+
isOpen: _propTypes2.default.bool.isRequired,
|
|
47287
|
+
defaultStyles: _propTypes2.default.shape({
|
|
47288
|
+
content: _propTypes2.default.object,
|
|
47289
|
+
overlay: _propTypes2.default.object
|
|
47290
|
+
}),
|
|
47291
|
+
style: _propTypes2.default.shape({
|
|
47292
|
+
content: _propTypes2.default.object,
|
|
47293
|
+
overlay: _propTypes2.default.object
|
|
47294
|
+
}),
|
|
47295
|
+
className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
|
|
47296
|
+
overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
|
|
47297
|
+
parentSelector: _propTypes2.default.func,
|
|
47298
|
+
bodyOpenClassName: _propTypes2.default.string,
|
|
47299
|
+
htmlOpenClassName: _propTypes2.default.string,
|
|
47300
|
+
ariaHideApp: _propTypes2.default.bool,
|
|
47301
|
+
appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),
|
|
47302
|
+
onAfterOpen: _propTypes2.default.func,
|
|
47303
|
+
onAfterClose: _propTypes2.default.func,
|
|
47304
|
+
onRequestClose: _propTypes2.default.func,
|
|
47305
|
+
closeTimeoutMS: _propTypes2.default.number,
|
|
47306
|
+
shouldFocusAfterRender: _propTypes2.default.bool,
|
|
47307
|
+
shouldCloseOnOverlayClick: _propTypes2.default.bool,
|
|
47308
|
+
shouldReturnFocusAfterClose: _propTypes2.default.bool,
|
|
47309
|
+
preventScroll: _propTypes2.default.bool,
|
|
47310
|
+
role: _propTypes2.default.string,
|
|
47311
|
+
contentLabel: _propTypes2.default.string,
|
|
47312
|
+
aria: _propTypes2.default.object,
|
|
47313
|
+
data: _propTypes2.default.object,
|
|
47314
|
+
children: _propTypes2.default.node,
|
|
47315
|
+
shouldCloseOnEsc: _propTypes2.default.bool,
|
|
47316
|
+
overlayRef: _propTypes2.default.func,
|
|
47317
|
+
contentRef: _propTypes2.default.func,
|
|
47318
|
+
id: _propTypes2.default.string,
|
|
47319
|
+
overlayElement: _propTypes2.default.func,
|
|
47320
|
+
contentElement: _propTypes2.default.func,
|
|
47321
|
+
testId: _propTypes2.default.string
|
|
47322
|
+
};
|
|
47323
|
+
exports.default = ModalPortal;
|
|
47324
|
+
module.exports = exports["default"];
|
|
47325
|
+
});
|
|
47326
|
+
unwrapExports(ModalPortal_1);
|
|
47327
|
+
|
|
47328
|
+
function componentWillMount() {
|
|
47329
|
+
var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
|
|
47330
|
+
if (state !== null && state !== undefined) {
|
|
47331
|
+
this.setState(state);
|
|
47332
|
+
}
|
|
47333
|
+
}
|
|
47334
|
+
function componentWillReceiveProps(nextProps) {
|
|
47335
|
+
function updater(prevState) {
|
|
47336
|
+
var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
|
|
47337
|
+
return state !== null && state !== undefined ? state : null;
|
|
47338
|
+
}
|
|
47339
|
+
this.setState(updater.bind(this));
|
|
47340
|
+
}
|
|
47341
|
+
function componentWillUpdate(nextProps, nextState) {
|
|
47342
|
+
try {
|
|
47343
|
+
var prevProps = this.props;
|
|
47344
|
+
var prevState = this.state;
|
|
47345
|
+
this.props = nextProps;
|
|
47346
|
+
this.state = nextState;
|
|
47347
|
+
this.__reactInternalSnapshotFlag = true;
|
|
47348
|
+
this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(prevProps, prevState);
|
|
47349
|
+
} finally {
|
|
47350
|
+
this.props = prevProps;
|
|
47351
|
+
this.state = prevState;
|
|
47352
|
+
}
|
|
47353
|
+
}
|
|
47354
|
+
componentWillMount.__suppressDeprecationWarning = true;
|
|
47355
|
+
componentWillReceiveProps.__suppressDeprecationWarning = true;
|
|
47356
|
+
componentWillUpdate.__suppressDeprecationWarning = true;
|
|
47357
|
+
function polyfill(Component) {
|
|
47358
|
+
var prototype = Component.prototype;
|
|
47359
|
+
if (!prototype || !prototype.isReactComponent) {
|
|
47360
|
+
throw new Error('Can only polyfill class components');
|
|
47361
|
+
}
|
|
47362
|
+
if (typeof Component.getDerivedStateFromProps !== 'function' && typeof prototype.getSnapshotBeforeUpdate !== 'function') {
|
|
47363
|
+
return Component;
|
|
47364
|
+
}
|
|
47365
|
+
var foundWillMountName = null;
|
|
47366
|
+
var foundWillReceivePropsName = null;
|
|
47367
|
+
var foundWillUpdateName = null;
|
|
47368
|
+
if (typeof prototype.componentWillMount === 'function') {
|
|
47369
|
+
foundWillMountName = 'componentWillMount';
|
|
47370
|
+
} else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
|
|
47371
|
+
foundWillMountName = 'UNSAFE_componentWillMount';
|
|
47372
|
+
}
|
|
47373
|
+
if (typeof prototype.componentWillReceiveProps === 'function') {
|
|
47374
|
+
foundWillReceivePropsName = 'componentWillReceiveProps';
|
|
47375
|
+
} else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
|
|
47376
|
+
foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
|
|
47377
|
+
}
|
|
47378
|
+
if (typeof prototype.componentWillUpdate === 'function') {
|
|
47379
|
+
foundWillUpdateName = 'componentWillUpdate';
|
|
47380
|
+
} else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
|
|
47381
|
+
foundWillUpdateName = 'UNSAFE_componentWillUpdate';
|
|
47382
|
+
}
|
|
47383
|
+
if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
|
|
47384
|
+
var componentName = Component.displayName || Component.name;
|
|
47385
|
+
var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
|
|
47386
|
+
throw Error('Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + componentName + ' uses ' + newApiName + ' but also contains the following legacy lifecycles:' + (foundWillMountName !== null ? '\n ' + foundWillMountName : '') + (foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '') + (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') + '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks');
|
|
47387
|
+
}
|
|
47388
|
+
if (typeof Component.getDerivedStateFromProps === 'function') {
|
|
47389
|
+
prototype.componentWillMount = componentWillMount;
|
|
47390
|
+
prototype.componentWillReceiveProps = componentWillReceiveProps;
|
|
47391
|
+
}
|
|
47392
|
+
if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
|
|
47393
|
+
if (typeof prototype.componentDidUpdate !== 'function') {
|
|
47394
|
+
throw new Error('Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype');
|
|
47578
47395
|
}
|
|
47579
|
-
|
|
47580
|
-
|
|
47581
|
-
|
|
47396
|
+
prototype.componentWillUpdate = componentWillUpdate;
|
|
47397
|
+
var componentDidUpdate = prototype.componentDidUpdate;
|
|
47398
|
+
prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) {
|
|
47399
|
+
var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot;
|
|
47400
|
+
componentDidUpdate.call(this, prevProps, prevState, snapshot);
|
|
47401
|
+
};
|
|
47402
|
+
}
|
|
47403
|
+
return Component;
|
|
47404
|
+
}
|
|
47405
|
+
|
|
47406
|
+
var reactLifecyclesCompat_es = {
|
|
47407
|
+
__proto__: null,
|
|
47408
|
+
polyfill: polyfill
|
|
47409
|
+
};
|
|
47410
|
+
|
|
47411
|
+
var Modal_1 = createCommonjsModule(function (module, exports) {
|
|
47412
|
+
|
|
47413
|
+
Object.defineProperty(exports, "__esModule", {
|
|
47414
|
+
value: true
|
|
47415
|
+
});
|
|
47416
|
+
exports.bodyOpenClassName = exports.portalClassName = undefined;
|
|
47417
|
+
var _extends = Object.assign || function (target) {
|
|
47418
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
47419
|
+
var source = arguments[i];
|
|
47420
|
+
for (var key in source) {
|
|
47421
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
47422
|
+
target[key] = source[key];
|
|
47423
|
+
}
|
|
47424
|
+
}
|
|
47582
47425
|
}
|
|
47583
|
-
|
|
47584
|
-
|
|
47585
|
-
|
|
47426
|
+
return target;
|
|
47427
|
+
};
|
|
47428
|
+
var _createClass = function () {
|
|
47429
|
+
function defineProperties(target, props) {
|
|
47430
|
+
for (var i = 0; i < props.length; i++) {
|
|
47431
|
+
var descriptor = props[i];
|
|
47432
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
47433
|
+
descriptor.configurable = true;
|
|
47434
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
47435
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
47436
|
+
}
|
|
47586
47437
|
}
|
|
47587
|
-
|
|
47588
|
-
|
|
47589
|
-
|
|
47590
|
-
|
|
47591
|
-
|
|
47592
|
-
}
|
|
47593
|
-
|
|
47594
|
-
|
|
47595
|
-
|
|
47596
|
-
|
|
47597
|
-
|
|
47598
|
-
|
|
47599
|
-
|
|
47600
|
-
|
|
47601
|
-
|
|
47602
|
-
|
|
47603
|
-
|
|
47604
|
-
|
|
47605
|
-
|
|
47606
|
-
|
|
47607
|
-
|
|
47608
|
-
}
|
|
47609
|
-
|
|
47610
|
-
|
|
47611
|
-
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
47612
|
-
style: {
|
|
47613
|
-
marginTop: "20px"
|
|
47438
|
+
return function (Constructor, protoProps, staticProps) {
|
|
47439
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
47440
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
|
47441
|
+
return Constructor;
|
|
47442
|
+
};
|
|
47443
|
+
}();
|
|
47444
|
+
var _react2 = _interopRequireDefault(React__default);
|
|
47445
|
+
var _reactDom2 = _interopRequireDefault(reactDom);
|
|
47446
|
+
var _propTypes2 = _interopRequireDefault(propTypes);
|
|
47447
|
+
var _ModalPortal2 = _interopRequireDefault(ModalPortal_1);
|
|
47448
|
+
var ariaAppHider$1 = _interopRequireWildcard(ariaAppHider);
|
|
47449
|
+
var _safeHTMLElement2 = _interopRequireDefault(safeHTMLElement);
|
|
47450
|
+
function _interopRequireWildcard(obj) {
|
|
47451
|
+
if (obj && obj.__esModule) {
|
|
47452
|
+
return obj;
|
|
47453
|
+
} else {
|
|
47454
|
+
var newObj = {};
|
|
47455
|
+
if (obj != null) {
|
|
47456
|
+
for (var key in obj) {
|
|
47457
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
|
|
47458
|
+
}
|
|
47459
|
+
}
|
|
47460
|
+
newObj.default = obj;
|
|
47461
|
+
return newObj;
|
|
47614
47462
|
}
|
|
47615
|
-
}
|
|
47616
|
-
|
|
47617
|
-
|
|
47463
|
+
}
|
|
47464
|
+
function _interopRequireDefault(obj) {
|
|
47465
|
+
return obj && obj.__esModule ? obj : {
|
|
47466
|
+
default: obj
|
|
47467
|
+
};
|
|
47468
|
+
}
|
|
47469
|
+
function _classCallCheck(instance, Constructor) {
|
|
47470
|
+
if (!(instance instanceof Constructor)) {
|
|
47471
|
+
throw new TypeError("Cannot call a class as a function");
|
|
47618
47472
|
}
|
|
47619
|
-
}
|
|
47620
|
-
|
|
47621
|
-
|
|
47622
|
-
|
|
47623
|
-
required: t("HALL_CODE_REQ")
|
|
47624
|
-
},
|
|
47625
|
-
render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
47626
|
-
style: {
|
|
47627
|
-
marginBottom: 0
|
|
47628
|
-
},
|
|
47629
|
-
className: "form-field",
|
|
47630
|
-
select: e => {
|
|
47631
|
-
console.log("e", e);
|
|
47632
|
-
props.onChange(e);
|
|
47633
|
-
slotsSearch(e);
|
|
47634
|
-
setShowInfo(true);
|
|
47635
|
-
},
|
|
47636
|
-
selected: props.value,
|
|
47637
|
-
option: getHallCodes,
|
|
47638
|
-
optionKey: "HallCode"
|
|
47639
|
-
})
|
|
47640
|
-
}), errors.hallCode && /*#__PURE__*/React__default.createElement("p", {
|
|
47641
|
-
style: {
|
|
47642
|
-
color: "red"
|
|
47473
|
+
}
|
|
47474
|
+
function _possibleConstructorReturn(self, call) {
|
|
47475
|
+
if (!self) {
|
|
47476
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
47643
47477
|
}
|
|
47644
|
-
|
|
47645
|
-
|
|
47646
|
-
|
|
47647
|
-
|
|
47478
|
+
return call && (typeof call === "object" || typeof call === "function") ? call : self;
|
|
47479
|
+
}
|
|
47480
|
+
function _inherits(subClass, superClass) {
|
|
47481
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
47482
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
|
47648
47483
|
}
|
|
47649
|
-
|
|
47650
|
-
|
|
47651
|
-
|
|
47484
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
47485
|
+
constructor: {
|
|
47486
|
+
value: subClass,
|
|
47487
|
+
enumerable: false,
|
|
47488
|
+
writable: true,
|
|
47489
|
+
configurable: true
|
|
47490
|
+
}
|
|
47491
|
+
});
|
|
47492
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
|
47493
|
+
}
|
|
47494
|
+
var portalClassName = exports.portalClassName = "ReactModalPortal";
|
|
47495
|
+
var bodyOpenClassName = exports.bodyOpenClassName = "ReactModal__Body--open";
|
|
47496
|
+
var isReact16 = safeHTMLElement.canUseDOM && _reactDom2.default.createPortal !== undefined;
|
|
47497
|
+
var createHTMLElement = function createHTMLElement(name) {
|
|
47498
|
+
return document.createElement(name);
|
|
47499
|
+
};
|
|
47500
|
+
var getCreatePortal = function getCreatePortal() {
|
|
47501
|
+
return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer;
|
|
47502
|
+
};
|
|
47503
|
+
function getParentElement(parentSelector) {
|
|
47504
|
+
return parentSelector();
|
|
47505
|
+
}
|
|
47506
|
+
var Modal = function (_Component) {
|
|
47507
|
+
_inherits(Modal, _Component);
|
|
47508
|
+
function Modal() {
|
|
47509
|
+
var _ref;
|
|
47510
|
+
var _temp, _this, _ret;
|
|
47511
|
+
_classCallCheck(this, Modal);
|
|
47512
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
47513
|
+
args[_key] = arguments[_key];
|
|
47514
|
+
}
|
|
47515
|
+
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () {
|
|
47516
|
+
!isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node);
|
|
47517
|
+
var parent = getParentElement(_this.props.parentSelector);
|
|
47518
|
+
if (parent && parent.contains(_this.node)) {
|
|
47519
|
+
parent.removeChild(_this.node);
|
|
47520
|
+
} else {
|
|
47521
|
+
console.warn('React-Modal: "parentSelector" prop did not returned any DOM ' + "element. Make sure that the parent element is unmounted to " + "avoid any memory leaks.");
|
|
47522
|
+
}
|
|
47523
|
+
}, _this.portalRef = function (ref) {
|
|
47524
|
+
_this.portal = ref;
|
|
47525
|
+
}, _this.renderPortal = function (props) {
|
|
47526
|
+
var createPortal = getCreatePortal();
|
|
47527
|
+
var portal = createPortal(_this, _react2.default.createElement(_ModalPortal2.default, _extends({
|
|
47528
|
+
defaultStyles: Modal.defaultStyles
|
|
47529
|
+
}, props)), _this.node);
|
|
47530
|
+
_this.portalRef(portal);
|
|
47531
|
+
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
47652
47532
|
}
|
|
47653
|
-
|
|
47654
|
-
|
|
47655
|
-
|
|
47656
|
-
|
|
47657
|
-
|
|
47658
|
-
|
|
47659
|
-
return t("PLEASE_SELECT_AT_LEAST_ONE_SLOT");
|
|
47533
|
+
_createClass(Modal, [{
|
|
47534
|
+
key: "componentDidMount",
|
|
47535
|
+
value: function componentDidMount() {
|
|
47536
|
+
if (!safeHTMLElement.canUseDOM) return;
|
|
47537
|
+
if (!isReact16) {
|
|
47538
|
+
this.node = createHTMLElement("div");
|
|
47660
47539
|
}
|
|
47661
|
-
|
|
47540
|
+
this.node.className = this.props.portalClassName;
|
|
47541
|
+
var parent = getParentElement(this.props.parentSelector);
|
|
47542
|
+
parent.appendChild(this.node);
|
|
47543
|
+
!isReact16 && this.renderPortal(this.props);
|
|
47662
47544
|
}
|
|
47663
|
-
},
|
|
47664
|
-
|
|
47665
|
-
|
|
47666
|
-
|
|
47667
|
-
|
|
47668
|
-
|
|
47669
|
-
|
|
47670
|
-
|
|
47545
|
+
}, {
|
|
47546
|
+
key: "getSnapshotBeforeUpdate",
|
|
47547
|
+
value: function getSnapshotBeforeUpdate(prevProps) {
|
|
47548
|
+
var prevParent = getParentElement(prevProps.parentSelector);
|
|
47549
|
+
var nextParent = getParentElement(this.props.parentSelector);
|
|
47550
|
+
return {
|
|
47551
|
+
prevParent: prevParent,
|
|
47552
|
+
nextParent: nextParent
|
|
47553
|
+
};
|
|
47671
47554
|
}
|
|
47672
|
-
},
|
|
47673
|
-
|
|
47674
|
-
|
|
47675
|
-
|
|
47676
|
-
|
|
47677
|
-
|
|
47678
|
-
|
|
47679
|
-
|
|
47680
|
-
|
|
47681
|
-
borderRadius: "8px",
|
|
47682
|
-
padding: "12px",
|
|
47683
|
-
backgroundColor: isAvailable ? "#e6ffed" : "#ffe6e6",
|
|
47684
|
-
cursor: isAvailable ? "pointer" : "not-allowed",
|
|
47685
|
-
opacity: isAvailable ? 1 : 0.6,
|
|
47686
|
-
flexDirection: "column",
|
|
47687
|
-
gap: "6px"
|
|
47555
|
+
}, {
|
|
47556
|
+
key: "componentDidUpdate",
|
|
47557
|
+
value: function componentDidUpdate(prevProps, _, snapshot) {
|
|
47558
|
+
if (!safeHTMLElement.canUseDOM) return;
|
|
47559
|
+
var _props = this.props,
|
|
47560
|
+
isOpen = _props.isOpen,
|
|
47561
|
+
portalClassName = _props.portalClassName;
|
|
47562
|
+
if (prevProps.portalClassName !== portalClassName) {
|
|
47563
|
+
this.node.className = portalClassName;
|
|
47688
47564
|
}
|
|
47689
|
-
|
|
47690
|
-
|
|
47691
|
-
|
|
47692
|
-
|
|
47693
|
-
|
|
47694
|
-
|
|
47695
|
-
|
|
47696
|
-
|
|
47697
|
-
|
|
47698
|
-
|
|
47565
|
+
var prevParent = snapshot.prevParent,
|
|
47566
|
+
nextParent = snapshot.nextParent;
|
|
47567
|
+
if (nextParent !== prevParent) {
|
|
47568
|
+
prevParent.removeChild(this.node);
|
|
47569
|
+
nextParent.appendChild(this.node);
|
|
47570
|
+
}
|
|
47571
|
+
if (!prevProps.isOpen && !isOpen) return;
|
|
47572
|
+
!isReact16 && this.renderPortal(this.props);
|
|
47573
|
+
}
|
|
47574
|
+
}, {
|
|
47575
|
+
key: "componentWillUnmount",
|
|
47576
|
+
value: function componentWillUnmount() {
|
|
47577
|
+
if (!safeHTMLElement.canUseDOM || !this.node || !this.portal) return;
|
|
47578
|
+
var state = this.portal.state;
|
|
47579
|
+
var now = Date.now();
|
|
47580
|
+
var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS);
|
|
47581
|
+
if (closesAt) {
|
|
47582
|
+
if (!state.beforeClose) {
|
|
47583
|
+
this.portal.closeWithTimeout();
|
|
47699
47584
|
}
|
|
47585
|
+
setTimeout(this.removePortal, closesAt - now);
|
|
47586
|
+
} else {
|
|
47587
|
+
this.removePortal();
|
|
47700
47588
|
}
|
|
47701
|
-
}
|
|
47702
|
-
|
|
47703
|
-
|
|
47589
|
+
}
|
|
47590
|
+
}, {
|
|
47591
|
+
key: "render",
|
|
47592
|
+
value: function render() {
|
|
47593
|
+
if (!safeHTMLElement.canUseDOM || !isReact16) {
|
|
47594
|
+
return null;
|
|
47704
47595
|
}
|
|
47705
|
-
|
|
47706
|
-
|
|
47707
|
-
color: slot.slotStaus === "AVAILABLE" ? "green" : "red",
|
|
47708
|
-
fontWeight: "bold"
|
|
47596
|
+
if (!this.node && isReact16) {
|
|
47597
|
+
this.node = createHTMLElement("div");
|
|
47709
47598
|
}
|
|
47710
|
-
|
|
47711
|
-
|
|
47712
|
-
|
|
47713
|
-
|
|
47714
|
-
|
|
47715
|
-
|
|
47716
|
-
|
|
47717
|
-
|
|
47718
|
-
|
|
47719
|
-
|
|
47720
|
-
|
|
47721
|
-
|
|
47722
|
-
|
|
47723
|
-
|
|
47724
|
-
|
|
47725
|
-
|
|
47726
|
-
style: {
|
|
47727
|
-
|
|
47728
|
-
|
|
47729
|
-
|
|
47730
|
-
|
|
47731
|
-
|
|
47732
|
-
|
|
47733
|
-
|
|
47734
|
-
|
|
47599
|
+
var createPortal = getCreatePortal();
|
|
47600
|
+
return createPortal(_react2.default.createElement(_ModalPortal2.default, _extends({
|
|
47601
|
+
ref: this.portalRef,
|
|
47602
|
+
defaultStyles: Modal.defaultStyles
|
|
47603
|
+
}, this.props)), this.node);
|
|
47604
|
+
}
|
|
47605
|
+
}], [{
|
|
47606
|
+
key: "setAppElement",
|
|
47607
|
+
value: function setAppElement(element) {
|
|
47608
|
+
ariaAppHider$1.setElement(element);
|
|
47609
|
+
}
|
|
47610
|
+
}]);
|
|
47611
|
+
return Modal;
|
|
47612
|
+
}(React__default.Component);
|
|
47613
|
+
Modal.propTypes = {
|
|
47614
|
+
isOpen: _propTypes2.default.bool.isRequired,
|
|
47615
|
+
style: _propTypes2.default.shape({
|
|
47616
|
+
content: _propTypes2.default.object,
|
|
47617
|
+
overlay: _propTypes2.default.object
|
|
47618
|
+
}),
|
|
47619
|
+
portalClassName: _propTypes2.default.string,
|
|
47620
|
+
bodyOpenClassName: _propTypes2.default.string,
|
|
47621
|
+
htmlOpenClassName: _propTypes2.default.string,
|
|
47622
|
+
className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({
|
|
47623
|
+
base: _propTypes2.default.string.isRequired,
|
|
47624
|
+
afterOpen: _propTypes2.default.string.isRequired,
|
|
47625
|
+
beforeClose: _propTypes2.default.string.isRequired
|
|
47626
|
+
})]),
|
|
47627
|
+
overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({
|
|
47628
|
+
base: _propTypes2.default.string.isRequired,
|
|
47629
|
+
afterOpen: _propTypes2.default.string.isRequired,
|
|
47630
|
+
beforeClose: _propTypes2.default.string.isRequired
|
|
47631
|
+
})]),
|
|
47632
|
+
appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),
|
|
47633
|
+
onAfterOpen: _propTypes2.default.func,
|
|
47634
|
+
onRequestClose: _propTypes2.default.func,
|
|
47635
|
+
closeTimeoutMS: _propTypes2.default.number,
|
|
47636
|
+
ariaHideApp: _propTypes2.default.bool,
|
|
47637
|
+
shouldFocusAfterRender: _propTypes2.default.bool,
|
|
47638
|
+
shouldCloseOnOverlayClick: _propTypes2.default.bool,
|
|
47639
|
+
shouldReturnFocusAfterClose: _propTypes2.default.bool,
|
|
47640
|
+
preventScroll: _propTypes2.default.bool,
|
|
47641
|
+
parentSelector: _propTypes2.default.func,
|
|
47642
|
+
aria: _propTypes2.default.object,
|
|
47643
|
+
data: _propTypes2.default.object,
|
|
47644
|
+
role: _propTypes2.default.string,
|
|
47645
|
+
contentLabel: _propTypes2.default.string,
|
|
47646
|
+
shouldCloseOnEsc: _propTypes2.default.bool,
|
|
47647
|
+
overlayRef: _propTypes2.default.func,
|
|
47648
|
+
contentRef: _propTypes2.default.func,
|
|
47649
|
+
id: _propTypes2.default.string,
|
|
47650
|
+
overlayElement: _propTypes2.default.func,
|
|
47651
|
+
contentElement: _propTypes2.default.func
|
|
47652
|
+
};
|
|
47653
|
+
Modal.defaultProps = {
|
|
47654
|
+
isOpen: false,
|
|
47655
|
+
portalClassName: portalClassName,
|
|
47656
|
+
bodyOpenClassName: bodyOpenClassName,
|
|
47657
|
+
role: "dialog",
|
|
47658
|
+
ariaHideApp: true,
|
|
47659
|
+
closeTimeoutMS: 0,
|
|
47660
|
+
shouldFocusAfterRender: true,
|
|
47661
|
+
shouldCloseOnEsc: true,
|
|
47662
|
+
shouldCloseOnOverlayClick: true,
|
|
47663
|
+
shouldReturnFocusAfterClose: true,
|
|
47664
|
+
preventScroll: false,
|
|
47665
|
+
parentSelector: function parentSelector() {
|
|
47666
|
+
return document.body;
|
|
47735
47667
|
},
|
|
47736
|
-
|
|
47737
|
-
|
|
47738
|
-
|
|
47739
|
-
|
|
47740
|
-
|
|
47741
|
-
},
|
|
47742
|
-
className: "form-field",
|
|
47743
|
-
select: props.onChange,
|
|
47744
|
-
selected: props.value,
|
|
47745
|
-
option: CHBPurpose === null || CHBPurpose === void 0 ? void 0 : (_CHBPurpose$CHB = CHBPurpose.CHB) === null || _CHBPurpose$CHB === void 0 ? void 0 : _CHBPurpose$CHB.Purpose,
|
|
47746
|
-
optionKey: "name"
|
|
47747
|
-
});
|
|
47748
|
-
}
|
|
47749
|
-
}), errors.purpose && /*#__PURE__*/React__default.createElement("p", {
|
|
47750
|
-
style: {
|
|
47751
|
-
color: "red"
|
|
47752
|
-
}
|
|
47753
|
-
}, errors.purpose.message)), /*#__PURE__*/React__default.createElement("div", {
|
|
47754
|
-
style: {
|
|
47755
|
-
marginBottom: "20px"
|
|
47756
|
-
}
|
|
47757
|
-
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("CHB_SPECIAL_CATEGORY"), " ", /*#__PURE__*/React__default.createElement("span", {
|
|
47758
|
-
style: {
|
|
47759
|
-
color: "red"
|
|
47668
|
+
overlayElement: function overlayElement(props, contentEl) {
|
|
47669
|
+
return _react2.default.createElement("div", props, contentEl);
|
|
47670
|
+
},
|
|
47671
|
+
contentElement: function contentElement(props, children) {
|
|
47672
|
+
return _react2.default.createElement("div", props, children);
|
|
47760
47673
|
}
|
|
47761
|
-
}
|
|
47762
|
-
|
|
47763
|
-
|
|
47764
|
-
|
|
47765
|
-
|
|
47766
|
-
|
|
47674
|
+
};
|
|
47675
|
+
Modal.defaultStyles = {
|
|
47676
|
+
overlay: {
|
|
47677
|
+
position: "fixed",
|
|
47678
|
+
top: 0,
|
|
47679
|
+
left: 0,
|
|
47680
|
+
right: 0,
|
|
47681
|
+
bottom: 0,
|
|
47682
|
+
backgroundColor: "rgba(255, 255, 255, 0.75)"
|
|
47767
47683
|
},
|
|
47768
|
-
|
|
47769
|
-
|
|
47770
|
-
|
|
47771
|
-
|
|
47772
|
-
|
|
47773
|
-
|
|
47774
|
-
|
|
47775
|
-
|
|
47776
|
-
|
|
47777
|
-
|
|
47778
|
-
|
|
47779
|
-
|
|
47684
|
+
content: {
|
|
47685
|
+
position: "absolute",
|
|
47686
|
+
top: "40px",
|
|
47687
|
+
left: "40px",
|
|
47688
|
+
right: "40px",
|
|
47689
|
+
bottom: "40px",
|
|
47690
|
+
border: "1px solid #ccc",
|
|
47691
|
+
background: "#fff",
|
|
47692
|
+
overflow: "auto",
|
|
47693
|
+
WebkitOverflowScrolling: "touch",
|
|
47694
|
+
borderRadius: "4px",
|
|
47695
|
+
outline: "none",
|
|
47696
|
+
padding: "20px"
|
|
47780
47697
|
}
|
|
47781
|
-
}
|
|
47782
|
-
|
|
47783
|
-
|
|
47698
|
+
};
|
|
47699
|
+
(0, reactLifecyclesCompat_es.polyfill)(Modal);
|
|
47700
|
+
if (process.env.NODE_ENV !== "production") {
|
|
47701
|
+
Modal.setCreateHTMLElement = function (fn) {
|
|
47702
|
+
return createHTMLElement = fn;
|
|
47703
|
+
};
|
|
47704
|
+
}
|
|
47705
|
+
exports.default = Modal;
|
|
47706
|
+
});
|
|
47707
|
+
unwrapExports(Modal_1);
|
|
47708
|
+
|
|
47709
|
+
var lib = createCommonjsModule(function (module, exports) {
|
|
47710
|
+
|
|
47711
|
+
Object.defineProperty(exports, "__esModule", {
|
|
47712
|
+
value: true
|
|
47713
|
+
});
|
|
47714
|
+
var _Modal2 = _interopRequireDefault(Modal_1);
|
|
47715
|
+
function _interopRequireDefault(obj) {
|
|
47716
|
+
return obj && obj.__esModule ? obj : {
|
|
47717
|
+
default: obj
|
|
47718
|
+
};
|
|
47719
|
+
}
|
|
47720
|
+
exports.default = _Modal2.default;
|
|
47721
|
+
module.exports = exports["default"];
|
|
47722
|
+
});
|
|
47723
|
+
var Modal = unwrapExports(lib);
|
|
47724
|
+
|
|
47725
|
+
const CitizenConsent = _ref => {
|
|
47726
|
+
var _user$info, _user$info2;
|
|
47727
|
+
let {
|
|
47728
|
+
showTermsPopupOwner,
|
|
47729
|
+
setShowTermsPopupOwner,
|
|
47730
|
+
otpVerifiedTimestamp,
|
|
47731
|
+
getModalData
|
|
47732
|
+
} = _ref;
|
|
47733
|
+
const {
|
|
47734
|
+
t
|
|
47735
|
+
} = reactI18next.useTranslation();
|
|
47736
|
+
const user = Digit.UserService.getUser();
|
|
47737
|
+
const ownername = user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.name;
|
|
47738
|
+
const ownermobileNumber = user === null || user === void 0 ? void 0 : user.info.mobileNumber;
|
|
47739
|
+
const ownerEmail = user === null || user === void 0 ? void 0 : (_user$info2 = user.info) === null || _user$info2 === void 0 ? void 0 : _user$info2.emailId;
|
|
47740
|
+
const {
|
|
47741
|
+
id
|
|
47742
|
+
} = reactRouterDom.useParams();
|
|
47743
|
+
const tenantId = window.location.href.includes("citizen") ? window.localStorage.getItem("CITIZEN.CITY") : window.localStorage.getItem("Employee.tenant-id");
|
|
47744
|
+
const [loader, setLoader] = React.useState(false);
|
|
47745
|
+
console.log("getModalData", getModalData);
|
|
47746
|
+
const {
|
|
47747
|
+
data,
|
|
47748
|
+
isLoading
|
|
47749
|
+
} = Digit.Hooks.obps.useBPADetailsPage(tenantId, {
|
|
47750
|
+
applicationNo: id
|
|
47751
|
+
});
|
|
47752
|
+
const [isUploading, setIsUploading] = React.useState(false);
|
|
47753
|
+
const [isFileUploaded, setIsFileUploaded] = React.useState(false);
|
|
47754
|
+
const isCitizenDeclared = sessionStorage.getItem("CitizenConsentdocFilestoreidCHB");
|
|
47755
|
+
const DateOnly = new Date();
|
|
47756
|
+
const updatedAdditionalDetails = _extends({}, data === null || data === void 0 ? void 0 : data.applicationData, {
|
|
47757
|
+
TimeStamp: otpVerifiedTimestamp
|
|
47758
|
+
});
|
|
47759
|
+
const updatedData = {
|
|
47760
|
+
applicationNo: data === null || data === void 0 ? void 0 : data.applicationNo,
|
|
47761
|
+
tenantId: data === null || data === void 0 ? void 0 : data.tenantId,
|
|
47762
|
+
applicationData: _extends({}, updatedAdditionalDetails)
|
|
47763
|
+
};
|
|
47764
|
+
const selfdeclarationform = "\n <div style=\"font-family:'Times New Roman', Times, serif; color:#000; font-size:16px; line-height:1.18; margin-top:-100px; padding:0;\">\n\n <h2 style=\"text-align:center; font-size:20px; margin:0 0 6px 0; font-weight:700; text-transform:uppercase;\">\n OWNER'S DECLARATION\n </h2>\n\n <div style=\"margin-top:-52px;\">\n <p style=\"margin-bottom:-32px;\"><strong>To,</strong></p>\n <p style=\"margin-bottom:-32px;\"><strong>Local Urban Bodies</strong></p>\n </div>\n\n <p style=\"margin-top:-20px;\"><strong>Dear Sir/Madam,</strong></p>\n\n <p style=\"margin-top:-52px;margin-bottom:-32px; text-align:justify;\">\n I/We further declare that I am/We are aware of all the actions taken have been authorized by me/us.\n </p>\n\n <ol style=\"margin-top:-52px;margin-bottom:-32px; padding:0;\">\n <li style=\"margin-top:-5px;margin-bottom:-25px;\">1. That I am/We are sole owner(s) of the site.</li>\n <li style=\"margin-top:-5px;margin-bottom:-25px;\">2. That there is no dispute regarding the site and if any dispute arises, then I/We shall be solely responsible for the same.</li>\n <li style=\"margin-top:-5px;margin-bottom:-25px;\">3. That construction of the building will be undertaken as per the approved building plans and structural design given by the Structural Engineer.</li>\n <li style=\"margin-top:-5px;margin-bottom:-25px;\">4. That above stated facts are true and the requisite documents have been uploaded with this building plan and nothing has been concealed thereof.</li>\n </ol>\n\n <!-- Signature / details table -->\n <table style=\"width:100%; border-collapse:collapse; margin-top:6px; font-size:14px;\">\n <tr>\n <td style=\"width:48%; vertical-align:top; padding:6px; border:1px dotted #000;\">\n <div style=\"font-weight:700; margin-bottom:4px;\">Date:</div>\n <div style=\"min-height:60px;\">" + (DateOnly || "<Date of Sign>") + "</div>\n </td>\n\n <td style=\"width:52%; vertical-align:top; border:1px dotted #000;\">\n <table style=\"width:100%; border-collapse:collapse;\">\n <tr>\n <td style=\"padding:6px; border-bottom:1px dotted #000; width:40%; font-weight:700;\">Name of Owner:</td>\n <td style=\"padding:6px; border-bottom:1px dotted #000;\">" + ownername + "</td>\n </tr>\n <tr>\n <td style=\"padding:6px; border-bottom:1px dotted #000; font-weight:700;\">e-Mail:</td>\n <td style=\"padding:6px; border-bottom:1px dotted #000;\">" + ownerEmail + "</td>\n </tr>\n <tr>\n <td style=\"padding:6px; border-bottom:1px dotted #000; font-weight:700;\">Mobile:</td>\n <td style=\"padding:6px; border-bottom:1px dotted #000;\">" + ownermobileNumber + "</td>\n </tr>\n <tr>\n <td style=\"padding:6px; font-weight:700;\">Signature:</td>\n <td style=\"padding:6px;\">Verified through OTP</b></td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </div>\n";
|
|
47765
|
+
const closeModal = () => {
|
|
47766
|
+
setShowTermsPopupOwner(false);
|
|
47767
|
+
};
|
|
47768
|
+
const uploadSelfDeclaration = function () {
|
|
47769
|
+
try {
|
|
47770
|
+
setLoader(true);
|
|
47771
|
+
const Chb = [_extends({}, getModalData, {
|
|
47772
|
+
applicationNo: "CHB-0001",
|
|
47773
|
+
tenantId: tenantId
|
|
47774
|
+
})];
|
|
47775
|
+
const _temp = _finallyRethrows(function () {
|
|
47776
|
+
return _catch(function () {
|
|
47777
|
+
setIsUploading(true);
|
|
47778
|
+
return Promise.resolve(Digit.PaymentService.generatePdf(Digit.ULBService.getStateId(), {
|
|
47779
|
+
Chb: Chb
|
|
47780
|
+
}, "communityhallowner")).then(function (result) {
|
|
47781
|
+
var _result$filestoreIds$;
|
|
47782
|
+
console.log(result, "RESULT");
|
|
47783
|
+
setLoader(false);
|
|
47784
|
+
if ((result === null || result === void 0 ? void 0 : (_result$filestoreIds$ = result.filestoreIds[0]) === null || _result$filestoreIds$ === void 0 ? void 0 : _result$filestoreIds$.length) > 0) {
|
|
47785
|
+
alert("File Uploaded Successfully");
|
|
47786
|
+
sessionStorage.setItem("CitizenConsentdocFilestoreidCHB", result === null || result === void 0 ? void 0 : result.filestoreIds[0]);
|
|
47787
|
+
setIsFileUploaded(true);
|
|
47788
|
+
} else {
|
|
47789
|
+
alert("File Upload Failed");
|
|
47790
|
+
}
|
|
47791
|
+
});
|
|
47792
|
+
}, function (error) {
|
|
47793
|
+
alert("Error Uploading PDF:", error);
|
|
47794
|
+
setLoader(false);
|
|
47795
|
+
});
|
|
47796
|
+
}, function (_wasThrown, _result) {
|
|
47797
|
+
setLoader(false);
|
|
47798
|
+
setIsUploading(false);
|
|
47799
|
+
if (_wasThrown) throw _result;
|
|
47800
|
+
return _result;
|
|
47801
|
+
});
|
|
47802
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
47803
|
+
} catch (e) {
|
|
47804
|
+
return Promise.reject(e);
|
|
47784
47805
|
}
|
|
47785
|
-
}
|
|
47786
|
-
|
|
47806
|
+
};
|
|
47807
|
+
const modalStyles = {
|
|
47808
|
+
modal: {
|
|
47809
|
+
width: "100%",
|
|
47810
|
+
height: "100%",
|
|
47811
|
+
top: "0",
|
|
47812
|
+
position: "relative",
|
|
47813
|
+
backgroundColor: "rgba(0, 0, 0, 0.7)",
|
|
47814
|
+
display: "flex",
|
|
47815
|
+
justifyContent: "center",
|
|
47816
|
+
alignItems: "center"
|
|
47817
|
+
},
|
|
47818
|
+
modalOverlay: {
|
|
47819
|
+
position: "fixed",
|
|
47820
|
+
top: "0",
|
|
47821
|
+
left: "0",
|
|
47822
|
+
width: "100%",
|
|
47823
|
+
height: "100%",
|
|
47824
|
+
backgroundColor: "rgba(0, 0, 0, 0.7)"
|
|
47825
|
+
},
|
|
47826
|
+
modalContent: {
|
|
47827
|
+
backgroundColor: "#FFFFFF",
|
|
47828
|
+
padding: "2rem",
|
|
47829
|
+
borderRadius: "0.5rem",
|
|
47830
|
+
maxWidth: "800px",
|
|
47831
|
+
margin: "auto",
|
|
47832
|
+
fontFamily: "Roboto, serif",
|
|
47833
|
+
overflowX: "hidden",
|
|
47834
|
+
textAlign: "justify",
|
|
47835
|
+
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.2)",
|
|
47836
|
+
maxHeight: "80vh",
|
|
47837
|
+
overflowY: "auto",
|
|
47838
|
+
lineHeight: "2"
|
|
47839
|
+
},
|
|
47840
|
+
heading: {
|
|
47841
|
+
textAlign: "center",
|
|
47842
|
+
fontWeight: "bold",
|
|
47843
|
+
marginBottom: "10px"
|
|
47844
|
+
},
|
|
47845
|
+
subheading: {
|
|
47846
|
+
textAlign: "center",
|
|
47847
|
+
fontWeight: "bold",
|
|
47787
47848
|
marginBottom: "20px"
|
|
47788
|
-
}
|
|
47789
|
-
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
|
|
47790
|
-
className: "card-label-smaller"
|
|
47791
|
-
}, t("CHB_PURPOSE_DESCRIPTION"), " ", /*#__PURE__*/React__default.createElement("span", {
|
|
47792
|
-
style: {
|
|
47793
|
-
color: "red"
|
|
47794
|
-
}
|
|
47795
|
-
}, "*")), /*#__PURE__*/React__default.createElement("div", {
|
|
47796
|
-
className: "field",
|
|
47797
|
-
style: {
|
|
47798
|
-
width: "50%"
|
|
47799
|
-
}
|
|
47800
|
-
}, /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
47801
|
-
control: control,
|
|
47802
|
-
name: "purposeDescription",
|
|
47803
|
-
defaultValue: "",
|
|
47804
|
-
rules: {
|
|
47805
|
-
required: t("CHB_PURPOSE_DESCRIPTION_REQUIRED"),
|
|
47806
|
-
minLength: {
|
|
47807
|
-
value: 5,
|
|
47808
|
-
message: t("CHB_PURPOSE_DESCRIPTION_REQUIRED_MIN")
|
|
47809
|
-
}
|
|
47810
47849
|
},
|
|
47811
|
-
|
|
47812
|
-
|
|
47813
|
-
|
|
47814
|
-
|
|
47815
|
-
|
|
47816
|
-
|
|
47817
|
-
value: props.value,
|
|
47818
|
-
onChange: e => {
|
|
47819
|
-
props.onChange(e.target.value);
|
|
47820
|
-
},
|
|
47821
|
-
onBlur: e => {
|
|
47822
|
-
props.onBlur(e);
|
|
47823
|
-
}
|
|
47824
|
-
})
|
|
47825
|
-
}), errors.purposeDescription && /*#__PURE__*/React__default.createElement("p", {
|
|
47826
|
-
style: {
|
|
47827
|
-
color: "red"
|
|
47828
|
-
}
|
|
47829
|
-
}, errors.purposeDescription.message))), !isCitizen && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
47830
|
-
style: {
|
|
47831
|
-
marginBottom: "20px",
|
|
47832
|
-
width: "50%"
|
|
47833
|
-
}
|
|
47834
|
-
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("CHB_DISCOUNT_AMOUNT")), /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
47835
|
-
control: control,
|
|
47836
|
-
name: "discountAmount",
|
|
47837
|
-
render: props => {
|
|
47838
|
-
var _errors$name;
|
|
47839
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
|
|
47840
|
-
type: "number",
|
|
47841
|
-
style: {
|
|
47842
|
-
marginBottom: 0,
|
|
47843
|
-
width: "100%"
|
|
47844
|
-
},
|
|
47845
|
-
value: props.value,
|
|
47846
|
-
error: errors === null || errors === void 0 ? void 0 : (_errors$name = errors.name) === null || _errors$name === void 0 ? void 0 : _errors$name.message,
|
|
47847
|
-
onChange: e => {
|
|
47848
|
-
props.onChange(e.target.value);
|
|
47849
|
-
},
|
|
47850
|
-
onBlur: e => {
|
|
47851
|
-
props.onBlur(e);
|
|
47852
|
-
},
|
|
47853
|
-
t: t
|
|
47854
|
-
});
|
|
47850
|
+
rightAlignedText: {
|
|
47851
|
+
textAlign: "right",
|
|
47852
|
+
whiteSpace: "pre-wrap",
|
|
47853
|
+
wordWrap: "break-word",
|
|
47854
|
+
fontFamily: "Roboto, serif",
|
|
47855
|
+
lineHeight: "2"
|
|
47855
47856
|
}
|
|
47856
|
-
}
|
|
47857
|
+
};
|
|
47858
|
+
return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(Modal, {
|
|
47859
|
+
isOpen: showTermsPopupOwner,
|
|
47860
|
+
onRequestClose: closeModal,
|
|
47861
|
+
contentLabel: "Self-Declaration",
|
|
47857
47862
|
style: {
|
|
47858
|
-
|
|
47863
|
+
modal: modalStyles.modal,
|
|
47864
|
+
overlay: modalStyles.modalOverlay,
|
|
47865
|
+
content: modalStyles.modalContent
|
|
47859
47866
|
}
|
|
47860
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
47867
|
+
}, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
47861
47868
|
style: {
|
|
47862
|
-
|
|
47869
|
+
whiteSpace: "pre-wrap",
|
|
47870
|
+
wordWrap: "break-word",
|
|
47871
|
+
textAlign: "justify",
|
|
47872
|
+
fontFamily: "Roboto, serif"
|
|
47863
47873
|
}
|
|
47864
|
-
},
|
|
47865
|
-
|
|
47866
|
-
|
|
47867
|
-
defaultValue: null,
|
|
47868
|
-
render: props => {
|
|
47869
|
-
var _CHBReason$CHB2;
|
|
47870
|
-
return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
|
|
47871
|
-
style: {
|
|
47872
|
-
marginBottom: 0
|
|
47873
|
-
},
|
|
47874
|
-
className: "form-field",
|
|
47875
|
-
select: props.onChange,
|
|
47876
|
-
selected: props.value,
|
|
47877
|
-
option: CHBReason === null || CHBReason === void 0 ? void 0 : (_CHBReason$CHB2 = CHBReason.CHB) === null || _CHBReason$CHB2 === void 0 ? void 0 : _CHBReason$CHB2.DiscountReason,
|
|
47878
|
-
optionKey: "reasonName"
|
|
47879
|
-
});
|
|
47874
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
47875
|
+
dangerouslySetInnerHTML: {
|
|
47876
|
+
__html: selfdeclarationform
|
|
47880
47877
|
}
|
|
47881
|
-
}))
|
|
47878
|
+
})), /*#__PURE__*/React__default.createElement("div", {
|
|
47882
47879
|
style: {
|
|
47883
47880
|
display: "flex",
|
|
47884
|
-
|
|
47885
|
-
gap: "10px",
|
|
47886
|
-
cursor: "pointer"
|
|
47887
|
-
}
|
|
47888
|
-
}, /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
47889
|
-
control: control,
|
|
47890
|
-
name: "termsAccepted",
|
|
47891
|
-
rules: {
|
|
47892
|
-
required: t("PLEASE_ACCEPT_TERMS_CONDITIONS")
|
|
47893
|
-
},
|
|
47894
|
-
render: props => /*#__PURE__*/React__default.createElement("input", {
|
|
47895
|
-
id: "termsAccepted",
|
|
47896
|
-
type: "checkbox",
|
|
47897
|
-
checked: props.value || false,
|
|
47898
|
-
onChange: e => {
|
|
47899
|
-
props.onChange(e.target.checked);
|
|
47900
|
-
console.log("cal", e.target.checked);
|
|
47901
|
-
if (e.target.checked) setShowTermsPopup(true);
|
|
47902
|
-
},
|
|
47903
|
-
style: {
|
|
47904
|
-
width: "18px",
|
|
47905
|
-
height: "18px",
|
|
47906
|
-
cursor: "pointer"
|
|
47907
|
-
}
|
|
47908
|
-
})
|
|
47909
|
-
}), /*#__PURE__*/React__default.createElement("label", {
|
|
47910
|
-
htmlFor: "termsAccepted",
|
|
47911
|
-
style: {
|
|
47912
|
-
cursor: "pointer",
|
|
47913
|
-
color: "#007bff",
|
|
47914
|
-
textDecoration: "underline",
|
|
47915
|
-
margin: 0
|
|
47881
|
+
justifyContent: "flex-end"
|
|
47916
47882
|
}
|
|
47917
|
-
},
|
|
47883
|
+
}, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
|
|
47884
|
+
label: t("BPA_CLOSE"),
|
|
47885
|
+
onSubmit: closeModal
|
|
47886
|
+
})), /*#__PURE__*/React__default.createElement("br", null), !isCitizenDeclared && /*#__PURE__*/React__default.createElement("div", {
|
|
47918
47887
|
style: {
|
|
47919
|
-
|
|
47888
|
+
display: "flex",
|
|
47889
|
+
justifyContent: "flex-end"
|
|
47920
47890
|
}
|
|
47921
|
-
},
|
|
47922
|
-
label: "
|
|
47923
|
-
|
|
47924
|
-
|
|
47925
|
-
|
|
47926
|
-
setShowTermsPopupOwner: setShowTermsPopup,
|
|
47927
|
-
tenantId: tenantId
|
|
47928
|
-
}), (CHBReasonLoading || CHBLocationLoading || CHBLoading || CHBPurposeLoading || CHBSpecialCategoryLoading || CHBHallCodeLoading || loader) && /*#__PURE__*/React__default.createElement(Loader, {
|
|
47891
|
+
}, /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
|
|
47892
|
+
label: t("BPA_UPLOAD"),
|
|
47893
|
+
onSubmit: uploadSelfDeclaration,
|
|
47894
|
+
disabled: isUploading || isFileUploaded
|
|
47895
|
+
})))), loader && /*#__PURE__*/React__default.createElement(Loader, {
|
|
47929
47896
|
page: true
|
|
47930
47897
|
}));
|
|
47931
47898
|
};
|
|
47932
47899
|
|
|
47933
|
-
const NewADSStepFormOne = _ref => {
|
|
47934
|
-
let {
|
|
47935
|
-
config,
|
|
47936
|
-
onGoNext,
|
|
47937
|
-
onBackClick
|
|
47938
|
-
} = _ref;
|
|
47939
|
-
const dispatch = reactRedux.useDispatch();
|
|
47940
|
-
const {
|
|
47941
|
-
t
|
|
47942
|
-
} = reactI18next.useTranslation();
|
|
47943
|
-
const [showToast, setShowToast] = React.useState(false);
|
|
47944
|
-
const [error, setError] = React.useState("");
|
|
47945
|
-
const currentStepData = reactRedux.useSelector(function (state) {
|
|
47946
|
-
return state.chb.CHBApplicationFormReducer.formData;
|
|
47947
|
-
});
|
|
47948
|
-
function goNext(data) {
|
|
47949
|
-
console.log("data aa rea", data);
|
|
47950
|
-
dispatch(UPDATE_CHBApplication_FORM(config.key, data));
|
|
47951
|
-
onGoNext();
|
|
47952
|
-
}
|
|
47953
|
-
function onGoBack(data) {
|
|
47954
|
-
onBackClick(config.key, data);
|
|
47955
|
-
}
|
|
47956
|
-
const closeToast = () => {
|
|
47957
|
-
setShowToast(false);
|
|
47958
|
-
setError("");
|
|
47959
|
-
};
|
|
47960
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(CHBCitizenSecond, {
|
|
47961
|
-
onGoBack: onGoBack,
|
|
47962
|
-
goNext: goNext,
|
|
47963
|
-
currentStepData: currentStepData,
|
|
47964
|
-
t: t
|
|
47965
|
-
}), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
|
|
47966
|
-
isDleteBtn: true,
|
|
47967
|
-
error: true,
|
|
47968
|
-
label: error,
|
|
47969
|
-
onClose: closeToast
|
|
47970
|
-
}));
|
|
47971
|
-
};
|
|
47972
|
-
|
|
47973
47900
|
const CHBCitizenDetailsNew = _ref => {
|
|
47974
47901
|
var _user$info, _user$info2, _user$info3;
|
|
47975
47902
|
let {
|
|
@@ -47983,13 +47910,16 @@ const CHBCitizenDetailsNew = _ref => {
|
|
|
47983
47910
|
const stateId = Digit.ULBService.getStateId();
|
|
47984
47911
|
const user = Digit.UserService.getUser();
|
|
47985
47912
|
const [loader, setLoader] = React.useState(false);
|
|
47913
|
+
const [showTermsPopup, setShowTermsPopup] = React.useState(false);
|
|
47914
|
+
const [getModalData, setModalData] = React.useState();
|
|
47986
47915
|
const {
|
|
47987
47916
|
control,
|
|
47988
47917
|
handleSubmit,
|
|
47989
47918
|
setValue,
|
|
47990
47919
|
formState: {
|
|
47991
47920
|
errors
|
|
47992
|
-
}
|
|
47921
|
+
},
|
|
47922
|
+
getValues
|
|
47993
47923
|
} = reactHookForm.useForm({
|
|
47994
47924
|
defaultValues: {
|
|
47995
47925
|
name: isCitizen && (user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.name) || "",
|
|
@@ -48000,13 +47930,17 @@ const CHBCitizenDetailsNew = _ref => {
|
|
|
48000
47930
|
});
|
|
48001
47931
|
const onSubmit = function (data) {
|
|
48002
47932
|
try {
|
|
48003
|
-
|
|
48004
|
-
|
|
47933
|
+
const isCitizenDeclared = sessionStorage.getItem("CitizenConsentdocFilestoreidCHB");
|
|
47934
|
+
return Promise.resolve(function (_currentStepData$venu, _currentStepData$venu2) {
|
|
48005
47935
|
if (currentStepData !== null && currentStepData !== void 0 && (_currentStepData$venu = currentStepData.venueDetails) !== null && _currentStepData$venu !== void 0 && (_currentStepData$venu2 = _currentStepData$venu[0]) !== null && _currentStepData$venu2 !== void 0 && _currentStepData$venu2.bookingNo) {
|
|
48006
47936
|
goNext(currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.venueDetails);
|
|
48007
47937
|
} else {
|
|
48008
47938
|
var _currentStepData$owne, _user$info4;
|
|
48009
47939
|
const baseApplication = (currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$owne = currentStepData.ownerDetails) === null || _currentStepData$owne === void 0 ? void 0 : _currentStepData$owne.hallsBookingApplication) || {};
|
|
47940
|
+
if (!isCitizenDeclared) {
|
|
47941
|
+
alert("Please upload Self Certificate");
|
|
47942
|
+
return;
|
|
47943
|
+
}
|
|
48010
47944
|
const applicantDetail = {
|
|
48011
47945
|
tenantId: tenantId,
|
|
48012
47946
|
applicantName: data === null || data === void 0 ? void 0 : data.name,
|
|
@@ -48014,6 +47948,9 @@ const CHBCitizenDetailsNew = _ref => {
|
|
|
48014
47948
|
applicantEmailId: data === null || data === void 0 ? void 0 : data.emailId,
|
|
48015
47949
|
type: user === null || user === void 0 ? void 0 : (_user$info4 = user.info) === null || _user$info4 === void 0 ? void 0 : _user$info4.type
|
|
48016
47950
|
};
|
|
47951
|
+
const additionalDetails = _extends({}, baseApplication === null || baseApplication === void 0 ? void 0 : baseApplication.additionalDetails, {
|
|
47952
|
+
disImage: isCitizenDeclared
|
|
47953
|
+
});
|
|
48017
47954
|
const owners = [{
|
|
48018
47955
|
name: data === null || data === void 0 ? void 0 : data.name,
|
|
48019
47956
|
mobileNumber: data === null || data === void 0 ? void 0 : data.mobileNumber,
|
|
@@ -48027,9 +47964,12 @@ const CHBCitizenDetailsNew = _ref => {
|
|
|
48027
47964
|
hallsBookingApplication: _extends({}, baseApplication, {
|
|
48028
47965
|
applicantDetail,
|
|
48029
47966
|
address,
|
|
48030
|
-
owners
|
|
47967
|
+
owners,
|
|
47968
|
+
additionalDetails
|
|
48031
47969
|
})
|
|
48032
47970
|
};
|
|
47971
|
+
console.log("checkpayload", payload);
|
|
47972
|
+
setLoader(true);
|
|
48033
47973
|
const _temp = _catch(function () {
|
|
48034
47974
|
return Promise.resolve(Digit.CHBServices.create(payload)).then(function (response) {
|
|
48035
47975
|
setLoader(false);
|
|
@@ -48040,8 +47980,7 @@ const CHBCitizenDetailsNew = _ref => {
|
|
|
48040
47980
|
});
|
|
48041
47981
|
if (_temp && _temp.then) return _temp.then(function () {});
|
|
48042
47982
|
}
|
|
48043
|
-
}();
|
|
48044
|
-
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
47983
|
+
}());
|
|
48045
47984
|
} catch (e) {
|
|
48046
47985
|
return Promise.reject(e);
|
|
48047
47986
|
}
|
|
@@ -48057,6 +47996,29 @@ const CHBCitizenDetailsNew = _ref => {
|
|
|
48057
47996
|
setValue("name", formattedData === null || formattedData === void 0 ? void 0 : (_formattedData$applic3 = formattedData.applicantDetail) === null || _formattedData$applic3 === void 0 ? void 0 : _formattedData$applic3.applicantName);
|
|
48058
47997
|
}
|
|
48059
47998
|
}, [currentStepData, setValue]);
|
|
47999
|
+
const handleModalData = e => {
|
|
48000
|
+
var _currentStepData$owne2, _getValues, _getValues2, _getValues3, _getValues4, _mapData$purpose, _mapData$bookingSlotD, _mapData$bookingSlotD2, _mapData$bookingSlotD3, _mapData$bookingSlotD4, _mapData$bookingSlotD5;
|
|
48001
|
+
console.log("currentStepData", currentStepData);
|
|
48002
|
+
console.log("getvalues", getValues());
|
|
48003
|
+
const mapData = currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$owne2 = currentStepData.ownerDetails) === null || _currentStepData$owne2 === void 0 ? void 0 : _currentStepData$owne2.hallsBookingApplication;
|
|
48004
|
+
const payload = {
|
|
48005
|
+
address: (_getValues = getValues()) === null || _getValues === void 0 ? void 0 : _getValues.address,
|
|
48006
|
+
emailId: (_getValues2 = getValues()) === null || _getValues2 === void 0 ? void 0 : _getValues2.emailId,
|
|
48007
|
+
mobileNumber: (_getValues3 = getValues()) === null || _getValues3 === void 0 ? void 0 : _getValues3.mobileNumber,
|
|
48008
|
+
name: (_getValues4 = getValues()) === null || _getValues4 === void 0 ? void 0 : _getValues4.name,
|
|
48009
|
+
communityHallName: mapData === null || mapData === void 0 ? void 0 : mapData.communityHallName,
|
|
48010
|
+
purpose: mapData === null || mapData === void 0 ? void 0 : (_mapData$purpose = mapData.purpose) === null || _mapData$purpose === void 0 ? void 0 : _mapData$purpose.purpose,
|
|
48011
|
+
days: mapData === null || mapData === void 0 ? void 0 : (_mapData$bookingSlotD = mapData.bookingSlotDetails) === null || _mapData$bookingSlotD === void 0 ? void 0 : _mapData$bookingSlotD.length,
|
|
48012
|
+
bookingDate: mapData === null || mapData === void 0 ? void 0 : (_mapData$bookingSlotD2 = mapData.bookingSlotDetails) === null || _mapData$bookingSlotD2 === void 0 ? void 0 : (_mapData$bookingSlotD3 = _mapData$bookingSlotD2[0]) === null || _mapData$bookingSlotD3 === void 0 ? void 0 : _mapData$bookingSlotD3.bookingDate,
|
|
48013
|
+
bookingEndDate: mapData === null || mapData === void 0 ? void 0 : (_mapData$bookingSlotD4 = mapData.bookingSlotDetails) === null || _mapData$bookingSlotD4 === void 0 ? void 0 : (_mapData$bookingSlotD5 = _mapData$bookingSlotD4.at(-1)) === null || _mapData$bookingSlotD5 === void 0 ? void 0 : _mapData$bookingSlotD5.bookingEndDate,
|
|
48014
|
+
ulbName: mapData === null || mapData === void 0 ? void 0 : mapData.tenantId,
|
|
48015
|
+
security: 5000,
|
|
48016
|
+
rent: mapData === null || mapData === void 0 ? void 0 : mapData.amount
|
|
48017
|
+
};
|
|
48018
|
+
console.log("payload", payload);
|
|
48019
|
+
setModalData(payload);
|
|
48020
|
+
if (e.target.checked) setShowTermsPopup(true);
|
|
48021
|
+
};
|
|
48060
48022
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("form", {
|
|
48061
48023
|
onSubmit: handleSubmit(onSubmit)
|
|
48062
48024
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -48204,7 +48166,46 @@ const CHBCitizenDetailsNew = _ref => {
|
|
|
48204
48166
|
style: {
|
|
48205
48167
|
color: "red"
|
|
48206
48168
|
}
|
|
48207
|
-
}, errors.address.message))
|
|
48169
|
+
}, errors.address.message)), /*#__PURE__*/React__default.createElement("div", {
|
|
48170
|
+
style: {
|
|
48171
|
+
display: "flex",
|
|
48172
|
+
alignItems: "center",
|
|
48173
|
+
gap: "10px",
|
|
48174
|
+
cursor: "pointer"
|
|
48175
|
+
}
|
|
48176
|
+
}, /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
|
|
48177
|
+
control: control,
|
|
48178
|
+
name: "termsAccepted",
|
|
48179
|
+
rules: {
|
|
48180
|
+
required: t("PLEASE_ACCEPT_TERMS_CONDITIONS")
|
|
48181
|
+
},
|
|
48182
|
+
render: props => /*#__PURE__*/React__default.createElement("input", {
|
|
48183
|
+
id: "termsAccepted",
|
|
48184
|
+
type: "checkbox",
|
|
48185
|
+
checked: props.value || false,
|
|
48186
|
+
onChange: e => {
|
|
48187
|
+
props.onChange(e.target.checked);
|
|
48188
|
+
handleModalData(e);
|
|
48189
|
+
},
|
|
48190
|
+
style: {
|
|
48191
|
+
width: "18px",
|
|
48192
|
+
height: "18px",
|
|
48193
|
+
cursor: "pointer"
|
|
48194
|
+
}
|
|
48195
|
+
})
|
|
48196
|
+
}), /*#__PURE__*/React__default.createElement("label", {
|
|
48197
|
+
htmlFor: "termsAccepted",
|
|
48198
|
+
style: {
|
|
48199
|
+
cursor: "pointer",
|
|
48200
|
+
color: "#007bff",
|
|
48201
|
+
textDecoration: "underline",
|
|
48202
|
+
margin: 0
|
|
48203
|
+
}
|
|
48204
|
+
}, t("CHB_SELF_LABEL"))), errors.termsAccepted && /*#__PURE__*/React__default.createElement("p", {
|
|
48205
|
+
style: {
|
|
48206
|
+
color: "red"
|
|
48207
|
+
}
|
|
48208
|
+
}, errors.termsAccepted.message)), /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
|
|
48208
48209
|
style: {
|
|
48209
48210
|
background: " white",
|
|
48210
48211
|
color: "black",
|
|
@@ -48216,7 +48217,12 @@ const CHBCitizenDetailsNew = _ref => {
|
|
|
48216
48217
|
}), /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
|
|
48217
48218
|
label: "Next",
|
|
48218
48219
|
submit: "submit"
|
|
48219
|
-
}))),
|
|
48220
|
+
}))), showTermsPopup && /*#__PURE__*/React__default.createElement(CitizenConsent, {
|
|
48221
|
+
showTermsPopupOwner: showTermsPopup,
|
|
48222
|
+
setShowTermsPopupOwner: setShowTermsPopup,
|
|
48223
|
+
getModalData: getModalData,
|
|
48224
|
+
tenantId: tenantId
|
|
48225
|
+
}), loader && /*#__PURE__*/React__default.createElement(Loader, {
|
|
48220
48226
|
page: true
|
|
48221
48227
|
}));
|
|
48222
48228
|
};
|