touchstudy-core 0.1.187 → 0.1.188

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.
@@ -13,12 +13,20 @@ export { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
13
13
  import { DemoContainer } from '@mui/x-date-pickers/internals/demo';
14
14
  export { DemoContainer } from '@mui/x-date-pickers/internals/demo';
15
15
  import React__default, { useState, useEffect, Fragment as Fragment$1, useRef, useCallback, useMemo, memo, createElement } from 'react';
16
- import { useTheme, Container, Typography, Stack, List, ListItem, FormGroup, FormControlLabel, Checkbox, Button, Box, Dialog, DialogTitle, IconButton, DialogContent, TextField, DialogActions, useMediaQuery, styled, FormLabel, Pagination, Paper, InputBase, Tooltip, tooltipClasses, Grid, ClickAwayListener, CircularProgress, FormControl, RadioGroup, Radio, Accordion, AccordionSummary, AccordionDetails, InputAdornment, Card as Card$1, Avatar, Table, TableHead, TableRow, TableCell, TableBody, Divider, Skeleton, Tabs, Tab, Drawer, TableContainer, tableCellClasses, Popover, Switch, InputLabel, Chip, ListItemButton, ListItemAvatar, ListItemText, Badge, CardMedia as CardMedia$1, MenuList } from '@mui/material';
16
+ import { useTheme, Container, Typography, Stack, List, ListItem, FormGroup, FormControlLabel, Checkbox, Button, Box, Dialog, DialogTitle, IconButton, useMediaQuery, DialogContent, TextField, DialogActions, styled, FormLabel, Pagination, Paper, InputBase, Tooltip, tooltipClasses, Grid, ClickAwayListener, CircularProgress, FormControl, RadioGroup, Radio, Accordion, AccordionSummary, AccordionDetails, InputAdornment, Card as Card$1, Avatar, Table, TableHead, TableRow, TableCell, TableBody, Divider, Skeleton, Tabs, Tab, Drawer, TableContainer, tableCellClasses, Popover, Switch, InputLabel, Chip, ListItemButton, ListItemAvatar, ListItemText, Badge, CardMedia as CardMedia$1, MenuList } from '@mui/material';
17
17
  import moment from 'moment';
18
18
  export { default as moment } from 'moment';
19
19
  import { FaSave, FaCaretDown, FaTimes, FaTrash, FaSortUp, FaSortDown, FaPlusCircle, FaEye, FaPlus, FaCalendar, FaUser, FaBookOpen, FaUpload, FaCheckCircle, FaShare, FaExchangeAlt, FaPencilAlt, FaBell } from 'react-icons/fa';
20
20
  import { IoMdArrowBack, IoIosAdd, IoMdSync, IoIosAlert, IoIosArrowDown, IoIosSearch, IoIosArrowUp, IoMdAdd } from 'react-icons/io';
21
21
  import { IoClose, IoSearch, IoCloseOutline, IoTime, IoChatbubbleEllipsesSharp, IoPrint, IoChevronDown, IoCheckmarkCircle, IoChevronUpOutline, IoChevronDownOutline, IoReceiptSharp, IoBook, IoWarning, IoCalendarClear, IoPerson, IoInformationCircle, IoTrash, IoAddCircle, IoCheckmark, IoCloseCircle, IoLogOut } from 'react-icons/io5';
22
+ import _$a from 'lodash';
23
+ import { useSelector, useDispatch } from 'react-redux';
24
+ import axios from 'axios';
25
+ import { useGoogleLogout, GoogleLogin } from '@leecheuk/react-google-login';
26
+ import 'moment/locale/ko.js';
27
+ import 'moment/locale/en-au.js';
28
+ import { CellMeasurerCache, CellMeasurer, AutoSizer, List as List$1, MultiGrid } from 'react-virtualized';
29
+ export { CellMeasurerCache, MultiGrid } from 'react-virtualized';
22
30
  import MButton from '@mui/material/Button';
23
31
  import DialogTitle$1 from '@mui/material/DialogTitle';
24
32
  import DialogContent$1 from '@mui/material/DialogContent';
@@ -28,14 +36,6 @@ import Typography$1 from '@mui/material/Typography';
28
36
  import { Formik, Form, Field, FieldArray } from 'formik';
29
37
  import Select, { components } from 'react-select';
30
38
  import CreatableSelect from 'react-select/creatable';
31
- import _$a from 'lodash';
32
- import { useSelector, useDispatch } from 'react-redux';
33
- import axios from 'axios';
34
- import { useGoogleLogout, GoogleLogin } from '@leecheuk/react-google-login';
35
- import 'moment/locale/ko.js';
36
- import 'moment/locale/en-au.js';
37
- import { CellMeasurerCache, CellMeasurer, AutoSizer, List as List$1, MultiGrid } from 'react-virtualized';
38
- export { CellMeasurerCache, MultiGrid } from 'react-virtualized';
39
39
  import tinymce from 'tinymce';
40
40
  import '@wiris/mathtype-tinymce6';
41
41
  import { Editor } from '@tinymce/tinymce-react';
@@ -5916,402 +5916,6 @@ var ConfirmDeleteDialogDefaultProps = {
5916
5916
  isDelete: true
5917
5917
  };
5918
5918
 
5919
- var ConfirmDialog = function ConfirmDialog(_ref) {
5920
- var open = _ref.open,
5921
- text = _ref.text,
5922
- cancelText = _ref.cancelText,
5923
- okText = _ref.okText,
5924
- isDelete = _ref.isDelete,
5925
- title = _ref.title,
5926
- confirmText = _ref.confirmText,
5927
- titleStyle = _ref.titleStyle,
5928
- titleClassName = _ref.titleClassName,
5929
- contentStyle = _ref.contentStyle,
5930
- cancelButtonStyle = _ref.cancelButtonStyle,
5931
- contentTextStyle = _ref.contentTextStyle,
5932
- okButtonStyle = _ref.okButtonStyle,
5933
- actionStyle = _ref.actionStyle,
5934
- _ref$okButtonVariant = _ref.okButtonVariant,
5935
- okButtonVariant = _ref$okButtonVariant === void 0 ? "contained" : _ref$okButtonVariant,
5936
- _ref$cancelButtonVari = _ref.cancelButtonVariant,
5937
- cancelButtonVariant = _ref$cancelButtonVari === void 0 ? "contained" : _ref$cancelButtonVari,
5938
- _ref$zIndex = _ref.zIndex,
5939
- zIndex = _ref$zIndex === void 0 ? 1102 : _ref$zIndex,
5940
- toggle = _ref.toggle,
5941
- onConfirm = _ref.onConfirm;
5942
- var _useState = useState(),
5943
- confirmTextValue = _useState[0],
5944
- setConfirmTextValue = _useState[1];
5945
- var _useTranslation = useTranslation(),
5946
- t = _useTranslation.t;
5947
- var handleConfirm = function handleConfirm() {
5948
- onConfirm();
5949
- };
5950
- var handleChangeConfirmText = function handleChangeConfirmText(e) {
5951
- setConfirmTextValue(e.target.value);
5952
- };
5953
- var handlePaste = function handlePaste(_) {};
5954
- useEffect(function () {
5955
- !open && setConfirmTextValue(undefined);
5956
- }, [open]);
5957
- var isValid = !!confirmText && !!confirmTextValue && confirmTextValue.trim() === confirmText.trim();
5958
- var isDisableDelete = !!confirmText && (confirmTextValue === null || confirmTextValue === void 0 ? void 0 : confirmTextValue.trim()) !== confirmText.trim();
5959
- return React__default.createElement(Dialog, {
5960
- open: open,
5961
- onClose: toggle,
5962
- sx: {
5963
- zIndex: zIndex
5964
- }
5965
- }, React__default.createElement(Fragment$1, null, React__default.createElement(DialogTitle, {
5966
- className: "border border-start-0 border-end-0 border-top-0 border-1 " + titleClassName,
5967
- sx: _extends({
5968
- fontSize: 16
5969
- }, titleStyle)
5970
- }, title || t('confirmation')), React__default.createElement(IconButton, {
5971
- "aria-label": "close",
5972
- onClick: toggle,
5973
- sx: {
5974
- position: "absolute",
5975
- right: 8,
5976
- top: 8,
5977
- color: function color(theme) {
5978
- return theme.palette.grey[500];
5979
- }
5980
- }
5981
- }, React__default.createElement(IoClose, null))), React__default.createElement(DialogContent, {
5982
- sx: _extends({
5983
- pt: 0.5
5984
- }, contentStyle)
5985
- }, React__default.createElement(Typography, {
5986
- className: "mb-1",
5987
- sx: _extends({
5988
- fontWeight: 700
5989
- }, contentTextStyle)
5990
- }, text), !!confirmText && React__default.createElement("div", {
5991
- className: "w-100"
5992
- }, React__default.createElement("p", {
5993
- className: "mb-3"
5994
- }, t("enter_text_to_confirm_delete", {
5995
- text: confirmText
5996
- })), React__default.createElement(TextField, {
5997
- className: "w-100",
5998
- sx: {
5999
- "& input": {
6000
- py: 1
6001
- }
6002
- },
6003
- value: confirmTextValue,
6004
- onChange: handleChangeConfirmText,
6005
- placeholder: t('please_enter'),
6006
- onPaste: handlePaste,
6007
- error: !isValid && confirmTextValue !== undefined,
6008
- color: isValid ? "success" : confirmTextValue !== undefined ? "error" : undefined
6009
- }))), React__default.createElement(DialogActions, {
6010
- className: "border border-start-0 border-end-0 border-bottom-0 border-1 " + titleClassName,
6011
- sx: _extends({
6012
- paddingTop: 1
6013
- }, actionStyle)
6014
- }, React__default.createElement(Button, {
6015
- variant: cancelButtonVariant,
6016
- color: cancelButtonVariant !== "contained" ? "primary" : "secondary",
6017
- className: "px-3 " + (cancelButtonVariant !== "contained" ? "primary" : "bg-secondary"),
6018
- onClick: toggle,
6019
- sx: cancelButtonStyle
6020
- }, cancelText || t("no")), React__default.createElement(Button, {
6021
- variant: okButtonVariant,
6022
- color: isDelete ? "error" : "primary",
6023
- className: "px-3",
6024
- disabled: isDisableDelete,
6025
- onClick: handleConfirm,
6026
- sx: _extends({}, okButtonStyle, isDelete && {
6027
- backgroundColor: "#db4d4d",
6028
- color: "#FFFFFF",
6029
- "&:hover": {
6030
- backgroundColor: "#C41414"
6031
- }
6032
- })
6033
- }, okText || t('yes'))));
6034
- };
6035
-
6036
- var ConfirmDeleteDialog = function ConfirmDeleteDialog(props) {
6037
- return React__default.createElement(ConfirmDialog, Object.assign({}, ConfirmDeleteDialogDefaultProps, props));
6038
- };
6039
-
6040
- var iconCloseDialog = function iconCloseDialog(_ref) {
6041
- var _ref$width = _ref.width,
6042
- width = _ref$width === void 0 ? "24" : _ref$width,
6043
- _ref$height = _ref.height,
6044
- height = _ref$height === void 0 ? "25" : _ref$height,
6045
- color = _ref.color;
6046
- return React__default.createElement("svg", {
6047
- width: width,
6048
- height: height,
6049
- viewBox: "0 0 24 25",
6050
- fill: color,
6051
- xmlns: "http://www.w3.org/2000/svg"
6052
- }, React__default.createElement("path", {
6053
- d: "M13.5909 12.5L18.0441 8.04687C18.2554 7.8359 18.3743 7.54962 18.3745 7.25099C18.3748 6.95237 18.2564 6.66587 18.0455 6.45453C17.8345 6.24319 17.5482 6.12431 17.2496 6.12404C16.951 6.12378 16.6645 6.24215 16.4531 6.45312L12 10.9062L7.54687 6.45312C7.33553 6.24178 7.04888 6.12305 6.75 6.12305C6.45111 6.12305 6.16447 6.24178 5.95312 6.45312C5.74178 6.66447 5.62305 6.95111 5.62305 7.25C5.62305 7.54888 5.74178 7.83553 5.95312 8.04687L10.4062 12.5L5.95312 16.9531C5.74178 17.1645 5.62305 17.4511 5.62305 17.75C5.62305 18.0489 5.74178 18.3355 5.95312 18.5469C6.16447 18.7582 6.45111 18.8769 6.75 18.8769C7.04888 18.8769 7.33553 18.7582 7.54687 18.5469L12 14.0937L16.4531 18.5469C16.6645 18.7582 16.9511 18.8769 17.25 18.8769C17.5489 18.8769 17.8355 18.7582 18.0469 18.5469C18.2582 18.3355 18.3769 18.0489 18.3769 17.75C18.3769 17.4511 18.2582 17.1645 18.0469 16.9531L13.5909 12.5Z",
6054
- fill: "#202B37"
6055
- }));
6056
- };
6057
-
6058
- var iconWarning = function iconWarning(_ref) {
6059
- var _ref$width = _ref.width,
6060
- width = _ref$width === void 0 ? "17" : _ref$width,
6061
- _ref$height = _ref.height,
6062
- height = _ref$height === void 0 ? "16" : _ref$height,
6063
- color = _ref.color;
6064
- return React__default.createElement("svg", {
6065
- width: width,
6066
- height: height,
6067
- viewBox: "0 0 17 16",
6068
- fill: color,
6069
- xmlns: "http://www.w3.org/2000/svg"
6070
- }, React__default.createElement("path", {
6071
- d: "M14.5335 12.4712L9.20754 2.58062C8.83004 1.87937 7.82441 1.87937 7.4466 2.58062L2.12097 12.4712C2.03901 12.6235 1.99792 12.7944 2.00171 12.9672C2.00549 13.1401 2.05404 13.309 2.14259 13.4575C2.23115 13.606 2.3567 13.729 2.50698 13.8145C2.65726 13.9 2.82714 13.9451 3.00004 13.9453H13.6529C13.8259 13.9453 13.996 13.9005 14.1465 13.8151C14.2969 13.7297 14.4227 13.6067 14.5115 13.4582C14.6002 13.3096 14.6489 13.1406 14.6527 12.9676C14.6566 12.7946 14.6155 12.6236 14.5335 12.4712ZM8.32722 12.4141C8.20361 12.4141 8.08277 12.3774 7.97999 12.3087C7.87721 12.2401 7.7971 12.1424 7.7498 12.0282C7.7025 11.914 7.69012 11.7884 7.71423 11.6671C7.73835 11.5459 7.79787 11.4345 7.88528 11.3471C7.97269 11.2597 8.08405 11.2002 8.20529 11.1761C8.32653 11.152 8.4522 11.1643 8.5664 11.2116C8.6806 11.2589 8.77822 11.3391 8.84689 11.4418C8.91557 11.5446 8.95222 11.6654 8.95222 11.7891C8.95222 11.8711 8.93606 11.9524 8.90465 12.0282C8.87324 12.1041 8.8272 12.173 8.76917 12.231C8.71113 12.289 8.64223 12.3351 8.5664 12.3665C8.49057 12.3979 8.4093 12.4141 8.32722 12.4141ZM9.00597 6.12813L8.8266 9.94063C8.8266 10.0732 8.77392 10.2004 8.68015 10.2942C8.58638 10.3879 8.45921 10.4406 8.3266 10.4406C8.19399 10.4406 8.06681 10.3879 7.97305 10.2942C7.87928 10.2004 7.8266 10.0732 7.8266 9.94063L7.64722 6.12969C7.64319 6.03862 7.65754 5.94768 7.6894 5.86227C7.72127 5.77687 7.77 5.69875 7.8327 5.63259C7.8954 5.56642 7.97078 5.51355 8.05434 5.47713C8.13791 5.44072 8.22795 5.4215 8.3191 5.42063H8.32566C8.41743 5.42058 8.50826 5.43912 8.59267 5.47515C8.67708 5.51117 8.75331 5.56392 8.81677 5.63021C8.88023 5.6965 8.92961 5.77497 8.96191 5.86087C8.99421 5.94676 9.00878 6.03832 9.00472 6.13L9.00597 6.12813Z",
6072
- fill: "#DB4D4D"
6073
- }));
6074
- };
6075
-
6076
- var styles$1 = {"lighter":"#F0FFF6","light":"#89F0B2","less_dark":"#3DC674","dark":"#349056","darker":"#18442A","gray_50":"#FBFBF9","gray_100":"#EAEAE5","gray_300":"#D0D0C8","gray_500":"#9A9A98","gray_700":"#5D5D5B","gray_900":"#363634","red_900":"#DB4D4D","green_support_900":"#3ACB46","yellow_900":"#FEAF06","purple_900":"#C3099A","titleBox":"_2mYOt","title":"_1H9qR","point":"_2rTfh","buttonGroup":"_W5dic","btnFeedback":"_FmMYN","btnTerminate":"_3kv6J","myanswer":"_1jZV7","titleMyAnswer1":"_1aYD1","titleMyAnswer2":"_2Oc4x","contentMyAnswer":"__LRYW","myAnswerItem":"_1U-Kx","time":"_2PXiz","timeCol":"_1zcfJ","answer-response":"_18ZNf","answer-response-0":"_3nbRi","answer-response-1":"_3NEHk","answer-response-2":"_Et0ih","answer-response-3":"_5Vc3v","answer-response-4":"_2SMBR","overall-response-1":"_1ImE5","overall-response-2":"_1oVKC","overall-response-3":"_2wXCw","answerCorrect":"_gE8qM","answerIncorrect":"_3kRqE","answerNograss":"_22Pi3","answerEasy":"_1C7aw","answerDiscrimination":"__YGYX","answerTrap":"_3AkGb","answerNoTime":"_3l-yC","questionOrder":"_2mK7U","myTimeLabel":"_3ZOZs","myPoolTime":"_1Gajr","topTimeLabel":"_62PzE","topTime":"_3HUx1","meanTimeLabel":"_Yu8Oq","meanTime":"_18kZu","compareChart":"_2MTOH","prevChart":"_JoHQL","chart":"_29iCQ","nextChart":"_3hjxI","titleChart":"_2Z42z","titleCompareGrass":"_34RN_","tableCompareGrass":"_2lzlQ","thcolumn1":"_2MSIH","tdcolumn1":"_1I06v","tdcolumn3":"_VpMQ5","classification":"_3t41M","wrapperProblem":"_2vh8v","titleProblem":"_3YfGm","titleProblemClose":"_34388","titleTrickyProblem":"_INxbh","wrongQuestions":"_35DcB","question":"_10SAW","assignedQuestions":"_oEGQ_","wrapperContent":"_zhZ1O","content":"_NGHD4","contentColumn1":"_v5SKe","span1":"_28SHT","span2":"_1raLd","contentColumn2":"_-xJ34","duration":"_1YGAg","topDuration":"_3DiyY","overallCorrectRate":"_DnkyV","answer":"_29MTE","contentVulnerable":"_3x1PG","wrappContentProblem":"_2saM2","contentProblem":"_1hTJx","labelProblem":"_3BXO9","name":"_1cUZW","percent":"_3CLEc","slider":"_3LCEY","track":"_3I8mi","noData":"_1oZ-s","loading":"_Nm201","table-responsive":"_3zQL-","form-label":"_3Vpmh","form-control":"_DafKE","form-label-dialog":"_3NjaH","btn-cancel":"_sLxwL","btn-register":"_4ZKQY","pdfBtnBox":"_2zUJf","pdfBtn":"_y_Cr7","form-select":"_HCIxD","loader":"_3aDIU","dot":"_JGCIL","bounce":"_3M62i"};
6077
-
6078
- var DropdownIndicator = function DropdownIndicator(props) {
6079
- return React__default.createElement(components.DropdownIndicator, Object.assign({}, props), React__default.createElement(FaCaretDown, {
6080
- size: 20,
6081
- color: styles.darker
6082
- }));
6083
- };
6084
- var CustomOption = function CustomOption(props) {
6085
- return React__default.createElement(components.Option, Object.assign({}, props), React__default.createElement("div", {
6086
- style: {
6087
- fontSize: "14px",
6088
- fontWeight: 500
6089
- }
6090
- }, props.data.label));
6091
- };
6092
-
6093
- var customStyles = {
6094
- control: function control(baseStyles, state) {
6095
- return _extends({}, baseStyles, {
6096
- fontSize: "14px",
6097
- fontWeight: 700,
6098
- color: styles.darker,
6099
- borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark,
6100
- boxShadow: state.isFocused ? "0 0 0 1px " + styles.dark + "4D" : baseStyles.boxShadow,
6101
- "&:active": {
6102
- borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark
6103
- },
6104
- "&:hover": {
6105
- borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark
6106
- }
6107
- });
6108
- },
6109
- input: function input(baseStyles, _) {
6110
- return _extends({}, baseStyles, {
6111
- fontSize: "14px",
6112
- fontWeight: 700,
6113
- color: styles.darker
6114
- });
6115
- },
6116
- placeholder: function placeholder(baseStyles, _) {
6117
- return _extends({}, baseStyles, {
6118
- whiteSpace: "nowrap"
6119
- });
6120
- },
6121
- singleValue: function singleValue(baseStyles) {
6122
- return _extends({}, baseStyles, {
6123
- fontSize: "14px",
6124
- fontWeight: 700,
6125
- color: styles.darker
6126
- });
6127
- },
6128
- option: function option(baseStyles, state) {
6129
- return _extends({}, baseStyles, {
6130
- zIndex: 999,
6131
- backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.light : 'white',
6132
- "&:active": {
6133
- backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.less_dark : baseStyles.backgroundColor
6134
- }
6135
- });
6136
- },
6137
- menuPortal: function menuPortal(base) {
6138
- return _extends({}, base, {
6139
- zIndex: 99
6140
- });
6141
- }
6142
- };
6143
-
6144
- var _excluded = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
6145
- var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
6146
- var _value$;
6147
- var isDefault = _ref.isDefault,
6148
- options = _ref.options,
6149
- isDisabled = _ref.isDisabled,
6150
- scrollBottom = _ref.scrollBottom,
6151
- value = _ref.value,
6152
- isMulti = _ref.isMulti,
6153
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
6154
- var isOptionValue = (value === null || value === void 0 ? void 0 : value.value) || (value === null || value === void 0 ? void 0 : (_value$ = value[0]) === null || _value$ === void 0 ? void 0 : _value$.value);
6155
- var initialValues = isOptionValue ? value : Array.isArray(value) ? options.filter(function (i) {
6156
- return value.includes(i.value);
6157
- }) : isMulti ? options.filter(function (i) {
6158
- return i.value == value;
6159
- }) : options.find(function (i) {
6160
- return i.value == value;
6161
- });
6162
- var _useTranslation = useTranslation(),
6163
- t = _useTranslation.t;
6164
- return React__default.createElement(Select, Object.assign({
6165
- isDisabled: isDisabled,
6166
- options: options,
6167
- value: !isDefault ? initialValues : undefined,
6168
- defaultValue: isDefault ? initialValues : undefined,
6169
- menuPlacement: scrollBottom ? "top" : "auto",
6170
- isMulti: isMulti,
6171
- components: {
6172
- IndicatorSeparator: function IndicatorSeparator() {
6173
- return null;
6174
- },
6175
- DropdownIndicator: DropdownIndicator,
6176
- Option: CustomOption
6177
- },
6178
- styles: customStyles,
6179
- placeholder: t("select_placeholder")
6180
- }, rest));
6181
- };
6182
-
6183
- var _excluded$1 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
6184
- var CustomCreatable = function CustomCreatable(_ref) {
6185
- var options = _ref.options,
6186
- isDisabled = _ref.isDisabled,
6187
- scrollBottom = _ref.scrollBottom,
6188
- value = _ref.value,
6189
- isMulti = _ref.isMulti,
6190
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
6191
- var initialValues = Array.isArray(value) ? options.filter(function (i) {
6192
- return value.includes(i.value);
6193
- }) : isMulti ? options.filter(function (i) {
6194
- return i.value == value;
6195
- }) : options.find(function (i) {
6196
- return i.value == value;
6197
- });
6198
- var _useTranslation = useTranslation(),
6199
- t = _useTranslation.t;
6200
- return React__default.createElement(CreatableSelect, Object.assign({
6201
- isClearable: true,
6202
- isDisabled: isDisabled,
6203
- options: options,
6204
- value: initialValues,
6205
- menuPlacement: scrollBottom ? "top" : "auto",
6206
- isMulti: isMulti,
6207
- components: {
6208
- IndicatorSeparator: function IndicatorSeparator() {
6209
- return null;
6210
- },
6211
- DropdownIndicator: DropdownIndicator,
6212
- Option: CustomOption
6213
- },
6214
- styles: customStyles,
6215
- placeholder: t("select_placeholder")
6216
- }, rest));
6217
- };
6218
-
6219
- var _excluded$2 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti", "optionValue", "styles"];
6220
- var CustomSelect = function CustomSelect(_ref) {
6221
- var isDefault = _ref.isDefault,
6222
- options = _ref.options,
6223
- isDisabled = _ref.isDisabled,
6224
- scrollBottom = _ref.scrollBottom,
6225
- value = _ref.value,
6226
- isMulti = _ref.isMulti,
6227
- optionValue = _ref.optionValue,
6228
- styles = _ref.styles,
6229
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
6230
- var _useTranslation = useTranslation(),
6231
- t = _useTranslation.t;
6232
- var initialValues = optionValue != null ? optionValue : value === undefined || value === null ? null : Array.isArray(value) ? options.filter(function (i) {
6233
- return value.includes(i.value);
6234
- }) : isMulti ? options === null || options === void 0 ? void 0 : options.filter(function (i) {
6235
- return i.value == value;
6236
- }) : options === null || options === void 0 ? void 0 : options.find(function (i) {
6237
- return i.value == value;
6238
- });
6239
- return React__default.createElement(Select, Object.assign({
6240
- isDisabled: isDisabled,
6241
- options: options,
6242
- value: !isDefault ? initialValues != null ? initialValues : null : undefined,
6243
- defaultValue: isDefault ? initialValues : undefined,
6244
- menuPlacement: scrollBottom ? "top" : "auto",
6245
- components: {
6246
- IndicatorSeparator: function IndicatorSeparator() {
6247
- return null;
6248
- },
6249
- DropdownIndicator: DropdownIndicator,
6250
- Option: CustomOption
6251
- },
6252
- styles: _extends({}, customStyles, styles),
6253
- isMulti: isMulti,
6254
- placeholder: t("select_placeholder")
6255
- }, rest));
6256
- };
6257
-
6258
- var _excluded$3 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti", "valueById", "isTextbook"];
6259
- var CustomSelectOption = function CustomSelectOption(_ref) {
6260
- var defaultValue = _ref.defaultValue,
6261
- options = _ref.options,
6262
- isDisabled = _ref.isDisabled,
6263
- scrollBottom = _ref.scrollBottom,
6264
- value = _ref.value,
6265
- isMulti = _ref.isMulti,
6266
- valueById = _ref.valueById,
6267
- isTextbook = _ref.isTextbook,
6268
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
6269
- var _useTranslation = useTranslation(),
6270
- t = _useTranslation.t;
6271
- var initialValues = defaultValue !== null && typeof defaultValue !== "undefined" ? (options === null || options === void 0 ? void 0 : options.find(function (option) {
6272
- return option.value === defaultValue;
6273
- })) || null : null;
6274
- var optionValue = valueById !== null && typeof valueById !== "undefined" ? (options === null || options === void 0 ? void 0 : options.find(function (option) {
6275
- return option.value == valueById;
6276
- })) || {
6277
- label: valueById,
6278
- value: valueById
6279
- } : null;
6280
- return isTextbook ? React__default.createElement(CreatableSelect, Object.assign({
6281
- isDisabled: isDisabled,
6282
- options: options,
6283
- value: optionValue || value,
6284
- defaultValue: initialValues,
6285
- menuPlacement: scrollBottom ? "top" : "auto",
6286
- isMulti: isMulti,
6287
- components: {
6288
- IndicatorSeparator: function IndicatorSeparator() {
6289
- return null;
6290
- },
6291
- DropdownIndicator: DropdownIndicator,
6292
- Option: CustomOption
6293
- },
6294
- styles: customStyles,
6295
- placeholder: t("select_placeholder")
6296
- }, rest)) : React__default.createElement(Select, Object.assign({
6297
- isDisabled: isDisabled,
6298
- options: options,
6299
- value: optionValue || value,
6300
- defaultValue: initialValues,
6301
- menuPlacement: scrollBottom ? "top" : "auto",
6302
- isMulti: isMulti,
6303
- components: {
6304
- IndicatorSeparator: function IndicatorSeparator() {
6305
- return null;
6306
- },
6307
- DropdownIndicator: DropdownIndicator,
6308
- Option: CustomOption
6309
- },
6310
- styles: customStyles,
6311
- placeholder: t("select_placeholder")
6312
- }, rest));
6313
- };
6314
-
6315
5919
  var PreparedType;
6316
5920
  (function (PreparedType) {
6317
5921
  PreparedType[PreparedType["csat_past_questions"] = 1] = "csat_past_questions";
@@ -6774,6 +6378,10 @@ var handleKeyDown = function handleKeyDown(e) {
6774
6378
  e.preventDefault();
6775
6379
  }
6776
6380
  };
6381
+ var getPercentage = function getPercentage(current, max) {
6382
+ if (!max) return 0;
6383
+ return current * 100 / max;
6384
+ };
6777
6385
 
6778
6386
  var isTextType = function isTextType(type) {
6779
6387
  return type === QuestionAnswerType.ShortAnswer || type === QuestionAnswerType.OrderMatters || type === QuestionAnswerType.OrderDoesNotMatters || type === QuestionAnswerType.SynonymProcessing;
@@ -7086,7 +6694,7 @@ var useKeyboardVisible = function useKeyboardVisible() {
7086
6694
  var isTabletUp = useMediaQuery(theme.breakpoints.up('lg'));
7087
6695
  var isFullScreen = !!document.fullscreenElement;
7088
6696
  var pageSxProps = _extends({}, !isTabletUp && isKeyboardVisible && isFullScreen && {
7089
- marginBlock: "3rem 50vh"
6697
+ marginBlock: "3rem 50dvh"
7090
6698
  });
7091
6699
  var handleInputFocus = function handleInputFocus() {
7092
6700
  setIsKeyboardVisible(true);
@@ -7732,6 +7340,412 @@ var OrderBy;
7732
7340
  OrderBy["DESC"] = "DESC";
7733
7341
  })(OrderBy || (OrderBy = {}));
7734
7342
 
7343
+ var ConfirmDialog = function ConfirmDialog(_ref) {
7344
+ var open = _ref.open,
7345
+ text = _ref.text,
7346
+ cancelText = _ref.cancelText,
7347
+ okText = _ref.okText,
7348
+ isDelete = _ref.isDelete,
7349
+ title = _ref.title,
7350
+ confirmText = _ref.confirmText,
7351
+ titleStyle = _ref.titleStyle,
7352
+ titleClassName = _ref.titleClassName,
7353
+ contentStyle = _ref.contentStyle,
7354
+ cancelButtonStyle = _ref.cancelButtonStyle,
7355
+ contentTextStyle = _ref.contentTextStyle,
7356
+ okButtonStyle = _ref.okButtonStyle,
7357
+ actionStyle = _ref.actionStyle,
7358
+ _ref$okButtonVariant = _ref.okButtonVariant,
7359
+ okButtonVariant = _ref$okButtonVariant === void 0 ? "contained" : _ref$okButtonVariant,
7360
+ _ref$cancelButtonVari = _ref.cancelButtonVariant,
7361
+ cancelButtonVariant = _ref$cancelButtonVari === void 0 ? "contained" : _ref$cancelButtonVari,
7362
+ _ref$zIndex = _ref.zIndex,
7363
+ zIndex = _ref$zIndex === void 0 ? 1102 : _ref$zIndex,
7364
+ toggle = _ref.toggle,
7365
+ onConfirm = _ref.onConfirm;
7366
+ var _useState = useState(),
7367
+ confirmTextValue = _useState[0],
7368
+ setConfirmTextValue = _useState[1];
7369
+ var _useTranslation = useTranslation(),
7370
+ t = _useTranslation.t;
7371
+ var _useKeyboardVisible = useKeyboardVisible(),
7372
+ pageSxProps = _useKeyboardVisible.pageSxProps,
7373
+ handleInputFocus = _useKeyboardVisible.handleInputFocus,
7374
+ handleInputBlur = _useKeyboardVisible.handleInputBlur;
7375
+ var handleConfirm = function handleConfirm() {
7376
+ onConfirm();
7377
+ };
7378
+ var handleChangeConfirmText = function handleChangeConfirmText(e) {
7379
+ setConfirmTextValue(e.target.value);
7380
+ };
7381
+ var handlePaste = function handlePaste(_) {};
7382
+ useEffect(function () {
7383
+ !open && setConfirmTextValue(undefined);
7384
+ }, [open]);
7385
+ var isValid = !!confirmText && !!confirmTextValue && confirmTextValue.trim() === confirmText.trim();
7386
+ var isDisableDelete = !!confirmText && (confirmTextValue === null || confirmTextValue === void 0 ? void 0 : confirmTextValue.trim()) !== confirmText.trim();
7387
+ return React__default.createElement(Dialog, {
7388
+ open: open,
7389
+ onClose: toggle,
7390
+ sx: {
7391
+ zIndex: zIndex
7392
+ },
7393
+ scroll: "body",
7394
+ PaperProps: {
7395
+ sx: _extends({}, pageSxProps)
7396
+ }
7397
+ }, React__default.createElement(Fragment$1, null, React__default.createElement(DialogTitle, {
7398
+ className: "border border-start-0 border-end-0 border-top-0 border-1 " + titleClassName,
7399
+ sx: _extends({
7400
+ fontSize: 16
7401
+ }, titleStyle)
7402
+ }, title || t('confirmation')), React__default.createElement(IconButton, {
7403
+ "aria-label": "close",
7404
+ onClick: toggle,
7405
+ sx: {
7406
+ position: "absolute",
7407
+ right: 8,
7408
+ top: 8,
7409
+ color: function color(theme) {
7410
+ return theme.palette.grey[500];
7411
+ }
7412
+ }
7413
+ }, React__default.createElement(IoClose, null))), React__default.createElement(DialogContent, {
7414
+ sx: _extends({
7415
+ pt: 0.5
7416
+ }, contentStyle)
7417
+ }, React__default.createElement(Typography, {
7418
+ className: "mb-1",
7419
+ sx: _extends({
7420
+ fontWeight: 700
7421
+ }, contentTextStyle)
7422
+ }, text), !!confirmText && React__default.createElement("div", {
7423
+ className: "w-100"
7424
+ }, React__default.createElement("p", {
7425
+ className: "mb-3"
7426
+ }, t("enter_text_to_confirm_delete", {
7427
+ text: confirmText
7428
+ })), React__default.createElement(TextField, {
7429
+ className: "w-100",
7430
+ sx: {
7431
+ "& input": {
7432
+ py: 1
7433
+ }
7434
+ },
7435
+ value: confirmTextValue,
7436
+ onChange: handleChangeConfirmText,
7437
+ placeholder: t('please_enter'),
7438
+ onPaste: handlePaste,
7439
+ error: !isValid && confirmTextValue !== undefined,
7440
+ color: isValid ? "success" : confirmTextValue !== undefined ? "error" : undefined,
7441
+ onFocus: handleInputFocus,
7442
+ onBlur: handleInputBlur
7443
+ }))), React__default.createElement(DialogActions, {
7444
+ className: "border border-start-0 border-end-0 border-bottom-0 border-1 " + titleClassName,
7445
+ sx: _extends({
7446
+ paddingTop: 1
7447
+ }, actionStyle)
7448
+ }, React__default.createElement(Button, {
7449
+ variant: cancelButtonVariant,
7450
+ color: cancelButtonVariant !== "contained" ? "primary" : "secondary",
7451
+ className: "px-3 " + (cancelButtonVariant !== "contained" ? "primary" : "bg-secondary"),
7452
+ onClick: toggle,
7453
+ sx: cancelButtonStyle
7454
+ }, cancelText || t("no")), React__default.createElement(Button, {
7455
+ variant: okButtonVariant,
7456
+ color: isDelete ? "error" : "primary",
7457
+ className: "px-3",
7458
+ disabled: isDisableDelete,
7459
+ onClick: handleConfirm,
7460
+ sx: _extends({}, okButtonStyle, isDelete && {
7461
+ backgroundColor: "#db4d4d",
7462
+ color: "#FFFFFF",
7463
+ "&:hover": {
7464
+ backgroundColor: "#C41414"
7465
+ }
7466
+ })
7467
+ }, okText || t('yes'))));
7468
+ };
7469
+
7470
+ var ConfirmDeleteDialog = function ConfirmDeleteDialog(props) {
7471
+ return React__default.createElement(ConfirmDialog, Object.assign({}, ConfirmDeleteDialogDefaultProps, props));
7472
+ };
7473
+
7474
+ var iconCloseDialog = function iconCloseDialog(_ref) {
7475
+ var _ref$width = _ref.width,
7476
+ width = _ref$width === void 0 ? "24" : _ref$width,
7477
+ _ref$height = _ref.height,
7478
+ height = _ref$height === void 0 ? "25" : _ref$height,
7479
+ color = _ref.color;
7480
+ return React__default.createElement("svg", {
7481
+ width: width,
7482
+ height: height,
7483
+ viewBox: "0 0 24 25",
7484
+ fill: color,
7485
+ xmlns: "http://www.w3.org/2000/svg"
7486
+ }, React__default.createElement("path", {
7487
+ d: "M13.5909 12.5L18.0441 8.04687C18.2554 7.8359 18.3743 7.54962 18.3745 7.25099C18.3748 6.95237 18.2564 6.66587 18.0455 6.45453C17.8345 6.24319 17.5482 6.12431 17.2496 6.12404C16.951 6.12378 16.6645 6.24215 16.4531 6.45312L12 10.9062L7.54687 6.45312C7.33553 6.24178 7.04888 6.12305 6.75 6.12305C6.45111 6.12305 6.16447 6.24178 5.95312 6.45312C5.74178 6.66447 5.62305 6.95111 5.62305 7.25C5.62305 7.54888 5.74178 7.83553 5.95312 8.04687L10.4062 12.5L5.95312 16.9531C5.74178 17.1645 5.62305 17.4511 5.62305 17.75C5.62305 18.0489 5.74178 18.3355 5.95312 18.5469C6.16447 18.7582 6.45111 18.8769 6.75 18.8769C7.04888 18.8769 7.33553 18.7582 7.54687 18.5469L12 14.0937L16.4531 18.5469C16.6645 18.7582 16.9511 18.8769 17.25 18.8769C17.5489 18.8769 17.8355 18.7582 18.0469 18.5469C18.2582 18.3355 18.3769 18.0489 18.3769 17.75C18.3769 17.4511 18.2582 17.1645 18.0469 16.9531L13.5909 12.5Z",
7488
+ fill: "#202B37"
7489
+ }));
7490
+ };
7491
+
7492
+ var iconWarning = function iconWarning(_ref) {
7493
+ var _ref$width = _ref.width,
7494
+ width = _ref$width === void 0 ? "17" : _ref$width,
7495
+ _ref$height = _ref.height,
7496
+ height = _ref$height === void 0 ? "16" : _ref$height,
7497
+ color = _ref.color;
7498
+ return React__default.createElement("svg", {
7499
+ width: width,
7500
+ height: height,
7501
+ viewBox: "0 0 17 16",
7502
+ fill: color,
7503
+ xmlns: "http://www.w3.org/2000/svg"
7504
+ }, React__default.createElement("path", {
7505
+ d: "M14.5335 12.4712L9.20754 2.58062C8.83004 1.87937 7.82441 1.87937 7.4466 2.58062L2.12097 12.4712C2.03901 12.6235 1.99792 12.7944 2.00171 12.9672C2.00549 13.1401 2.05404 13.309 2.14259 13.4575C2.23115 13.606 2.3567 13.729 2.50698 13.8145C2.65726 13.9 2.82714 13.9451 3.00004 13.9453H13.6529C13.8259 13.9453 13.996 13.9005 14.1465 13.8151C14.2969 13.7297 14.4227 13.6067 14.5115 13.4582C14.6002 13.3096 14.6489 13.1406 14.6527 12.9676C14.6566 12.7946 14.6155 12.6236 14.5335 12.4712ZM8.32722 12.4141C8.20361 12.4141 8.08277 12.3774 7.97999 12.3087C7.87721 12.2401 7.7971 12.1424 7.7498 12.0282C7.7025 11.914 7.69012 11.7884 7.71423 11.6671C7.73835 11.5459 7.79787 11.4345 7.88528 11.3471C7.97269 11.2597 8.08405 11.2002 8.20529 11.1761C8.32653 11.152 8.4522 11.1643 8.5664 11.2116C8.6806 11.2589 8.77822 11.3391 8.84689 11.4418C8.91557 11.5446 8.95222 11.6654 8.95222 11.7891C8.95222 11.8711 8.93606 11.9524 8.90465 12.0282C8.87324 12.1041 8.8272 12.173 8.76917 12.231C8.71113 12.289 8.64223 12.3351 8.5664 12.3665C8.49057 12.3979 8.4093 12.4141 8.32722 12.4141ZM9.00597 6.12813L8.8266 9.94063C8.8266 10.0732 8.77392 10.2004 8.68015 10.2942C8.58638 10.3879 8.45921 10.4406 8.3266 10.4406C8.19399 10.4406 8.06681 10.3879 7.97305 10.2942C7.87928 10.2004 7.8266 10.0732 7.8266 9.94063L7.64722 6.12969C7.64319 6.03862 7.65754 5.94768 7.6894 5.86227C7.72127 5.77687 7.77 5.69875 7.8327 5.63259C7.8954 5.56642 7.97078 5.51355 8.05434 5.47713C8.13791 5.44072 8.22795 5.4215 8.3191 5.42063H8.32566C8.41743 5.42058 8.50826 5.43912 8.59267 5.47515C8.67708 5.51117 8.75331 5.56392 8.81677 5.63021C8.88023 5.6965 8.92961 5.77497 8.96191 5.86087C8.99421 5.94676 9.00878 6.03832 9.00472 6.13L9.00597 6.12813Z",
7506
+ fill: "#DB4D4D"
7507
+ }));
7508
+ };
7509
+
7510
+ var styles$1 = {"lighter":"#F0FFF6","light":"#89F0B2","less_dark":"#3DC674","dark":"#349056","darker":"#18442A","gray_50":"#FBFBF9","gray_100":"#EAEAE5","gray_300":"#D0D0C8","gray_500":"#9A9A98","gray_700":"#5D5D5B","gray_900":"#363634","red_900":"#DB4D4D","green_support_900":"#3ACB46","yellow_900":"#FEAF06","purple_900":"#C3099A","titleBox":"_2mYOt","title":"_1H9qR","point":"_2rTfh","buttonGroup":"_W5dic","btnFeedback":"_FmMYN","btnTerminate":"_3kv6J","myanswer":"_1jZV7","titleMyAnswer1":"_1aYD1","titleMyAnswer2":"_2Oc4x","contentMyAnswer":"__LRYW","myAnswerItem":"_1U-Kx","time":"_2PXiz","timeCol":"_1zcfJ","answer-response":"_18ZNf","answer-response-0":"_3nbRi","answer-response-1":"_3NEHk","answer-response-2":"_Et0ih","answer-response-3":"_5Vc3v","answer-response-4":"_2SMBR","overall-response-1":"_1ImE5","overall-response-2":"_1oVKC","overall-response-3":"_2wXCw","answerCorrect":"_gE8qM","answerIncorrect":"_3kRqE","answerNograss":"_22Pi3","answerEasy":"_1C7aw","answerDiscrimination":"__YGYX","answerTrap":"_3AkGb","answerNoTime":"_3l-yC","questionOrder":"_2mK7U","myTimeLabel":"_3ZOZs","myPoolTime":"_1Gajr","topTimeLabel":"_62PzE","topTime":"_3HUx1","meanTimeLabel":"_Yu8Oq","meanTime":"_18kZu","compareChart":"_2MTOH","prevChart":"_JoHQL","chart":"_29iCQ","nextChart":"_3hjxI","titleChart":"_2Z42z","titleCompareGrass":"_34RN_","tableCompareGrass":"_2lzlQ","thcolumn1":"_2MSIH","tdcolumn1":"_1I06v","tdcolumn3":"_VpMQ5","classification":"_3t41M","wrapperProblem":"_2vh8v","titleProblem":"_3YfGm","titleProblemClose":"_34388","titleTrickyProblem":"_INxbh","wrongQuestions":"_35DcB","question":"_10SAW","assignedQuestions":"_oEGQ_","wrapperContent":"_zhZ1O","content":"_NGHD4","contentColumn1":"_v5SKe","span1":"_28SHT","span2":"_1raLd","contentColumn2":"_-xJ34","duration":"_1YGAg","topDuration":"_3DiyY","overallCorrectRate":"_DnkyV","answer":"_29MTE","contentVulnerable":"_3x1PG","wrappContentProblem":"_2saM2","contentProblem":"_1hTJx","labelProblem":"_3BXO9","name":"_1cUZW","percent":"_3CLEc","slider":"_3LCEY","track":"_3I8mi","noData":"_1oZ-s","loading":"_Nm201","table-responsive":"_3zQL-","form-label":"_3Vpmh","form-control":"_DafKE","form-label-dialog":"_3NjaH","btn-cancel":"_sLxwL","btn-register":"_4ZKQY","pdfBtnBox":"_2zUJf","pdfBtn":"_y_Cr7","form-select":"_HCIxD","loader":"_3aDIU","dot":"_JGCIL","bounce":"_3M62i"};
7511
+
7512
+ var DropdownIndicator = function DropdownIndicator(props) {
7513
+ return React__default.createElement(components.DropdownIndicator, Object.assign({}, props), React__default.createElement(FaCaretDown, {
7514
+ size: 20,
7515
+ color: styles.darker
7516
+ }));
7517
+ };
7518
+ var CustomOption = function CustomOption(props) {
7519
+ return React__default.createElement(components.Option, Object.assign({}, props), React__default.createElement("div", {
7520
+ style: {
7521
+ fontSize: "14px",
7522
+ fontWeight: 500
7523
+ }
7524
+ }, props.data.label));
7525
+ };
7526
+
7527
+ var customStyles = {
7528
+ control: function control(baseStyles, state) {
7529
+ return _extends({}, baseStyles, {
7530
+ fontSize: "14px",
7531
+ fontWeight: 700,
7532
+ color: styles.darker,
7533
+ borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark,
7534
+ boxShadow: state.isFocused ? "0 0 0 1px " + styles.dark + "4D" : baseStyles.boxShadow,
7535
+ "&:active": {
7536
+ borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark
7537
+ },
7538
+ "&:hover": {
7539
+ borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark
7540
+ }
7541
+ });
7542
+ },
7543
+ input: function input(baseStyles, _) {
7544
+ return _extends({}, baseStyles, {
7545
+ fontSize: "14px",
7546
+ fontWeight: 700,
7547
+ color: styles.darker
7548
+ });
7549
+ },
7550
+ placeholder: function placeholder(baseStyles, _) {
7551
+ return _extends({}, baseStyles, {
7552
+ whiteSpace: "nowrap"
7553
+ });
7554
+ },
7555
+ singleValue: function singleValue(baseStyles) {
7556
+ return _extends({}, baseStyles, {
7557
+ fontSize: "14px",
7558
+ fontWeight: 700,
7559
+ color: styles.darker
7560
+ });
7561
+ },
7562
+ option: function option(baseStyles, state) {
7563
+ return _extends({}, baseStyles, {
7564
+ zIndex: 999,
7565
+ backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.light : 'white',
7566
+ "&:active": {
7567
+ backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.less_dark : baseStyles.backgroundColor
7568
+ }
7569
+ });
7570
+ },
7571
+ menuPortal: function menuPortal(base) {
7572
+ return _extends({}, base, {
7573
+ zIndex: 99
7574
+ });
7575
+ }
7576
+ };
7577
+
7578
+ var _excluded = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
7579
+ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
7580
+ var _value$;
7581
+ var isDefault = _ref.isDefault,
7582
+ options = _ref.options,
7583
+ isDisabled = _ref.isDisabled,
7584
+ scrollBottom = _ref.scrollBottom,
7585
+ value = _ref.value,
7586
+ isMulti = _ref.isMulti,
7587
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
7588
+ var isOptionValue = (value === null || value === void 0 ? void 0 : value.value) || (value === null || value === void 0 ? void 0 : (_value$ = value[0]) === null || _value$ === void 0 ? void 0 : _value$.value);
7589
+ var initialValues = isOptionValue ? value : Array.isArray(value) ? options.filter(function (i) {
7590
+ return value.includes(i.value);
7591
+ }) : isMulti ? options.filter(function (i) {
7592
+ return i.value == value;
7593
+ }) : options.find(function (i) {
7594
+ return i.value == value;
7595
+ });
7596
+ var _useTranslation = useTranslation(),
7597
+ t = _useTranslation.t;
7598
+ return React__default.createElement(Select, Object.assign({
7599
+ isDisabled: isDisabled,
7600
+ options: options,
7601
+ value: !isDefault ? initialValues : undefined,
7602
+ defaultValue: isDefault ? initialValues : undefined,
7603
+ menuPlacement: scrollBottom ? "top" : "auto",
7604
+ isMulti: isMulti,
7605
+ components: {
7606
+ IndicatorSeparator: function IndicatorSeparator() {
7607
+ return null;
7608
+ },
7609
+ DropdownIndicator: DropdownIndicator,
7610
+ Option: CustomOption
7611
+ },
7612
+ styles: customStyles,
7613
+ placeholder: t("select_placeholder")
7614
+ }, rest));
7615
+ };
7616
+
7617
+ var _excluded$1 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
7618
+ var CustomCreatable = function CustomCreatable(_ref) {
7619
+ var options = _ref.options,
7620
+ isDisabled = _ref.isDisabled,
7621
+ scrollBottom = _ref.scrollBottom,
7622
+ value = _ref.value,
7623
+ isMulti = _ref.isMulti,
7624
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
7625
+ var initialValues = Array.isArray(value) ? options.filter(function (i) {
7626
+ return value.includes(i.value);
7627
+ }) : isMulti ? options.filter(function (i) {
7628
+ return i.value == value;
7629
+ }) : options.find(function (i) {
7630
+ return i.value == value;
7631
+ });
7632
+ var _useTranslation = useTranslation(),
7633
+ t = _useTranslation.t;
7634
+ return React__default.createElement(CreatableSelect, Object.assign({
7635
+ isClearable: true,
7636
+ isDisabled: isDisabled,
7637
+ options: options,
7638
+ value: initialValues,
7639
+ menuPlacement: scrollBottom ? "top" : "auto",
7640
+ isMulti: isMulti,
7641
+ components: {
7642
+ IndicatorSeparator: function IndicatorSeparator() {
7643
+ return null;
7644
+ },
7645
+ DropdownIndicator: DropdownIndicator,
7646
+ Option: CustomOption
7647
+ },
7648
+ styles: customStyles,
7649
+ placeholder: t("select_placeholder")
7650
+ }, rest));
7651
+ };
7652
+
7653
+ var _excluded$2 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti", "optionValue", "styles"];
7654
+ var CustomSelect = function CustomSelect(_ref) {
7655
+ var isDefault = _ref.isDefault,
7656
+ options = _ref.options,
7657
+ isDisabled = _ref.isDisabled,
7658
+ scrollBottom = _ref.scrollBottom,
7659
+ value = _ref.value,
7660
+ isMulti = _ref.isMulti,
7661
+ optionValue = _ref.optionValue,
7662
+ styles = _ref.styles,
7663
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
7664
+ var _useTranslation = useTranslation(),
7665
+ t = _useTranslation.t;
7666
+ var initialValues = optionValue != null ? optionValue : value === undefined || value === null ? null : Array.isArray(value) ? options.filter(function (i) {
7667
+ return value.includes(i.value);
7668
+ }) : isMulti ? options === null || options === void 0 ? void 0 : options.filter(function (i) {
7669
+ return i.value == value;
7670
+ }) : options === null || options === void 0 ? void 0 : options.find(function (i) {
7671
+ return i.value == value;
7672
+ });
7673
+ return React__default.createElement(Select, Object.assign({
7674
+ isDisabled: isDisabled,
7675
+ options: options,
7676
+ value: !isDefault ? initialValues != null ? initialValues : null : undefined,
7677
+ defaultValue: isDefault ? initialValues : undefined,
7678
+ menuPlacement: scrollBottom ? "top" : "auto",
7679
+ components: {
7680
+ IndicatorSeparator: function IndicatorSeparator() {
7681
+ return null;
7682
+ },
7683
+ DropdownIndicator: DropdownIndicator,
7684
+ Option: CustomOption
7685
+ },
7686
+ styles: _extends({}, customStyles, styles),
7687
+ isMulti: isMulti,
7688
+ placeholder: t("select_placeholder")
7689
+ }, rest));
7690
+ };
7691
+
7692
+ var _excluded$3 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti", "valueById", "isTextbook"];
7693
+ var CustomSelectOption = function CustomSelectOption(_ref) {
7694
+ var defaultValue = _ref.defaultValue,
7695
+ options = _ref.options,
7696
+ isDisabled = _ref.isDisabled,
7697
+ scrollBottom = _ref.scrollBottom,
7698
+ value = _ref.value,
7699
+ isMulti = _ref.isMulti,
7700
+ valueById = _ref.valueById,
7701
+ isTextbook = _ref.isTextbook,
7702
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
7703
+ var _useTranslation = useTranslation(),
7704
+ t = _useTranslation.t;
7705
+ var initialValues = defaultValue !== null && typeof defaultValue !== "undefined" ? (options === null || options === void 0 ? void 0 : options.find(function (option) {
7706
+ return option.value === defaultValue;
7707
+ })) || null : null;
7708
+ var optionValue = valueById !== null && typeof valueById !== "undefined" ? (options === null || options === void 0 ? void 0 : options.find(function (option) {
7709
+ return option.value == valueById;
7710
+ })) || {
7711
+ label: valueById,
7712
+ value: valueById
7713
+ } : null;
7714
+ return isTextbook ? React__default.createElement(CreatableSelect, Object.assign({
7715
+ isDisabled: isDisabled,
7716
+ options: options,
7717
+ value: optionValue || value,
7718
+ defaultValue: initialValues,
7719
+ menuPlacement: scrollBottom ? "top" : "auto",
7720
+ isMulti: isMulti,
7721
+ components: {
7722
+ IndicatorSeparator: function IndicatorSeparator() {
7723
+ return null;
7724
+ },
7725
+ DropdownIndicator: DropdownIndicator,
7726
+ Option: CustomOption
7727
+ },
7728
+ styles: customStyles,
7729
+ placeholder: t("select_placeholder")
7730
+ }, rest)) : React__default.createElement(Select, Object.assign({
7731
+ isDisabled: isDisabled,
7732
+ options: options,
7733
+ value: optionValue || value,
7734
+ defaultValue: initialValues,
7735
+ menuPlacement: scrollBottom ? "top" : "auto",
7736
+ isMulti: isMulti,
7737
+ components: {
7738
+ IndicatorSeparator: function IndicatorSeparator() {
7739
+ return null;
7740
+ },
7741
+ DropdownIndicator: DropdownIndicator,
7742
+ Option: CustomOption
7743
+ },
7744
+ styles: customStyles,
7745
+ placeholder: t("select_placeholder")
7746
+ }, rest));
7747
+ };
7748
+
7735
7749
  function CommonCreateNewQuestionDialog(_ref) {
7736
7750
  var handleCreateQuestion = _ref.handleCreateQuestion,
7737
7751
  openDialog = _ref.openDialog,
@@ -23990,20 +24004,20 @@ var useOverallChartContainer = function useOverallChartContainer(isStudent, exam
23990
24004
  }, [examCode, isStudent, code, examSessionId, studentId]);
23991
24005
  var myData = useMemo(function () {
23992
24006
  if (!overallData || !overallData.data[0]) return [0, 0, 0, 0, 0, 0];
23993
- var highLevelQuestions = overallData.data[0].highLevelQuestions * 100 / overallData.maxData.highLevelQuestions;
23994
- var lowLevelQuestions = overallData.data[0].lowLevelQuestions * 100 / overallData.maxData.lowLevelQuestions;
23995
- var questionLongestTime = overallData.data[0].questionLongestTime * 100 / overallData.maxData.questionLongestTime;
23996
- var problemSolvingTime = overallData.data[0].problemSolvingTime * 100 / overallData.maxData.problemSolvingTime;
23997
- var totalAsteriskQuestions = overallData.data[0].totalAsteriskQuestions * 100 / overallData.maxData.totalAsteriskQuestions;
24007
+ var highLevelQuestions = getPercentage(overallData.data[0].highLevelQuestions, overallData.maxData.highLevelQuestions);
24008
+ var lowLevelQuestions = getPercentage(overallData.data[0].lowLevelQuestions, overallData.maxData.lowLevelQuestions);
24009
+ var questionLongestTime = getPercentage(overallData.data[0].questionLongestTime, overallData.maxData.questionLongestTime);
24010
+ var problemSolvingTime = getPercentage(overallData.data[0].problemSolvingTime, overallData.maxData.problemSolvingTime);
24011
+ var totalAsteriskQuestions = getPercentage(overallData.data[0].totalAsteriskQuestions, overallData.maxData.totalAsteriskQuestions);
23998
24012
  return [overallData.data[0].correctRate, highLevelQuestions, questionLongestTime, problemSolvingTime, totalAsteriskQuestions, lowLevelQuestions];
23999
24013
  }, [JSON.stringify(overallData)]);
24000
24014
  var avgData = useMemo(function () {
24001
24015
  if (!overallData || !overallData.data[1]) return [0, 0, 0, 0, 0, 0];
24002
- var highLevelQuestions = overallData.data[1].highLevelQuestions * 100 / overallData.maxData.highLevelQuestions;
24003
- var lowLevelQuestions = overallData.data[1].lowLevelQuestions * 100 / overallData.maxData.lowLevelQuestions;
24004
- var questionLongestTime = overallData.data[1].questionLongestTime * 100 / overallData.maxData.questionLongestTime;
24005
- var problemSolvingTime = overallData.data[1].problemSolvingTime * 100 / overallData.maxData.problemSolvingTime;
24006
- var totalAsteriskQuestions = overallData.data[1].totalAsteriskQuestions * 100 / overallData.maxData.totalAsteriskQuestions;
24016
+ var highLevelQuestions = getPercentage(overallData.data[1].highLevelQuestions, overallData.maxData.highLevelQuestions);
24017
+ var lowLevelQuestions = getPercentage(overallData.data[1].lowLevelQuestions, overallData.maxData.lowLevelQuestions);
24018
+ var questionLongestTime = getPercentage(overallData.data[1].questionLongestTime, overallData.maxData.questionLongestTime);
24019
+ var problemSolvingTime = getPercentage(overallData.data[1].problemSolvingTime, overallData.maxData.problemSolvingTime);
24020
+ var totalAsteriskQuestions = getPercentage(overallData.data[1].totalAsteriskQuestions, overallData.maxData.totalAsteriskQuestions);
24007
24021
  return [overallData.data[1].correctRate, highLevelQuestions, questionLongestTime, problemSolvingTime, totalAsteriskQuestions, lowLevelQuestions];
24008
24022
  }, [JSON.stringify(overallData)]);
24009
24023
  var categories = [t("correct_rate"), t("high_level"), t("longest_time"), t("solving_time"), t("asterisks"), t("low_level")];
@@ -24119,13 +24133,13 @@ var useCategoriesOverallChartContainer = function useCategoriesOverallChartConta
24119
24133
  var myData = useMemo(function () {
24120
24134
  if (!(overallData !== null && overallData !== void 0 && overallData.length)) return [0, 0, 0, 0, 0, 0];
24121
24135
  return overallData.map(function (i) {
24122
- return !i.totalQuestions ? 0 : i.totalCorrectQuestions * 100 / i.totalQuestions;
24136
+ return getPercentage(i.totalCorrectQuestions, i.totalQuestions);
24123
24137
  });
24124
24138
  }, [JSON.stringify(overallData)]);
24125
24139
  var avgData = useMemo(function () {
24126
24140
  if (!(overallData !== null && overallData !== void 0 && overallData.length)) return [0, 0, 0, 0, 0, 0];
24127
24141
  return overallData.map(function (i) {
24128
- return !i.totalQuestions ? 0 : i.avgCorrectQuestions * 100 / i.totalQuestions;
24142
+ return getPercentage(i.avgCorrectQuestions, i.totalQuestions);
24129
24143
  });
24130
24144
  }, [JSON.stringify(overallData)]);
24131
24145
  var categories = useMemo(function () {
@@ -39085,5 +39099,5 @@ var LayoutContext = function LayoutContext(_ref) {
39085
39099
  });else return React__default.createElement(Fragment$1, null, children);
39086
39100
  };
39087
39101
 
39088
- export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AcademyList, AcceptNoAcademy, ActionButtons, AnnouncementContainer, AnnouncementType, AnswerCountSelector, ArticleBlock$1 as ArticleBlock, ArticleCategorySelector, ArticleDialog, AttendanceFormDialog, BASE_URL, BRIEF_GRADE_OPTIONS, ChatContainer, types as ChatTypes, ClassDetail, ClassList, ClassNoteDialog, ClassSelector, CommonCreateNewQuestionDialog, CommonDialog, CompareTypeOptions, ConfirmDeleteDialog, ConfirmDialog, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, DEFAULT_ANSWER_COUNT, DEFAULT_ARTICLE, DEFAULT_MATH_QUESTION_GROUP, DEFAULT_NOTE_FILTER, DEFAULT_PAGING_RESPONSE, DEFAULT_QUESTION, DEFAULT_QUESTION_GROUP, DEFAULT_SCORE$1 as DEFAULT_SCORE, DefaultErrorMessage, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, ExamDetailView, ExamEditorType, ExamEvent, ExamNoteDialog, ExamResultV2, ExamSessionItem, ExamStatus, GOOGLE_CLIENT_ID, GOOGLE_RECAPTCHA_ID, GOOGLE_RECAPTCHA_KEY, GOOGLE_RECAPTCHA_SECRET, GRADE_OPTIONS, Header, HexagonChart, InputText, LANGUAGE, LEARNING_SPACE, Language, LanguageHeaders, LayoutContext, LessonTooltip, ListView, Loading, LoadingComponent, Login, LoginQRCode, LoginWithEmail, SignIn as LoginWithPassword, MathJaxContainer, MathTinyEditor, MonthGroupedExamSessionItem, NewNoteButton, NoAcademyHeaders, NotFound, NoteDrawer, NoteTabs, NoteType, NotesContainer, NotificationDetail, NotificationList, OrderBy, OrderType, PRE_REDIRECT_URL, PUSHER_CONFIG, PassCodeCheck, PassCodeDialog, PreparedItem, PreparedTextbookList, PreparedTextbookView, PreparedType, PrintContainerClassName, PrintContentClassName, PrintExamResultView, PrintExamView2, PrintHeaderClassName, PrintTitleClassName, QRCodeConfirmation, QuestionAnswerType, QuestionBlock$1 as QuestionBlock, QuestionCompareType, QuestionCountSelector, QuestionGroupBlock, QuestionGroupBlockBody$1 as QuestionGroupBlockBody, QuestionOrderName, QuestionShortInput$1 as QuestionShortInput, REDIRECT_URL, RELEASE_DATE, RecentUserAction, RecentUserActionNames, RecentUserActionSortBy, ReleaseAlert, Role, SUPER_ADMIN_BASE_URL, SchoolType, ScoreSelector, SearchInput, ShareToTeacherDialog, SolutionOrderChart, StudentInfoDrawer, StudentSelector, SubjectSelector, TextbookActionButtons, TextbookDrawer, TextbookEditorType, TextbookList, TheAcademyDropdown, TheLanguageDropdown, TimeChart, TimeOrderChart, TinyEditor, UserList, UserSortColumn, VirtualListView, VirtualTableView, api, apiUpload, canAccess as canAccessRoute, cleanRichText, convertHHMMSStoSeconds, createRecentUserActionListApi, diffFromNow, ellipsisText, encodeParams, formatDataMyAnswer, formatDateTime, formatPhoneNumber, formatRole, formatTextbookDataMyAnswer, formatTime, formatTimeSecond, generateNewQuestionGroup, getAcademyDomain, getAccessToken, getErrorMessage, getLanguage, getLearningSpace, getLocalDayOfWeek, getOrdinalSuffix, getPreviousQuestinGroupCategory, getQuestionGroupsAfterQuestionCountChanged, getRecentUserActionListApi, getRedirectUrl, getRemainTime, getRole, getUtcDayOfWeek, groupMonth, handleKeyDown, i18n, includePathname, isLocalHost, isSequentialQuestionGroups, isTextType, labelStyle, minutesToTimeSpan, pushTo, _reduceToMathArticles as reduceToMathArticles, reset, _resetAllCategoriesAndQuestionTypesBySubject as resetAllCategoriesAndQuestionTypesBySubject, setAcademies, setAcademy, setAlert, setConcurrentConnectionPusher, setLanguage, setLoading, setReFetchUserAcademies, setTotalUnreadMessages, setUser, store, timAgo, timeSpanToLocalMoment, toISOString, toLocalTime, useAutoAcademyDomain, useChatContainer, useCountDownTimer, useGoogleSignOut, useKeyboardVisible, useLanguage, useList, useLoadMore, useLogin, useNotes, usePusherConversation, useSwitchAcademy, useVirtualizeList, utcToLocalTime };
39102
+ export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AcademyList, AcceptNoAcademy, ActionButtons, AnnouncementContainer, AnnouncementType, AnswerCountSelector, ArticleBlock$1 as ArticleBlock, ArticleCategorySelector, ArticleDialog, AttendanceFormDialog, BASE_URL, BRIEF_GRADE_OPTIONS, ChatContainer, types as ChatTypes, ClassDetail, ClassList, ClassNoteDialog, ClassSelector, CommonCreateNewQuestionDialog, CommonDialog, CompareTypeOptions, ConfirmDeleteDialog, ConfirmDialog, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, DEFAULT_ANSWER_COUNT, DEFAULT_ARTICLE, DEFAULT_MATH_QUESTION_GROUP, DEFAULT_NOTE_FILTER, DEFAULT_PAGING_RESPONSE, DEFAULT_QUESTION, DEFAULT_QUESTION_GROUP, DEFAULT_SCORE$1 as DEFAULT_SCORE, DefaultErrorMessage, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, ExamDetailView, ExamEditorType, ExamEvent, ExamNoteDialog, ExamResultV2, ExamSessionItem, ExamStatus, GOOGLE_CLIENT_ID, GOOGLE_RECAPTCHA_ID, GOOGLE_RECAPTCHA_KEY, GOOGLE_RECAPTCHA_SECRET, GRADE_OPTIONS, Header, HexagonChart, InputText, LANGUAGE, LEARNING_SPACE, Language, LanguageHeaders, LayoutContext, LessonTooltip, ListView, Loading, LoadingComponent, Login, LoginQRCode, LoginWithEmail, SignIn as LoginWithPassword, MathJaxContainer, MathTinyEditor, MonthGroupedExamSessionItem, NewNoteButton, NoAcademyHeaders, NotFound, NoteDrawer, NoteTabs, NoteType, NotesContainer, NotificationDetail, NotificationList, OrderBy, OrderType, PRE_REDIRECT_URL, PUSHER_CONFIG, PassCodeCheck, PassCodeDialog, PreparedItem, PreparedTextbookList, PreparedTextbookView, PreparedType, PrintContainerClassName, PrintContentClassName, PrintExamResultView, PrintExamView2, PrintHeaderClassName, PrintTitleClassName, QRCodeConfirmation, QuestionAnswerType, QuestionBlock$1 as QuestionBlock, QuestionCompareType, QuestionCountSelector, QuestionGroupBlock, QuestionGroupBlockBody$1 as QuestionGroupBlockBody, QuestionOrderName, QuestionShortInput$1 as QuestionShortInput, REDIRECT_URL, RELEASE_DATE, RecentUserAction, RecentUserActionNames, RecentUserActionSortBy, ReleaseAlert, Role, SUPER_ADMIN_BASE_URL, SchoolType, ScoreSelector, SearchInput, ShareToTeacherDialog, SolutionOrderChart, StudentInfoDrawer, StudentSelector, SubjectSelector, TextbookActionButtons, TextbookDrawer, TextbookEditorType, TextbookList, TheAcademyDropdown, TheLanguageDropdown, TimeChart, TimeOrderChart, TinyEditor, UserList, UserSortColumn, VirtualListView, VirtualTableView, api, apiUpload, canAccess as canAccessRoute, cleanRichText, convertHHMMSStoSeconds, createRecentUserActionListApi, diffFromNow, ellipsisText, encodeParams, formatDataMyAnswer, formatDateTime, formatPhoneNumber, formatRole, formatTextbookDataMyAnswer, formatTime, formatTimeSecond, generateNewQuestionGroup, getAcademyDomain, getAccessToken, getErrorMessage, getLanguage, getLearningSpace, getLocalDayOfWeek, getOrdinalSuffix, getPercentage, getPreviousQuestinGroupCategory, getQuestionGroupsAfterQuestionCountChanged, getRecentUserActionListApi, getRedirectUrl, getRemainTime, getRole, getUtcDayOfWeek, groupMonth, handleKeyDown, i18n, includePathname, isLocalHost, isSequentialQuestionGroups, isTextType, labelStyle, minutesToTimeSpan, pushTo, _reduceToMathArticles as reduceToMathArticles, reset, _resetAllCategoriesAndQuestionTypesBySubject as resetAllCategoriesAndQuestionTypesBySubject, setAcademies, setAcademy, setAlert, setConcurrentConnectionPusher, setLanguage, setLoading, setReFetchUserAcademies, setTotalUnreadMessages, setUser, store, timAgo, timeSpanToLocalMoment, toISOString, toLocalTime, useAutoAcademyDomain, useChatContainer, useCountDownTimer, useGoogleSignOut, useKeyboardVisible, useLanguage, useList, useLoadMore, useLogin, useNotes, usePusherConversation, useSwitchAcademy, useVirtualizeList, utcToLocalTime };
39089
39103
  //# sourceMappingURL=index.modern.js.map