diy-template-components 0.2.32 → 0.2.33
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/build/index.es.js +183 -270
- package/build/index.es.js.map +1 -1
- package/build/index.js +183 -270
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
function ___$insertStyle(css) {
|
|
6
|
-
if (!css ||
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const style = document.createElement('style');
|
|
10
|
-
style.setAttribute('type', 'text/css');
|
|
11
|
-
style.innerHTML = css;
|
|
12
|
-
document.head.appendChild(style);
|
|
13
|
-
return css;
|
|
5
|
+
function ___$insertStyle(css) {
|
|
6
|
+
if (!css || typeof window === 'undefined') {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const style = document.createElement('style');
|
|
10
|
+
style.setAttribute('type', 'text/css');
|
|
11
|
+
style.innerHTML = css;
|
|
12
|
+
document.head.appendChild(style);
|
|
13
|
+
return css;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -33,20 +33,17 @@ var Countdown__default = /*#__PURE__*/_interopDefaultLegacy(Countdown);
|
|
|
33
33
|
var ReactDOMServer__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOMServer);
|
|
34
34
|
|
|
35
35
|
function _extends() {
|
|
36
|
-
_extends = Object.assign
|
|
36
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
37
37
|
for (var i = 1; i < arguments.length; i++) {
|
|
38
38
|
var source = arguments[i];
|
|
39
|
-
|
|
40
39
|
for (var key in source) {
|
|
41
40
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
42
41
|
target[key] = source[key];
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
|
-
|
|
47
45
|
return target;
|
|
48
46
|
};
|
|
49
|
-
|
|
50
47
|
return _extends.apply(this, arguments);
|
|
51
48
|
}
|
|
52
49
|
|
|
@@ -302,21 +299,17 @@ const alpha = {
|
|
|
302
299
|
seventyPercent: 0.7,
|
|
303
300
|
eightyPercent: 0.8
|
|
304
301
|
};
|
|
305
|
-
|
|
306
302
|
const getRGBFromHex = hex => {
|
|
307
303
|
const r = parseInt(hex.slice(1, 3), 16);
|
|
308
304
|
const g = parseInt(hex.slice(3, 5), 16);
|
|
309
305
|
const b = parseInt(hex.slice(5, 7), 16);
|
|
310
306
|
return [r, g, b];
|
|
311
307
|
};
|
|
312
|
-
|
|
313
308
|
const hexToRgbA = (hex, alpha = null) => {
|
|
314
309
|
const values = getRGBFromHex(hex);
|
|
315
|
-
|
|
316
310
|
if (alpha !== null) {
|
|
317
311
|
values.push(alpha);
|
|
318
312
|
}
|
|
319
|
-
|
|
320
313
|
return `rgba(${values.join(',')})`;
|
|
321
314
|
};
|
|
322
315
|
const colorMixer = (hex1, weightage = 1, hex2 = colors.white) => {
|
|
@@ -456,29 +449,24 @@ function useLinkBuilder(data) {
|
|
|
456
449
|
basePath,
|
|
457
450
|
isMasterTemplate
|
|
458
451
|
} = React.useContext(PageContext);
|
|
459
|
-
|
|
460
452
|
if (isEdit || !data.isLink) {
|
|
461
453
|
return null;
|
|
462
454
|
}
|
|
463
|
-
|
|
464
455
|
if (data?.isExistingLink === false) {
|
|
465
456
|
return data.link;
|
|
466
457
|
}
|
|
467
|
-
|
|
468
458
|
if (data?.isExternal) {
|
|
469
459
|
return data.link;
|
|
470
460
|
}
|
|
471
|
-
|
|
472
461
|
if (!isPreview) {
|
|
473
462
|
const link = data.link === '/' ? '' : '/' + data.link;
|
|
474
463
|
return basePath ? `//${basePath}${link}` : null;
|
|
475
|
-
}
|
|
476
|
-
|
|
464
|
+
}
|
|
477
465
|
|
|
466
|
+
// courses in preview: special case
|
|
478
467
|
if (data.link === 'courses') {
|
|
479
468
|
return `//${basePath}/courses`;
|
|
480
469
|
}
|
|
481
|
-
|
|
482
470
|
const {
|
|
483
471
|
pageId
|
|
484
472
|
} = navList.find(el => el.slug === data?.link) || {};
|
|
@@ -654,14 +642,12 @@ var calendar$1 = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2218%
|
|
|
654
642
|
var video = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2219%22%20viewBox%3D%220%200%2018%2019%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M15.8625%205.1275C15.555%204.9625%2014.91%204.79%2014.0325%205.405L12.93%206.185C12.8475%203.8525%2011.835%202.9375%209.375%202.9375H4.875C2.31%202.9375%201.3125%203.935%201.3125%206.5V12.5C1.3125%2014.225%202.25%2016.0625%204.875%2016.0625H9.375C11.835%2016.0625%2012.8475%2015.1475%2012.93%2012.815L14.0325%2013.595C14.4975%2013.925%2014.9025%2014.03%2015.225%2014.03C15.5025%2014.03%2015.72%2013.9475%2015.8625%2013.8725C16.17%2013.715%2016.6875%2013.2875%2016.6875%2012.215V6.785C16.6875%205.7125%2016.17%205.285%2015.8625%205.1275ZM8.25%209.035C7.4775%209.035%206.84%208.405%206.84%207.625C6.84%206.845%207.4775%206.215%208.25%206.215C9.0225%206.215%209.66%206.845%209.66%207.625C9.66%208.405%209.0225%209.035%208.25%209.035Z%22%20fill%3D%22%23589DF5%22%2F%3E%3C%2Fsvg%3E";
|
|
655
643
|
|
|
656
644
|
/** @returns {import('./types').IconData} */
|
|
657
|
-
|
|
658
645
|
const getConfiguredIcon1 = url => ({
|
|
659
646
|
url,
|
|
660
647
|
svgChildrenConfigs: []
|
|
661
648
|
});
|
|
662
|
-
/** @returns {import('./types').IconData} */
|
|
663
|
-
|
|
664
649
|
|
|
650
|
+
/** @returns {import('./types').IconData} */
|
|
665
651
|
const getConfiguredIcon2 = (url, stroke, fill) => ({
|
|
666
652
|
url,
|
|
667
653
|
svgChildrenConfigs: [{
|
|
@@ -670,7 +656,6 @@ const getConfiguredIcon2 = (url, stroke, fill) => ({
|
|
|
670
656
|
fill
|
|
671
657
|
}]
|
|
672
658
|
});
|
|
673
|
-
|
|
674
659
|
const icons = {
|
|
675
660
|
'Live class': getConfiguredIcon2(liveTv, false, true),
|
|
676
661
|
'Recorded videos': getConfiguredIcon2(liveTv2, false, true),
|
|
@@ -703,41 +688,51 @@ const icons = {
|
|
|
703
688
|
'Video Play': getConfiguredIcon2(videoPlay, false, true),
|
|
704
689
|
Quote: getConfiguredIcon2(quote, false, true),
|
|
705
690
|
// Stock
|
|
691
|
+
|
|
706
692
|
'Stock Growth': getConfiguredIcon2(stockGrowth, false, true),
|
|
707
693
|
Money: getConfiguredIcon2(money, false, true),
|
|
708
694
|
Split: getConfiguredIcon2(split, false, true),
|
|
709
695
|
Chart: getConfiguredIcon2(chart, false, true),
|
|
710
696
|
// Personality Development
|
|
697
|
+
|
|
711
698
|
Leaders: getConfiguredIcon2(leaders, false, true),
|
|
712
699
|
Women: getConfiguredIcon2(women, false, true),
|
|
713
700
|
Program: getConfiguredIcon2(program, false, true),
|
|
714
701
|
// Photography
|
|
702
|
+
|
|
715
703
|
'Video Editing': getConfiguredIcon2(videoEditing, false, true),
|
|
716
704
|
Editing: getConfiguredIcon2(editing, false, true),
|
|
717
705
|
Camera: getConfiguredIcon2(camera, false, true),
|
|
718
706
|
Sessions: getConfiguredIcon2(sessions, false, true),
|
|
719
707
|
// Computer
|
|
708
|
+
|
|
720
709
|
'Regular Batches': getConfiguredIcon2(regularBatches, false, true),
|
|
721
710
|
'Alternate Batches': getConfiguredIcon2(alternateBatches, false, true),
|
|
722
711
|
'Weekend Batches': getConfiguredIcon2(weekendBatches, false, true),
|
|
723
712
|
// Life Coach
|
|
713
|
+
|
|
724
714
|
Girl: getConfiguredIcon2(girl, false, true),
|
|
725
715
|
Smile: getConfiguredIcon2(smile, false, true),
|
|
726
716
|
Relationships: getConfiguredIcon2(relationships, false, true),
|
|
727
717
|
// Music
|
|
718
|
+
|
|
728
719
|
Vocal: getConfiguredIcon2(vocal, false, true),
|
|
729
720
|
Instrument: getConfiguredIcon2(instrument, false, true),
|
|
730
721
|
Music: getConfiguredIcon2(music, false, true),
|
|
731
722
|
// Fitness
|
|
723
|
+
|
|
732
724
|
Workout: getConfiguredIcon2(workout, false, true),
|
|
733
725
|
Barbell: getConfiguredIcon2(barbell, false, true),
|
|
734
726
|
Trainer: getConfiguredIcon2(trainer, false, true),
|
|
735
727
|
Report: getConfiguredIcon2(report, false, true),
|
|
736
728
|
// Govt Exam
|
|
729
|
+
|
|
737
730
|
'Govt Exam': getConfiguredIcon2(govtExam, false, true),
|
|
738
731
|
// IIT JEE
|
|
732
|
+
|
|
739
733
|
College: getConfiguredIcon2(college, false, true),
|
|
740
734
|
// Others
|
|
735
|
+
|
|
741
736
|
Teachers: getConfiguredIcon2(teachers, false, true),
|
|
742
737
|
Learning: getConfiguredIcon2(learning, false, true),
|
|
743
738
|
Success: getConfiguredIcon2(success, false, true),
|
|
@@ -749,12 +744,9 @@ const icons = {
|
|
|
749
744
|
Video: getConfiguredIcon2(video, false, true)
|
|
750
745
|
};
|
|
751
746
|
|
|
752
|
-
const someMethod1 = (
|
|
753
|
-
/** @type {import('./types').IconData["svgChildrenConfigs"]} */
|
|
754
|
-
svgChildrenConfigs, color, hoverColor) => {
|
|
747
|
+
const someMethod1 = ( /** @type {import('./types').IconData["svgChildrenConfigs"]} */svgChildrenConfigs, color, hoverColor) => {
|
|
755
748
|
/** @type {{ [k:string]:React.CSSProperties; }} */
|
|
756
749
|
const obj = {};
|
|
757
|
-
|
|
758
750
|
for (const svgChildConfig of svgChildrenConfigs) {
|
|
759
751
|
if (color) obj['& ' + svgChildConfig.selector] = {
|
|
760
752
|
fill: svgChildConfig.fill ? color : undefined,
|
|
@@ -765,10 +757,8 @@ svgChildrenConfigs, color, hoverColor) => {
|
|
|
765
757
|
stroke: svgChildConfig.stroke ? hoverColor : undefined
|
|
766
758
|
};
|
|
767
759
|
}
|
|
768
|
-
|
|
769
760
|
return obj;
|
|
770
761
|
};
|
|
771
|
-
|
|
772
762
|
const useStyles$1 = reactJss.createUseStyles({
|
|
773
763
|
'@keyframes slideRight': {
|
|
774
764
|
to: {
|
|
@@ -812,8 +802,8 @@ const defaultSvgState = {
|
|
|
812
802
|
childrenConfigs: [],
|
|
813
803
|
attributes: defaultAttributes
|
|
814
804
|
};
|
|
815
|
-
/** @type {import('./props.type').IconProps} */
|
|
816
805
|
|
|
806
|
+
/** @type {import('./props.type').IconProps} */
|
|
817
807
|
const iconDefaultProps = {
|
|
818
808
|
name: undefined,
|
|
819
809
|
width: 'auto',
|
|
@@ -823,8 +813,8 @@ const iconDefaultProps = {
|
|
|
823
813
|
opacity: undefined,
|
|
824
814
|
className: undefined
|
|
825
815
|
};
|
|
826
|
-
/** @type {import("react").FC<import('./props.type').IconProps>} */
|
|
827
816
|
|
|
817
|
+
/** @type {import("react").FC<import('./props.type').IconProps>} */
|
|
828
818
|
const Icon = ({
|
|
829
819
|
name,
|
|
830
820
|
width,
|
|
@@ -843,10 +833,8 @@ const Icon = ({
|
|
|
843
833
|
}, []);
|
|
844
834
|
/** */
|
|
845
835
|
|
|
846
|
-
const rootRef = React.useRef(
|
|
847
|
-
|
|
848
|
-
null); // this ref is used to cancel the fetch promise success callback in case name prop changed
|
|
849
|
-
|
|
836
|
+
const rootRef = React.useRef( /** @type {HTMLElement} */null);
|
|
837
|
+
// this ref is used to cancel the fetch promise success callback in case name prop changed
|
|
850
838
|
const currentName = React.useRef(name);
|
|
851
839
|
const [svgState, setSvgState] = React.useState(defaultSvgState);
|
|
852
840
|
const styles = useStyles$1({
|
|
@@ -857,46 +845,41 @@ const Icon = ({
|
|
|
857
845
|
opacity,
|
|
858
846
|
hoverColor
|
|
859
847
|
});
|
|
860
|
-
|
|
861
848
|
const _className = React.useMemo(() => `${styles.root} ${className || ''}`, [className]);
|
|
862
|
-
|
|
863
849
|
React.useEffect(() => {
|
|
864
850
|
// reset
|
|
865
851
|
currentName.current = name;
|
|
866
852
|
setSvgState(defaultSvgState);
|
|
867
853
|
const icon = icons[name];
|
|
868
|
-
|
|
869
854
|
if (icon) {
|
|
870
855
|
/**
|
|
871
856
|
* retrieve from cache
|
|
872
857
|
* @type {Promise<string>}
|
|
873
858
|
*/
|
|
874
859
|
let svgProm = Icon.getCachedSvgPromise(name);
|
|
875
|
-
|
|
876
860
|
if (!svgProm) {
|
|
877
861
|
svgProm = fetch(icon.url).then(r => r.text()).catch(() => {
|
|
878
862
|
// unset in cache
|
|
879
863
|
Icon.setCachedSvgPromise(name, undefined);
|
|
880
864
|
return null;
|
|
881
|
-
});
|
|
882
|
-
|
|
865
|
+
});
|
|
866
|
+
//save in cache
|
|
883
867
|
Icon.setCachedSvgPromise(name, svgProm);
|
|
884
868
|
}
|
|
885
|
-
|
|
886
869
|
svgProm.then(svg => {
|
|
887
870
|
if (svg && isMounted.current && name === currentName.current) {
|
|
888
871
|
const div = document.createElement('div');
|
|
889
|
-
div.innerHTML = svg;
|
|
872
|
+
div.innerHTML = svg;
|
|
890
873
|
|
|
874
|
+
// set the new attributes
|
|
891
875
|
const newAttributes = {};
|
|
892
|
-
|
|
893
876
|
for (const ob of div.firstElementChild.attributes) {
|
|
894
877
|
const camelCased = ob.name.replace(/(-|:)([a-z])/g, g => g[1].toUpperCase());
|
|
895
878
|
newAttributes[camelCased] = ob.value;
|
|
896
|
-
}
|
|
897
|
-
// Set state calls are called immediately inside asynchronous operations, timeouts, and intervals.
|
|
898
|
-
|
|
879
|
+
}
|
|
899
880
|
|
|
881
|
+
// setting the state in last.
|
|
882
|
+
// Set state calls are called immediately inside asynchronous operations, timeouts, and intervals.
|
|
900
883
|
setSvgState({
|
|
901
884
|
innerHtml: div.firstElementChild.innerHTML,
|
|
902
885
|
childrenConfigs: icon.svgChildrenConfigs,
|
|
@@ -916,14 +899,11 @@ const Icon = ({
|
|
|
916
899
|
onClick: onClick
|
|
917
900
|
}));
|
|
918
901
|
};
|
|
919
|
-
|
|
920
902
|
Icon.defaultProps = iconDefaultProps;
|
|
921
|
-
/** static properties for caching */
|
|
922
903
|
|
|
904
|
+
/** static properties for caching */
|
|
923
905
|
Icon.cacheStore = {};
|
|
924
|
-
|
|
925
906
|
Icon.getCachedSvgPromise = name => Icon.cacheStore[name];
|
|
926
|
-
|
|
927
907
|
Icon.setCachedSvgPromise = (name, prom) => Icon.cacheStore[name] = prom;
|
|
928
908
|
|
|
929
909
|
const useDropdownStyles = createUseStyles(theme => ({
|
|
@@ -1035,7 +1015,6 @@ function OptionList({
|
|
|
1035
1015
|
isLandingPages
|
|
1036
1016
|
}) {
|
|
1037
1017
|
React.useContext(PageContext);
|
|
1038
|
-
|
|
1039
1018
|
const tabsDataModifier = () => {
|
|
1040
1019
|
return optionsData?.map(dt => {
|
|
1041
1020
|
return {
|
|
@@ -1047,7 +1026,6 @@ function OptionList({
|
|
|
1047
1026
|
};
|
|
1048
1027
|
});
|
|
1049
1028
|
};
|
|
1050
|
-
|
|
1051
1029
|
const tabData = tabsDataModifier();
|
|
1052
1030
|
const classes = useSectionStyles$a();
|
|
1053
1031
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -1136,31 +1114,24 @@ function DesktopHeader({
|
|
|
1136
1114
|
const classes = useSectionStyles$a({
|
|
1137
1115
|
isFixed
|
|
1138
1116
|
});
|
|
1139
|
-
|
|
1140
1117
|
const optionDataFn = () => {
|
|
1141
1118
|
let optionsArr = navData;
|
|
1142
1119
|
let optionsData = [];
|
|
1143
|
-
|
|
1144
1120
|
if (optionsArr?.length > 5) {
|
|
1145
1121
|
optionsData = optionsArr?.slice(0, 4);
|
|
1146
1122
|
} else {
|
|
1147
1123
|
optionsData = optionsArr;
|
|
1148
1124
|
}
|
|
1149
|
-
|
|
1150
1125
|
return optionsData;
|
|
1151
1126
|
};
|
|
1152
|
-
|
|
1153
1127
|
const moreContentFn = () => {
|
|
1154
1128
|
let optionsArr = navData;
|
|
1155
1129
|
let moreContent = [];
|
|
1156
|
-
|
|
1157
1130
|
if (optionsArr?.length > 5) {
|
|
1158
1131
|
moreContent = optionsArr?.slice(4);
|
|
1159
1132
|
}
|
|
1160
|
-
|
|
1161
1133
|
return moreContent;
|
|
1162
1134
|
};
|
|
1163
|
-
|
|
1164
1135
|
return /*#__PURE__*/React__default["default"].createElement("nav", {
|
|
1165
1136
|
className: classes.section
|
|
1166
1137
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -1218,7 +1189,6 @@ function MobileHeader({
|
|
|
1218
1189
|
const navEl = React.useRef(null);
|
|
1219
1190
|
React.useLayoutEffect(() => {
|
|
1220
1191
|
const body = navEl?.current?.ownerDocument?.body;
|
|
1221
|
-
|
|
1222
1192
|
if (sideMenu) {
|
|
1223
1193
|
body?.setAttribute('style', 'overflow: hidden;');
|
|
1224
1194
|
} else {
|
|
@@ -1228,7 +1198,6 @@ function MobileHeader({
|
|
|
1228
1198
|
let iosUrl = null;
|
|
1229
1199
|
let androidUrl = null;
|
|
1230
1200
|
let downloadLink = null;
|
|
1231
|
-
|
|
1232
1201
|
if (isTutorWebsite) {
|
|
1233
1202
|
if (header?.iosUrl) {
|
|
1234
1203
|
iosUrl = /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
@@ -1251,7 +1220,6 @@ function MobileHeader({
|
|
|
1251
1220
|
}
|
|
1252
1221
|
});
|
|
1253
1222
|
}
|
|
1254
|
-
|
|
1255
1223
|
if (header?.androidURL) {
|
|
1256
1224
|
androidUrl = /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
1257
1225
|
data: {
|
|
@@ -1272,7 +1240,6 @@ function MobileHeader({
|
|
|
1272
1240
|
}
|
|
1273
1241
|
});
|
|
1274
1242
|
}
|
|
1275
|
-
|
|
1276
1243
|
if (iosUrl && androidUrl) {
|
|
1277
1244
|
downloadLink = /*#__PURE__*/React__default["default"].createElement("div", null, iosUrl, androidUrl);
|
|
1278
1245
|
} else if (header?.iosUrl) {
|
|
@@ -1322,7 +1289,6 @@ function MobileHeader({
|
|
|
1322
1289
|
downloadLink = null;
|
|
1323
1290
|
}
|
|
1324
1291
|
}
|
|
1325
|
-
|
|
1326
1292
|
return /*#__PURE__*/React__default["default"].createElement("nav", {
|
|
1327
1293
|
ref: navEl,
|
|
1328
1294
|
className: classes.section
|
|
@@ -1379,11 +1345,9 @@ function Header({
|
|
|
1379
1345
|
isMobile,
|
|
1380
1346
|
isTutorWebsite
|
|
1381
1347
|
} = React.useContext(PageContext);
|
|
1382
|
-
|
|
1383
1348
|
const filterHiddenNavs = () => {
|
|
1384
1349
|
return data?.navs?.filter(dt => !dt.isHiddenNav);
|
|
1385
1350
|
};
|
|
1386
|
-
|
|
1387
1351
|
return isMobile ? /*#__PURE__*/React__default["default"].createElement(MobileHeader, {
|
|
1388
1352
|
navData: filterHiddenNavs(),
|
|
1389
1353
|
header: data,
|
|
@@ -1739,7 +1703,6 @@ const rustTheme = {
|
|
|
1739
1703
|
light: colors.lightRust,
|
|
1740
1704
|
lightest: colors.lightestRust
|
|
1741
1705
|
};
|
|
1742
|
-
|
|
1743
1706
|
const generateThemePalette = themeColors => ({
|
|
1744
1707
|
primary: themeColors,
|
|
1745
1708
|
background: {
|
|
@@ -1762,7 +1725,6 @@ const generateThemePalette = themeColors => ({
|
|
|
1762
1725
|
tertiary: colors.blueGrey
|
|
1763
1726
|
}
|
|
1764
1727
|
});
|
|
1765
|
-
|
|
1766
1728
|
const bluePalette = generateThemePalette(blueTheme);
|
|
1767
1729
|
const redPalette = generateThemePalette(redTheme);
|
|
1768
1730
|
const orangePalette = generateThemePalette(orangeTheme);
|
|
@@ -1803,9 +1765,7 @@ const fontComponents = {
|
|
|
1803
1765
|
'Merriweather Sans': MerriweatherSans,
|
|
1804
1766
|
'Arima Madurai': ArimaMadurai
|
|
1805
1767
|
};
|
|
1806
|
-
|
|
1807
1768
|
const getFontComponent = font => fontComponents[font] || (() => null);
|
|
1808
|
-
|
|
1809
1769
|
function FontSeeder({
|
|
1810
1770
|
fontFamily
|
|
1811
1771
|
}) {
|
|
@@ -1815,37 +1775,30 @@ function FontSeeder({
|
|
|
1815
1775
|
const useRubikFont = reactJss.createUseStyles({
|
|
1816
1776
|
'@import': `url('https://fonts.googleapis.com/css2?family=Lato&family=Rubik:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap')`
|
|
1817
1777
|
});
|
|
1818
|
-
|
|
1819
1778
|
function Rubik() {
|
|
1820
1779
|
// to import "Rubik" font css
|
|
1821
1780
|
useRubikFont();
|
|
1822
1781
|
return null;
|
|
1823
1782
|
}
|
|
1824
|
-
|
|
1825
1783
|
const useIbmPlexSansFont = reactJss.createUseStyles({
|
|
1826
1784
|
'@import': 'url(https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap)'
|
|
1827
1785
|
});
|
|
1828
|
-
|
|
1829
1786
|
function IbmPlexSans() {
|
|
1830
1787
|
// to import "Ibm Plex Sans" font css
|
|
1831
1788
|
useIbmPlexSansFont();
|
|
1832
1789
|
return null;
|
|
1833
1790
|
}
|
|
1834
|
-
|
|
1835
1791
|
const useMerriweatherSansFont = reactJss.createUseStyles({
|
|
1836
1792
|
'@import': 'url(https://fonts.googleapis.com/css2?family=Merriweather+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap)'
|
|
1837
1793
|
});
|
|
1838
|
-
|
|
1839
1794
|
function MerriweatherSans() {
|
|
1840
1795
|
// to import "Merriweather Sans" font css
|
|
1841
1796
|
useMerriweatherSansFont();
|
|
1842
1797
|
return null;
|
|
1843
1798
|
}
|
|
1844
|
-
|
|
1845
1799
|
const useArimaMaduraiFont = reactJss.createUseStyles({
|
|
1846
1800
|
'@import': 'url(https://fonts.googleapis.com/css2?family=Arima+Madurai:wght@400;500;700&display=swap)'
|
|
1847
1801
|
});
|
|
1848
|
-
|
|
1849
1802
|
function ArimaMadurai() {
|
|
1850
1803
|
// to import "Arima Madurai" font css
|
|
1851
1804
|
useArimaMaduraiFont();
|
|
@@ -1876,9 +1829,7 @@ const TYPE_TO_COMPONENT_MAP$1 = {
|
|
|
1876
1829
|
TILES_SECTION: /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return index$1; })),
|
|
1877
1830
|
EMAIL_DRIP_MARKET: /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return index; }))
|
|
1878
1831
|
};
|
|
1879
|
-
|
|
1880
1832
|
const getCompToRender$1 = type => TYPE_TO_COMPONENT_MAP$1[type] || (() => null);
|
|
1881
|
-
|
|
1882
1833
|
const MemoisedSection$1 = /*#__PURE__*/React.memo(({
|
|
1883
1834
|
sectionData,
|
|
1884
1835
|
extraProps
|
|
@@ -1895,9 +1846,7 @@ function SectionRenderer$1({
|
|
|
1895
1846
|
extraProps
|
|
1896
1847
|
}) {
|
|
1897
1848
|
return /*#__PURE__*/React__default["default"].createElement(React.Suspense, {
|
|
1898
|
-
fallback: null
|
|
1899
|
-
/*GIF maybe*/
|
|
1900
|
-
|
|
1849
|
+
fallback: null /*GIF maybe*/
|
|
1901
1850
|
}, /*#__PURE__*/React__default["default"].createElement(MemoisedSection$1, {
|
|
1902
1851
|
sectionData: sectionData,
|
|
1903
1852
|
extraProps: extraProps
|
|
@@ -1969,8 +1918,8 @@ function PageRenderer$1({
|
|
|
1969
1918
|
isCustomWebsite,
|
|
1970
1919
|
_id
|
|
1971
1920
|
}), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id]);
|
|
1972
|
-
const Wrapper = SectionWrapper || React.Fragment;
|
|
1973
|
-
|
|
1921
|
+
const Wrapper = SectionWrapper || React.Fragment;
|
|
1922
|
+
// console.log("CONTEXT______", context)
|
|
1974
1923
|
return /*#__PURE__*/React__default["default"].createElement(ThemeProvider, {
|
|
1975
1924
|
theme: theme
|
|
1976
1925
|
}, /*#__PURE__*/React__default["default"].createElement(PageContext.Provider, {
|
|
@@ -2193,23 +2142,18 @@ const getArrowRotationAngle = props => {
|
|
|
2193
2142
|
switch (true) {
|
|
2194
2143
|
case props.left:
|
|
2195
2144
|
return 180;
|
|
2196
|
-
|
|
2197
2145
|
case props.up:
|
|
2198
2146
|
return 270;
|
|
2199
|
-
|
|
2200
2147
|
case props.down:
|
|
2201
2148
|
return 90;
|
|
2202
|
-
|
|
2203
2149
|
case props.right:
|
|
2204
2150
|
default:
|
|
2205
2151
|
return 0;
|
|
2206
2152
|
}
|
|
2207
2153
|
};
|
|
2208
|
-
|
|
2209
2154
|
const sizeHandler = ({
|
|
2210
2155
|
size
|
|
2211
2156
|
}) => size === 'small' ? '32px' : '48px';
|
|
2212
|
-
|
|
2213
2157
|
const useArrowButtonStyles = createUseStyles(theme => ({
|
|
2214
2158
|
arrowButtonContainer: {
|
|
2215
2159
|
cursor: 'pointer',
|
|
@@ -2249,7 +2193,6 @@ function dotsToShow(i, n) {
|
|
|
2249
2193
|
const leftToShow = i < elementsToShow / 2;
|
|
2250
2194
|
const rightToShow = n - i - 1 < elementsToShow / 2;
|
|
2251
2195
|
let leftCount, rightCount;
|
|
2252
|
-
|
|
2253
2196
|
if (leftToShow) {
|
|
2254
2197
|
leftCount = i;
|
|
2255
2198
|
rightCount = elementsToShow - i - 1;
|
|
@@ -2260,13 +2203,11 @@ function dotsToShow(i, n) {
|
|
|
2260
2203
|
leftCount = 2;
|
|
2261
2204
|
rightCount = 2;
|
|
2262
2205
|
}
|
|
2263
|
-
|
|
2264
2206
|
return {
|
|
2265
2207
|
leftCount,
|
|
2266
2208
|
rightCount
|
|
2267
2209
|
};
|
|
2268
2210
|
}
|
|
2269
|
-
|
|
2270
2211
|
function Carousel({
|
|
2271
2212
|
settings,
|
|
2272
2213
|
children,
|
|
@@ -2320,15 +2261,12 @@ function Carousel({
|
|
|
2320
2261
|
...settings,
|
|
2321
2262
|
className: settings?.className ? settings?.className + ' ' + classes.sliderClass : classes.sliderClass
|
|
2322
2263
|
};
|
|
2323
|
-
|
|
2324
2264
|
const nextClick = () => {
|
|
2325
2265
|
sliderRef.current.slickNext();
|
|
2326
2266
|
};
|
|
2327
|
-
|
|
2328
2267
|
const previousClick = () => {
|
|
2329
2268
|
sliderRef.current.slickPrev();
|
|
2330
2269
|
};
|
|
2331
|
-
|
|
2332
2270
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Slider__default["default"], _extends({
|
|
2333
2271
|
ref: sliderRef
|
|
2334
2272
|
}, sliderSettings), children), hideArrow || isMobile ? null : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -2348,34 +2286,39 @@ const NextImageRenderer = ({
|
|
|
2348
2286
|
src,
|
|
2349
2287
|
...props
|
|
2350
2288
|
}) => {
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2289
|
+
try {
|
|
2290
|
+
const {
|
|
2291
|
+
isCustomWebsite
|
|
2292
|
+
} = React.useContext(PageContext);
|
|
2293
|
+
let {
|
|
2294
|
+
refSetter,
|
|
2295
|
+
className
|
|
2296
|
+
} = props;
|
|
2297
|
+
if (isCustomWebsite) {
|
|
2298
|
+
return /*#__PURE__*/React__default["default"].createElement(require.resolve('next/image').default, {
|
|
2299
|
+
src: src,
|
|
2300
|
+
// height: "640",
|
|
2301
|
+
// width: "959",
|
|
2302
|
+
layout: 'fill',
|
|
2303
|
+
ref: {
|
|
2304
|
+
refSetter
|
|
2305
|
+
},
|
|
2306
|
+
className: {
|
|
2307
|
+
className
|
|
2308
|
+
},
|
|
2309
|
+
...props
|
|
2310
|
+
});
|
|
2311
|
+
} else {
|
|
2312
|
+
return /*#__PURE__*/React__default["default"].createElement("img", {
|
|
2313
|
+
ref: refSetter,
|
|
2314
|
+
className: className,
|
|
2315
|
+
src: src
|
|
2316
|
+
});
|
|
2317
|
+
}
|
|
2318
|
+
} catch (err) {
|
|
2319
|
+
return {
|
|
2320
|
+
notFound: true
|
|
2321
|
+
};
|
|
2379
2322
|
}
|
|
2380
2323
|
};
|
|
2381
2324
|
|
|
@@ -2430,7 +2373,6 @@ function Section$4({
|
|
|
2430
2373
|
src: nodeData.image.metadata.value
|
|
2431
2374
|
}))));
|
|
2432
2375
|
}
|
|
2433
|
-
|
|
2434
2376
|
function BannerCarouselRight({
|
|
2435
2377
|
sectionData
|
|
2436
2378
|
}) {
|
|
@@ -2456,9 +2398,7 @@ function BannerCarouselRight({
|
|
|
2456
2398
|
className: classes.sectionContainer
|
|
2457
2399
|
}, /*#__PURE__*/React__default["default"].createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React__default["default"].createElement(Section$4, {
|
|
2458
2400
|
nodeData: node,
|
|
2459
|
-
key: idx
|
|
2460
|
-
/* or some other unique property */
|
|
2461
|
-
|
|
2401
|
+
key: idx /* or some other unique property */
|
|
2462
2402
|
})))));
|
|
2463
2403
|
}
|
|
2464
2404
|
|
|
@@ -2665,11 +2605,9 @@ function List({
|
|
|
2665
2605
|
containerWidth
|
|
2666
2606
|
});
|
|
2667
2607
|
const [nodeData] = sectionData.components;
|
|
2668
|
-
|
|
2669
2608
|
const getNumber = val => {
|
|
2670
2609
|
return val.toString().length == 1 ? '0' + val : val;
|
|
2671
2610
|
};
|
|
2672
|
-
|
|
2673
2611
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
|
2674
2612
|
className: classes.section
|
|
2675
2613
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -2755,12 +2693,13 @@ const useSectionStyles$6 = createUseStyles(theme => ({
|
|
|
2755
2693
|
padding: '100px 0',
|
|
2756
2694
|
height: '100%',
|
|
2757
2695
|
display: 'flex',
|
|
2758
|
-
alignItems: 'center'
|
|
2696
|
+
alignItems: 'center'
|
|
2697
|
+
// backgroundImage: ({ imageUrl } = {}) =>
|
|
2759
2698
|
// `linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%), url("${imageUrl}")`,
|
|
2760
2699
|
// backgroundPosition: 'center',
|
|
2761
2700
|
// backgroundSize: 'cover'
|
|
2762
|
-
|
|
2763
2701
|
},
|
|
2702
|
+
|
|
2764
2703
|
centerBgImageContainer: {
|
|
2765
2704
|
width: '100%',
|
|
2766
2705
|
position: 'relative',
|
|
@@ -2890,7 +2829,6 @@ const Section$3 = ({
|
|
|
2890
2829
|
className: classes?.centerBgImage
|
|
2891
2830
|
}))));
|
|
2892
2831
|
};
|
|
2893
|
-
|
|
2894
2832
|
function BannerCarouselCenter({
|
|
2895
2833
|
sectionData,
|
|
2896
2834
|
isCustomWebsite
|
|
@@ -2910,9 +2848,7 @@ function BannerCarouselCenter({
|
|
|
2910
2848
|
}, /*#__PURE__*/React__default["default"].createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React__default["default"].createElement(Section$3, {
|
|
2911
2849
|
nodeData: node,
|
|
2912
2850
|
isCustomWebsite: isCustomWebsite,
|
|
2913
|
-
key: idx
|
|
2914
|
-
/* or some other unique property */
|
|
2915
|
-
|
|
2851
|
+
key: idx /* or some other unique property */
|
|
2916
2852
|
}))));
|
|
2917
2853
|
}
|
|
2918
2854
|
|
|
@@ -3082,7 +3018,6 @@ function Section$2({
|
|
|
3082
3018
|
size: isMobile ? 'small' : 'medium'
|
|
3083
3019
|
})));
|
|
3084
3020
|
}
|
|
3085
|
-
|
|
3086
3021
|
function BannerCarouselLeft({
|
|
3087
3022
|
sectionData,
|
|
3088
3023
|
isCustomWebsite
|
|
@@ -3106,9 +3041,7 @@ function BannerCarouselLeft({
|
|
|
3106
3041
|
className: classes.sectionContainer
|
|
3107
3042
|
}, /*#__PURE__*/React__default["default"].createElement(Wrapper, null, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React__default["default"].createElement(Section$2, {
|
|
3108
3043
|
nodeData: node,
|
|
3109
|
-
key: idx
|
|
3110
|
-
/* or some other unique property */
|
|
3111
|
-
|
|
3044
|
+
key: idx /* or some other unique property */
|
|
3112
3045
|
})))));
|
|
3113
3046
|
}
|
|
3114
3047
|
|
|
@@ -3263,7 +3196,6 @@ async function postApiCall(baseURLs, data) {
|
|
|
3263
3196
|
},
|
|
3264
3197
|
data
|
|
3265
3198
|
});
|
|
3266
|
-
|
|
3267
3199
|
if (res) {
|
|
3268
3200
|
return res.data;
|
|
3269
3201
|
}
|
|
@@ -3288,7 +3220,6 @@ async function postApiCallForm(baseURLs, data, extraProps) {
|
|
|
3288
3220
|
if (extraProps && extraProps.formSubmitSuccess) {
|
|
3289
3221
|
extraProps.formSubmitSuccess();
|
|
3290
3222
|
}
|
|
3291
|
-
|
|
3292
3223
|
return res.data;
|
|
3293
3224
|
});
|
|
3294
3225
|
} catch (err) {
|
|
@@ -3401,7 +3332,6 @@ function SubscribeToNewsletter({
|
|
|
3401
3332
|
const [inputVal, setInputVal] = React.useState(formInitialValue);
|
|
3402
3333
|
let [isValid, setIsValid] = React.useState(true);
|
|
3403
3334
|
let [btnDisabled, setBtnDisabled] = React.useState(false);
|
|
3404
|
-
|
|
3405
3335
|
const handleSubmit = () => {
|
|
3406
3336
|
let data = {
|
|
3407
3337
|
sectionId: sectionData.sectionId,
|
|
@@ -3417,11 +3347,9 @@ function SubscribeToNewsletter({
|
|
|
3417
3347
|
setBtnDisabled(true);
|
|
3418
3348
|
setInputVal(formInitialValue);
|
|
3419
3349
|
};
|
|
3420
|
-
|
|
3421
3350
|
const checkValidity = () => {
|
|
3422
3351
|
if (validations?.[nodeData?.inputField?.metadata?.validationType]?.length) {
|
|
3423
3352
|
let regex = new RegExp(validations[nodeData?.inputField?.metadata?.validationType]);
|
|
3424
|
-
|
|
3425
3353
|
if (regex?.test(inputVal)) {
|
|
3426
3354
|
setIsValid(true);
|
|
3427
3355
|
} else {
|
|
@@ -3429,7 +3357,6 @@ function SubscribeToNewsletter({
|
|
|
3429
3357
|
}
|
|
3430
3358
|
}
|
|
3431
3359
|
};
|
|
3432
|
-
|
|
3433
3360
|
React.useEffect(() => {
|
|
3434
3361
|
if (!isValid) {
|
|
3435
3362
|
setBtnDisabled(true);
|
|
@@ -3779,7 +3706,6 @@ function Section$1({
|
|
|
3779
3706
|
className: classes.contentRow
|
|
3780
3707
|
}, carouselContent))));
|
|
3781
3708
|
}
|
|
3782
|
-
|
|
3783
3709
|
function Testimonials({
|
|
3784
3710
|
sectionData
|
|
3785
3711
|
}) {
|
|
@@ -3844,7 +3770,6 @@ const loaderStyle = theme => ({
|
|
|
3844
3770
|
});
|
|
3845
3771
|
|
|
3846
3772
|
const useStyles = reactJss.createUseStyles(loaderStyle);
|
|
3847
|
-
|
|
3848
3773
|
function Loader({
|
|
3849
3774
|
texts
|
|
3850
3775
|
}) {
|
|
@@ -3856,13 +3781,11 @@ function Loader({
|
|
|
3856
3781
|
React.useEffect(() => {
|
|
3857
3782
|
if (texts && texts.length) {
|
|
3858
3783
|
let textID = '';
|
|
3859
|
-
|
|
3860
3784
|
for (let i = 0; i < texts.length; i++) {
|
|
3861
3785
|
textID = setTimeout(() => {
|
|
3862
3786
|
setLoaderText(texts[i]);
|
|
3863
3787
|
}, 2000 * i);
|
|
3864
3788
|
}
|
|
3865
|
-
|
|
3866
3789
|
return () => {
|
|
3867
3790
|
clearTimeout(textID);
|
|
3868
3791
|
};
|
|
@@ -3932,18 +3855,15 @@ function VideoPlayer(props) {
|
|
|
3932
3855
|
imageUrl: imageUrl
|
|
3933
3856
|
});
|
|
3934
3857
|
const theme = useTheme();
|
|
3935
|
-
|
|
3936
3858
|
function getId(url) {
|
|
3937
3859
|
var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
|
|
3938
3860
|
var match = url?.match(regExp);
|
|
3939
|
-
|
|
3940
3861
|
if (match?.[2].length == 11) {
|
|
3941
3862
|
return 'https://www.youtube.com/embed/' + match[2];
|
|
3942
3863
|
} else {
|
|
3943
3864
|
return url;
|
|
3944
3865
|
}
|
|
3945
3866
|
}
|
|
3946
|
-
|
|
3947
3867
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !isLoaded && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3948
3868
|
className: classes.imgContainer
|
|
3949
3869
|
}, /*#__PURE__*/React__default["default"].createElement(NextImageRenderer, {
|
|
@@ -4789,8 +4709,8 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
|
|
|
4789
4709
|
width: 'calc(100% - 2px)',
|
|
4790
4710
|
position: 'relative',
|
|
4791
4711
|
paddingBottom: '59.83%' // keeping aspect ratio 585x350
|
|
4792
|
-
|
|
4793
4712
|
},
|
|
4713
|
+
|
|
4794
4714
|
contentRow: {
|
|
4795
4715
|
display: 'grid',
|
|
4796
4716
|
gridTemplateColumns: ({
|
|
@@ -5048,7 +4968,6 @@ const FAQListing = ({
|
|
|
5048
4968
|
isSelected: selectedIndex === index
|
|
5049
4969
|
})))));
|
|
5050
4970
|
};
|
|
5051
|
-
|
|
5052
4971
|
const Accordion = ({
|
|
5053
4972
|
item,
|
|
5054
4973
|
isSelected,
|
|
@@ -5335,9 +5254,10 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5335
5254
|
flexGrow: 1,
|
|
5336
5255
|
display: 'flex',
|
|
5337
5256
|
flexDirection: 'column',
|
|
5338
|
-
justifyContent: 'space-between'
|
|
5339
|
-
|
|
5257
|
+
justifyContent: 'space-between'
|
|
5258
|
+
//alignItems: 'center',
|
|
5340
5259
|
},
|
|
5260
|
+
|
|
5341
5261
|
courseCardTags: {
|
|
5342
5262
|
display: 'flex',
|
|
5343
5263
|
justifyContent: 'flex-start',
|
|
@@ -5363,11 +5283,12 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5363
5283
|
wordBreak: 'break-word',
|
|
5364
5284
|
padding: '12px 0px',
|
|
5365
5285
|
textAlign: 'left',
|
|
5366
|
-
display: 'inline-block'
|
|
5286
|
+
display: 'inline-block'
|
|
5287
|
+
// overflow: 'hidden',
|
|
5367
5288
|
// whiteSpace: 'nowrap',
|
|
5368
5289
|
// textOverflow: 'ellipsis'
|
|
5369
|
-
|
|
5370
5290
|
},
|
|
5291
|
+
|
|
5371
5292
|
courseCardDiscount: {
|
|
5372
5293
|
display: 'flex',
|
|
5373
5294
|
justifyContent: 'flex-start',
|
|
@@ -5449,7 +5370,8 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5449
5370
|
}
|
|
5450
5371
|
},
|
|
5451
5372
|
'@media (max-width: 768px)': {
|
|
5452
|
-
coursesContainer: {
|
|
5373
|
+
coursesContainer: {
|
|
5374
|
+
//background: theme?.palette?.background?.primary
|
|
5453
5375
|
},
|
|
5454
5376
|
coursesCardAndText: {
|
|
5455
5377
|
padding: '70px 30px'
|
|
@@ -5481,7 +5403,6 @@ async function getCourseList(baseURLs, hashToken) {
|
|
|
5481
5403
|
if (!hashToken) {
|
|
5482
5404
|
throw 'Missing hash token';
|
|
5483
5405
|
}
|
|
5484
|
-
|
|
5485
5406
|
const res = await axios__default["default"]({
|
|
5486
5407
|
method: 'get',
|
|
5487
5408
|
baseURL: baseURLs?.API_COURSE_URL,
|
|
@@ -5493,7 +5414,6 @@ async function getCourseList(baseURLs, hashToken) {
|
|
|
5493
5414
|
requiredFilters: '[10]'
|
|
5494
5415
|
}
|
|
5495
5416
|
});
|
|
5496
|
-
|
|
5497
5417
|
if (res) {
|
|
5498
5418
|
return res.data;
|
|
5499
5419
|
}
|
|
@@ -5505,7 +5425,6 @@ function getShortenedSubstring(name, length, allowDots = true) {
|
|
|
5505
5425
|
if (name) {
|
|
5506
5426
|
return name.length < length ? name : `${name.substr(0, length)}${allowDots && '...'}`;
|
|
5507
5427
|
}
|
|
5508
|
-
|
|
5509
5428
|
return '';
|
|
5510
5429
|
}
|
|
5511
5430
|
|
|
@@ -5583,13 +5502,11 @@ function courses({
|
|
|
5583
5502
|
containerWidth
|
|
5584
5503
|
});
|
|
5585
5504
|
const [nodeData] = sectionData?.components;
|
|
5586
|
-
|
|
5587
5505
|
const handleApiCall = () => {
|
|
5588
5506
|
if (baseURLs) {
|
|
5589
5507
|
getCourseList(baseURLs, hashToken).then(response => {
|
|
5590
5508
|
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
|
|
5591
5509
|
const coursesData = response?.data?.coursesData;
|
|
5592
|
-
|
|
5593
5510
|
if (coursesData && coursesData.length) {
|
|
5594
5511
|
setCardList(response?.data?.coursesData);
|
|
5595
5512
|
setShowShimmer(false);
|
|
@@ -5600,12 +5517,12 @@ function courses({
|
|
|
5600
5517
|
setShowShimmer(false);
|
|
5601
5518
|
setFallbackImages(placeholders);
|
|
5602
5519
|
}
|
|
5603
|
-
}
|
|
5520
|
+
}
|
|
5521
|
+
// For User Website & Draft Preview: If no data found, hide section.
|
|
5604
5522
|
else setErrored(true);
|
|
5605
5523
|
}
|
|
5606
5524
|
}).catch(err => {
|
|
5607
5525
|
const errMsg = err?.response?.data?.data?.message;
|
|
5608
|
-
|
|
5609
5526
|
if (errMsg === 'NOT_FOUND') {
|
|
5610
5527
|
if (nodeData?.cardCarousel?.metadata?.placeholders?.length && isEdit) {
|
|
5611
5528
|
setShowShimmer(false);
|
|
@@ -5617,16 +5534,16 @@ function courses({
|
|
|
5617
5534
|
});
|
|
5618
5535
|
}
|
|
5619
5536
|
};
|
|
5620
|
-
|
|
5621
5537
|
React.useEffect(() => {
|
|
5622
|
-
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
|
|
5623
|
-
|
|
5538
|
+
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
|
|
5539
|
+
// For Master template Preview: Show placeholder images. If placeholder doesn't come from backend, show shimmer.
|
|
5624
5540
|
if (isMasterTemplate) {
|
|
5625
5541
|
if (placeholders && placeholders.length) {
|
|
5626
5542
|
setShowShimmer(false);
|
|
5627
5543
|
setFallbackImages(placeholders);
|
|
5628
5544
|
}
|
|
5629
|
-
}
|
|
5545
|
+
}
|
|
5546
|
+
// other
|
|
5630
5547
|
else {
|
|
5631
5548
|
handleApiCall();
|
|
5632
5549
|
}
|
|
@@ -5691,7 +5608,6 @@ function courses({
|
|
|
5691
5608
|
});
|
|
5692
5609
|
})))));
|
|
5693
5610
|
}
|
|
5694
|
-
|
|
5695
5611
|
function SimpleCardsContainer({
|
|
5696
5612
|
children,
|
|
5697
5613
|
classes
|
|
@@ -6107,7 +6023,6 @@ function FormEnquiry({
|
|
|
6107
6023
|
setBtnDisabled(true);
|
|
6108
6024
|
}
|
|
6109
6025
|
}, [validData]);
|
|
6110
|
-
|
|
6111
6026
|
const handleSubmit = () => {
|
|
6112
6027
|
let data = {
|
|
6113
6028
|
sectionId: sectionData?._id || null,
|
|
@@ -6118,23 +6033,22 @@ function FormEnquiry({
|
|
|
6118
6033
|
setBtnDisabled(true);
|
|
6119
6034
|
setInputVal(formInitialValue);
|
|
6120
6035
|
};
|
|
6121
|
-
|
|
6122
6036
|
const checkValidity = (regexField, fieldname, fieldValidity) => {
|
|
6123
6037
|
if (validations?.[regexField]?.length) {
|
|
6124
6038
|
let regex = new RegExp(validations[regexField]);
|
|
6125
|
-
|
|
6126
6039
|
if (regex?.test(inputVal[fieldname])) {
|
|
6127
|
-
setValidData({
|
|
6040
|
+
setValidData({
|
|
6041
|
+
...validData,
|
|
6128
6042
|
[fieldValidity]: 1
|
|
6129
6043
|
});
|
|
6130
6044
|
} else {
|
|
6131
|
-
setValidData({
|
|
6045
|
+
setValidData({
|
|
6046
|
+
...validData,
|
|
6132
6047
|
[fieldValidity]: 0
|
|
6133
6048
|
});
|
|
6134
6049
|
}
|
|
6135
6050
|
}
|
|
6136
6051
|
};
|
|
6137
|
-
|
|
6138
6052
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
|
6139
6053
|
className: classes.section
|
|
6140
6054
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -6214,7 +6128,8 @@ function FormEnquiry({
|
|
|
6214
6128
|
isValid: validData.nameValid,
|
|
6215
6129
|
inputType: 'input',
|
|
6216
6130
|
onChange: e => {
|
|
6217
|
-
setInputVal({
|
|
6131
|
+
setInputVal({
|
|
6132
|
+
...inputVal,
|
|
6218
6133
|
name: e.target.value
|
|
6219
6134
|
});
|
|
6220
6135
|
},
|
|
@@ -6222,7 +6137,8 @@ function FormEnquiry({
|
|
|
6222
6137
|
checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
|
|
6223
6138
|
},
|
|
6224
6139
|
onFocus: () => {
|
|
6225
|
-
setValidData({
|
|
6140
|
+
setValidData({
|
|
6141
|
+
...validData,
|
|
6226
6142
|
nameValid: 1
|
|
6227
6143
|
});
|
|
6228
6144
|
}
|
|
@@ -6234,7 +6150,8 @@ function FormEnquiry({
|
|
|
6234
6150
|
isValid: validData.phoneValid,
|
|
6235
6151
|
inputType: 'input',
|
|
6236
6152
|
onChange: e => {
|
|
6237
|
-
setInputVal({
|
|
6153
|
+
setInputVal({
|
|
6154
|
+
...inputVal,
|
|
6238
6155
|
phone: e.target.value
|
|
6239
6156
|
});
|
|
6240
6157
|
},
|
|
@@ -6242,7 +6159,8 @@ function FormEnquiry({
|
|
|
6242
6159
|
checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
|
|
6243
6160
|
},
|
|
6244
6161
|
onFocus: () => {
|
|
6245
|
-
setValidData({
|
|
6162
|
+
setValidData({
|
|
6163
|
+
...validData,
|
|
6246
6164
|
phoneValid: 1
|
|
6247
6165
|
});
|
|
6248
6166
|
}
|
|
@@ -6254,7 +6172,8 @@ function FormEnquiry({
|
|
|
6254
6172
|
isValid: validData.emailValid,
|
|
6255
6173
|
inputType: 'input',
|
|
6256
6174
|
onChange: e => {
|
|
6257
|
-
setInputVal({
|
|
6175
|
+
setInputVal({
|
|
6176
|
+
...inputVal,
|
|
6258
6177
|
email: e.target.value
|
|
6259
6178
|
});
|
|
6260
6179
|
},
|
|
@@ -6262,7 +6181,8 @@ function FormEnquiry({
|
|
|
6262
6181
|
checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
|
|
6263
6182
|
},
|
|
6264
6183
|
onFocus: () => {
|
|
6265
|
-
setValidData({
|
|
6184
|
+
setValidData({
|
|
6185
|
+
...validData,
|
|
6266
6186
|
emailValid: 1
|
|
6267
6187
|
});
|
|
6268
6188
|
}
|
|
@@ -6274,7 +6194,8 @@ function FormEnquiry({
|
|
|
6274
6194
|
isValid: validData.messageValid,
|
|
6275
6195
|
inputType: 'textarea',
|
|
6276
6196
|
onChange: e => {
|
|
6277
|
-
setInputVal({
|
|
6197
|
+
setInputVal({
|
|
6198
|
+
...inputVal,
|
|
6278
6199
|
message: e.target.value
|
|
6279
6200
|
});
|
|
6280
6201
|
},
|
|
@@ -6282,7 +6203,8 @@ function FormEnquiry({
|
|
|
6282
6203
|
checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
|
|
6283
6204
|
},
|
|
6284
6205
|
onFocus: () => {
|
|
6285
|
-
setValidData({
|
|
6206
|
+
setValidData({
|
|
6207
|
+
...validData,
|
|
6286
6208
|
messageValid: 1
|
|
6287
6209
|
});
|
|
6288
6210
|
}
|
|
@@ -6379,11 +6301,12 @@ const useSectionStyles = createUseStyles(theme => ({
|
|
|
6379
6301
|
flexDirection: 'column',
|
|
6380
6302
|
width: '85%',
|
|
6381
6303
|
position: 'relative',
|
|
6382
|
-
paddingBottom: '55%'
|
|
6304
|
+
paddingBottom: '55%'
|
|
6305
|
+
// '& img': {
|
|
6383
6306
|
// width: '80%'
|
|
6384
6307
|
// }
|
|
6385
|
-
|
|
6386
6308
|
},
|
|
6309
|
+
|
|
6387
6310
|
telephoneImage: {
|
|
6388
6311
|
width: '80%'
|
|
6389
6312
|
},
|
|
@@ -6522,7 +6445,6 @@ function Contact({
|
|
|
6522
6445
|
phoneValid: 1,
|
|
6523
6446
|
messageValid: 1
|
|
6524
6447
|
});
|
|
6525
|
-
|
|
6526
6448
|
const handleSubmit = () => {
|
|
6527
6449
|
const data = {
|
|
6528
6450
|
sectionId: sectionData?._id || null,
|
|
@@ -6533,7 +6455,6 @@ function Contact({
|
|
|
6533
6455
|
setBtnDisabled(true);
|
|
6534
6456
|
setInputVal(formInitialValue);
|
|
6535
6457
|
};
|
|
6536
|
-
|
|
6537
6458
|
React.useEffect(() => {
|
|
6538
6459
|
if (validData?.nameValid && validData?.emailValid && validData?.phoneValid && validData?.messageValid) {
|
|
6539
6460
|
setBtnDisabled(false);
|
|
@@ -6541,23 +6462,22 @@ function Contact({
|
|
|
6541
6462
|
setBtnDisabled(true);
|
|
6542
6463
|
}
|
|
6543
6464
|
}, [validData]);
|
|
6544
|
-
|
|
6545
6465
|
const checkValidity = (regexField, fieldname, fieldValidity) => {
|
|
6546
6466
|
if (validations?.[regexField]?.length) {
|
|
6547
6467
|
let regex = new RegExp(validations[regexField]);
|
|
6548
|
-
|
|
6549
6468
|
if (regex?.test(inputVal[fieldname])) {
|
|
6550
|
-
setValidData({
|
|
6469
|
+
setValidData({
|
|
6470
|
+
...validData,
|
|
6551
6471
|
[fieldValidity]: 1
|
|
6552
6472
|
});
|
|
6553
6473
|
} else {
|
|
6554
|
-
setValidData({
|
|
6474
|
+
setValidData({
|
|
6475
|
+
...validData,
|
|
6555
6476
|
[fieldValidity]: 0
|
|
6556
6477
|
});
|
|
6557
6478
|
}
|
|
6558
6479
|
}
|
|
6559
6480
|
};
|
|
6560
|
-
|
|
6561
6481
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
|
6562
6482
|
className: classes.section
|
|
6563
6483
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -6599,7 +6519,8 @@ function Contact({
|
|
|
6599
6519
|
isValid: validData.nameValid,
|
|
6600
6520
|
inputType: 'input',
|
|
6601
6521
|
onChange: e => {
|
|
6602
|
-
setInputVal({
|
|
6522
|
+
setInputVal({
|
|
6523
|
+
...inputVal,
|
|
6603
6524
|
name: e.target.value
|
|
6604
6525
|
});
|
|
6605
6526
|
},
|
|
@@ -6607,7 +6528,8 @@ function Contact({
|
|
|
6607
6528
|
checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
|
|
6608
6529
|
},
|
|
6609
6530
|
onFocus: () => {
|
|
6610
|
-
setValidData({
|
|
6531
|
+
setValidData({
|
|
6532
|
+
...validData,
|
|
6611
6533
|
nameValid: 1
|
|
6612
6534
|
});
|
|
6613
6535
|
}
|
|
@@ -6619,7 +6541,8 @@ function Contact({
|
|
|
6619
6541
|
isValid: validData.phoneValid,
|
|
6620
6542
|
inputType: 'input',
|
|
6621
6543
|
onChange: e => {
|
|
6622
|
-
setInputVal({
|
|
6544
|
+
setInputVal({
|
|
6545
|
+
...inputVal,
|
|
6623
6546
|
phone: e.target.value
|
|
6624
6547
|
});
|
|
6625
6548
|
},
|
|
@@ -6627,7 +6550,8 @@ function Contact({
|
|
|
6627
6550
|
checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
|
|
6628
6551
|
},
|
|
6629
6552
|
onFocus: () => {
|
|
6630
|
-
setValidData({
|
|
6553
|
+
setValidData({
|
|
6554
|
+
...validData,
|
|
6631
6555
|
phoneValid: 1
|
|
6632
6556
|
});
|
|
6633
6557
|
}
|
|
@@ -6639,7 +6563,8 @@ function Contact({
|
|
|
6639
6563
|
isValid: validData.emailValid,
|
|
6640
6564
|
inputType: 'input',
|
|
6641
6565
|
onChange: e => {
|
|
6642
|
-
setInputVal({
|
|
6566
|
+
setInputVal({
|
|
6567
|
+
...inputVal,
|
|
6643
6568
|
email: e.target.value
|
|
6644
6569
|
});
|
|
6645
6570
|
},
|
|
@@ -6647,7 +6572,8 @@ function Contact({
|
|
|
6647
6572
|
checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
|
|
6648
6573
|
},
|
|
6649
6574
|
onFocus: () => {
|
|
6650
|
-
setValidData({
|
|
6575
|
+
setValidData({
|
|
6576
|
+
...validData,
|
|
6651
6577
|
emailValid: 1
|
|
6652
6578
|
});
|
|
6653
6579
|
}
|
|
@@ -6659,7 +6585,8 @@ function Contact({
|
|
|
6659
6585
|
isValid: validData.messageValid,
|
|
6660
6586
|
inputType: 'textarea',
|
|
6661
6587
|
onChange: e => {
|
|
6662
|
-
setInputVal({
|
|
6588
|
+
setInputVal({
|
|
6589
|
+
...inputVal,
|
|
6663
6590
|
message: e.target.value
|
|
6664
6591
|
});
|
|
6665
6592
|
},
|
|
@@ -6667,7 +6594,8 @@ function Contact({
|
|
|
6667
6594
|
checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
|
|
6668
6595
|
},
|
|
6669
6596
|
onFocus: () => {
|
|
6670
|
-
setValidData({
|
|
6597
|
+
setValidData({
|
|
6598
|
+
...validData,
|
|
6671
6599
|
messageValid: 1
|
|
6672
6600
|
});
|
|
6673
6601
|
}
|
|
@@ -6928,7 +6856,8 @@ const useWebinarPromotionPage = createUseStyles(theme => {
|
|
|
6928
6856
|
const SingleVideoSlide$1 = props => {
|
|
6929
6857
|
const [isReadMore, setIsReadMore] = React.useState(false);
|
|
6930
6858
|
const theme = useTheme();
|
|
6931
|
-
React.useEffect(() => {
|
|
6859
|
+
React.useEffect(() => {
|
|
6860
|
+
// remaining days epoch
|
|
6932
6861
|
// current date epoch
|
|
6933
6862
|
// subtract remaining days from current day epoch
|
|
6934
6863
|
// moment the result - and see if there are days
|
|
@@ -6940,7 +6869,6 @@ const SingleVideoSlide$1 = props => {
|
|
|
6940
6869
|
webinarCtaClick,
|
|
6941
6870
|
conversions = 0
|
|
6942
6871
|
} = props;
|
|
6943
|
-
|
|
6944
6872
|
const renderer = ({
|
|
6945
6873
|
days,
|
|
6946
6874
|
hours,
|
|
@@ -6956,9 +6884,7 @@ const SingleVideoSlide$1 = props => {
|
|
|
6956
6884
|
return /*#__PURE__*/React__default["default"].createElement("span", null, Math.floor(moment__default["default"].duration(given.diff(current)).asDays()), " day(s)");
|
|
6957
6885
|
}
|
|
6958
6886
|
};
|
|
6959
|
-
|
|
6960
6887
|
const checkIfOfferIsValid = () => moment__default["default"]().diff(moment__default["default"](props.data.offerPriceEndDate)) < 0;
|
|
6961
|
-
|
|
6962
6888
|
const checkForShowDiscount = () => {
|
|
6963
6889
|
if (props.data.endDate === null || checkIfOfferIsValid()) {
|
|
6964
6890
|
if (data.discount > 0 && data.offerPriceValidFor === 0) {
|
|
@@ -6970,19 +6896,16 @@ const SingleVideoSlide$1 = props => {
|
|
|
6970
6896
|
if (data.offerPriceValidFor <= conversions) {
|
|
6971
6897
|
return false;
|
|
6972
6898
|
}
|
|
6973
|
-
|
|
6974
6899
|
if (data.offerPriceValidFor - conversions < 0) {
|
|
6975
6900
|
return false;
|
|
6976
6901
|
} else {
|
|
6977
6902
|
return true;
|
|
6978
6903
|
}
|
|
6979
6904
|
}
|
|
6980
|
-
|
|
6981
6905
|
if (data.discount > 0) {
|
|
6982
6906
|
return true;
|
|
6983
6907
|
}
|
|
6984
6908
|
};
|
|
6985
|
-
|
|
6986
6909
|
const discount = ({
|
|
6987
6910
|
price,
|
|
6988
6911
|
discount
|
|
@@ -6990,7 +6913,6 @@ const SingleVideoSlide$1 = props => {
|
|
|
6990
6913
|
console.log('discountxx', props.data.price, props.data.discount);
|
|
6991
6914
|
return (discount / price * 100).toFixed(2);
|
|
6992
6915
|
};
|
|
6993
|
-
|
|
6994
6916
|
const classes = useWebinarPromotionPage();
|
|
6995
6917
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
6996
6918
|
className: classes.videoCarouselContainer
|
|
@@ -7086,9 +7008,10 @@ const SingleVideoSlide$1 = props => {
|
|
|
7086
7008
|
data: {
|
|
7087
7009
|
// link: 'headerData?.loginCtaLink',
|
|
7088
7010
|
// isLink: 1,
|
|
7089
|
-
value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW'
|
|
7090
|
-
|
|
7011
|
+
value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW'
|
|
7012
|
+
// isExternal: 1
|
|
7091
7013
|
},
|
|
7014
|
+
|
|
7092
7015
|
onClick: webinarCtaClick,
|
|
7093
7016
|
type: 'primary',
|
|
7094
7017
|
size: 'medium',
|
|
@@ -7422,14 +7345,14 @@ const SingleVideoSlide = props => {
|
|
|
7422
7345
|
isEdit
|
|
7423
7346
|
} = React.useContext(PageContext);
|
|
7424
7347
|
console.log(isEdit, 'isEdit');
|
|
7425
|
-
React.useEffect(() => {
|
|
7348
|
+
React.useEffect(() => {
|
|
7349
|
+
// remaining days epoch
|
|
7426
7350
|
// current date epoch
|
|
7427
7351
|
// subtract remaining days from current day epoch
|
|
7428
7352
|
// moment the result - and see if there are days
|
|
7429
7353
|
// days is present show days
|
|
7430
7354
|
// else start reverse timer
|
|
7431
7355
|
}, []);
|
|
7432
|
-
|
|
7433
7356
|
const renderer = ({
|
|
7434
7357
|
days,
|
|
7435
7358
|
hours,
|
|
@@ -7445,7 +7368,6 @@ const SingleVideoSlide = props => {
|
|
|
7445
7368
|
return /*#__PURE__*/React__default["default"].createElement("span", null, Math.floor(moment__default["default"].duration(given.diff(current)).asDays()), " day(s)");
|
|
7446
7369
|
}
|
|
7447
7370
|
};
|
|
7448
|
-
|
|
7449
7371
|
const {
|
|
7450
7372
|
data,
|
|
7451
7373
|
courseBuyNow,
|
|
@@ -7454,9 +7376,7 @@ const SingleVideoSlide = props => {
|
|
|
7454
7376
|
} = props;
|
|
7455
7377
|
const showCourseInstallmentData = data?.courseOverviewData;
|
|
7456
7378
|
const InstalmentData = isEdit ? data?.courseOverviewData?.installments?.formData?.installments[0].installmentAmount : data?.courseOverviewData?.installments?.formData?.installmentInfo?.installments[0].installmentPrice;
|
|
7457
|
-
|
|
7458
7379
|
const checkIfOfferIsValid = () => moment__default["default"]().diff(moment__default["default"](props?.data?.endDate || 0)) < 0;
|
|
7459
|
-
|
|
7460
7380
|
const checkForShowDiscount = () => {
|
|
7461
7381
|
if (props.data.endDate === null || checkIfOfferIsValid()) {
|
|
7462
7382
|
if (data.discount > 0 && data.offerPriceValidFor === 0) {
|
|
@@ -7468,28 +7388,23 @@ const SingleVideoSlide = props => {
|
|
|
7468
7388
|
if (data.offerPriceValidFor <= conversions) {
|
|
7469
7389
|
return false;
|
|
7470
7390
|
}
|
|
7471
|
-
|
|
7472
7391
|
if (data.offerPriceValidFor - conversions < 0) {
|
|
7473
7392
|
return false;
|
|
7474
7393
|
} else {
|
|
7475
7394
|
return true;
|
|
7476
7395
|
}
|
|
7477
7396
|
}
|
|
7478
|
-
|
|
7479
7397
|
if (data.discount > 0) {
|
|
7480
7398
|
return true;
|
|
7481
7399
|
}
|
|
7482
7400
|
};
|
|
7483
|
-
|
|
7484
7401
|
const classes = useCoursePromotionPage();
|
|
7485
|
-
|
|
7486
7402
|
const discount = ({
|
|
7487
7403
|
price,
|
|
7488
7404
|
discount
|
|
7489
7405
|
}) => {
|
|
7490
7406
|
return (discount / price * 100).toFixed(2);
|
|
7491
7407
|
};
|
|
7492
|
-
|
|
7493
7408
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
7494
7409
|
className: classes.videoCarouselContainer
|
|
7495
7410
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -7603,15 +7518,16 @@ const SingleVideoSlide = props => {
|
|
|
7603
7518
|
data: {
|
|
7604
7519
|
// link: 'headerData?.loginCtaLink',
|
|
7605
7520
|
// isLink: 1,
|
|
7606
|
-
value: 'BUY NOW'
|
|
7607
|
-
|
|
7521
|
+
value: 'BUY NOW'
|
|
7522
|
+
// isExternal: 1
|
|
7608
7523
|
},
|
|
7524
|
+
|
|
7609
7525
|
onClick: courseBuyNow,
|
|
7610
7526
|
type: 'primary',
|
|
7611
7527
|
size: 'medium',
|
|
7612
7528
|
target: null,
|
|
7613
|
-
rel: null
|
|
7614
|
-
|
|
7529
|
+
rel: null
|
|
7530
|
+
// styling={isMobile ? { margin: '0 40px' } : {}}
|
|
7615
7531
|
})))), showCourseInstallmentData && InstalmentData && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
7616
7532
|
className: classes.payInstallmentContainer,
|
|
7617
7533
|
onClick: showCourseInstallment
|
|
@@ -7816,18 +7732,15 @@ const FormPage = ({
|
|
|
7816
7732
|
_id,
|
|
7817
7733
|
baseURLs
|
|
7818
7734
|
} = React.useContext(PageContext);
|
|
7819
|
-
|
|
7820
7735
|
const handleSubmit = async e => {
|
|
7821
7736
|
e.preventDefault();
|
|
7822
7737
|
let formResponse = [];
|
|
7823
|
-
|
|
7824
7738
|
for (const [key, value] of Object.entries(formData)) {
|
|
7825
7739
|
if (value.questionType === 'MC') {
|
|
7826
7740
|
if (value.solutionArray.length > 1) {
|
|
7827
7741
|
value.solutionArray.shift();
|
|
7828
7742
|
}
|
|
7829
7743
|
}
|
|
7830
|
-
|
|
7831
7744
|
formResponse.push({
|
|
7832
7745
|
questionId: key,
|
|
7833
7746
|
questionName: value.questionName,
|
|
@@ -7835,7 +7748,6 @@ const FormPage = ({
|
|
|
7835
7748
|
solutionArray: value.solutionArray
|
|
7836
7749
|
});
|
|
7837
7750
|
}
|
|
7838
|
-
|
|
7839
7751
|
const data = {
|
|
7840
7752
|
sectionId: sectionData?.components?.[0]?._id || null,
|
|
7841
7753
|
landingPageId: _id || null,
|
|
@@ -7845,7 +7757,6 @@ const FormPage = ({
|
|
|
7845
7757
|
setFormData({});
|
|
7846
7758
|
setformSubmitted(!formSubmitted);
|
|
7847
7759
|
};
|
|
7848
|
-
|
|
7849
7760
|
React.useEffect(() => {
|
|
7850
7761
|
//add all questions to formData
|
|
7851
7762
|
let formData = {};
|
|
@@ -7858,23 +7769,26 @@ const FormPage = ({
|
|
|
7858
7769
|
});
|
|
7859
7770
|
setFormData(formData);
|
|
7860
7771
|
}, [metadata, formSubmitted]);
|
|
7861
|
-
|
|
7862
7772
|
const handleOnClick = (e, item, option) => {
|
|
7863
7773
|
// if the checkbox is checked
|
|
7864
7774
|
if (!e.target.checked) {
|
|
7865
7775
|
// if the checkbox is checked and the solution array is empty
|
|
7866
7776
|
if (!formData[item._id]?.solutionArray?.length) {
|
|
7867
|
-
setFormData({
|
|
7777
|
+
setFormData({
|
|
7778
|
+
...formData,
|
|
7868
7779
|
[item._id]: {
|
|
7869
7780
|
questionName: item.text,
|
|
7870
7781
|
solutionArray: [option.value],
|
|
7871
7782
|
questionType: 'MC'
|
|
7872
7783
|
}
|
|
7873
7784
|
});
|
|
7874
|
-
}
|
|
7785
|
+
}
|
|
7786
|
+
// if the checkbox is checked and the solution array is not empty and the value is already in the array remove it
|
|
7875
7787
|
else if (formData[item._id]?.solutionArray?.includes(option.value)) {
|
|
7876
7788
|
// if only one value is in the array remove it
|
|
7877
|
-
|
|
7789
|
+
|
|
7790
|
+
setFormData({
|
|
7791
|
+
...formData,
|
|
7878
7792
|
[item._id]: {
|
|
7879
7793
|
questionName: item.text,
|
|
7880
7794
|
solutionArray: formData[item._id]?.solutionArray?.filter(item => item !== option.value),
|
|
@@ -7882,20 +7796,24 @@ const FormPage = ({
|
|
|
7882
7796
|
}
|
|
7883
7797
|
});
|
|
7884
7798
|
}
|
|
7885
|
-
}
|
|
7799
|
+
}
|
|
7800
|
+
// if the checkbox is unchecked
|
|
7886
7801
|
else {
|
|
7887
7802
|
// if the checkbox is unchecked and the solution array is empty
|
|
7888
7803
|
if (typeof formData[item._id]?.solutionArray?.length === 'undefined') {
|
|
7889
|
-
setFormData({
|
|
7804
|
+
setFormData({
|
|
7805
|
+
...formData,
|
|
7890
7806
|
[item._id]: {
|
|
7891
7807
|
questionName: item.text,
|
|
7892
7808
|
solutionArray: [option.value],
|
|
7893
7809
|
questionType: 'MC'
|
|
7894
7810
|
}
|
|
7895
7811
|
});
|
|
7896
|
-
}
|
|
7812
|
+
}
|
|
7813
|
+
// if the checkbox is unchecked and the solution array is not empty and the value is not in the array add it
|
|
7897
7814
|
else if (!formData[item._id]?.solutionArray?.includes(option.value)) {
|
|
7898
|
-
setFormData({
|
|
7815
|
+
setFormData({
|
|
7816
|
+
...formData,
|
|
7899
7817
|
[item._id]: {
|
|
7900
7818
|
questionName: item.text,
|
|
7901
7819
|
solutionArray: [...formData[item._id]?.solutionArray, option.value],
|
|
@@ -7905,7 +7823,6 @@ const FormPage = ({
|
|
|
7905
7823
|
}
|
|
7906
7824
|
}
|
|
7907
7825
|
};
|
|
7908
|
-
|
|
7909
7826
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
|
7910
7827
|
className: classes.formPageSection
|
|
7911
7828
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -7932,7 +7849,8 @@ const FormPage = ({
|
|
|
7932
7849
|
placeholder: "Short answer",
|
|
7933
7850
|
name: item._id,
|
|
7934
7851
|
onChange: e => {
|
|
7935
|
-
setFormData({
|
|
7852
|
+
setFormData({
|
|
7853
|
+
...formData,
|
|
7936
7854
|
[item._id]: {
|
|
7937
7855
|
index,
|
|
7938
7856
|
questionName: item.text,
|
|
@@ -7972,11 +7890,13 @@ const FormPage = ({
|
|
|
7972
7890
|
name: "text",
|
|
7973
7891
|
required: item.isRequired,
|
|
7974
7892
|
value: option.value,
|
|
7975
|
-
checked: formData[item._id]?.solutionArray?.[0] === option.value
|
|
7893
|
+
checked: formData[item._id]?.solutionArray?.[0] === option.value
|
|
7894
|
+
// name={option.value}
|
|
7976
7895
|
// id={option.value}
|
|
7977
7896
|
,
|
|
7978
7897
|
onClick: e => {
|
|
7979
|
-
setFormData({
|
|
7898
|
+
setFormData({
|
|
7899
|
+
...formData,
|
|
7980
7900
|
[item._id]: {
|
|
7981
7901
|
questionName: item.text,
|
|
7982
7902
|
solutionArray: [option.value],
|
|
@@ -7992,9 +7912,10 @@ const FormPage = ({
|
|
|
7992
7912
|
data: {
|
|
7993
7913
|
// link: 'headerData?.loginCtaLink',
|
|
7994
7914
|
// isLink: 1,
|
|
7995
|
-
value: 'SUBMIT'
|
|
7996
|
-
|
|
7915
|
+
value: 'SUBMIT'
|
|
7916
|
+
// isExternal: 1
|
|
7997
7917
|
},
|
|
7918
|
+
|
|
7998
7919
|
type: 'primary',
|
|
7999
7920
|
size: 'medium',
|
|
8000
7921
|
target: null,
|
|
@@ -8088,7 +8009,6 @@ function Tiles({
|
|
|
8088
8009
|
const nodeData = sectionData.components;
|
|
8089
8010
|
console.log(nodeData);
|
|
8090
8011
|
const tilesList = nodeData[0]?.tilesList.components;
|
|
8091
|
-
|
|
8092
8012
|
const handleClick = value => {
|
|
8093
8013
|
if (!isEdit && value) {
|
|
8094
8014
|
if (value.indexOf('http://') == 0 || value.indexOf('https://') == 0) {
|
|
@@ -8098,7 +8018,6 @@ function Tiles({
|
|
|
8098
8018
|
}
|
|
8099
8019
|
}
|
|
8100
8020
|
};
|
|
8101
|
-
|
|
8102
8021
|
const TileDiv = tilesList?.map((tile, i) => {
|
|
8103
8022
|
return /*#__PURE__*/React__default["default"].createElement(React.Fragment, {
|
|
8104
8023
|
key: i
|
|
@@ -8161,8 +8080,8 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
8161
8080
|
width: 'auto',
|
|
8162
8081
|
height: '48px'
|
|
8163
8082
|
/* margin: 18px 0px; */
|
|
8164
|
-
|
|
8165
8083
|
},
|
|
8084
|
+
|
|
8166
8085
|
'p-young-guru-title': {
|
|
8167
8086
|
fontFamily: theme?.typography?.fontFamily,
|
|
8168
8087
|
fontStyle: 'normal',
|
|
@@ -8189,8 +8108,8 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
8189
8108
|
fontSize: '0',
|
|
8190
8109
|
textAlign: 'center'
|
|
8191
8110
|
/* padding:35px 0 40px */
|
|
8192
|
-
|
|
8193
8111
|
},
|
|
8112
|
+
|
|
8194
8113
|
'two-columns .column': {
|
|
8195
8114
|
width: '100%',
|
|
8196
8115
|
maxWidth: '275px',
|
|
@@ -8206,9 +8125,10 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
8206
8125
|
color: '#030a21',
|
|
8207
8126
|
marginBottom: '5px',
|
|
8208
8127
|
textAlign: 'left'
|
|
8209
|
-
}
|
|
8210
|
-
// }
|
|
8128
|
+
}
|
|
8211
8129
|
|
|
8130
|
+
// @media screen and (max-width: 600px) {
|
|
8131
|
+
// }
|
|
8212
8132
|
}));
|
|
8213
8133
|
|
|
8214
8134
|
function Section({
|
|
@@ -8237,8 +8157,8 @@ function Section({
|
|
|
8237
8157
|
}, /*#__PURE__*/React__default["default"].createElement("tbody", null, customHtmlData?.isCustomHtml ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
8238
8158
|
className: classes.email_description_para,
|
|
8239
8159
|
dangerouslySetInnerHTML: {
|
|
8240
|
-
__html: `${customHtmlData?.html ? customHtmlData?.html : ''}`
|
|
8241
|
-
|
|
8160
|
+
__html: `${customHtmlData?.html ? customHtmlData?.html : ''}`
|
|
8161
|
+
// __html: '<div>sdnfksdnflksdnfklsndk</div>'
|
|
8242
8162
|
}
|
|
8243
8163
|
}) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, header?.isActive ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", null, /*#__PURE__*/React__default["default"].createElement("table", {
|
|
8244
8164
|
style: {
|
|
@@ -8271,7 +8191,8 @@ function Section({
|
|
|
8271
8191
|
textAlign: 'center'
|
|
8272
8192
|
}
|
|
8273
8193
|
}, header?.components[1]?.metadata?.image?.length ? /*#__PURE__*/React__default["default"].createElement("img", {
|
|
8274
|
-
src: header?.components[1]?.metadata?.image
|
|
8194
|
+
src: header?.components[1]?.metadata?.image
|
|
8195
|
+
// width={600}
|
|
8275
8196
|
,
|
|
8276
8197
|
alt: "",
|
|
8277
8198
|
style: {
|
|
@@ -8557,14 +8478,12 @@ function Section({
|
|
|
8557
8478
|
}
|
|
8558
8479
|
}, "All rights reserved.")))))))))))))) : null)))));
|
|
8559
8480
|
}
|
|
8560
|
-
|
|
8561
8481
|
function EmailDripMarket({
|
|
8562
8482
|
sectionData,
|
|
8563
8483
|
extraProps = {}
|
|
8564
8484
|
}) {
|
|
8565
8485
|
console.log('extrapropstemplate', extraProps);
|
|
8566
8486
|
const isInitialMount = React.useRef(true);
|
|
8567
|
-
|
|
8568
8487
|
const convertToHtml = sectionData => {
|
|
8569
8488
|
const html = ReactDOMServer__default["default"].renderToStaticMarkup( /*#__PURE__*/React__default["default"].createElement(Section, {
|
|
8570
8489
|
nodeData: sectionData,
|
|
@@ -8574,15 +8493,15 @@ function EmailDripMarket({
|
|
|
8574
8493
|
}));
|
|
8575
8494
|
return html;
|
|
8576
8495
|
};
|
|
8577
|
-
|
|
8578
8496
|
React.useEffect(() => {
|
|
8579
8497
|
if (isInitialMount.current) {
|
|
8580
8498
|
isInitialMount.current = false;
|
|
8581
8499
|
} else {
|
|
8582
8500
|
extraProps?.callbackHtml(convertToHtml(sectionData));
|
|
8583
8501
|
}
|
|
8584
|
-
}, [extraProps?.convertedHtml]);
|
|
8502
|
+
}, [extraProps?.convertedHtml]);
|
|
8585
8503
|
|
|
8504
|
+
// const mockData = sectionData?.sections[0];
|
|
8586
8505
|
const emailRef = React.useRef(null);
|
|
8587
8506
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
|
8588
8507
|
style: {
|
|
@@ -8592,7 +8511,6 @@ function EmailDripMarket({
|
|
|
8592
8511
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
8593
8512
|
onClick: e => {
|
|
8594
8513
|
e.stopPropagation(); // prevent the click from event Capturing, in email onClick events do not work
|
|
8595
|
-
|
|
8596
8514
|
e.preventDefault();
|
|
8597
8515
|
}
|
|
8598
8516
|
}, /*#__PURE__*/React__default["default"].createElement(Section, {
|
|
@@ -8631,9 +8549,7 @@ const TYPE_TO_COMPONENT_MAP = {
|
|
|
8631
8549
|
TILES_SECTION: Tiles,
|
|
8632
8550
|
EMAIL_DRIP_MARKET: EmailDripMarket
|
|
8633
8551
|
};
|
|
8634
|
-
|
|
8635
8552
|
const getCompToRender = type => TYPE_TO_COMPONENT_MAP[type] || (() => null);
|
|
8636
|
-
|
|
8637
8553
|
const MemoisedSection = /*#__PURE__*/React.memo(({
|
|
8638
8554
|
sectionData,
|
|
8639
8555
|
extraProps,
|
|
@@ -8755,11 +8671,9 @@ const componentParser = compObj => {
|
|
|
8755
8671
|
});
|
|
8756
8672
|
return component;
|
|
8757
8673
|
}
|
|
8758
|
-
|
|
8759
8674
|
if (Array.isArray(compObj.components)) {
|
|
8760
8675
|
compObj.components = compObj.components.map(componentParser);
|
|
8761
8676
|
}
|
|
8762
|
-
|
|
8763
8677
|
return compObj;
|
|
8764
8678
|
};
|
|
8765
8679
|
const inverseComponentParser = compObj => {
|
|
@@ -8784,7 +8698,6 @@ const inverseComponentParser = compObj => {
|
|
|
8784
8698
|
if (compObj.components) {
|
|
8785
8699
|
compObj.components = compObj.components.map(inverseComponentParser);
|
|
8786
8700
|
}
|
|
8787
|
-
|
|
8788
8701
|
return compObj;
|
|
8789
8702
|
}
|
|
8790
8703
|
};
|