touchstudy-core 0.1.144 → 0.1.146

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 CHANGED
@@ -21,7 +21,7 @@ var Select = require('react-select');
21
21
  var Select__default = _interopDefault(Select);
22
22
  var CreatableSelect = _interopDefault(require('react-select/creatable'));
23
23
  var axios = _interopDefault(require('axios'));
24
- var _$5 = _interopDefault(require('lodash'));
24
+ var _$6 = _interopDefault(require('lodash'));
25
25
  var reactGoogleLogin = require('@leecheuk/react-google-login');
26
26
  require('moment/locale/ko.js');
27
27
  require('moment/locale/en-au.js');
@@ -1461,6 +1461,10 @@ var textbook_owner_email_is_required = "교재 소유자의 이메일은 필수
1461
1461
  var invalid_textbook_owner_email_address = "유효하지 않은 교재 소유자 이메일 주소입니다";
1462
1462
  var textbook_owner_academy_is_required = "교재 소유자의 학원은 필수입니다";
1463
1463
  var textbook_owner_course_is_required = "교재 소유자의 수업은 필수입니다";
1464
+ var start_order = "주문 번호 시작";
1465
+ var student_notice_notes = "학생 공지/노트";
1466
+ var note = "메모";
1467
+ var student_parents = "학생/학부모";
1464
1468
  var lang_ko = {
1465
1469
  problem_solving: problem_solving,
1466
1470
  my_story: my_story,
@@ -2559,7 +2563,11 @@ var lang_ko = {
2559
2563
  textbook_owner_email_is_required: textbook_owner_email_is_required,
2560
2564
  invalid_textbook_owner_email_address: invalid_textbook_owner_email_address,
2561
2565
  textbook_owner_academy_is_required: textbook_owner_academy_is_required,
2562
- textbook_owner_course_is_required: textbook_owner_course_is_required
2566
+ textbook_owner_course_is_required: textbook_owner_course_is_required,
2567
+ start_order: start_order,
2568
+ student_notice_notes: student_notice_notes,
2569
+ note: note,
2570
+ student_parents: student_parents
2563
2571
  };
2564
2572
 
2565
2573
  var problem_solving$1 = "Problem Solving";
@@ -3681,6 +3689,10 @@ var textbook_owner_email_is_required$1 = "Textbook owner email is required";
3681
3689
  var invalid_textbook_owner_email_address$1 = "Invalid textbook owner email address";
3682
3690
  var textbook_owner_academy_is_required$1 = "Textbook owner academy is required";
3683
3691
  var textbook_owner_course_is_required$1 = "Textbook owner class is required";
3692
+ var start_order$1 = "Start order number";
3693
+ var student_notice_notes$1 = "Student notice/notes";
3694
+ var note$1 = "Note";
3695
+ var student_parents$1 = "Student/Parents";
3684
3696
  var lang_en = {
3685
3697
  problem_solving: problem_solving$1,
3686
3698
  my_story: my_story$1,
@@ -4781,7 +4793,11 @@ var lang_en = {
4781
4793
  textbook_owner_email_is_required: textbook_owner_email_is_required$1,
4782
4794
  invalid_textbook_owner_email_address: invalid_textbook_owner_email_address$1,
4783
4795
  textbook_owner_academy_is_required: textbook_owner_academy_is_required$1,
4784
- textbook_owner_course_is_required: textbook_owner_course_is_required$1
4796
+ textbook_owner_course_is_required: textbook_owner_course_is_required$1,
4797
+ start_order: start_order$1,
4798
+ student_notice_notes: student_notice_notes$1,
4799
+ note: note$1,
4800
+ student_parents: student_parents$1
4785
4801
  };
4786
4802
 
4787
4803
  i18n__default.use(reactI18next.initReactI18next).init({
@@ -6151,6 +6167,41 @@ function _finally(body, finalizer) {
6151
6167
  UserSortColumn["Grade"] = "Grade";
6152
6168
  })(exports.UserSortColumn || (exports.UserSortColumn = {}));
6153
6169
 
6170
+ var NoteSortColumn;
6171
+ (function (NoteSortColumn) {
6172
+ NoteSortColumn["Content"] = "Content";
6173
+ NoteSortColumn["CreatedAt"] = "CreatedAt";
6174
+ NoteSortColumn["Question"] = "Question";
6175
+ })(NoteSortColumn || (NoteSortColumn = {}));
6176
+ (function (NoteType) {
6177
+ NoteType[NoteType["Default"] = 0] = "Default";
6178
+ NoteType[NoteType["StudentReadable"] = 1] = "StudentReadable";
6179
+ })(exports.NoteType || (exports.NoteType = {}));
6180
+
6181
+ var SchoolType;
6182
+ (function (SchoolType) {
6183
+ SchoolType[SchoolType["Default"] = 0] = "Default";
6184
+ SchoolType[SchoolType["Elementary"] = 1] = "Elementary";
6185
+ SchoolType[SchoolType["Middle"] = 2] = "Middle";
6186
+ SchoolType[SchoolType["High"] = 3] = "High";
6187
+ })(SchoolType || (SchoolType = {}));
6188
+ var HighSchoolGrade;
6189
+ (function (HighSchoolGrade) {
6190
+ HighSchoolGrade[HighSchoolGrade["Default"] = 0] = "Default";
6191
+ HighSchoolGrade[HighSchoolGrade["AdvancedMathematics1"] = 1] = "AdvancedMathematics1";
6192
+ HighSchoolGrade[HighSchoolGrade["AdvancedMathematics2"] = 2] = "AdvancedMathematics2";
6193
+ HighSchoolGrade[HighSchoolGrade["Algebra"] = 3] = "Algebra";
6194
+ HighSchoolGrade[HighSchoolGrade["Calculus1"] = 4] = "Calculus1";
6195
+ HighSchoolGrade[HighSchoolGrade["Calculus2"] = 5] = "Calculus2";
6196
+ HighSchoolGrade[HighSchoolGrade["ProbabilityAndStatistics"] = 6] = "ProbabilityAndStatistics";
6197
+ HighSchoolGrade[HighSchoolGrade["Geometry"] = 7] = "Geometry";
6198
+ })(HighSchoolGrade || (HighSchoolGrade = {}));
6199
+ (function (TextbookEditorType) {
6200
+ TextbookEditorType[TextbookEditorType["Default"] = 0] = "Default";
6201
+ TextbookEditorType[TextbookEditorType["Korea"] = 1] = "Korea";
6202
+ TextbookEditorType[TextbookEditorType["Math"] = 2] = "Math";
6203
+ })(exports.TextbookEditorType || (exports.TextbookEditorType = {}));
6204
+
6154
6205
  (function (SchoolType) {
6155
6206
  SchoolType[SchoolType["Default"] = 0] = "Default";
6156
6207
  SchoolType[SchoolType["Elementary"] = 1] = "Elementary";
@@ -6330,7 +6381,7 @@ var getLocalDayOfWeek = function getLocalDayOfWeek(utcDateTime, dayOfWeek) {
6330
6381
  return moment.utc(utcDateTime).add(diff, "days").local().weekday();
6331
6382
  };
6332
6383
  var getUtcDayOfWeek = function getUtcDayOfWeek(localDateTime, dayOfWeek) {
6333
- var currentDayOfWeek = _$5.cloneDeep(localDateTime).local().weekday();
6384
+ var currentDayOfWeek = _$6.cloneDeep(localDateTime).local().weekday();
6334
6385
  var diff = dayOfWeek - currentDayOfWeek;
6335
6386
  if (diff < 0) diff += 7;
6336
6387
  return localDateTime.add(diff, "days").utc().weekday();
@@ -6827,7 +6878,7 @@ var useList = function useList(fetchData, defaultQuery) {
6827
6878
  var _paging$page, _paging$limit;
6828
6879
  return (((_paging$page = paging.page) != null ? _paging$page : 0) - 1) * ((_paging$limit = paging.limit) != null ? _paging$limit : 0) + index + 1;
6829
6880
  };
6830
- var debounceSearch = _$5.debounce(function () {
6881
+ var debounceSearch = _$6.debounce(function () {
6831
6882
  var _textSearchRef$curren;
6832
6883
  setFilter(_extends({}, filter, {
6833
6884
  currentPage: 1,
@@ -7763,11 +7814,13 @@ var SearchInput = function SearchInput(_ref) {
7763
7814
  placeholder = _ref$placeholder === void 0 ? "Search for..." : _ref$placeholder,
7764
7815
  onChange = _ref.onChange,
7765
7816
  _ref$fit = _ref.fit,
7766
- fit = _ref$fit === void 0 ? true : _ref$fit;
7817
+ fit = _ref$fit === void 0 ? true : _ref$fit,
7818
+ sx = _ref.sx,
7819
+ searchSx = _ref.searchSx;
7767
7820
  return React__default.createElement(material.Paper, {
7768
7821
  component: "div",
7769
- className: "bg-light w-100 " + (fit && "h-100"),
7770
- sx: {
7822
+ className: (sx ? "" : "bg-light") + " w-100 " + (fit && "h-100"),
7823
+ sx: _extends({
7771
7824
  p: "2px 4px",
7772
7825
  display: "flex",
7773
7826
  alignItems: "center",
@@ -7779,11 +7832,11 @@ var SearchInput = function SearchInput(_ref) {
7779
7832
  return theme.palette.primary.main;
7780
7833
  }
7781
7834
  }
7782
- }
7835
+ }, sx)
7783
7836
  }, React__default.createElement(material.Box, {
7784
- sx: {
7837
+ sx: _extends({
7785
7838
  p: "10px"
7786
- },
7839
+ }, searchSx),
7787
7840
  "aria-label": "search"
7788
7841
  }, React__default.createElement(io5.IoSearch, {
7789
7842
  size: 24,
@@ -10684,6 +10737,8 @@ var useLoginPhoneNumber = function useLoginPhoneNumber(props) {
10684
10737
  var _useState5 = React.useState(false),
10685
10738
  refreshReCaptcha = _useState5[0],
10686
10739
  setRefreshReCaptcha = _useState5[1];
10740
+ var passwordRef = React.useRef(null);
10741
+ var submitBtnRef = React.useRef(null);
10687
10742
  var dispatch = reactRedux.useDispatch();
10688
10743
  var handleClickShowPassword = function handleClickShowPassword() {
10689
10744
  setShowPassword(!showPassword);
@@ -10741,6 +10796,18 @@ var useLoginPhoneNumber = function useLoginPhoneNumber(props) {
10741
10796
  return Promise.reject(e);
10742
10797
  }
10743
10798
  };
10799
+ var handlePhoneKeyDown = function handlePhoneKeyDown(e) {
10800
+ if (e.key === 'Enter') {
10801
+ e.preventDefault();
10802
+ if (passwordRef.current) passwordRef.current.focus();
10803
+ }
10804
+ };
10805
+ var handlePasswordKeyDown = function handlePasswordKeyDown(e) {
10806
+ if (e.key === 'Enter' && tokenReCaptcha && password.trim() && phoneNumber.trim()) {
10807
+ e.preventDefault();
10808
+ if (submitBtnRef.current) submitBtnRef.current.click();
10809
+ }
10810
+ };
10744
10811
  return {
10745
10812
  t: t,
10746
10813
  showPassword: showPassword,
@@ -10748,6 +10815,10 @@ var useLoginPhoneNumber = function useLoginPhoneNumber(props) {
10748
10815
  tokenReCaptcha: tokenReCaptcha,
10749
10816
  phoneNumber: phoneNumber,
10750
10817
  password: password,
10818
+ passwordRef: passwordRef,
10819
+ submitBtnRef: submitBtnRef,
10820
+ handlePasswordKeyDown: handlePasswordKeyDown,
10821
+ handlePhoneKeyDown: handlePhoneKeyDown,
10751
10822
  handleChangePassword: handleChangePassword,
10752
10823
  handlePhoneNumberChange: handlePhoneNumberChange,
10753
10824
  handleLoginPhoneNumber: handleLoginPhoneNumber,
@@ -10764,6 +10835,10 @@ var LoginPhone = function LoginPhone(props) {
10764
10835
  tokenReCaptcha = _useLoginPhoneNumber.tokenReCaptcha,
10765
10836
  phoneNumber = _useLoginPhoneNumber.phoneNumber,
10766
10837
  password = _useLoginPhoneNumber.password,
10838
+ passwordRef = _useLoginPhoneNumber.passwordRef,
10839
+ submitBtnRef = _useLoginPhoneNumber.submitBtnRef,
10840
+ handlePasswordKeyDown = _useLoginPhoneNumber.handlePasswordKeyDown,
10841
+ handlePhoneKeyDown = _useLoginPhoneNumber.handlePhoneKeyDown,
10767
10842
  handleChangePassword = _useLoginPhoneNumber.handleChangePassword,
10768
10843
  handlePhoneNumberChange = _useLoginPhoneNumber.handlePhoneNumberChange,
10769
10844
  handleLoginPhoneNumber = _useLoginPhoneNumber.handleLoginPhoneNumber,
@@ -10797,8 +10872,10 @@ var LoginPhone = function LoginPhone(props) {
10797
10872
  id: "phone_new_xs",
10798
10873
  name: "phone_new_xs",
10799
10874
  value: phoneNumber,
10800
- onChange: handlePhoneNumberChange
10875
+ onChange: handlePhoneNumberChange,
10876
+ onKeyDown: handlePhoneKeyDown
10801
10877
  }), React__default.createElement(material.TextField, {
10878
+ inputRef: passwordRef,
10802
10879
  label: t("password"),
10803
10880
  type: showPassword ? "text" : "password",
10804
10881
  fullWidth: true,
@@ -10825,12 +10902,14 @@ var LoginPhone = function LoginPhone(props) {
10825
10902
  size: "small",
10826
10903
  value: password,
10827
10904
  onChange: handleChangePassword,
10905
+ onKeyDown: handlePasswordKeyDown,
10828
10906
  InputLabelProps: {
10829
10907
  style: {
10830
10908
  color: "#349056"
10831
10909
  }
10832
10910
  }
10833
10911
  }), React__default.createElement(material.Button, {
10912
+ ref: submitBtnRef,
10834
10913
  variant: "outlined",
10835
10914
  sx: {
10836
10915
  color: "#349056"
@@ -11214,13 +11293,6 @@ var useLogin$1 = function useLogin(_ref) {
11214
11293
  var isAcademy = !!(user !== null && user !== void 0 && user.academyDomain) || !!(user !== null && user !== void 0 && user.isLearningSpace);
11215
11294
  var needToRegister = isFirstLogin && isAcademy;
11216
11295
  var redirectUrl = needToRegister ? registerUrl : isAcademy ? homeAcademyUrl : homeUrl;
11217
- console.log({
11218
- isFirstLogin: isFirstLogin,
11219
- isAcademy: isAcademy,
11220
- token: token,
11221
- user: user,
11222
- redirectUrl: redirectUrl
11223
- });
11224
11296
  handleSwitchOTP(false);
11225
11297
  redirectLoginUser(_extends({}, user, {
11226
11298
  isNotEnoughStatements: isFirstLogin
@@ -12619,7 +12691,7 @@ var ClassForm = function ClassForm(_ref) {
12619
12691
  };
12620
12692
  var handleDeleteWeeklyDays = function handleDeleteWeeklyDays(currentValue) {
12621
12693
  if (formikProp.values.courseWeeklyDays.length <= 1) return;
12622
- var courseWeeklyDays = _$5.cloneDeep(formikProp.values.courseWeeklyDays);
12694
+ var courseWeeklyDays = _$6.cloneDeep(formikProp.values.courseWeeklyDays);
12623
12695
  var newValues = courseWeeklyDays.filter(function (i) {
12624
12696
  var _i$startTime, _currentValue$startTi, _i$endTime, _currentValue$endTime;
12625
12697
  return i.dayOfWeek !== currentValue.dayOfWeek || ((_i$startTime = i.startTime) === null || _i$startTime === void 0 ? void 0 : _i$startTime.format("HH:mm:ss")) !== ((_currentValue$startTi = currentValue.startTime) === null || _currentValue$startTi === void 0 ? void 0 : _currentValue$startTi.format("HH:mm:ss")) || ((_i$endTime = i.endTime) === null || _i$endTime === void 0 ? void 0 : _i$endTime.format("HH:mm:ss")) !== ((_currentValue$endTime = currentValue.endTime) === null || _currentValue$endTime === void 0 ? void 0 : _currentValue$endTime.format("HH:mm:ss"));
@@ -12655,7 +12727,7 @@ var ClassForm = function ClassForm(_ref) {
12655
12727
  var handleChangeWeeklyDayTime = function handleChangeWeeklyDayTime(key, newValue, currentValue) {
12656
12728
  var _extends2;
12657
12729
  var time = newValue === null || newValue === void 0 ? void 0 : newValue.local();
12658
- var courseWeeklyDays = _$5.cloneDeep(formikProp.values.courseWeeklyDays);
12730
+ var courseWeeklyDays = _$6.cloneDeep(formikProp.values.courseWeeklyDays);
12659
12731
  var currentIndex = courseWeeklyDays.findIndex(function (i) {
12660
12732
  var _i$startTime2, _currentValue$startTi2, _i$endTime2, _currentValue$endTime2;
12661
12733
  return i.dayOfWeek === currentValue.dayOfWeek && ((_i$startTime2 = i.startTime) === null || _i$startTime2 === void 0 ? void 0 : _i$startTime2.format("HH:mm:ss")) === ((_currentValue$startTi2 = currentValue.startTime) === null || _currentValue$startTi2 === void 0 ? void 0 : _currentValue$startTi2.format("HH:mm:ss")) && ((_i$endTime2 = i.endTime) === null || _i$endTime2 === void 0 ? void 0 : _i$endTime2.format("HH:mm:ss")) === ((_currentValue$endTime2 = currentValue.endTime) === null || _currentValue$endTime2 === void 0 ? void 0 : _currentValue$endTime2.format("HH:mm:ss"));
@@ -12690,11 +12762,11 @@ var ClassForm = function ClassForm(_ref) {
12690
12762
  }, [JSON.stringify(data)]);
12691
12763
  var minDate = React.useMemo(function () {
12692
12764
  if (!formikProp.values.startDate) return undefined;
12693
- return _$5.cloneDeep(formikProp.values.startDate).add(1, "days");
12765
+ return _$6.cloneDeep(formikProp.values.startDate).add(1, "days");
12694
12766
  }, [formikProp.values.startDate]);
12695
12767
  var maxDate = React.useMemo(function () {
12696
12768
  if (!formikProp.values.endDate) return undefined;
12697
- return _$5.cloneDeep(formikProp.values.endDate).add(1, "days");
12769
+ return _$6.cloneDeep(formikProp.values.endDate).add(1, "days");
12698
12770
  }, [formikProp.values.endDate]);
12699
12771
  var WeeklyDayErrors = formikProp.touched.courseWeeklyDays && formikProp.errors.courseWeeklyDays && React__default.createElement("div", {
12700
12772
  className: "mt-1"
@@ -12711,7 +12783,7 @@ var ClassForm = function ClassForm(_ref) {
12711
12783
  });
12712
12784
  }, [JSON.stringify(formikProp.values.courseWeeklyDays)]);
12713
12785
  var courseWeeklyDays = React.useMemo(function () {
12714
- return _$5.sortBy(formikProp.values.courseWeeklyDays, ["dayOfWeek"]);
12786
+ return _$6.sortBy(formikProp.values.courseWeeklyDays, ["dayOfWeek"]);
12715
12787
  }, [JSON.stringify(formikProp.values.courseWeeklyDays)]);
12716
12788
  return React__default.createElement("div", {
12717
12789
  className: "d-flex flex-column"
@@ -12862,7 +12934,7 @@ var ClassForm = function ClassForm(_ref) {
12862
12934
  value: v.startTime,
12863
12935
  format: "HH:mm",
12864
12936
  open: open === index + "-startTime",
12865
- maxTime: v.endTime ? _$5.cloneDeep(v.endTime).add(-1, "minutes") : undefined,
12937
+ maxTime: v.endTime ? _$6.cloneDeep(v.endTime).add(-1, "minutes") : undefined,
12866
12938
  onAccept: function onAccept(newValue) {
12867
12939
  return handleChangeWeeklyDayTime("startTime", newValue, v);
12868
12940
  },
@@ -12892,7 +12964,7 @@ var ClassForm = function ClassForm(_ref) {
12892
12964
  components: ["TimePicker"]
12893
12965
  }, React__default.createElement(xDatePickers.TimePicker, {
12894
12966
  value: v.endTime,
12895
- minTime: v.startTime ? (_$cloneDeep = _$5.cloneDeep(v.startTime)) === null || _$cloneDeep === void 0 ? void 0 : _$cloneDeep.add(1, "minutes") : undefined,
12967
+ minTime: v.startTime ? (_$cloneDeep = _$6.cloneDeep(v.startTime)) === null || _$cloneDeep === void 0 ? void 0 : _$cloneDeep.add(1, "minutes") : undefined,
12896
12968
  format: "HH:mm",
12897
12969
  open: open === index + "-endTime",
12898
12970
  onAccept: function onAccept(newValue) {
@@ -13517,7 +13589,7 @@ var useStudentClassList = function useStudentClassList(courseId) {
13517
13589
  currentPage: 1
13518
13590
  }));
13519
13591
  };
13520
- var debounceSearch = _$5.debounce(function () {
13592
+ var debounceSearch = _$6.debounce(function () {
13521
13593
  setFilter(_extends({}, filter, {
13522
13594
  currentPage: 1
13523
13595
  }));
@@ -13653,7 +13725,7 @@ var useTeacherClassList = function useTeacherClassList(courseId) {
13653
13725
  currentPage: 1
13654
13726
  }));
13655
13727
  };
13656
- var debounceSearch = _$5.debounce(function () {
13728
+ var debounceSearch = _$6.debounce(function () {
13657
13729
  setFilter(_extends({}, filter, {
13658
13730
  currentPage: 1
13659
13731
  }));
@@ -13961,7 +14033,7 @@ var useClassDetail = function useClassDetail(_ref) {
13961
14033
  });
13962
14034
  }, [JSON.stringify(course)]);
13963
14035
  var convertToRequestBody = function convertToRequestBody(request) {
13964
- var localStartDate = _$5.cloneDeep(request.startDate);
14036
+ var localStartDate = _$6.cloneDeep(request.startDate);
13965
14037
  return _extends({}, request, {
13966
14038
  startDate: request.startDate.utc().format(DATE_TIME_FORMAT),
13967
14039
  endDate: request.endDate.utc().format(DATE_TIME_FORMAT),
@@ -14210,13 +14282,13 @@ var useClassDetail = function useClassDetail(_ref) {
14210
14282
  });
14211
14283
  if (event.target.checked) {
14212
14284
  setSelected(function (prev) {
14213
- return _$5.uniq([].concat(prev, newSelected));
14285
+ return _$6.uniq([].concat(prev, newSelected));
14214
14286
  });
14215
14287
  return;
14216
14288
  }
14217
- setSelected(_$5.difference(selected, newSelected));
14289
+ setSelected(_$6.difference(selected, newSelected));
14218
14290
  };
14219
- var debounceSearch = _$5.debounce(function () {
14291
+ var debounceSearch = _$6.debounce(function () {
14220
14292
  setFilter(_extends({}, filter, {
14221
14293
  currentPage: 1
14222
14294
  }));
@@ -14234,7 +14306,7 @@ var useClassDetail = function useClassDetail(_ref) {
14234
14306
  }) : userList.map(function (n) {
14235
14307
  return n.teacherId;
14236
14308
  });
14237
- var checkLength = _$5.intersection(selected, newSelected).length;
14309
+ var checkLength = _$6.intersection(selected, newSelected).length;
14238
14310
  return checkLength === userLength;
14239
14311
  };
14240
14312
  var handleClear = function handleClear() {
@@ -14269,7 +14341,7 @@ var useClassDetail = function useClassDetail(_ref) {
14269
14341
  }));
14270
14342
  setSelected([]);
14271
14343
  };
14272
- var debounceSort = _$5.debounce(handleSort, 300);
14344
+ var debounceSort = _$6.debounce(handleSort, 300);
14273
14345
  var handleChangePage = function handleChangePage(_, page) {
14274
14346
  setFilter(_extends({}, filter, {
14275
14347
  currentPage: page
@@ -14347,8 +14419,8 @@ var LessonFormBody = function LessonFormBody(_ref) {
14347
14419
  React.useEffect(function () {
14348
14420
  if (open && data) formikProp.setValues(data);else formikProp.setValues(DEFAULT_LESSON_REQUEST);
14349
14421
  }, [open, JSON.stringify(data)]);
14350
- var maxTime = formikProp.values.endTime ? _$5.cloneDeep(formikProp.values.endTime).add(-1, "minutes") : undefined;
14351
- var minTime = formikProp.values.startTime ? _$5.cloneDeep(formikProp.values.startTime).add(1, "minutes") : undefined;
14422
+ var maxTime = formikProp.values.endTime ? _$6.cloneDeep(formikProp.values.endTime).add(-1, "minutes") : undefined;
14423
+ var minTime = formikProp.values.startTime ? _$6.cloneDeep(formikProp.values.startTime).add(1, "minutes") : undefined;
14352
14424
  return React__default.createElement(React.Fragment, null, React__default.createElement(material.DialogContent, {
14353
14425
  sx: {
14354
14426
  overflowY: "unset"
@@ -14928,7 +15000,7 @@ var useClassList = function useClassList(history, classCreateUrl, classUpdateUrl
14928
15000
  currentPage: 1
14929
15001
  }));
14930
15002
  };
14931
- var debounceSearch = _$5.debounce(function () {
15003
+ var debounceSearch = _$6.debounce(function () {
14932
15004
  setClassFilter(_extends({}, classFilter, {
14933
15005
  currentPage: 1
14934
15006
  }));
@@ -17371,13 +17443,6 @@ var PrintState$1;
17371
17443
  PrintState[PrintState["Printed"] = 3] = "Printed";
17372
17444
  })(PrintState$1 || (PrintState$1 = {}));
17373
17445
 
17374
- var NoteSortColumn;
17375
- (function (NoteSortColumn) {
17376
- NoteSortColumn["Content"] = "Content";
17377
- NoteSortColumn["CreatedAt"] = "CreatedAt";
17378
- NoteSortColumn["Question"] = "Question";
17379
- })(NoteSortColumn || (NoteSortColumn = {}));
17380
-
17381
17446
  var DEFAULT_NOTE_FILTER = {
17382
17447
  sortColumnDirection: exports.OrderType.DESC,
17383
17448
  sortColumnName: NoteSortColumn.CreatedAt,
@@ -19613,6 +19678,7 @@ var ClassNoteDialog = function ClassNoteDialog(_ref) {
19613
19678
  var open = _ref.open,
19614
19679
  studentName = _ref.studentName,
19615
19680
  selectedNote = _ref.selectedNote,
19681
+ tip = _ref.tip,
19616
19682
  onClose = _ref.onClose,
19617
19683
  onSaveNote = _ref.onSaveNote;
19618
19684
  var _useTranslation = reactI18next.useTranslation(),
@@ -19656,7 +19722,7 @@ var ClassNoteDialog = function ClassNoteDialog(_ref) {
19656
19722
  fontSize: "16px",
19657
19723
  lineHeight: "19.09px",
19658
19724
  color: "#202B37"
19659
- }, t(selectedNote ? "edit_student_note" : "student_note_taking"))), React__default.createElement(IconButton, {
19725
+ }, t(selectedNote ? "edit_student_note" : "student_note_taking"), tip)), React__default.createElement(IconButton, {
19660
19726
  "aria-label": "close",
19661
19727
  sx: {
19662
19728
  position: "absolute",
@@ -20028,7 +20094,7 @@ var useNotes = function useNotes(setFilter, filter) {
20028
20094
  var items = (data === null || data === void 0 ? void 0 : data.items) || [];
20029
20095
  var newNotes = items;
20030
20096
  if (filter !== null && filter !== void 0 && filter.currentPage && (filter === null || filter === void 0 ? void 0 : filter.currentPage) > 1) {
20031
- newNotes = [].concat(_$5.uniqBy([].concat(notes, items), "id"));
20097
+ newNotes = [].concat(_$6.uniqBy([].concat(notes, items), "id"));
20032
20098
  }
20033
20099
  setNotes(newNotes);
20034
20100
  });
@@ -20051,7 +20117,7 @@ var useNotes = function useNotes(setFilter, filter) {
20051
20117
  });
20052
20118
  }, [filter === null || filter === void 0 ? void 0 : filter.currentPage, totalPages]);
20053
20119
  var handleNoteAdded = function handleNoteAdded(note) {
20054
- var newNotes = [].concat(_$5.uniqBy([note].concat(notes), "id"));
20120
+ var newNotes = [].concat(_$6.uniqBy([note].concat(notes), "id"));
20055
20121
  setNotes(newNotes);
20056
20122
  };
20057
20123
  var handleNoteUpdated = function handleNoteUpdated(note) {
@@ -20082,6 +20148,7 @@ var useNotes = function useNotes(setFilter, filter) {
20082
20148
  };
20083
20149
 
20084
20150
  var NoteItem = function NoteItem(_ref) {
20151
+ var _user$roles;
20085
20152
  var data = _ref.data,
20086
20153
  openTooltip = _ref.openTooltip,
20087
20154
  actions = _ref.actions,
@@ -20092,6 +20159,11 @@ var NoteItem = function NoteItem(_ref) {
20092
20159
  onLoad = _ref.onLoad;
20093
20160
  var _useTranslation = reactI18next.useTranslation(),
20094
20161
  t = _useTranslation.t;
20162
+ var user = reactRedux.useSelector(function (state) {
20163
+ var _state$common;
20164
+ return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
20165
+ });
20166
+ var isAdmin = !!user && (user === null || user === void 0 ? void 0 : (_user$roles = user.roles) === null || _user$roles === void 0 ? void 0 : _user$roles.includes(exports.Role.Admin));
20095
20167
  var handleMoreClick = function handleMoreClick(e) {
20096
20168
  e.preventDefault();
20097
20169
  e.stopPropagation();
@@ -20114,7 +20186,7 @@ var NoteItem = function NoteItem(_ref) {
20114
20186
  gap: 1
20115
20187
  }, React__default.createElement(material.Typography, Object.assign({}, NoteItemStyles.text.left), data.examSessionId ? t("article") + " " + data.articleNumber : "" + data.fullName), React__default.createElement(material.Typography, Object.assign({}, NoteItemStyles.text.middle), data.examSessionId ? "" + t("number_question", {
20116
20188
  number: (data.questionOrder || 0) + 1
20117
- }) : "" + utcToLocalTime(data.createdAt, t("date_format") + " HH:mm")), data.examSessionId && React__default.createElement(material.Typography, Object.assign({}, NoteItemStyles.text.right), data.categoryName)), React__default.createElement(material.Typography, Object.assign({}, NoteItemStyles.contentText), data.content)), React__default.createElement(material.Box, null, React__default.createElement(material.ClickAwayListener, {
20189
+ }) : "" + utcToLocalTime(data.createdAt, t("date_format") + " HH:mm")), data.examSessionId && React__default.createElement(material.Typography, Object.assign({}, NoteItemStyles.text.right), data.categoryName)), React__default.createElement(material.Typography, Object.assign({}, NoteItemStyles.contentText), data.content)), React__default.createElement(material.Box, null, (isAdmin || data.isOwned) && React__default.createElement(material.ClickAwayListener, {
20118
20190
  onClickAway: onClose
20119
20191
  }, React__default.createElement(material.Box, null, React__default.createElement(CustomTooltip, {
20120
20192
  onClose: onClose,
@@ -20512,7 +20584,7 @@ var useExamResultData = function useExamResultData(props) {
20512
20584
  topAnswerOrder: i.topAnswerOrder == null ? 0 : i.topAnswerOrder
20513
20585
  });
20514
20586
  });
20515
- var sortedMySeriesQuestionData = _$5.sortBy(questionsData.filter(function (i) {
20587
+ var sortedMySeriesQuestionData = _$6.sortBy(questionsData.filter(function (i) {
20516
20588
  return i.answerOrder !== 0;
20517
20589
  }), ["answerOrder", "questionOrder"]);
20518
20590
  var mySeriesData = [null].concat(sortedMySeriesQuestionData.map(function (item) {
@@ -20522,7 +20594,7 @@ var useExamResultData = function useExamResultData(props) {
20522
20594
  }).map(function () {
20523
20595
  return null;
20524
20596
  }), [null]);
20525
- var sortedTopSeriesQuestionData = _$5.sortBy(questionsData.filter(function (i) {
20597
+ var sortedTopSeriesQuestionData = _$6.sortBy(questionsData.filter(function (i) {
20526
20598
  return i.topAnswerOrder !== 0;
20527
20599
  }), ["topAnswerOrder", "questionOrder"]);
20528
20600
  var topSeriesData = [null].concat(sortedTopSeriesQuestionData.map(function (item) {
@@ -22778,7 +22850,7 @@ var useUserList = function useUserList(role) {
22778
22850
  currentPage: 1
22779
22851
  }));
22780
22852
  };
22781
- var debounceSort = _$5.debounce(handleSort, 300);
22853
+ var debounceSort = _$6.debounce(handleSort, 300);
22782
22854
  var getUserById = function getUserById(id) {
22783
22855
  try {
22784
22856
  var _temp8 = function _temp8() {
@@ -22936,7 +23008,7 @@ var useUserList = function useUserList(role) {
22936
23008
  return Promise.reject(e);
22937
23009
  }
22938
23010
  };
22939
- var debounceSearch = _$5.debounce(function () {
23011
+ var debounceSearch = _$6.debounce(function () {
22940
23012
  setFilter(_extends({}, filter, {
22941
23013
  currentPage: 1
22942
23014
  }));
@@ -24192,8 +24264,8 @@ var useExamDetailView = function useExamDetailView(props) {
24192
24264
  var handleAddArticle = function handleAddArticle() {
24193
24265
  var _$maxBy, _$maxBy2;
24194
24266
  if (!exam) return;
24195
- var maxArticle = ((_$maxBy = _$5.maxBy(exam.questions, "article")) === null || _$maxBy === void 0 ? void 0 : _$maxBy.article) || 0;
24196
- var maxOrder = ((_$maxBy2 = _$5.maxBy(exam.questions, "questionOrder")) === null || _$maxBy2 === void 0 ? void 0 : _$maxBy2.questionOrder) || 0;
24267
+ var maxArticle = ((_$maxBy = _$6.maxBy(exam.questions, "article")) === null || _$maxBy === void 0 ? void 0 : _$maxBy.article) || 0;
24268
+ var maxOrder = ((_$maxBy2 = _$6.maxBy(exam.questions, "questionOrder")) === null || _$maxBy2 === void 0 ? void 0 : _$maxBy2.questionOrder) || 0;
24197
24269
  onChangeExam(_extends({}, exam, {
24198
24270
  questions: [].concat(exam.questions, [{
24199
24271
  questionAnswerType: exports.QuestionAnswerType.SingleChoice,
@@ -24241,7 +24313,7 @@ var useExamDetailView = function useExamDetailView(props) {
24241
24313
  var examGroupByArticle = React.useMemo(function () {
24242
24314
  if (!exam) return [];
24243
24315
  var articles = [];
24244
- var groupedArticle = _$5.groupBy(exam.questions, "article");
24316
+ var groupedArticle = _$6.groupBy(exam.questions, "article");
24245
24317
  for (var key in groupedArticle) {
24246
24318
  if (Object.prototype.hasOwnProperty.call(groupedArticle, key)) {
24247
24319
  var _questions$find, _$maxBy3;
@@ -24251,13 +24323,13 @@ var useExamDetailView = function useExamDetailView(props) {
24251
24323
  categoryId: (_questions$find = questions.find(function (i) {
24252
24324
  return !!i.categoryId;
24253
24325
  })) === null || _questions$find === void 0 ? void 0 : _questions$find.categoryId,
24254
- answerCount: ((_$maxBy3 = _$5.maxBy(questions, "numberOfAnswers")) === null || _$maxBy3 === void 0 ? void 0 : _$maxBy3.numberOfAnswers) || DEFAULT_ANSWER_COUNT,
24326
+ answerCount: ((_$maxBy3 = _$6.maxBy(questions, "numberOfAnswers")) === null || _$maxBy3 === void 0 ? void 0 : _$maxBy3.numberOfAnswers) || DEFAULT_ANSWER_COUNT,
24255
24327
  questionCount: questions.length,
24256
24328
  questions: questions
24257
24329
  });
24258
24330
  }
24259
24331
  }
24260
- return _$5.sortBy(articles, "article");
24332
+ return _$6.sortBy(articles, "article");
24261
24333
  }, [JSON.stringify(exam)]);
24262
24334
  var durationOptions = React.useMemo(function () {
24263
24335
  var options = DURATION_OPTIONS.map(function (i) {
@@ -26678,11 +26750,11 @@ var useTextbookShare = function useTextbookShare(props) {
26678
26750
  });
26679
26751
  if (event.target.checked) {
26680
26752
  setSelectedShare(function (prev) {
26681
- return _$5.uniq([].concat(prev, newSelected));
26753
+ return _$6.uniq([].concat(prev, newSelected));
26682
26754
  });
26683
26755
  return;
26684
26756
  }
26685
- setSelectedShare(_$5.difference(selectedShare, newSelected));
26757
+ setSelectedShare(_$6.difference(selectedShare, newSelected));
26686
26758
  };
26687
26759
  var isCheckAllShare = function isCheckAllShare(userLength) {
26688
26760
  var newSelected = isUpdate ? shared.map(function (n) {
@@ -26690,7 +26762,7 @@ var useTextbookShare = function useTextbookShare(props) {
26690
26762
  }) : notShared.map(function (n) {
26691
26763
  return n.id;
26692
26764
  });
26693
- var checkLength = _$5.intersection(selectedShare, newSelected).length;
26765
+ var checkLength = _$6.intersection(selectedShare, newSelected).length;
26694
26766
  return checkLength === userLength;
26695
26767
  };
26696
26768
  var handleClickCheckboxShare = function handleClickCheckboxShare(id) {
@@ -26949,7 +27021,7 @@ var TextbookList = function TextbookList(props) {
26949
27021
  handleUpdateSharedTextbook = _useTextbookShare.handleUpdateSharedTextbook,
26950
27022
  currentModel = _useTextbookShare.currentModel;
26951
27023
  var textbookHeaders = React.useMemo(function () {
26952
- var headers = _$5.clone(TEXTBOOK_HEADERS);
27024
+ var headers = _$6.clone(TEXTBOOK_HEADERS);
26953
27025
  if (isTeacher && isTeacherSite) headers.splice(5, 0, {
26954
27026
  title: "teacher_personal_textbook"
26955
27027
  });
@@ -27544,7 +27616,7 @@ var useNotificationList = function useNotificationList(_ref) {
27544
27616
  currentPage: 1
27545
27617
  }));
27546
27618
  };
27547
- var debounceSearch = _$5.debounce(function () {
27619
+ var debounceSearch = _$6.debounce(function () {
27548
27620
  setNotificationFilter(_extends({}, notificationFilter, {
27549
27621
  currentPage: 1
27550
27622
  }));
@@ -27970,31 +28042,6 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
27970
28042
  };
27971
28043
  };
27972
28044
 
27973
- var SchoolType;
27974
- (function (SchoolType) {
27975
- SchoolType[SchoolType["Default"] = 0] = "Default";
27976
- SchoolType[SchoolType["Elementary"] = 1] = "Elementary";
27977
- SchoolType[SchoolType["Middle"] = 2] = "Middle";
27978
- SchoolType[SchoolType["High"] = 3] = "High";
27979
- })(SchoolType || (SchoolType = {}));
27980
- var HighSchoolGrade;
27981
- (function (HighSchoolGrade) {
27982
- HighSchoolGrade[HighSchoolGrade["Default"] = 0] = "Default";
27983
- HighSchoolGrade[HighSchoolGrade["AdvancedMathematics1"] = 1] = "AdvancedMathematics1";
27984
- HighSchoolGrade[HighSchoolGrade["AdvancedMathematics2"] = 2] = "AdvancedMathematics2";
27985
- HighSchoolGrade[HighSchoolGrade["Algebra"] = 3] = "Algebra";
27986
- HighSchoolGrade[HighSchoolGrade["Calculus1"] = 4] = "Calculus1";
27987
- HighSchoolGrade[HighSchoolGrade["Calculus2"] = 5] = "Calculus2";
27988
- HighSchoolGrade[HighSchoolGrade["ProbabilityAndStatistics"] = 6] = "ProbabilityAndStatistics";
27989
- HighSchoolGrade[HighSchoolGrade["Geometry"] = 7] = "Geometry";
27990
- })(HighSchoolGrade || (HighSchoolGrade = {}));
27991
- var TextbookEditorType;
27992
- (function (TextbookEditorType) {
27993
- TextbookEditorType[TextbookEditorType["Default"] = 0] = "Default";
27994
- TextbookEditorType[TextbookEditorType["Korea"] = 1] = "Korea";
27995
- TextbookEditorType[TextbookEditorType["Math"] = 2] = "Math";
27996
- })(TextbookEditorType || (TextbookEditorType = {}));
27997
-
27998
28045
  var TextbookSortBy$1;
27999
28046
  (function (TextbookSortBy) {
28000
28047
  TextbookSortBy["Name"] = "Name";
@@ -28147,6 +28194,12 @@ var preparedTextbookSchema = function preparedTextbookSchema(t) {
28147
28194
  }),
28148
28195
  name: yup.string().required(t("name_required")),
28149
28196
  questionGroups: yup.array().of(yup.object().shape({
28197
+ pageFrom: yup.number().notRequired().integer().notRequired().min(1, t("min_is_1")),
28198
+ pageTo: yup.number().notRequired().integer().typeError(t("must_be_number")).test("is-greater", t("page_to_must_be_greater_than_or_equal_to_page_from"), function (value) {
28199
+ var _this$parent2 = this === null || this === void 0 ? void 0 : this.parent,
28200
+ pageFrom = _this$parent2.pageFrom;
28201
+ return !value || !pageFrom || value >= pageFrom;
28202
+ }),
28150
28203
  articles: yup.array().of(yup.object().shape({
28151
28204
  categories: yup.array().of(yup.number()).min(1, t("category_required")),
28152
28205
  title: yup.string().notRequired(),
@@ -28168,12 +28221,18 @@ var preparedTextbookSchema = function preparedTextbookSchema(t) {
28168
28221
  subChapters: yup.array().of(yup.object().shape({
28169
28222
  pageFrom: yup.number().required(t("page_from_required")).integer().typeError(t("must_be_number")).min(1, t("min_is_1")),
28170
28223
  pageTo: yup.number().required(t("page_to_required")).integer().typeError(t("must_be_number")).test("is-greater", t("page_to_must_be_greater_than_or_equal_to_page_from"), function (value) {
28171
- var _this$parent2 = this === null || this === void 0 ? void 0 : this.parent,
28172
- pageFrom = _this$parent2.pageFrom;
28224
+ var _this$parent3 = this === null || this === void 0 ? void 0 : this.parent,
28225
+ pageFrom = _this$parent3.pageFrom;
28173
28226
  return value >= pageFrom;
28174
28227
  }),
28175
28228
  name: yup.string().required(t("name_required")),
28176
28229
  questionGroups: yup.array().of(yup.object().shape({
28230
+ pageFrom: yup.number().notRequired().integer().notRequired().min(1, t("min_is_1")),
28231
+ pageTo: yup.number().notRequired().integer().typeError(t("must_be_number")).test("is-greater", t("page_to_must_be_greater_than_or_equal_to_page_from"), function (value) {
28232
+ var _this$parent4 = this === null || this === void 0 ? void 0 : this.parent,
28233
+ pageFrom = _this$parent4.pageFrom;
28234
+ return !value || !pageFrom || value >= pageFrom;
28235
+ }),
28177
28236
  articles: yup.array().of(yup.object().shape({
28178
28237
  categories: yup.array().of(yup.number()).min(1, t("category_required")),
28179
28238
  title: yup.string().notRequired(),
@@ -28210,7 +28269,7 @@ var DEFAULT_TEXTBOOK_REQUEST = {
28210
28269
  grade: "",
28211
28270
  textbookOwners: [],
28212
28271
  isPrepared: true,
28213
- type: TextbookEditorType.Korea
28272
+ type: exports.TextbookEditorType.Korea
28214
28273
  };
28215
28274
  var DEFAULT_CHAPTER = {
28216
28275
  name: "",
@@ -28261,7 +28320,7 @@ var CustomTextbookTab = function CustomTextbookTab(props) {
28261
28320
  };
28262
28321
 
28263
28322
  var _reduceToMathArticles = function reduceToMathArticles(textbook, isMath) {
28264
- var values = isMath !== undefined ? _$5.cloneDeep(textbook) : textbook;
28323
+ var values = isMath !== undefined ? _$6.cloneDeep(textbook) : textbook;
28265
28324
  if (isMath !== undefined) values.type = isMath;
28266
28325
  for (var key in values) {
28267
28326
  if (values.hasOwnProperty(key)) {
@@ -28276,7 +28335,7 @@ var _reduceToMathArticles = function reduceToMathArticles(textbook, isMath) {
28276
28335
  return values;
28277
28336
  };
28278
28337
  var _resetAllCategoriesAndQuestionTypesBySubject = function resetAllCategoriesAndQuestionTypesBySubject(textbook, subject) {
28279
- var values = subject ? _$5.cloneDeep(textbook) : textbook;
28338
+ var values = subject ? _$6.cloneDeep(textbook) : textbook;
28280
28339
  if (subject) {
28281
28340
  values.subjectId = subject === null || subject === void 0 ? void 0 : subject.value;
28282
28341
  values.subject = subject;
@@ -28338,6 +28397,8 @@ var convertResponseToRequest = function convertResponseToRequest(selectedTextboo
28338
28397
  return {
28339
28398
  id: g.id,
28340
28399
  chapterId: c.id,
28400
+ pageFrom: g.pageFrom,
28401
+ pageTo: g.pageTo,
28341
28402
  questions: g.questions.map(function (q) {
28342
28403
  var _q$questionType;
28343
28404
  return _extends({}, q, {
@@ -28381,6 +28442,8 @@ var convertResponseToRequest = function convertResponseToRequest(selectedTextboo
28381
28442
  return {
28382
28443
  id: g.id,
28383
28444
  chapterId: c.id,
28445
+ pageFrom: g.pageFrom,
28446
+ pageTo: g.pageTo,
28384
28447
  questions: g.questions.map(function (q) {
28385
28448
  var _q$questionType2;
28386
28449
  return _extends({}, q, {
@@ -28424,9 +28487,21 @@ var handleKeyDown = function handleKeyDown(e) {
28424
28487
  e.preventDefault();
28425
28488
  }
28426
28489
  };
28490
+ var isSequentialQuestionGroups = function isSequentialQuestionGroups(questionGroups) {
28491
+ if (!questionGroups.length) return true;
28492
+ if (questionGroups[0].questions[0].questionOrder !== 0) return false;
28493
+ for (var index = 1; index < questionGroups.length; index++) {
28494
+ var questionGroup = questionGroups[index];
28495
+ var prevQuestionGroup = questionGroups[index - 1];
28496
+ if (prevQuestionGroup.questions[prevQuestionGroup.questions.length - 1].questionOrder !== questionGroup.questions[0].questionOrder - 1) return false;
28497
+ }
28498
+ return true;
28499
+ };
28427
28500
 
28501
+ var _ = _$6;
28428
28502
  var ArticleBlock = function ArticleBlock(_ref) {
28429
- var expandedIndex = _ref.expandedIndex,
28503
+ var errors = _ref.errors,
28504
+ expandedIndex = _ref.expandedIndex,
28430
28505
  data = _ref.data,
28431
28506
  categories = _ref.categories,
28432
28507
  path = _ref.path,
@@ -28460,13 +28535,22 @@ var ArticleBlock = function ArticleBlock(_ref) {
28460
28535
  onOpenCategoryMenu(path + ".categories[0]");
28461
28536
  };
28462
28537
  var handleChangeCategory = function handleChangeCategory(val) {
28463
- setFieldValue(path + ".categoryOptions", [val]);
28464
- setFieldValue(path + ".categories", [val === null || val === void 0 ? void 0 : val.value]);
28538
+ setFieldValue(path + ".categoryOptions", val !== null && val !== void 0 && val.value ? [val] : []);
28539
+ setFieldValue(path + ".categories", val !== null && val !== void 0 && val.value ? [val.value] : []);
28465
28540
  };
28466
28541
  var handleChangeSubCategory = function handleChangeSubCategory(val) {
28467
- setFieldValue(path + ".categoryOptions[1]", val);
28468
- setFieldValue(path + ".categories[1]", val === null || val === void 0 ? void 0 : val.value);
28542
+ if (!(val !== null && val !== void 0 && val.value)) {
28543
+ var _data$categories, _data$categoryOptions;
28544
+ var category = data === null || data === void 0 ? void 0 : (_data$categories = data.categories) === null || _data$categories === void 0 ? void 0 : _data$categories[0];
28545
+ var categoryOption = data === null || data === void 0 ? void 0 : (_data$categoryOptions = data.categoryOptions) === null || _data$categoryOptions === void 0 ? void 0 : _data$categoryOptions[0];
28546
+ setFieldValue(path + ".categories", category ? [category] : []);
28547
+ setFieldValue(path + ".categoryOptions", categoryOption ? [categoryOption] : []);
28548
+ } else {
28549
+ setFieldValue(path + ".categories[1]", val.value);
28550
+ setFieldValue(path + ".categoryOptions[1]", val);
28551
+ }
28469
28552
  };
28553
+ var categoryError = _.get(errors, path + ".categories");
28470
28554
  return React__default.createElement(material.Stack, {
28471
28555
  direction: "row",
28472
28556
  alignItems: "center",
@@ -28518,7 +28602,7 @@ var ArticleBlock = function ArticleBlock(_ref) {
28518
28602
  }, t("category")), React__default.createElement(formik.Field, {
28519
28603
  name: path + ".categories[0]",
28520
28604
  render: function render() {
28521
- var _data$categoryOptions;
28605
+ var _data$categoryOptions2;
28522
28606
  return React__default.createElement(ArticleCategorySelector, {
28523
28607
  style: {
28524
28608
  "div:has(&)": {
@@ -28526,7 +28610,7 @@ var ArticleBlock = function ArticleBlock(_ref) {
28526
28610
  }
28527
28611
  },
28528
28612
  id: "category",
28529
- optionValue: (_data$categoryOptions = data.categoryOptions) === null || _data$categoryOptions === void 0 ? void 0 : _data$categoryOptions[0],
28613
+ optionValue: (_data$categoryOptions2 = data.categoryOptions) === null || _data$categoryOptions2 === void 0 ? void 0 : _data$categoryOptions2[0],
28530
28614
  options: categories,
28531
28615
  rest: {
28532
28616
  isLoading: optionKey === path + ".categories[0]" ? isLoadingCategories : false,
@@ -28538,7 +28622,13 @@ var ArticleBlock = function ArticleBlock(_ref) {
28538
28622
  placeholder: t("select_category")
28539
28623
  });
28540
28624
  }
28541
- }))), React__default.createElement(material.Grid, {
28625
+ }), !!categoryError && React__default.createElement(material.Typography, {
28626
+ fontWeight: 500,
28627
+ fontSize: "10px",
28628
+ lineHeight: "11.93px",
28629
+ mt: 1,
28630
+ color: !categoryError ? "#97A1AF" : "#F34B4B"
28631
+ }, categoryError))), React__default.createElement(material.Grid, {
28542
28632
  item: true,
28543
28633
  xs: 12 / 5
28544
28634
  }, React__default.createElement(material.FormGroup, {
@@ -28555,7 +28645,7 @@ var ArticleBlock = function ArticleBlock(_ref) {
28555
28645
  }, t("sub_category")), React__default.createElement(formik.Field, {
28556
28646
  name: path + ".categories[1]",
28557
28647
  render: function render() {
28558
- var _data$categoryOptions2;
28648
+ var _data$categoryOptions3;
28559
28649
  return React__default.createElement(ArticleCategorySelector, {
28560
28650
  style: {
28561
28651
  "div:has(&)": {
@@ -28563,7 +28653,7 @@ var ArticleBlock = function ArticleBlock(_ref) {
28563
28653
  }
28564
28654
  },
28565
28655
  id: "sub_category",
28566
- optionValue: (_data$categoryOptions2 = data.categoryOptions) === null || _data$categoryOptions2 === void 0 ? void 0 : _data$categoryOptions2[1],
28656
+ optionValue: (_data$categoryOptions3 = data.categoryOptions) === null || _data$categoryOptions3 === void 0 ? void 0 : _data$categoryOptions3[1],
28567
28657
  options: categories,
28568
28658
  rest: {
28569
28659
  isClearable: true,
@@ -28668,7 +28758,9 @@ var isEqual = function isEqual(prev, next) {
28668
28758
  var nextIsLoadingCategories = isNextMatched ? next.isLoadingCategories : undefined;
28669
28759
  var prevCategories = isPrevMatched ? prev.categories : undefined;
28670
28760
  var nextCategories = isNextMatched ? next.categories : undefined;
28671
- return prevOptionKey === nextOptionKey && prevIsLoadingCategories === nextIsLoadingCategories && JSON.stringify(prev.data) === JSON.stringify(next.data) && JSON.stringify(prevCategories) === JSON.stringify(nextCategories) && prev.path === next.path && prev.expandedIndex == next.expandedIndex && prev.disabled === next.disabled && prev.onOpenCategoryMenu == next.onOpenCategoryMenu && prev.onOpenSubCategoryMenu == next.onOpenSubCategoryMenu;
28761
+ var prevCategoryError = _.get(prev.errors, prev.path + ".categories");
28762
+ var nextCategoryError = _.get(next.errors, next.path + ".categories");
28763
+ return prevOptionKey === nextOptionKey && prevIsLoadingCategories === nextIsLoadingCategories && JSON.stringify(prev.data) === JSON.stringify(next.data) && JSON.stringify(prevCategories) === JSON.stringify(nextCategories) && prev.path === next.path && prev.expandedIndex == next.expandedIndex && prev.disabled === next.disabled && prev.onOpenCategoryMenu == next.onOpenCategoryMenu && prev.onOpenSubCategoryMenu == next.onOpenSubCategoryMenu && prevCategoryError === nextCategoryError;
28672
28764
  };
28673
28765
  var ArticleBlock$1 = React.memo(ArticleBlock, isEqual);
28674
28766
 
@@ -28954,10 +29046,10 @@ var isEqual$1 = function isEqual(prev, next) {
28954
29046
  };
28955
29047
  var QuestionBlock$1 = React.memo(QuestionBlock, isEqual$1);
28956
29048
 
28957
- var _excluded$g = ["data", "path", "isMath", "open", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "categories", "questionTypes", "disabled", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
28958
- var _ = _$5;
29049
+ var _excluded$g = ["data", "path", "isMath", "open", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "categories", "questionTypes", "disabled", "onQuestioStartOrderChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
29050
+ var _$1 = _$6;
28959
29051
  var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
28960
- var _data$articles$3, _data$articles$3$cate, _data$articles$4, _data$articles$4$cate;
29052
+ var _data$articles$3, _data$articles$3$cate, _data$articles$4, _data$articles$4$cate, _questions$2;
28961
29053
  var data = _ref.data,
28962
29054
  path = _ref.path,
28963
29055
  isMath = _ref.isMath,
@@ -28968,6 +29060,7 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
28968
29060
  categories = _ref.categories,
28969
29061
  questionTypes = _ref.questionTypes,
28970
29062
  disabled = _ref.disabled,
29063
+ onQuestioStartOrderChange = _ref.onQuestioStartOrderChange,
28971
29064
  onDelete = _ref.onDelete,
28972
29065
  onOpenSubCategoryMenu = _ref.onOpenSubCategoryMenu,
28973
29066
  onOpenCategoryMenu = _ref.onOpenCategoryMenu,
@@ -28976,14 +29069,30 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
28976
29069
  onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
28977
29070
  formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$g);
28978
29071
  var errors = formikProps.errors;
28979
- var theme = material.useTheme();
29072
+ var startOrderRef = React.useRef(null);
28980
29073
  var articles = data.articles,
28981
29074
  questions = data.questions;
28982
- var blockErrors = _.get(errors, path);
29075
+ var blockErrors = _$1.get(errors, path);
28983
29076
  var handleOpenQuestionTypeMenu = React.useCallback(function (key) {
28984
29077
  var _data$articles$, _data$articles$$categ, _data$articles$2, _data$articles$2$cate;
28985
29078
  onOpenQuestionTypeMenu(key, (_data$articles$ = data.articles[0]) === null || _data$articles$ === void 0 ? void 0 : (_data$articles$$categ = _data$articles$.categories) === null || _data$articles$$categ === void 0 ? void 0 : _data$articles$$categ[0], (_data$articles$2 = data.articles[0]) === null || _data$articles$2 === void 0 ? void 0 : (_data$articles$2$cate = _data$articles$2.categories) === null || _data$articles$2$cate === void 0 ? void 0 : _data$articles$2$cate[1]);
28986
29079
  }, [(_data$articles$3 = data.articles[0]) === null || _data$articles$3 === void 0 ? void 0 : (_data$articles$3$cate = _data$articles$3.categories) === null || _data$articles$3$cate === void 0 ? void 0 : _data$articles$3$cate[0], (_data$articles$4 = data.articles[0]) === null || _data$articles$4 === void 0 ? void 0 : (_data$articles$4$cate = _data$articles$4.categories) === null || _data$articles$4$cate === void 0 ? void 0 : _data$articles$4$cate[1]]);
29080
+ var debounceQuestionStartOrderChange = _$1.debounce(onQuestioStartOrderChange, 300);
29081
+ var handleChangeStartQuestionOrder = function handleChangeStartQuestionOrder(e) {
29082
+ var value = e.target.value.replace(/\D/g, '');
29083
+ var order = +value;
29084
+ if (Number.isNaN(order) || order === 0) {
29085
+ order = 1;
29086
+ if (order === 0 && startOrderRef.current) {
29087
+ startOrderRef.current.value = "1";
29088
+ }
29089
+ }
29090
+ debounceQuestionStartOrderChange(order - 1);
29091
+ };
29092
+ React.useEffect(function () {
29093
+ var _questions$;
29094
+ if (startOrderRef.current) startOrderRef.current.value = "" + ((((_questions$ = questions[0]) === null || _questions$ === void 0 ? void 0 : _questions$.questionOrder) || 0) + 1);
29095
+ }, [(_questions$2 = questions[0]) === null || _questions$2 === void 0 ? void 0 : _questions$2.questionOrder]);
28987
29096
  return React__default.createElement(formik.FieldArray, {
28988
29097
  name: path + ".articles",
28989
29098
  render: function render(arrayHelpers) {
@@ -28997,7 +29106,7 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
28997
29106
  gap: 2
28998
29107
  }, !isMath && React__default.createElement(material.Stack, {
28999
29108
  sx: {
29000
- border: "1.5px solid " + (blockErrors ? open ? error.main : error.light : open ? theme.palette.secondary.main : theme.palette.secondary.light),
29109
+ border: (open ? "3px" : "1.5px") + " solid " + (blockErrors ? open ? error.main : error.light : "#a3a3a4"),
29001
29110
  borderRadius: 2
29002
29111
  },
29003
29112
  gap: 1,
@@ -29035,7 +29144,20 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
29035
29144
  }, i18n.t("article")))), React__default.createElement(material.Stack, {
29036
29145
  gap: 1,
29037
29146
  direction: "column"
29038
- }, React__default.createElement(ListView, {
29147
+ }, React__default.createElement(material.Box, null, React__default.createElement(material.FormControl, {
29148
+ sx: {
29149
+ display: "flex",
29150
+ flexDirection: "row",
29151
+ alignItems: "center",
29152
+ gap: 1
29153
+ }
29154
+ }, React__default.createElement(material.FormLabel, null, i18n.t("start_order")), React__default.createElement(material.TextField, {
29155
+ inputRef: startOrderRef,
29156
+ onChange: handleChangeStartQuestionOrder,
29157
+ type: "number",
29158
+ size: "small",
29159
+ disabled: disabled
29160
+ }))), React__default.createElement(ListView, {
29039
29161
  data: questions,
29040
29162
  render: function render(question, index) {
29041
29163
  return React__default.createElement(QuestionBlock$1, Object.assign({
@@ -29061,8 +29183,8 @@ var isEqual$2 = function isEqual(prev, next) {
29061
29183
  var isNextMatched = next.optionKey.startsWith(next.path);
29062
29184
  var prevOptionKey = isPrevMatched ? prev.optionKey : undefined;
29063
29185
  var nextOptionKey = isNextMatched ? next.optionKey : undefined;
29064
- var prevBlockErrors = _.get(prev.errors, prev.path);
29065
- var nextBlockErrors = _.get(next.errors, next.path);
29186
+ var prevBlockErrors = _$1.get(prev.errors, prev.path);
29187
+ var nextBlockErrors = _$1.get(next.errors, next.path);
29066
29188
  var prevIsLoadingCategories = isPrevMatched ? prev.isLoadingCategories : undefined;
29067
29189
  var nextIsLoadingCategories = isNextMatched ? next.isLoadingCategories : undefined;
29068
29190
  var prevCategories = isPrevMatched ? prev.categories : undefined;
@@ -29082,9 +29204,9 @@ var isEqual$2 = function isEqual(prev, next) {
29082
29204
  var QuestionGroupBlockBody$1 = React.memo(QuestionGroupBlockBody, isEqual$2);
29083
29205
 
29084
29206
  var _excluded$h = ["expandedIndex", "open", "paths", "path", "isMath", "data", "categories", "isLoadingCategories", "isLoadingQuestionTypes", "questionTypes", "optionKey", "disabled", "onToggle", "onQuestionCountChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
29085
- var _$1 = _$5;
29207
+ var _$2 = _$6;
29086
29208
  var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
29087
- var _data$articles$2, _data$articles$2$cate, _data$articles$2$cate2, _data$articles$3, _data$articles$3$cate, _data$articles$3$cate2;
29209
+ var _data$articles$3, _data$articles$3$cate, _data$articles$3$cate2, _data$articles$4, _data$articles$4$cate, _data$articles$4$cate2;
29088
29210
  var expandedIndex = _ref.expandedIndex,
29089
29211
  open = _ref.open,
29090
29212
  paths = _ref.paths,
@@ -29129,6 +29251,16 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
29129
29251
  setFieldValue(path + ".questionCount", questionCount);
29130
29252
  onQuestionCountChange(questionCount, expandedIndex);
29131
29253
  };
29254
+ var handleChangeStartQuestionOrder = function handleChangeStartQuestionOrder(order) {
29255
+ var _questions$;
29256
+ var questions = data.questions;
29257
+ if (((_questions$ = questions[0]) === null || _questions$ === void 0 ? void 0 : _questions$.questionOrder) === order) return;
29258
+ setFieldValue(path + ".questions", questions.map(function (q, index) {
29259
+ return _extends({}, q, {
29260
+ questionOrder: order + index
29261
+ });
29262
+ }));
29263
+ };
29132
29264
  var handleChangeAnswerCount = function handleChangeAnswerCount(val) {
29133
29265
  var answerCount = (val === null || val === void 0 ? void 0 : val.value) || 1;
29134
29266
  setFieldValue(path + ".answerCount", answerCount);
@@ -29172,16 +29304,24 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
29172
29304
  }
29173
29305
  };
29174
29306
  var handleChangeCategory = function handleChangeCategory(val) {
29175
- setFieldValue(path + ".articles[0].categoryOptions", [val]);
29176
- setFieldValue(path + ".articles[0].categories", [val === null || val === void 0 ? void 0 : val.value]);
29307
+ setFieldValue(path + ".articles[0].categoryOptions", val !== null && val !== void 0 && val.value ? [val] : []);
29308
+ setFieldValue(path + ".articles[0].categories", val !== null && val !== void 0 && val.value ? [val.value] : []);
29177
29309
  };
29178
29310
  var handleChangeSubCategory = function handleChangeSubCategory(val) {
29179
- setFieldValue(path + ".articles[0].categories[1]", val === null || val === void 0 ? void 0 : val.value);
29180
- setFieldValue(path + ".articles[0].categoryOptions[1]", val);
29311
+ if (!(val !== null && val !== void 0 && val.value)) {
29312
+ var _data$articles, _data$articles$2, _data$articles$2$cate, _data$articles2, _data$articles2$, _data$articles2$$cate;
29313
+ var category = data === null || data === void 0 ? void 0 : (_data$articles = data.articles) === null || _data$articles === void 0 ? void 0 : (_data$articles$2 = _data$articles[0]) === null || _data$articles$2 === void 0 ? void 0 : (_data$articles$2$cate = _data$articles$2.categories) === null || _data$articles$2$cate === void 0 ? void 0 : _data$articles$2$cate[0];
29314
+ var categoryOption = data === null || data === void 0 ? void 0 : (_data$articles2 = data.articles) === null || _data$articles2 === void 0 ? void 0 : (_data$articles2$ = _data$articles2[0]) === null || _data$articles2$ === void 0 ? void 0 : (_data$articles2$$cate = _data$articles2$.categoryOptions) === null || _data$articles2$$cate === void 0 ? void 0 : _data$articles2$$cate[0];
29315
+ setFieldValue(path + ".articles[0].categories", category ? [category] : []);
29316
+ setFieldValue(path + ".articles[0].categoryOptions", categoryOption ? [categoryOption] : []);
29317
+ } else {
29318
+ setFieldValue(path + ".articles[0].categories[1]", val.value);
29319
+ setFieldValue(path + ".articles[0].categoryOptions[1]", val);
29320
+ }
29181
29321
  };
29182
29322
  var summary = open ? "" : [t("number_questions", {
29183
29323
  n: data.questionCount
29184
- }), (_data$articles$2 = data.articles[0]) === null || _data$articles$2 === void 0 ? void 0 : (_data$articles$2$cate = _data$articles$2.categoryOptions) === null || _data$articles$2$cate === void 0 ? void 0 : (_data$articles$2$cate2 = _data$articles$2$cate[0]) === null || _data$articles$2$cate2 === void 0 ? void 0 : _data$articles$2$cate2.label, (_data$articles$3 = data.articles[0]) === null || _data$articles$3 === void 0 ? void 0 : (_data$articles$3$cate = _data$articles$3.categoryOptions) === null || _data$articles$3$cate === void 0 ? void 0 : (_data$articles$3$cate2 = _data$articles$3$cate[1]) === null || _data$articles$3$cate2 === void 0 ? void 0 : _data$articles$3$cate2.label, isMath ? data.questions.map(function (i) {
29324
+ }), (_data$articles$3 = data.articles[0]) === null || _data$articles$3 === void 0 ? void 0 : (_data$articles$3$cate = _data$articles$3.categoryOptions) === null || _data$articles$3$cate === void 0 ? void 0 : (_data$articles$3$cate2 = _data$articles$3$cate[0]) === null || _data$articles$3$cate2 === void 0 ? void 0 : _data$articles$3$cate2.label, (_data$articles$4 = data.articles[0]) === null || _data$articles$4 === void 0 ? void 0 : (_data$articles$4$cate = _data$articles$4.categoryOptions) === null || _data$articles$4$cate === void 0 ? void 0 : (_data$articles$4$cate2 = _data$articles$4$cate[1]) === null || _data$articles$4$cate2 === void 0 ? void 0 : _data$articles$4$cate2.label, isMath ? data.questions.map(function (i) {
29185
29325
  var _i$questionType;
29186
29326
  return ((_i$questionType = i.questionType) === null || _i$questionType === void 0 ? void 0 : _i$questionType.label) || i.questionTypeName;
29187
29327
  }).filter(function (i) {
@@ -29189,12 +29329,15 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
29189
29329
  }).join(",") : ""].filter(function (i) {
29190
29330
  return !!i;
29191
29331
  }).join(" / ");
29192
- var blockErrors = _$1.get(errors, path);
29332
+ var pageFromError = _$2.get(errors, path + ".pageFrom");
29333
+ var pageToError = _$2.get(errors, path + ".pageTo");
29334
+ var categoryError = _$2.get(errors, path + ".articles[0].categories");
29335
+ var blockErrors = _$2.get(errors, path);
29193
29336
  return React__default.createElement(material.Accordion, {
29194
29337
  expanded: open,
29195
29338
  onChange: handleToggle,
29196
29339
  sx: {
29197
- border: "1.5px solid " + (blockErrors ? open ? error.main : error.light : open ? colors.yellow[900] : colors.yellow[500])
29340
+ border: (open ? "5px" : "1.5px") + " solid " + (blockErrors ? open ? error.main : error.light : open ? colors.yellow[900] : colors.yellow[500])
29198
29341
  }
29199
29342
  }, React__default.createElement(material.AccordionSummary, {
29200
29343
  expandIcon: React__default.createElement(md.MdExpandMore, {
@@ -29228,24 +29371,28 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
29228
29371
  whiteSpace: "nowrap"
29229
29372
  }, title, !open && ":")), React__default.createElement(material.Box, {
29230
29373
  sx: {
29231
- flexGrow: 1
29374
+ flexGrow: 1,
29375
+ cursor: "default"
29376
+ },
29377
+ onClick: function onClick(e) {
29378
+ open && e.stopPropagation();
29232
29379
  }
29233
29380
  }, open ? React__default.createElement(material.Stack, {
29234
- direction: "row",
29235
- flexWrap: "nowrap",
29381
+ direction: "column",
29236
29382
  gap: 2
29383
+ }, React__default.createElement(material.Stack, {
29384
+ direction: "row",
29385
+ flexWrap: "nowrap"
29237
29386
  }, React__default.createElement(material.Grid, {
29238
29387
  container: true,
29239
29388
  flexGrow: 1,
29240
- direction: "row",
29241
- flexWrap: "nowrap",
29242
- gap: 2
29389
+ direction: "row"
29243
29390
  }, React__default.createElement(material.Grid, {
29244
29391
  item: true,
29245
29392
  xs: 3
29246
29393
  }, React__default.createElement(material.FormGroup, {
29247
- onClick: function onClick(e) {
29248
- open && e.stopPropagation();
29394
+ sx: {
29395
+ marginRight: 2
29249
29396
  }
29250
29397
  }, React__default.createElement(material.FormLabel, {
29251
29398
  htmlFor: "question_count",
@@ -29267,10 +29414,8 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
29267
29414
  maxWidth: "100%",
29268
29415
  "& div": {
29269
29416
  maxWidth: "100%"
29270
- }
29271
- },
29272
- onClick: function onClick(e) {
29273
- open && e.stopPropagation();
29417
+ },
29418
+ marginRight: 2
29274
29419
  }
29275
29420
  }, React__default.createElement(material.FormLabel, {
29276
29421
  htmlFor: "category",
@@ -29298,7 +29443,13 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
29298
29443
  placeholder: t("select_category")
29299
29444
  });
29300
29445
  }
29301
- }))), isMath && React__default.createElement(material.Grid, {
29446
+ }), !!categoryError && React__default.createElement(material.Typography, {
29447
+ fontWeight: 500,
29448
+ fontSize: "10px",
29449
+ lineHeight: "11.93px",
29450
+ mt: 1,
29451
+ color: !categoryError ? "#97A1AF" : "#F34B4B"
29452
+ }, categoryError))), isMath && React__default.createElement(material.Grid, {
29302
29453
  item: true,
29303
29454
  xs: 3
29304
29455
  }, React__default.createElement(material.FormGroup, {
@@ -29306,10 +29457,8 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
29306
29457
  maxWidth: "100%",
29307
29458
  "& div": {
29308
29459
  maxWidth: "100%"
29309
- }
29310
- },
29311
- onClick: function onClick(e) {
29312
- open && e.stopPropagation();
29460
+ },
29461
+ marginRight: 2
29313
29462
  }
29314
29463
  }, React__default.createElement(material.FormLabel, {
29315
29464
  htmlFor: "category",
@@ -29317,7 +29466,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
29317
29466
  }, t("sub_category")), React__default.createElement(formik.Field, {
29318
29467
  name: path + ".articles[0].categoryOptions[1]",
29319
29468
  render: function render(_ref4) {
29320
- var _data$articles$4, _data$articles$4$cate;
29469
+ var _data$articles$5, _data$articles$5$cate;
29321
29470
  var field = _ref4.field;
29322
29471
  return React__default.createElement(ArticleCategorySelector, {
29323
29472
  style: {
@@ -29335,7 +29484,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
29335
29484
  onMenuClose: onCloseCategoryMenu
29336
29485
  },
29337
29486
  onChange: handleChangeSubCategory,
29338
- isDisabled: disabled || !((_data$articles$4 = data.articles[0]) !== null && _data$articles$4 !== void 0 && (_data$articles$4$cate = _data$articles$4.categories) !== null && _data$articles$4$cate !== void 0 && _data$articles$4$cate[0]),
29487
+ isDisabled: disabled || !((_data$articles$5 = data.articles[0]) !== null && _data$articles$5 !== void 0 && (_data$articles$5$cate = _data$articles$5.categories) !== null && _data$articles$5$cate !== void 0 && _data$articles$5$cate[0]),
29339
29488
  placeholder: t("select_category")
29340
29489
  });
29341
29490
  }
@@ -29345,6 +29494,9 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
29345
29494
  }, React__default.createElement(material.FormGroup, {
29346
29495
  onClick: function onClick(e) {
29347
29496
  open && e.stopPropagation();
29497
+ },
29498
+ sx: {
29499
+ marginRight: 2
29348
29500
  }
29349
29501
  }, React__default.createElement(material.FormLabel, {
29350
29502
  htmlFor: "question_count",
@@ -29358,12 +29510,67 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
29358
29510
  isDisabled: disabled
29359
29511
  }));
29360
29512
  }
29361
- })))), isMath && React__default.createElement(material.Box, {
29513
+ }))), !isMath && React__default.createElement(material.Grid, {
29514
+ item: true,
29515
+ xs: 3
29516
+ }, React__default.createElement(material.FormGroup, {
29517
+ sx: {
29518
+ marginRight: 2
29519
+ }
29520
+ }, React__default.createElement(material.FormLabel, {
29521
+ htmlFor: "question_count",
29522
+ className: "form-label"
29523
+ }, t("page_from")), React__default.createElement(formik.Field, {
29524
+ name: path + ".pageFrom",
29525
+ render: function render(_ref6) {
29526
+ var field = _ref6.field;
29527
+ return React__default.createElement(material.TextField, Object.assign({
29528
+ placeholder: t("page_from"),
29529
+ type: "number"
29530
+ }, field, {
29531
+ size: "small",
29532
+ onKeyDown: handleKeyDown,
29533
+ disabled: disabled
29534
+ }));
29535
+ }
29536
+ }), !!pageFromError && React__default.createElement(material.Typography, {
29537
+ fontWeight: 500,
29538
+ fontSize: "10px",
29539
+ lineHeight: "11.93px",
29540
+ mt: 1,
29541
+ color: !pageFromError ? "#97A1AF" : "#F34B4B"
29542
+ }, pageFromError))), !isMath && React__default.createElement(material.Grid, {
29543
+ item: true,
29544
+ xs: 3
29545
+ }, React__default.createElement(material.FormGroup, {
29546
+ sx: {
29547
+ marginRight: 2
29548
+ }
29549
+ }, React__default.createElement(material.FormLabel, {
29550
+ htmlFor: "question_count",
29551
+ className: "form-label"
29552
+ }, t("page_to")), React__default.createElement(formik.Field, {
29553
+ name: path + ".pageTo",
29554
+ render: function render(_ref7) {
29555
+ var field = _ref7.field;
29556
+ return React__default.createElement(material.TextField, Object.assign({
29557
+ placeholder: t("page_to"),
29558
+ type: "number"
29559
+ }, field, {
29560
+ size: "small",
29561
+ onKeyDown: handleKeyDown,
29562
+ disabled: disabled
29563
+ }));
29564
+ }
29565
+ }), !!pageToError && React__default.createElement(material.Typography, {
29566
+ fontWeight: 500,
29567
+ fontSize: "10px",
29568
+ lineHeight: "11.93px",
29569
+ mt: 1,
29570
+ color: !pageToError ? "#97A1AF" : "#F34B4B"
29571
+ }, pageToError)))), isMath && React__default.createElement(material.Box, {
29362
29572
  sx: {
29363
29573
  display: "flex"
29364
- },
29365
- onClick: function onClick(e) {
29366
- open && e.stopPropagation();
29367
29574
  }
29368
29575
  }, React__default.createElement(material.Button, {
29369
29576
  variant: "contained",
@@ -29373,7 +29580,84 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
29373
29580
  sx: {
29374
29581
  whiteSpace: "nowrap"
29375
29582
  }
29376
- }, t("category_copy")))) : React__default.createElement(material.Typography, {
29583
+ }, t("category_copy")))), isMath && React__default.createElement(material.Stack, {
29584
+ direction: "row",
29585
+ flexWrap: "nowrap"
29586
+ }, React__default.createElement(material.Grid, {
29587
+ container: true,
29588
+ flexGrow: 1,
29589
+ direction: "row"
29590
+ }, React__default.createElement(material.Grid, {
29591
+ item: true,
29592
+ xs: 3
29593
+ }, React__default.createElement(material.FormGroup, {
29594
+ sx: {
29595
+ marginRight: 2
29596
+ }
29597
+ }, React__default.createElement(material.FormLabel, {
29598
+ htmlFor: "question_count",
29599
+ className: "form-label"
29600
+ }, t("page_from")), React__default.createElement(formik.Field, {
29601
+ name: path + ".pageFrom",
29602
+ render: function render(_ref8) {
29603
+ var field = _ref8.field;
29604
+ return React__default.createElement(material.TextField, Object.assign({
29605
+ placeholder: t("page_from"),
29606
+ type: "number"
29607
+ }, field, {
29608
+ size: "small",
29609
+ onKeyDown: handleKeyDown,
29610
+ disabled: disabled
29611
+ }));
29612
+ }
29613
+ }), !!pageFromError && React__default.createElement(material.Typography, {
29614
+ fontWeight: 500,
29615
+ fontSize: "10px",
29616
+ lineHeight: "11.93px",
29617
+ mt: 1,
29618
+ color: !pageFromError ? "#97A1AF" : "#F34B4B"
29619
+ }, pageFromError))), React__default.createElement(material.Grid, {
29620
+ item: true,
29621
+ xs: 3
29622
+ }, React__default.createElement(material.FormGroup, {
29623
+ sx: {
29624
+ marginRight: 2
29625
+ }
29626
+ }, React__default.createElement(material.FormLabel, {
29627
+ htmlFor: "question_count",
29628
+ className: "form-label"
29629
+ }, t("page_to")), React__default.createElement(formik.Field, {
29630
+ name: path + ".pageTo",
29631
+ render: function render(_ref9) {
29632
+ var field = _ref9.field;
29633
+ return React__default.createElement(material.TextField, Object.assign({
29634
+ placeholder: t("page_to"),
29635
+ type: "number"
29636
+ }, field, {
29637
+ size: "small",
29638
+ onKeyDown: handleKeyDown,
29639
+ disabled: disabled
29640
+ }));
29641
+ }
29642
+ }), !!pageToError && React__default.createElement(material.Typography, {
29643
+ fontWeight: 500,
29644
+ fontSize: "10px",
29645
+ lineHeight: "11.93px",
29646
+ mt: 1,
29647
+ color: !pageToError ? "#97A1AF" : "#F34B4B"
29648
+ }, pageToError)))), React__default.createElement(material.Box, {
29649
+ sx: {
29650
+ display: "flex",
29651
+ visibility: "hidden"
29652
+ }
29653
+ }, React__default.createElement(material.Button, {
29654
+ variant: "contained",
29655
+ color: "success",
29656
+ disabled: true,
29657
+ sx: {
29658
+ whiteSpace: "nowrap"
29659
+ }
29660
+ }, t("category_copy"))))) : React__default.createElement(material.Typography, {
29377
29661
  fontWeight: 600,
29378
29662
  sx: {
29379
29663
  overflow: "hidden",
@@ -29395,6 +29679,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
29395
29679
  isLoadingQuestionTypes: isLoadingQuestionTypes,
29396
29680
  optionKey: optionKey,
29397
29681
  disabled: disabled,
29682
+ onQuestioStartOrderChange: handleChangeStartQuestionOrder,
29398
29683
  onDelete: onDelete,
29399
29684
  onOpenSubCategoryMenu: onOpenSubCategoryMenu,
29400
29685
  onOpenCategoryMenu: onOpenCategoryMenu,
@@ -29461,6 +29746,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
29461
29746
  var questions = currentQuestionGroup.questions;
29462
29747
  var lastOrder = questions[questions.length - 1].questionOrder;
29463
29748
  var newQuestionGroups = questionGroups;
29749
+ var isSequential = isSequentialQuestionGroups(questionGroups);
29464
29750
  if (questions.length < questionCount) {
29465
29751
  var additionalQuestions = Array.from({
29466
29752
  length: questionCount - questions.length
@@ -29473,7 +29759,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
29473
29759
  newQuestionGroups = [].concat(prevQuestionGroups, [_extends({}, currentQuestionGroup, {
29474
29760
  questionCount: questionCount,
29475
29761
  questions: [].concat(currentQuestionGroup.questions, additionalQuestions)
29476
- })], nextQuestionGroups.map(function (i) {
29762
+ })], isSequential ? nextQuestionGroups.map(function (i) {
29477
29763
  return _extends({}, i, {
29478
29764
  questions: i.questions.map(function (q) {
29479
29765
  return _extends({}, q, {
@@ -29481,14 +29767,14 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
29481
29767
  });
29482
29768
  })
29483
29769
  });
29484
- }));
29770
+ }) : nextQuestionGroups);
29485
29771
  setFieldValue(path + ".questionGroups", newQuestionGroups);
29486
29772
  } else {
29487
29773
  var remainQuestions = questions.slice(0, questionCount);
29488
29774
  newQuestionGroups = [].concat(prevQuestionGroups, [_extends({}, currentQuestionGroup, {
29489
29775
  questionCount: questionCount,
29490
29776
  questions: [].concat(remainQuestions)
29491
- })], nextQuestionGroups.map(function (i) {
29777
+ })], isSequential ? nextQuestionGroups.map(function (i) {
29492
29778
  return _extends({}, i, {
29493
29779
  questions: i.questions.map(function (q) {
29494
29780
  return _extends({}, q, {
@@ -29496,7 +29782,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
29496
29782
  });
29497
29783
  })
29498
29784
  });
29499
- }));
29785
+ }) : nextQuestionGroups);
29500
29786
  }
29501
29787
  setFieldValue(path + ".questionGroups", newQuestionGroups);
29502
29788
  };
@@ -29603,7 +29889,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
29603
29889
  };
29604
29890
 
29605
29891
  var _excluded$j = ["data", "expandedIndex", "open", "path", "paths", "isMath", "isLoadingCategories", "isLoadingQuestionTypes", "categories", "questionTypes", "optionKey", "disabled", "onToggle", "onDelete", "onCopiedPrevQuestionGroup", "onCloseCategoryMenu", "onOpenCategoryMenu", "onOpenSubCategoryMenu", "onOpenQuestionTypeMenu", "onCloseQuestionTypeMenu"];
29606
- var _$2 = _$5;
29892
+ var _$3 = _$6;
29607
29893
  var ChapterBlock = function ChapterBlock(_ref) {
29608
29894
  var data = _ref.data,
29609
29895
  expandedIndex = _ref.expandedIndex,
@@ -29643,10 +29929,10 @@ var ChapterBlock = function ChapterBlock(_ref) {
29643
29929
  chapter: title
29644
29930
  }), title, path.replace(/\[(\d+)\]$/, ""), expandedIndex);
29645
29931
  };
29646
- var pageNameError = _$2.get(errors, path + ".name");
29647
- var pageFromError = _$2.get(errors, path + ".pageFrom");
29648
- var pageToError = _$2.get(errors, path + ".pageTo");
29649
- var blockErrors = _$2.get(errors, path);
29932
+ var pageNameError = _$3.get(errors, path + ".name");
29933
+ var pageFromError = _$3.get(errors, path + ".pageFrom");
29934
+ var pageToError = _$3.get(errors, path + ".pageTo");
29935
+ var blockErrors = _$3.get(errors, path);
29650
29936
  return React__default.createElement(material.Accordion, {
29651
29937
  expanded: open,
29652
29938
  onChange: handleToggle,
@@ -29930,7 +30216,9 @@ var CATEGORY_URL$1 = BASE_URL + "/api/examcategory";
29930
30216
  var getCategoryListAdminApi$1 = function getCategoryListAdminApi(data) {
29931
30217
  try {
29932
30218
  return Promise.resolve(api.get("" + ADMIN_CATEGORY_URL$1, {
29933
- params: data
30219
+ params: _extends({}, data, {
30220
+ sortColumnName: "name"
30221
+ })
29934
30222
  }));
29935
30223
  } catch (e) {
29936
30224
  return Promise.reject(e);
@@ -29939,7 +30227,9 @@ var getCategoryListAdminApi$1 = function getCategoryListAdminApi(data) {
29939
30227
  var getCategoryListApi$1 = function getCategoryListApi(data) {
29940
30228
  try {
29941
30229
  return Promise.resolve(api.get("" + CATEGORY_URL$1, {
29942
- params: data
30230
+ params: _extends({}, data, {
30231
+ sortColumnName: "name"
30232
+ })
29943
30233
  }));
29944
30234
  } catch (e) {
29945
30235
  return Promise.reject(e);
@@ -29948,7 +30238,9 @@ var getCategoryListApi$1 = function getCategoryListApi(data) {
29948
30238
  var getCategoryQuestionTypeListApi = function getCategoryQuestionTypeListApi(isSuper, data) {
29949
30239
  try {
29950
30240
  return Promise.resolve(api.get((isSuper ? ADMIN_CATEGORY_URL$1 : CATEGORY_URL$1) + "/question-types", {
29951
- params: data
30241
+ params: _extends({}, data, {
30242
+ sortColumnName: "name"
30243
+ })
29952
30244
  }));
29953
30245
  } catch (e) {
29954
30246
  return Promise.reject(e);
@@ -29988,7 +30280,7 @@ var useTextbookOptions = function useTextbookOptions(subjectId, isMath, filter,
29988
30280
  return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : (_state$common2$user = _state$common2.user) === null || _state$common2$user === void 0 ? void 0 : _state$common2$user.academyDomain;
29989
30281
  });
29990
30282
  var getOptionFilter = function getOptionFilter() {
29991
- var cloneFilter = _$5.clone(filter);
30283
+ var cloneFilter = _$6.clone(filter);
29992
30284
  for (var key in cloneFilter) {
29993
30285
  if (Object.prototype.hasOwnProperty.call(cloneFilter, key)) {
29994
30286
  var element = cloneFilter[key];
@@ -30138,12 +30430,12 @@ var useTextbookOptions = function useTextbookOptions(subjectId, isMath, filter,
30138
30430
  };
30139
30431
  };
30140
30432
 
30141
- var _$3 = _$5;
30433
+ var _$4 = _$6;
30142
30434
  var TextbookContentsTab = function TextbookContentsTab(props) {
30143
30435
  var disabled = props.disabled,
30144
30436
  values = props.values,
30145
30437
  setFieldValue = props.setFieldValue;
30146
- var isMath = values.type === TextbookEditorType.Math;
30438
+ var isMath = values.type === exports.TextbookEditorType.Math;
30147
30439
  var _useTranslation = reactI18next.useTranslation(),
30148
30440
  t = _useTranslation.t;
30149
30441
  var _useState = React.useState(""),
@@ -30181,7 +30473,7 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
30181
30473
  };
30182
30474
  var handleConfirmDeleteBlock = function handleConfirmDeleteBlock() {
30183
30475
  if (!(openConfirmDelete !== null && openConfirmDelete !== void 0 && openConfirmDelete.path)) return;
30184
- var items = _$3.get(values, openConfirmDelete.path, []);
30476
+ var items = _$4.get(values, openConfirmDelete.path, []);
30185
30477
  setFieldValue(openConfirmDelete.path, items.filter(function (_, i) {
30186
30478
  return i !== openConfirmDelete.itemIndex;
30187
30479
  }));
@@ -30221,12 +30513,12 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
30221
30513
  if (!newParts.length) return;
30222
30514
  if (newParts.length < parts.length) {
30223
30515
  var _$get, _$get2, _$get3;
30224
- var subChapters = (_$get = _$3.get(values, newPath + ".subChapters")) != null ? _$get : [];
30516
+ var subChapters = (_$get = _$4.get(values, newPath + ".subChapters")) != null ? _$get : [];
30225
30517
  var questionGroups = [];
30226
- if (!subChapters.length) questionGroups = (_$get2 = _$3.get(values, newPath + ".questionGroups")) != null ? _$get2 : [];else questionGroups = (_$get3 = _$3.get(values, newPath + ".subChapters[" + (subChapters.length - 1) + "].questionGroups")) != null ? _$get3 : [];
30227
- return _$3.last(questionGroups);
30518
+ if (!subChapters.length) questionGroups = (_$get2 = _$4.get(values, newPath + ".questionGroups")) != null ? _$get2 : [];else questionGroups = (_$get3 = _$4.get(values, newPath + ".subChapters[" + (subChapters.length - 1) + "].questionGroups")) != null ? _$get3 : [];
30519
+ return _$4.last(questionGroups);
30228
30520
  }
30229
- return _$3.get(values, newPath);
30521
+ return _$4.get(values, newPath);
30230
30522
  };
30231
30523
  var handleOpenSubCategoryMenu = React.useCallback(function (key, categoryId) {
30232
30524
  setOptionKey(key);
@@ -30718,7 +31010,7 @@ var useSelect = function useSelect(_ref) {
30718
31010
  setLoading = _useState2[1];
30719
31011
  React.useEffect(function () {
30720
31012
  if (!email || !academy) return;
30721
- var fetchData = _$5.debounce(function () {
31013
+ var fetchData = _$6.debounce(function () {
30722
31014
  try {
30723
31015
  var _temp2 = function _temp2() {
30724
31016
  setLoading(false);
@@ -30832,7 +31124,7 @@ var OwnerSelector = function OwnerSelector(_ref) {
30832
31124
  }, errors === null || errors === void 0 ? void 0 : errors.textbookOwners[index].courseId)));
30833
31125
  };
30834
31126
 
30835
- var _$4 = _$5;
31127
+ var _$5 = _$6;
30836
31128
  var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
30837
31129
  var errors = _ref.errors,
30838
31130
  values = _ref.values,
@@ -30905,12 +31197,12 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
30905
31197
  disabled: disabled || !!val.academyId && val.academyId !== (academy === null || academy === void 0 ? void 0 : academy.id)
30906
31198
  }));
30907
31199
  }
30908
- }), _$4.get(errors, "textbookOwners[" + index + "].email") && React__default.createElement(material.Typography, {
31200
+ }), _$5.get(errors, "textbookOwners[" + index + "].email") && React__default.createElement(material.Typography, {
30909
31201
  fontWeight: 500,
30910
31202
  fontSize: "10px",
30911
31203
  lineHeight: "11.93px",
30912
31204
  color: "#F34B4B"
30913
- }, _$4.get(errors, "textbookOwners[" + index + "].email"))), !!(values !== null && values !== void 0 && (_values$textbookOwner = values.textbookOwners) !== null && _values$textbookOwner !== void 0 && _values$textbookOwner[index].email) && React__default.createElement(OwnerSelector, {
31205
+ }, _$5.get(errors, "textbookOwners[" + index + "].email"))), !!(values !== null && values !== void 0 && (_values$textbookOwner = values.textbookOwners) !== null && _values$textbookOwner !== void 0 && _values$textbookOwner[index].email) && React__default.createElement(OwnerSelector, {
30914
31206
  values: values,
30915
31207
  errors: errors,
30916
31208
  index: index,
@@ -30982,7 +31274,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
30982
31274
  };
30983
31275
  }, [dirty, i18n.t]);
30984
31276
  var handleChangeTextbookType = function handleChangeTextbookType() {
30985
- var isMath = values.type === TextbookEditorType.Math ? TextbookEditorType.Korea : TextbookEditorType.Math;
31277
+ var isMath = values.type === exports.TextbookEditorType.Math ? exports.TextbookEditorType.Korea : exports.TextbookEditorType.Math;
30986
31278
  var newValues = _reduceToMathArticles(values, isMath);
30987
31279
  setValues(newValues);
30988
31280
  };
@@ -31052,23 +31344,35 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
31052
31344
  color: !(errors !== null && errors !== void 0 && errors.subjectId) ? "#97A1AF" : "#F34B4B"
31053
31345
  }, errors === null || errors === void 0 ? void 0 : errors.subjectId)), React__default.createElement(material.Stack, {
31054
31346
  flexDirection: "column",
31055
- justifyContent: "center",
31056
31347
  gap: 1
31057
31348
  }, React__default.createElement("label", {
31349
+ htmlFor: "hidden",
31350
+ style: {
31351
+ visibility: "hidden"
31352
+ }
31353
+ }, "hidden"), React__default.createElement(material.Stack, {
31354
+ flexDirection: "row",
31355
+ justifyContent: "center",
31356
+ alignItems: "center",
31357
+ gap: 1
31358
+ }, React__default.createElement(material.FormLabel, {
31058
31359
  htmlFor: "type",
31059
31360
  className: "text-center"
31060
- }, i18n.t(values.type !== 2 ? "korea" : "math")), React__default.createElement(formik.Field, {
31361
+ }, i18n.t("korea")), React__default.createElement(formik.Field, {
31061
31362
  name: "type",
31062
31363
  render: function render(_ref4) {
31063
31364
  var field = _ref4.field;
31064
31365
  return React__default.createElement(material.Switch, Object.assign({}, field, {
31065
31366
  color: "success",
31066
31367
  disabled: !!textbookId || disabled,
31067
- checked: values.type === 2,
31368
+ checked: values.type === exports.TextbookEditorType.Math,
31068
31369
  onChange: handleChangeTextbookType
31069
31370
  }));
31070
31371
  }
31071
- }))), React__default.createElement(material.Box, null, React__default.createElement(material.Button, {
31372
+ }), React__default.createElement(material.FormLabel, {
31373
+ htmlFor: "type",
31374
+ className: "text-center"
31375
+ }, i18n.t("math"))))), React__default.createElement(material.Box, null, React__default.createElement(material.Button, {
31072
31376
  type: "submit",
31073
31377
  sx: {
31074
31378
  width: "fit-content"
@@ -31076,7 +31380,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
31076
31380
  variant: "contained",
31077
31381
  disabled: disabled,
31078
31382
  onClick: function onClick() {
31079
- if (!_$5.isEmpty(errors)) {
31383
+ if (!_$6.isEmpty(errors)) {
31080
31384
  reactToastify.toast.error(i18n.t("please_fill_in_the_blank_fields"));
31081
31385
  }
31082
31386
  },
@@ -31843,7 +32147,7 @@ var usePreparedExam = function usePreparedExam(_ref) {
31843
32147
  return Promise.reject(e);
31844
32148
  }
31845
32149
  };
31846
- var debounceSearch = _$5.debounce(function () {
32150
+ var debounceSearch = _$6.debounce(function () {
31847
32151
  setTextbookFilter(_extends({}, textbookFilter, {
31848
32152
  currentPage: 1
31849
32153
  }));
@@ -32169,20 +32473,41 @@ var useTextbookDrawer = function useTextbookDrawer(_ref) {
32169
32473
  var arrOptions = [];
32170
32474
  var obj = {};
32171
32475
  textbook === null || textbook === void 0 ? void 0 : textbook.chapters.map(function (chapter) {
32476
+ var _chapter$subChapters, _chapter$questionGrou;
32172
32477
  arrOptions.push({
32173
32478
  label: t("page_number", {
32174
32479
  number: chapter.pageFrom
32175
32480
  }),
32176
32481
  value: chapter.pageFrom
32177
32482
  });
32178
- if (chapter.subChapters) {
32483
+ if ((_chapter$subChapters = chapter.subChapters) !== null && _chapter$subChapters !== void 0 && _chapter$subChapters.length) {
32179
32484
  chapter.subChapters.map(function (subChapter) {
32485
+ var _subChapter$questionG;
32180
32486
  arrOptions.push({
32181
32487
  label: t("page_number", {
32182
32488
  number: subChapter.pageFrom
32183
32489
  }),
32184
32490
  value: subChapter.pageFrom
32185
32491
  });
32492
+ if ((_subChapter$questionG = subChapter.questionGroups) !== null && _subChapter$questionG !== void 0 && _subChapter$questionG.length) {
32493
+ subChapter.questionGroups.map(function (questionGroup) {
32494
+ questionGroup.pageFrom && arrOptions.push({
32495
+ label: t("page_number", {
32496
+ number: questionGroup.pageFrom
32497
+ }),
32498
+ value: questionGroup.pageFrom
32499
+ });
32500
+ });
32501
+ }
32502
+ });
32503
+ } else if ((_chapter$questionGrou = chapter.questionGroups) !== null && _chapter$questionGrou !== void 0 && _chapter$questionGrou.length) {
32504
+ chapter.questionGroups.map(function (questionGroup) {
32505
+ questionGroup.pageFrom && arrOptions.push({
32506
+ label: t("page_number", {
32507
+ number: questionGroup.pageFrom
32508
+ }),
32509
+ value: questionGroup.pageFrom
32510
+ });
32186
32511
  });
32187
32512
  }
32188
32513
  });
@@ -32865,7 +33190,7 @@ var TextbookDrawer = function TextbookDrawer(_ref) {
32865
33190
  }), React__default.createElement(material.Stack, {
32866
33191
  sx: {
32867
33192
  position: "absolute",
32868
- left: textbook !== null && textbook !== void 0 && textbook.progress && (textbook === null || textbook === void 0 ? void 0 : textbook.progress) > 7 ? (textbook === null || textbook === void 0 ? void 0 : textbook.progress) - 8 + "%" : ((textbook === null || textbook === void 0 ? void 0 : textbook.progress) || 0) + 3 + "%",
33193
+ left: "max(" + (textbook !== null && textbook !== void 0 && textbook.progress && (textbook === null || textbook === void 0 ? void 0 : textbook.progress) > 7 ? (textbook === null || textbook === void 0 ? void 0 : textbook.progress) - 8 + "%" : ((textbook === null || textbook === void 0 ? void 0 : textbook.progress) || 0) + 3 + "%") + ", 16px)",
32869
33194
  height: "100%",
32870
33195
  justifyContent: "center"
32871
33196
  }
@@ -33552,7 +33877,7 @@ var PreparedItem = function PreparedItem(_ref) {
33552
33877
  });
33553
33878
  return React__default.createElement(formik.Form, {
33554
33879
  style: {
33555
- height: !_$5.isEmpty(values) && !textbookList.length ? "100%" : "unset"
33880
+ height: !_$6.isEmpty(values) && !textbookList.length ? "100%" : "unset"
33556
33881
  }
33557
33882
  }, React__default.createElement(material.Stack, null, React__default.createElement(material.Accordion, {
33558
33883
  sx: {
@@ -33958,7 +34283,7 @@ var PreparedItem = function PreparedItem(_ref) {
33958
34283
  open: openConfirmDialog,
33959
34284
  onClose: handleCloseConfirmDialog,
33960
34285
  onSubmit: handleResetFilter
33961
- }), !_$5.isEmpty(values) && !textbookList.length && React__default.createElement(material.Stack, {
34286
+ }), !_$6.isEmpty(values) && !textbookList.length && React__default.createElement(material.Stack, {
33962
34287
  height: 1,
33963
34288
  justifyContent: "center",
33964
34289
  alignItems: "center"