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