@elice/material-runbox 1.240718.0-trasncript.1 → 1.240718.0-trasncript.2

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.
Files changed (55) hide show
  1. package/cjs/_virtual/_rollupPluginBabelHelpers.js +386 -0
  2. package/cjs/assets/queue.gif.js +1 -2
  3. package/cjs/assets/runbox_logo.png.js +1 -2
  4. package/cjs/assets/terminated.png.js +1 -2
  5. package/cjs/components/material-runbox/MaterialRunbox.js +24 -20
  6. package/cjs/components/material-runbox/MaterialRunboxBody.js +10 -4
  7. package/cjs/components/material-runbox/MaterialRunboxContent.js +132 -103
  8. package/cjs/components/material-runbox/MaterialRunboxFooter.js +27 -18
  9. package/cjs/components/material-runbox/MaterialRunboxHeader.js +103 -87
  10. package/cjs/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +31 -27
  11. package/cjs/components/material-runbox/actions/MaterialRunboxActionGrade.js +242 -159
  12. package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.js +32 -28
  13. package/cjs/components/material-runbox/actions/MaterialRunboxActionReset.js +125 -76
  14. package/cjs/components/material-runbox/actions/MaterialRunboxActionRestart.js +84 -53
  15. package/cjs/components/material-runbox/actions/MaterialRunboxActionShare.js +40 -28
  16. package/cjs/components/material-runbox/contexts/MaterialRunboxApiContext.js +27 -15
  17. package/cjs/components/material-runbox/contexts/MaterialRunboxCommandContext.js +52 -36
  18. package/cjs/components/material-runbox/contexts/MaterialRunboxContext.js +11 -8
  19. package/cjs/components/material-runbox/contexts/index.js +17 -0
  20. package/cjs/components/material-runbox/hooks/index.js +7 -0
  21. package/cjs/components/material-runbox/hooks/useRunboxControl.js +62 -38
  22. package/cjs/components/material-runbox/index.js +7 -0
  23. package/cjs/components/material-runbox/locales/index.js +13 -0
  24. package/cjs/components/material-runbox/runtime/Runtime.js +25 -17
  25. package/cjs/components/material-runbox/runtime/RuntimeOverlayAssigned.js +33 -29
  26. package/cjs/components/material-runbox/runtime/RuntimeOverlayQueued.js +40 -39
  27. package/cjs/components/material-runbox/runtime/RuntimeOverlayTerminated.js +72 -57
  28. package/es/_virtual/_rollupPluginBabelHelpers.js +377 -0
  29. package/es/assets/queue.gif.js +1 -2
  30. package/es/assets/runbox_logo.png.js +1 -2
  31. package/es/assets/terminated.png.js +1 -2
  32. package/es/components/material-runbox/MaterialRunbox.js +24 -20
  33. package/es/components/material-runbox/MaterialRunboxBody.js +6 -4
  34. package/es/components/material-runbox/MaterialRunboxContent.js +128 -103
  35. package/es/components/material-runbox/MaterialRunboxFooter.js +23 -18
  36. package/es/components/material-runbox/MaterialRunboxHeader.js +99 -88
  37. package/es/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +27 -27
  38. package/es/components/material-runbox/actions/MaterialRunboxActionGrade.js +237 -159
  39. package/es/components/material-runbox/actions/MaterialRunboxActionMenu.js +28 -28
  40. package/es/components/material-runbox/actions/MaterialRunboxActionReset.js +121 -76
  41. package/es/components/material-runbox/actions/MaterialRunboxActionRestart.js +80 -53
  42. package/es/components/material-runbox/actions/MaterialRunboxActionShare.js +36 -28
  43. package/es/components/material-runbox/contexts/MaterialRunboxApiContext.js +22 -14
  44. package/es/components/material-runbox/contexts/MaterialRunboxCommandContext.js +47 -35
  45. package/es/components/material-runbox/contexts/MaterialRunboxContext.js +6 -7
  46. package/es/components/material-runbox/contexts/index.js +3 -0
  47. package/es/components/material-runbox/hooks/index.js +1 -0
  48. package/es/components/material-runbox/hooks/useRunboxControl.js +62 -38
  49. package/es/components/material-runbox/index.js +1 -0
  50. package/es/components/material-runbox/locales/index.js +4 -0
  51. package/es/components/material-runbox/runtime/Runtime.js +21 -17
  52. package/es/components/material-runbox/runtime/RuntimeOverlayAssigned.js +34 -30
  53. package/es/components/material-runbox/runtime/RuntimeOverlayQueued.js +41 -40
  54. package/es/components/material-runbox/runtime/RuntimeOverlayTerminated.js +69 -58
  55. package/package.json +8 -11
@@ -1,5 +1,6 @@
1
+ import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import _styled from '@emotion/styled/base';
2
- import React from 'react';
3
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
4
  import { Spinner } from '@elice/blocks';
4
5
  import { useRawEliceIntl } from '@elice/intl';
5
6
  import { EliceRunboxProvider } from '@elice/runbox-client';
@@ -17,11 +18,11 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
17
18
  //
18
19
  //
19
20
  //
20
- const DEFAULT_DATA = [null, null, null];
21
+ var DEFAULT_DATA = [null, null, null];
21
22
  //
22
23
  //
23
24
  //
24
- const StyledRunboxContainer = /*#__PURE__*/_styled("div", {
25
+ var StyledRunboxContainer = /*#__PURE__*/_styled("div", {
25
26
  target: "eeh98mq0"
26
27
  })("production" === "production" ? {
27
28
  name: "t5t5sq",
@@ -34,122 +35,146 @@ const StyledRunboxContainer = /*#__PURE__*/_styled("div", {
34
35
  //
35
36
  //
36
37
  //
37
- const MaterialRunboxContent = ({
38
- runboxId,
39
- courseId
40
- }) => {
41
- const intl = useRawEliceIntl();
42
- const {
43
- showMessenger
44
- } = useMaterialRunboxContext();
45
- const materialRunboxApi = useMaterialRunboxApiContext();
38
+ var MaterialRunboxContent = function MaterialRunboxContent(_ref) {
39
+ var runboxId = _ref.runboxId,
40
+ courseId = _ref.courseId;
41
+ var intl = useRawEliceIntl();
42
+ var _useMaterialRunboxCon = useMaterialRunboxContext(),
43
+ showMessenger = _useMaterialRunboxCon.showMessenger;
44
+ var materialRunboxApi = useMaterialRunboxApiContext();
46
45
  //
47
46
  //
48
47
  //
49
- const {
50
- data: [runbox, runtime, runtimeTemplate] = DEFAULT_DATA,
51
- isInitialLoading,
52
- isError,
53
- refetch
54
- } = useQuery({
55
- enabled: Boolean(runboxId),
56
- queryKey: ['eliceMaterialRunboxRunboxApi.runboxRunboxIdGet', 'eliceMaterialRunboxRuntimeTemplateApi.runtimeTemplateRuntimeTemplateIdGet', runboxId, courseId],
57
- queryFn: ({
58
- signal
59
- }) => materialRunboxApi.runbox.runboxRunboxIdGet({
60
- runboxId: runboxId,
61
- eliceCourseId: courseId
62
- }, {
63
- signal
64
- }).then(runbox => Promise.all([
65
- // runbox
66
- runbox,
67
- // runtime
68
- materialRunboxApi.runtime.runtimeGet({
69
- filterImageId: runbox.imageId,
70
- filterRuntimeTemplateId: runbox.runtimeTemplateId,
71
- skip: 0,
72
- count: 1,
73
- eliceCourseId: courseId
74
- }, {
75
- signal
76
- }).then(runtimes => {
77
- var _a;
78
- return (_a = runtimes[0]) !== null && _a !== void 0 ? _a : null;
48
+ var _useQuery = useQuery({
49
+ enabled: Boolean(runboxId),
50
+ queryKey: ['eliceMaterialRunboxRunboxApi.runboxRunboxIdGet', 'eliceMaterialRunboxRuntimeTemplateApi.runtimeTemplateRuntimeTemplateIdGet', runboxId, courseId],
51
+ queryFn: function queryFn(_ref2) {
52
+ var signal = _ref2.signal;
53
+ return materialRunboxApi.runbox.runboxRunboxIdGet({
54
+ runboxId: runboxId,
55
+ eliceCourseId: courseId
56
+ }, {
57
+ signal: signal
58
+ }).then(function (runbox) {
59
+ return Promise.all([
60
+ // runbox
61
+ runbox,
62
+ // runtime
63
+ materialRunboxApi.runtime.runtimeGet({
64
+ filterImageId: runbox.imageId,
65
+ filterRuntimeTemplateId: runbox.runtimeTemplateId,
66
+ skip: 0,
67
+ count: 1,
68
+ eliceCourseId: courseId
69
+ }, {
70
+ signal: signal
71
+ }).then(function (runtimes) {
72
+ var _a;
73
+ return (_a = runtimes[0]) !== null && _a !== void 0 ? _a : null;
74
+ }),
75
+ // runtimeTemplate
76
+ materialRunboxApi.runtimeTemplate.runtimeTemplateRuntimeTemplateIdGet({
77
+ runtimeTemplateId: runbox.runtimeTemplateId,
78
+ eliceCourseId: courseId
79
+ }, {
80
+ signal: signal
81
+ })]);
82
+ });
83
+ },
84
+ cacheTime: 0,
85
+ keepPreviousData: true,
86
+ refetchOnWindowFocus: false
79
87
  }),
80
- // runtimeTemplate
81
- materialRunboxApi.runtimeTemplate.runtimeTemplateRuntimeTemplateIdGet({
82
- runtimeTemplateId: runbox.runtimeTemplateId,
83
- eliceCourseId: courseId
84
- }, {
85
- signal
86
- })])),
87
- cacheTime: 0,
88
- keepPreviousData: true,
89
- refetchOnWindowFocus: false
90
- });
88
+ _useQuery$data = _useQuery.data,
89
+ _useQuery$data2 = _useQuery$data === void 0 ? DEFAULT_DATA : _useQuery$data,
90
+ _useQuery$data3 = _slicedToArray(_useQuery$data2, 3),
91
+ runbox = _useQuery$data3[0],
92
+ runtime = _useQuery$data3[1],
93
+ runtimeTemplate = _useQuery$data3[2],
94
+ isInitialLoading = _useQuery.isInitialLoading,
95
+ isError = _useQuery.isError,
96
+ refetch = _useQuery.refetch;
91
97
  //
92
98
  //
93
99
  //
94
100
  if (isInitialLoading) {
95
- return React.createElement(StyledRunboxContainer, null, React.createElement(Spinner, null));
101
+ return jsx(StyledRunboxContainer, {
102
+ children: jsx(Spinner, {})
103
+ });
96
104
  }
97
105
  if (isError) {
98
- return React.createElement(StyledRunboxContainer, null, React.createElement(Stack, {
99
- gap: "1.5rem"
100
- }, React.createElement(Typography, {
101
- variant: "h6"
102
- }, intl.formatMessage({
103
- id: 'runbox.runtime.message.startError'
104
- })), React.createElement(Stack, {
105
- gap: "0.5rem"
106
- }, React.createElement(Button, {
107
- startIcon: React.createElement(Refresh, null),
108
- onClick: () => refetch()
109
- }, intl.formatMessage({
110
- id: 'runbox.common.retry'
111
- })), typeof showMessenger === 'function' ? React.createElement(Button, {
112
- variant: "outlined",
113
- onClick: () => showMessenger()
114
- }, intl.formatMessage({
115
- id: 'runbox.common.support'
116
- })) : null)));
106
+ return jsx(StyledRunboxContainer, {
107
+ children: jsxs(Stack, {
108
+ gap: "1.5rem",
109
+ children: [jsx(Typography, {
110
+ variant: "h6",
111
+ children: intl.formatMessage({
112
+ id: 'runbox.runtime.message.startError'
113
+ })
114
+ }), jsxs(Stack, {
115
+ gap: "0.5rem",
116
+ children: [jsx(Button, {
117
+ startIcon: jsx(Refresh, {}),
118
+ onClick: function onClick() {
119
+ return refetch();
120
+ },
121
+ children: intl.formatMessage({
122
+ id: 'runbox.common.retry'
123
+ })
124
+ }), typeof showMessenger === 'function' ? jsx(Button, {
125
+ variant: "outlined",
126
+ onClick: function onClick() {
127
+ return showMessenger();
128
+ },
129
+ children: intl.formatMessage({
130
+ id: 'runbox.common.support'
131
+ })
132
+ }) : null]
133
+ })]
134
+ })
135
+ });
117
136
  }
118
137
  if (!runbox || !runtimeTemplate) {
119
138
  return null;
120
139
  }
121
- const props = {
122
- runbox,
123
- runtime,
124
- runtimeTemplate,
125
- courseId,
126
- refetch
140
+ var props = {
141
+ runbox: runbox,
142
+ runtime: runtime,
143
+ runtimeTemplate: runtimeTemplate,
144
+ courseId: courseId,
145
+ refetch: refetch
127
146
  };
128
- return React.createElement(MaterialRunboxCommandContextProvider, {
147
+ return jsx(MaterialRunboxCommandContextProvider, {
129
148
  runtime: runtime,
130
- courseId: courseId
131
- }, React.createElement(EliceRunboxProvider, {
132
- runboxId: runbox.id,
133
- runboxApiHeartbeat: ({
134
- id,
135
- signal
136
- }) => materialRunboxApi.runbox.runboxRunboxIdHeartbeatPost({
137
- runboxId: id,
138
- eliceCourseId: courseId
139
- }, {
140
- signal
141
- }),
142
- runboxApiQuota: ({
143
- id,
144
- signal
145
- }) => materialRunboxApi.runbox.runboxRunboxIdQuotaGet({
146
- runboxId: id,
147
- eliceCourseId: courseId
148
- }, {
149
- signal
150
- }),
151
- onRunboxRefetchRequest: refetch
152
- }, React.createElement(StyledRunboxContainer, null, React.createElement(MaterialRunboxHeader, Object.assign({}, props)), React.createElement(MaterialRunboxBody, Object.assign({}, props)), React.createElement(MaterialRunboxFooter, Object.assign({}, props)))));
149
+ courseId: courseId,
150
+ children: jsx(EliceRunboxProvider, {
151
+ runboxId: runbox.id,
152
+ runboxApiHeartbeat: function runboxApiHeartbeat(_ref3) {
153
+ var id = _ref3.id,
154
+ signal = _ref3.signal;
155
+ return materialRunboxApi.runbox.runboxRunboxIdHeartbeatPost({
156
+ runboxId: id,
157
+ eliceCourseId: courseId
158
+ }, {
159
+ signal: signal
160
+ });
161
+ },
162
+ runboxApiQuota: function runboxApiQuota(_ref4) {
163
+ var id = _ref4.id,
164
+ signal = _ref4.signal;
165
+ return materialRunboxApi.runbox.runboxRunboxIdQuotaGet({
166
+ runboxId: id,
167
+ eliceCourseId: courseId
168
+ }, {
169
+ signal: signal
170
+ });
171
+ },
172
+ onRunboxRefetchRequest: refetch,
173
+ children: jsxs(StyledRunboxContainer, {
174
+ children: [jsx(MaterialRunboxHeader, Object.assign({}, props)), jsx(MaterialRunboxBody, Object.assign({}, props)), jsx(MaterialRunboxFooter, Object.assign({}, props))]
175
+ })
176
+ })
177
+ });
153
178
  };
154
179
 
155
180
  export { MaterialRunboxContent as default };
@@ -1,48 +1,53 @@
1
1
  import _styled from '@emotion/styled/base';
2
- import React from 'react';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { EliceRunboxResourceStat, EliceRunboxRemainingTimer, EliceRunboxNetworkStat, EliceRunboxRunningStatus } from '@elice/runbox-client';
4
4
  import { Box, Stack, Divider } from '@mui/material';
5
5
 
6
6
  //
7
7
  //
8
8
  //
9
- const StyledFooter = /*#__PURE__*/_styled("div", {
9
+ var StyledFooter = /*#__PURE__*/_styled("div", {
10
10
  target: "e9lbhtr0"
11
- })("position:relative;flex:0 0 2rem;display:flex;justify-content:space-between;align-items:center;padding:0 1rem;width:100%;border-top:1px solid ", ({
12
- theme
13
- }) => theme.palette.divider, ";");
11
+ })("position:relative;flex:0 0 2rem;display:flex;justify-content:space-between;align-items:center;padding:0 1rem;width:100%;border-top:1px solid ", function (_ref) {
12
+ var theme = _ref.theme;
13
+ return theme.palette.divider;
14
+ }, ";");
14
15
  //
15
16
  //
16
17
  //
17
- const MaterialRunboxFooter = ({
18
- runtimeTemplate
19
- }) => {
18
+ var MaterialRunboxFooter = function MaterialRunboxFooter(_ref2) {
19
+ var runtimeTemplate = _ref2.runtimeTemplate;
20
20
  /**
21
21
  * Resource stats
22
22
  */
23
- const renderFooterResourceStats = () => {
23
+ var renderFooterResourceStats = function renderFooterResourceStats() {
24
24
  var _a, _b;
25
- return React.createElement(Box, null, React.createElement(EliceRunboxResourceStat, {
26
- gpu: ((_b = (_a = runtimeTemplate.gpus) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0
27
- }));
25
+ return jsx(Box, {
26
+ children: jsx(EliceRunboxResourceStat, {
27
+ gpu: ((_b = (_a = runtimeTemplate.gpus) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0
28
+ })
29
+ });
28
30
  };
29
31
  /**
30
32
  * Status
31
33
  */
32
- const renderFooterStatus = () => {
33
- return React.createElement(Stack, {
34
+ var renderFooterStatus = function renderFooterStatus() {
35
+ return jsxs(Stack, {
34
36
  direction: "row",
35
37
  gap: "0.5rem",
36
- divider: React.createElement(Divider, {
38
+ divider: jsx(Divider, {
37
39
  orientation: "vertical",
38
40
  flexItem: true
39
- })
40
- }, React.createElement(EliceRunboxRemainingTimer, null), React.createElement(EliceRunboxNetworkStat, null), React.createElement(EliceRunboxRunningStatus, null));
41
+ }),
42
+ children: [jsx(EliceRunboxRemainingTimer, {}), jsx(EliceRunboxNetworkStat, {}), jsx(EliceRunboxRunningStatus, {})]
43
+ });
41
44
  };
42
45
  //
43
46
  //
44
47
  //
45
- return React.createElement(StyledFooter, null, renderFooterResourceStats(), renderFooterStatus());
48
+ return jsxs(StyledFooter, {
49
+ children: [renderFooterResourceStats(), renderFooterStatus()]
50
+ });
46
51
  };
47
52
 
48
53
  export { MaterialRunboxFooter as default };
@@ -1,4 +1,6 @@
1
+ import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import _styled from '@emotion/styled/base';
3
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
4
  import React from 'react';
3
5
  import { useRawEliceIntl } from '@elice/intl';
4
6
  import { Tag, EliceIcon } from '@elice/mui-elements';
@@ -13,77 +15,80 @@ import MaterialRunboxActionMenu from './actions/MaterialRunboxActionMenu.js';
13
15
  import { useMaterialRunboxApiContext } from './contexts/MaterialRunboxApiContext.js';
14
16
  import './contexts/MaterialRunboxCommandContext.js';
15
17
  import { useMaterialRunboxContext } from './contexts/MaterialRunboxContext.js';
16
- import runboxLogoImage from '../../assets/runbox_logo.png.js';
18
+ import img from '../../assets/runbox_logo.png.js';
17
19
 
18
- const StyledHeader = /*#__PURE__*/_styled("div", {
20
+ var StyledHeader = /*#__PURE__*/_styled("div", {
19
21
  target: "e110d0bp0"
20
- })("position:relative;flex:0 0 3rem;display:flex;justify-content:space-between;align-items:center;padding:0 1rem;width:100%;border-bottom:1px solid ", ({
21
- theme
22
- }) => theme.palette.divider, ";overflow:hidden;");
22
+ })("position:relative;flex:0 0 3rem;display:flex;justify-content:space-between;align-items:center;padding:0 1rem;width:100%;border-bottom:1px solid ", function (_ref) {
23
+ var theme = _ref.theme;
24
+ return theme.palette.divider;
25
+ }, ";overflow:hidden;");
23
26
  //
24
27
  //
25
28
  //
26
- const MaterialRunboxHeader = ({
27
- runbox,
28
- runtime,
29
- runtimeTemplate,
30
- courseId,
31
- refetch
32
- }) => {
33
- const intl = useRawEliceIntl();
34
- const {
35
- enableAutoShutdownToggle
36
- } = useMaterialRunboxContext();
37
- const [menuAnchorEl, setMenuAnchorEl] = React.useState(null);
38
- const {
39
- status
40
- } = useEliceRunboxRunning();
41
- const isRunboxRunning = status === 'running';
29
+ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref2) {
30
+ var runbox = _ref2.runbox,
31
+ runtime = _ref2.runtime,
32
+ runtimeTemplate = _ref2.runtimeTemplate,
33
+ courseId = _ref2.courseId,
34
+ refetch = _ref2.refetch;
35
+ var intl = useRawEliceIntl();
36
+ var _useMaterialRunboxCon = useMaterialRunboxContext(),
37
+ enableAutoShutdownToggle = _useMaterialRunboxCon.enableAutoShutdownToggle;
38
+ var _React$useState = React.useState(null),
39
+ _React$useState2 = _slicedToArray(_React$useState, 2),
40
+ menuAnchorEl = _React$useState2[0],
41
+ setMenuAnchorEl = _React$useState2[1];
42
+ var _useEliceRunboxRunnin = useEliceRunboxRunning(),
43
+ status = _useEliceRunboxRunnin.status;
44
+ var isRunboxRunning = status === 'running';
42
45
  /**
43
46
  *
44
47
  */
45
- const handleMenuClose = () => {
48
+ var handleMenuClose = function handleMenuClose() {
46
49
  setMenuAnchorEl(null);
47
50
  };
48
- const materialRunboxApi = useMaterialRunboxApiContext();
49
- const {
50
- data: leaderboardSubmitInfo,
51
- isLoading: isLeaderboardSubmitInfoLoading
52
- } = useQuery({
53
- queryKey: ['eliceMaterialRunboxRunboxApi.runboxRunboxIdSubmitInfoGet', {
54
- courseId,
55
- runtime
56
- }],
57
- queryFn: ({
58
- signal
59
- }) => materialRunboxApi.runbox.runboxRunboxIdSubmitInfoGet({
60
- eliceCourseId: courseId,
61
- runboxId: runtime === null || runtime === void 0 ? void 0 : runtime.runboxId
62
- }, {
63
- signal
51
+ var materialRunboxApi = useMaterialRunboxApiContext();
52
+ var _useQuery = useQuery({
53
+ queryKey: ['eliceMaterialRunboxRunboxApi.runboxRunboxIdSubmitInfoGet', {
54
+ courseId: courseId,
55
+ runtime: runtime
56
+ }],
57
+ queryFn: function queryFn(_ref3) {
58
+ var signal = _ref3.signal;
59
+ return materialRunboxApi.runbox.runboxRunboxIdSubmitInfoGet({
60
+ eliceCourseId: courseId,
61
+ runboxId: runtime === null || runtime === void 0 ? void 0 : runtime.runboxId
62
+ }, {
63
+ signal: signal
64
+ });
65
+ },
66
+ refetchInterval: function refetchInterval(data) {
67
+ return !(data === null || data === void 0 ? void 0 : data.remainSubmitCount) ? false : 5 * 1000;
68
+ },
69
+ enabled: Boolean(runtime === null || runtime === void 0 ? void 0 : runtime.runboxId),
70
+ retry: false
64
71
  }),
65
- refetchInterval: data => !(data === null || data === void 0 ? void 0 : data.remainSubmitCount) ? false : 5 * 1000,
66
- enabled: Boolean(runtime === null || runtime === void 0 ? void 0 : runtime.runboxId),
67
- retry: false
68
- });
72
+ leaderboardSubmitInfo = _useQuery.data,
73
+ isLeaderboardSubmitInfoLoading = _useQuery.isLoading;
69
74
  /**
70
75
  *
71
76
  */
72
- const renderHeaderSubmitInfo = () => {
73
- const remainSubmitCount = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.remainSubmitCount;
74
- const totalSubmitCount = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.submitCountLimit;
75
- const isDailyLimitEnabled = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.dailyLimitEnabled;
76
- const isIndividualTypeLeaderboard = (leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.entryType) === enums.LeaderboardEntryType.Individual;
77
+ var renderHeaderSubmitInfo = function renderHeaderSubmitInfo() {
78
+ var remainSubmitCount = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.remainSubmitCount;
79
+ var totalSubmitCount = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.submitCountLimit;
80
+ var isDailyLimitEnabled = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.dailyLimitEnabled;
81
+ var isIndividualTypeLeaderboard = (leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.entryType) === enums.LeaderboardEntryType.Individual;
77
82
  if (isLeaderboardSubmitInfoLoading || remainSubmitCount === null) {
78
83
  return null;
79
84
  }
80
- return React.createElement(Tag, {
85
+ return jsx(Tag, {
81
86
  label: intl.formatMessage({
82
87
  id: 'runbox.header.submitInfo'
83
88
  }, {
84
89
  remainCount: remainSubmitCount,
85
90
  totalCount: totalSubmitCount,
86
- isDailyLimitEnabled,
91
+ isDailyLimitEnabled: isDailyLimitEnabled,
87
92
  isIndividual: isIndividualTypeLeaderboard
88
93
  }),
89
94
  variant: "muted",
@@ -93,11 +98,11 @@ const MaterialRunboxHeader = ({
93
98
  /**
94
99
  *
95
100
  */
96
- const renderHeaderActionAutoShutdown = () => {
101
+ var renderHeaderActionAutoShutdown = function renderHeaderActionAutoShutdown() {
97
102
  if (!enableAutoShutdownToggle) {
98
103
  return null;
99
104
  }
100
- return React.createElement(MaterialRunboxActionAutoShutdown, {
105
+ return jsx(MaterialRunboxActionAutoShutdown, {
101
106
  runtime: runtime,
102
107
  runtimeTemplate: runtimeTemplate,
103
108
  courseId: courseId,
@@ -107,11 +112,11 @@ const MaterialRunboxHeader = ({
107
112
  /**
108
113
  *
109
114
  */
110
- const renderHeaderActionGrade = () => {
115
+ var renderHeaderActionGrade = function renderHeaderActionGrade() {
111
116
  if (!runbox.submission.enabled) {
112
117
  return null;
113
118
  }
114
- return React.createElement(MaterialRunboxActionGrade, {
119
+ return jsx(MaterialRunboxActionGrade, {
115
120
  runtime: runtime,
116
121
  courseId: courseId
117
122
  });
@@ -119,45 +124,51 @@ const MaterialRunboxHeader = ({
119
124
  /**
120
125
  *
121
126
  */
122
- const renderOptionMenu = () => {
123
- return React.createElement(React.Fragment, null, React.createElement(IconButton, {
124
- disabled: !isRunboxRunning,
125
- onClick: e => {
126
- if (Boolean(menuAnchorEl)) {
127
- setMenuAnchorEl(null);
128
- } else {
129
- setMenuAnchorEl(e.currentTarget);
130
- }
131
- }
132
- }, React.createElement(EliceIcon, {
133
- icon: faEllipsisVertical
134
- })), React.createElement(MaterialRunboxActionMenu, {
135
- runbox: runbox,
136
- runtime: runtime,
137
- courseId: courseId,
138
- menuAnchorEl: menuAnchorEl,
139
- refetch: refetch,
140
- handleMenuClose: handleMenuClose
141
- }));
127
+ var renderOptionMenu = function renderOptionMenu() {
128
+ return jsxs(Fragment, {
129
+ children: [jsx(IconButton, {
130
+ disabled: !isRunboxRunning,
131
+ onClick: function onClick(e) {
132
+ if (Boolean(menuAnchorEl)) {
133
+ setMenuAnchorEl(null);
134
+ } else {
135
+ setMenuAnchorEl(e.currentTarget);
136
+ }
137
+ },
138
+ children: jsx(EliceIcon, {
139
+ icon: faEllipsisVertical
140
+ })
141
+ }), jsx(MaterialRunboxActionMenu, {
142
+ runbox: runbox,
143
+ runtime: runtime,
144
+ courseId: courseId,
145
+ menuAnchorEl: menuAnchorEl,
146
+ refetch: refetch,
147
+ handleMenuClose: handleMenuClose
148
+ })]
149
+ });
142
150
  };
143
151
  //
144
152
  //
145
153
  //
146
- return React.createElement(StyledHeader, null, React.createElement(Box, {
147
- component: "img",
148
- src: runboxLogoImage,
149
- alt: "elice runbox",
150
- sx: {
151
- width: 'auto',
152
- height: '100%',
153
- imageRendering: 'auto',
154
- padding: '0.465rem 0'
155
- }
156
- }), React.createElement(Stack, {
157
- direction: "row",
158
- alignItems: "center",
159
- gap: "0.5rem"
160
- }, renderHeaderSubmitInfo(), renderHeaderActionAutoShutdown(), renderOptionMenu(), renderHeaderActionGrade()));
154
+ return jsxs(StyledHeader, {
155
+ children: [jsx(Box, {
156
+ component: "img",
157
+ src: img,
158
+ alt: "elice runbox",
159
+ sx: {
160
+ width: 'auto',
161
+ height: '100%',
162
+ imageRendering: 'auto',
163
+ padding: '0.465rem 0'
164
+ }
165
+ }), jsxs(Stack, {
166
+ direction: "row",
167
+ alignItems: "center",
168
+ gap: "0.5rem",
169
+ children: [renderHeaderSubmitInfo(), renderHeaderActionAutoShutdown(), renderOptionMenu(), renderHeaderActionGrade()]
170
+ })]
171
+ });
161
172
  };
162
173
 
163
174
  export { MaterialRunboxHeader as default };