dce-reactkit 3.4.0-beta.3 → 3.4.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -19,7 +19,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
19
  PERFORMANCE OF THIS SOFTWARE.
20
20
  ***************************************************************************** */
21
21
 
22
- function __awaiter$1(thisArg, _arguments, P, generator) {
22
+ function __awaiter(thisArg, _arguments, P, generator) {
23
23
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
24
24
  return new (P || (P = Promise))(function (resolve, reject) {
25
25
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -34,7 +34,7 @@ function __awaiter$1(thisArg, _arguments, P, generator) {
34
34
  * List of error codes built into the react kit
35
35
  * @author Gabe Abrams
36
36
  */
37
- var ReactKitErrorCode$2;
37
+ var ReactKitErrorCode;
38
38
  (function (ReactKitErrorCode) {
39
39
  ReactKitErrorCode["NoResponse"] = "DRK1";
40
40
  ReactKitErrorCode["NoCode"] = "DRK2";
@@ -49,8 +49,8 @@ var ReactKitErrorCode$2;
49
49
  ReactKitErrorCode["NotAllowedToReviewLogs"] = "DRK11";
50
50
  ReactKitErrorCode["ThemeCheckedBeforeReactKitReady"] = "DRK12";
51
51
  ReactKitErrorCode["SessionExpiredMessageGottenBeforeReactKitReady"] = "DRK13";
52
- })(ReactKitErrorCode$2 || (ReactKitErrorCode$2 = {}));
53
- var ReactKitErrorCode$3 = ReactKitErrorCode$2;
52
+ })(ReactKitErrorCode || (ReactKitErrorCode = {}));
53
+ var ReactKitErrorCode$1 = ReactKitErrorCode;
54
54
 
55
55
  /**
56
56
  * Displays an error
@@ -90,7 +90,7 @@ const ErrorBox = (props) => {
90
90
  } },
91
91
  "code:",
92
92
  ' ',
93
- String((_a = error.code) !== null && _a !== void 0 ? _a : ReactKitErrorCode$3.NoCode).toUpperCase())));
93
+ String((_a = error.code) !== null && _a !== void 0 ? _a : ReactKitErrorCode$1.NoCode).toUpperCase())));
94
94
  }
95
95
  // Main UI
96
96
  return (React__default.createElement("div", { className: "alert alert-danger text-center", style: {
@@ -111,7 +111,7 @@ const ErrorBox = (props) => {
111
111
  * Types of buttons in the modal
112
112
  * @author Gabe Abrams
113
113
  */
114
- var ModalButtonType$2;
114
+ var ModalButtonType;
115
115
  (function (ModalButtonType) {
116
116
  ModalButtonType["Okay"] = "okay";
117
117
  ModalButtonType["Cancel"] = "cancel";
@@ -123,14 +123,14 @@ var ModalButtonType$2;
123
123
  ModalButtonType["ImSure"] = "imSure";
124
124
  ModalButtonType["Delete"] = "delete";
125
125
  ModalButtonType["Confirm"] = "confirm";
126
- })(ModalButtonType$2 || (ModalButtonType$2 = {}));
127
- var ModalButtonType$3 = ModalButtonType$2;
126
+ })(ModalButtonType || (ModalButtonType = {}));
127
+ var ModalButtonType$1 = ModalButtonType;
128
128
 
129
129
  /**
130
130
  * Types of modals
131
131
  * @author Gabe Abrams
132
132
  */
133
- var ModalType$2;
133
+ var ModalType;
134
134
  (function (ModalType) {
135
135
  ModalType["Okay"] = "okay";
136
136
  ModalType["OkayCancel"] = "okay-cancel";
@@ -141,8 +141,8 @@ var ModalType$2;
141
141
  ModalType["DeleteCancel"] = "delete-cancel";
142
142
  ModalType["ConfirmCancel"] = "confirm-cancel";
143
143
  ModalType["NoButtons"] = "-";
144
- })(ModalType$2 || (ModalType$2 = {}));
145
- var ModalType$3 = ModalType$2;
144
+ })(ModalType || (ModalType = {}));
145
+ var ModalType$1 = ModalType;
146
146
 
147
147
  /**
148
148
  * Built-in metadata for logs
@@ -167,7 +167,7 @@ const LogBuiltInMetadata = {
167
167
  * @author Gabe Abrams
168
168
  * @param ms number of ms to wait
169
169
  */
170
- const waitMs = (ms = 0) => __awaiter$1(void 0, void 0, void 0, function* () {
170
+ const waitMs = (ms = 0) => __awaiter(void 0, void 0, void 0, function* () {
171
171
  return new Promise((resolve) => {
172
172
  setTimeout(resolve, ms);
173
173
  });
@@ -177,7 +177,7 @@ const waitMs = (ms = 0) => __awaiter$1(void 0, void 0, void 0, function* () {
177
177
  * Bootstrap variants
178
178
  * @author Gabe Abrams
179
179
  */
180
- var Variant$2;
180
+ var Variant;
181
181
  (function (Variant) {
182
182
  Variant["Primary"] = "primary";
183
183
  Variant["Secondary"] = "secondary";
@@ -187,21 +187,21 @@ var Variant$2;
187
187
  Variant["Danger"] = "danger";
188
188
  Variant["Light"] = "light";
189
189
  Variant["Dark"] = "dark";
190
- })(Variant$2 || (Variant$2 = {}));
191
- var Variant$3 = Variant$2;
190
+ })(Variant || (Variant = {}));
191
+ var Variant$1 = Variant;
192
192
 
193
193
  /**
194
194
  * Modal sizes
195
195
  * @author Gabe Abrams
196
196
  */
197
- var ModalSize$1;
197
+ var ModalSize;
198
198
  (function (ModalSize) {
199
199
  ModalSize["Small"] = "sm";
200
200
  ModalSize["Medium"] = "md";
201
201
  ModalSize["Large"] = "lg";
202
202
  ModalSize["ExtraLarge"] = "xl";
203
- })(ModalSize$1 || (ModalSize$1 = {}));
204
- var ModalSize$2 = ModalSize$1;
203
+ })(ModalSize || (ModalSize = {}));
204
+ var ModalSize$1 = ModalSize;
205
205
 
206
206
  /**
207
207
  * A generic popup modal
@@ -214,80 +214,80 @@ var ModalSize$2 = ModalSize$1;
214
214
  const MS_TO_ANIMATE = 200; // Animation duration
215
215
  // Modal type to list of buttons
216
216
  const modalTypeToModalButtonTypes = {
217
- [ModalType$3.Okay]: [
218
- ModalButtonType$3.Okay,
217
+ [ModalType$1.Okay]: [
218
+ ModalButtonType$1.Okay,
219
219
  ],
220
- [ModalType$3.OkayCancel]: [
221
- ModalButtonType$3.Okay,
222
- ModalButtonType$3.Cancel,
220
+ [ModalType$1.OkayCancel]: [
221
+ ModalButtonType$1.Okay,
222
+ ModalButtonType$1.Cancel,
223
223
  ],
224
- [ModalType$3.YesNo]: [
225
- ModalButtonType$3.Yes,
226
- ModalButtonType$3.No,
224
+ [ModalType$1.YesNo]: [
225
+ ModalButtonType$1.Yes,
226
+ ModalButtonType$1.No,
227
227
  ],
228
- [ModalType$3.YesNoCancel]: [
229
- ModalButtonType$3.Yes,
230
- ModalButtonType$3.No,
231
- ModalButtonType$3.Cancel,
228
+ [ModalType$1.YesNoCancel]: [
229
+ ModalButtonType$1.Yes,
230
+ ModalButtonType$1.No,
231
+ ModalButtonType$1.Cancel,
232
232
  ],
233
- [ModalType$3.AbandonGoBack]: [
234
- ModalButtonType$3.Abandon,
235
- ModalButtonType$3.GoBack,
233
+ [ModalType$1.AbandonGoBack]: [
234
+ ModalButtonType$1.Abandon,
235
+ ModalButtonType$1.GoBack,
236
236
  ],
237
- [ModalType$3.ImSureCancel]: [
238
- ModalButtonType$3.ImSure,
239
- ModalButtonType$3.Cancel,
237
+ [ModalType$1.ImSureCancel]: [
238
+ ModalButtonType$1.ImSure,
239
+ ModalButtonType$1.Cancel,
240
240
  ],
241
- [ModalType$3.DeleteCancel]: [
242
- ModalButtonType$3.Delete,
243
- ModalButtonType$3.Cancel,
241
+ [ModalType$1.DeleteCancel]: [
242
+ ModalButtonType$1.Delete,
243
+ ModalButtonType$1.Cancel,
244
244
  ],
245
- [ModalType$3.ConfirmCancel]: [
246
- ModalButtonType$3.Confirm,
247
- ModalButtonType$3.Cancel,
245
+ [ModalType$1.ConfirmCancel]: [
246
+ ModalButtonType$1.Confirm,
247
+ ModalButtonType$1.Cancel,
248
248
  ],
249
249
  };
250
250
  // Button type styling and labels
251
251
  const ModalButtonTypeToLabelAndVariant = {
252
- [ModalButtonType$3.Okay]: {
252
+ [ModalButtonType$1.Okay]: {
253
253
  label: 'Okay',
254
- variant: Variant$3.Dark,
254
+ variant: Variant$1.Dark,
255
255
  },
256
- [ModalButtonType$3.Cancel]: {
256
+ [ModalButtonType$1.Cancel]: {
257
257
  label: 'Cancel',
258
- variant: Variant$3.Secondary,
258
+ variant: Variant$1.Secondary,
259
259
  },
260
- [ModalButtonType$3.Yes]: {
260
+ [ModalButtonType$1.Yes]: {
261
261
  label: 'Yes',
262
- variant: Variant$3.Dark,
262
+ variant: Variant$1.Dark,
263
263
  },
264
- [ModalButtonType$3.No]: {
264
+ [ModalButtonType$1.No]: {
265
265
  label: 'No',
266
- variant: Variant$3.Secondary,
266
+ variant: Variant$1.Secondary,
267
267
  },
268
- [ModalButtonType$3.Abandon]: {
268
+ [ModalButtonType$1.Abandon]: {
269
269
  label: 'Abandon Changes',
270
- variant: Variant$3.Warning,
270
+ variant: Variant$1.Warning,
271
271
  },
272
- [ModalButtonType$3.GoBack]: {
272
+ [ModalButtonType$1.GoBack]: {
273
273
  label: 'Go Back',
274
- variant: Variant$3.Secondary,
274
+ variant: Variant$1.Secondary,
275
275
  },
276
- [ModalButtonType$3.Continue]: {
276
+ [ModalButtonType$1.Continue]: {
277
277
  label: 'Continue',
278
- variant: Variant$3.Dark,
278
+ variant: Variant$1.Dark,
279
279
  },
280
- [ModalButtonType$3.ImSure]: {
280
+ [ModalButtonType$1.ImSure]: {
281
281
  label: 'I am sure',
282
- variant: Variant$3.Warning,
282
+ variant: Variant$1.Warning,
283
283
  },
284
- [ModalButtonType$3.Delete]: {
284
+ [ModalButtonType$1.Delete]: {
285
285
  label: 'Yes, Delete',
286
- variant: Variant$3.Danger,
286
+ variant: Variant$1.Danger,
287
287
  },
288
- [ModalButtonType$3.Confirm]: {
288
+ [ModalButtonType$1.Confirm]: {
289
289
  label: 'Confirm',
290
- variant: Variant$3.Dark,
290
+ variant: Variant$1.Dark,
291
291
  },
292
292
  };
293
293
  /*------------------------------------------------------------------------*/
@@ -365,7 +365,7 @@ const Modal = (props) => {
365
365
  /*------------------------------------------------------------------------*/
366
366
  var _a;
367
367
  /* -------------- Props ------------- */
368
- const { type = ModalType$3.NoButtons, size = ModalSize$2.Large, title, children, onClose, dontAllowBackdropExit, onTopOfOtherModals, } = props;
368
+ const { type = ModalType$1.NoButtons, size = ModalSize$1.Large, title, children, onClose, dontAllowBackdropExit, onTopOfOtherModals, } = props;
369
369
  /* -------------- State ------------- */
370
370
  // If true, the modal is shown
371
371
  const [visible, setVisible] = useState(false);
@@ -382,7 +382,7 @@ const Modal = (props) => {
382
382
  * @author Gabe Abrams
383
383
  */
384
384
  useEffect(() => {
385
- (() => __awaiter$1(void 0, void 0, void 0, function* () {
385
+ (() => __awaiter(void 0, void 0, void 0, function* () {
386
386
  // Set defaults
387
387
  setVisible(false);
388
388
  setAnimatingIn(true);
@@ -408,7 +408,7 @@ const Modal = (props) => {
408
408
  * @param ModalButtonType the button that was clicked when closing the
409
409
  * modal
410
410
  */
411
- const handleClose = (ModalButtonType) => __awaiter$1(void 0, void 0, void 0, function* () {
411
+ const handleClose = (ModalButtonType) => __awaiter(void 0, void 0, void 0, function* () {
412
412
  // Don't close if no handler
413
413
  if (!onClose) {
414
414
  return;
@@ -470,7 +470,7 @@ const Modal = (props) => {
470
470
  React__default.createElement("style", null, style$8),
471
471
  React__default.createElement("div", { className: `Modal-backdrop ${backdropAnimationClass}`, style: {
472
472
  zIndex: 5000000003,
473
- }, onClick: () => __awaiter$1(void 0, void 0, void 0, function* () {
473
+ }, onClick: () => __awaiter(void 0, void 0, void 0, function* () {
474
474
  // Skip if exit via backdrop not allowed
475
475
  if (dontAllowBackdropExit || !onClose) {
476
476
  // Show pop animation
@@ -483,7 +483,7 @@ const Modal = (props) => {
483
483
  return;
484
484
  }
485
485
  // Handle close
486
- handleClose(ModalButtonType$3.Cancel);
486
+ handleClose(ModalButtonType$1.Cancel);
487
487
  }) }),
488
488
  React__default.createElement("div", { className: `modal-dialog modal-${size} ${animationClass}`, style: {
489
489
  zIndex: 5000000002,
@@ -495,7 +495,7 @@ const Modal = (props) => {
495
495
  } }, title),
496
496
  onClose && (React__default.createElement("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: () => {
497
497
  // Handle close
498
- handleClose(ModalButtonType$3.Cancel);
498
+ handleClose(ModalButtonType$1.Cancel);
499
499
  } }))),
500
500
  children && (React__default.createElement("div", { className: "modal-body" }, children)),
501
501
  footer && (React__default.createElement("div", { className: "modal-footer pt-1 pb-1" }, footer))))));
@@ -505,7 +505,7 @@ const Modal = (props) => {
505
505
  * An error with a code
506
506
  * @author Gabe Abrams
507
507
  */
508
- class ErrorWithCode$1 extends Error {
508
+ class ErrorWithCode extends Error {
509
509
  constructor(message, code) {
510
510
  super(message);
511
511
  this.name = 'ErrorWithCode';
@@ -552,10 +552,10 @@ let storedSendRequest;
552
552
  * @author Gabe Abrams
553
553
  * @returns sendRequest function
554
554
  */
555
- const getSendRequest = () => __awaiter$1(void 0, void 0, void 0, function* () {
555
+ const getSendRequest = () => __awaiter(void 0, void 0, void 0, function* () {
556
556
  // Track timeout
557
557
  let timedOut = false;
558
- (() => __awaiter$1(void 0, void 0, void 0, function* () {
558
+ (() => __awaiter(void 0, void 0, void 0, function* () {
559
559
  yield waitMs(5000);
560
560
  timedOut = true;
561
561
  }))(),
@@ -563,7 +563,7 @@ const getSendRequest = () => __awaiter$1(void 0, void 0, void 0, function* () {
563
563
  yield initialized;
564
564
  // Error if no send request function
565
565
  if (timedOut) {
566
- showFatalError(new ErrorWithCode$1('Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.', ReactKitErrorCode$3.NoCACCLSendRequestFunction));
566
+ showFatalError(new ErrorWithCode('Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.', ReactKitErrorCode$1.NoCACCLSendRequestFunction));
567
567
  // Return dummy function that never resolves
568
568
  return (() => {
569
569
  return new Promise(() => { });
@@ -623,7 +623,7 @@ const _setStubResponse = (opts) => {
623
623
  const { path, body, } = opts;
624
624
  const method = ((_a = opts.method) !== null && _a !== void 0 ? _a : 'GET').toUpperCase();
625
625
  const errorMessage = ((_b = opts.errorMessage) !== null && _b !== void 0 ? _b : 'An unknown error has occurred.');
626
- const errorCode = ((_c = opts.errorCode) !== null && _c !== void 0 ? _c : ReactKitErrorCode$3.NoCode);
626
+ const errorCode = ((_c = opts.errorCode) !== null && _c !== void 0 ? _c : ReactKitErrorCode$1.NoCode);
627
627
  // Store to stub responses
628
628
  if (!stubResponses[method]) {
629
629
  stubResponses[method] = {};
@@ -651,7 +651,7 @@ const _setStubResponse = (opts) => {
651
651
  * @param [opts.params] - query/body parameters to include
652
652
  * @returns response from server
653
653
  */
654
- const visitServerEndpoint = (opts) => __awaiter$1(void 0, void 0, void 0, function* () {
654
+ const visitServerEndpoint = (opts) => __awaiter(void 0, void 0, void 0, function* () {
655
655
  var _a, _b, _c;
656
656
  const method = ((_a = opts.method) !== null && _a !== void 0 ? _a : 'GET');
657
657
  // Handle stubs
@@ -669,7 +669,7 @@ const visitServerEndpoint = (opts) => __awaiter$1(void 0, void 0, void 0, functi
669
669
  return stubResponse.body;
670
670
  }
671
671
  // Error
672
- throw new ErrorWithCode$1(stubResponse.errorMessage, stubResponse.errorCode);
672
+ throw new ErrorWithCode(stubResponse.errorMessage, stubResponse.errorCode);
673
673
  }
674
674
  // Send the request
675
675
  const sendRequest = yield getSendRequest();
@@ -680,11 +680,11 @@ const visitServerEndpoint = (opts) => __awaiter$1(void 0, void 0, void 0, functi
680
680
  });
681
681
  // Check for failure
682
682
  if (!response || !response.body) {
683
- throw new ErrorWithCode$1('We didn\'t get a response from the server. Please check your internet connection.', ReactKitErrorCode$3.NoResponse);
683
+ throw new ErrorWithCode('We didn\'t get a response from the server. Please check your internet connection.', ReactKitErrorCode$1.NoResponse);
684
684
  }
685
685
  if (!response.body.success) {
686
686
  // Session expired
687
- if (response.body.code === ReactKitErrorCode$3.SessionExpired) {
687
+ if (response.body.code === ReactKitErrorCode$1.SessionExpired) {
688
688
  // Skip notice if session was already expired
689
689
  if (sessionAlreadyExpired) {
690
690
  // Never return (browser is already reloading)
@@ -705,9 +705,9 @@ const visitServerEndpoint = (opts) => __awaiter$1(void 0, void 0, void 0, functi
705
705
  });
706
706
  }
707
707
  // Other errors
708
- throw new ErrorWithCode$1((response.body.message
708
+ throw new ErrorWithCode((response.body.message
709
709
  || 'An unknown error occurred. Please contact an admin.'), (response.body.code
710
- || ReactKitErrorCode$3.NoCode));
710
+ || ReactKitErrorCode$1.NoCode));
711
711
  }
712
712
  // Success! Extract the body
713
713
  const { body } = response.body;
@@ -719,7 +719,7 @@ const visitServerEndpoint = (opts) => __awaiter$1(void 0, void 0, void 0, functi
719
719
  * Log a user action on the client (cannot be used on the server)
720
720
  * @author Gabe Abrams
721
721
  */
722
- const logClientEvent = (opts) => __awaiter$1(void 0, void 0, void 0, function* () {
722
+ const logClientEvent = (opts) => __awaiter(void 0, void 0, void 0, function* () {
723
723
  var _a, _b, _c, _d, _e, _f, _g;
724
724
  return visitServerEndpoint({
725
725
  path: LOG_ROUTE_PATH,
@@ -771,7 +771,7 @@ let onAlertClosed;
771
771
  * @param title the title text to display at the top of the alert
772
772
  * @param text the text to display in the alert
773
773
  */
774
- const alert$1 = (title, text) => __awaiter$1(void 0, void 0, void 0, function* () {
774
+ const alert$1 = (title, text) => __awaiter(void 0, void 0, void 0, function* () {
775
775
  // Fallback if alert not available
776
776
  if (!setAlertInfo) {
777
777
  window.alert(`${title}\n\n${text}`);
@@ -811,7 +811,7 @@ let onConfirmClosed;
811
811
  * button
812
812
  * @returns true if the user confirmed
813
813
  */
814
- const confirm = (title, text, opts) => __awaiter$1(void 0, void 0, void 0, function* () {
814
+ const confirm = (title, text, opts) => __awaiter(void 0, void 0, void 0, function* () {
815
815
  // Fallback if confirm is not available
816
816
  if (!setConfirmInfo) {
817
817
  return window.confirm(`${title}\n\n${text}`);
@@ -850,8 +850,8 @@ const showFatalError = (error, errorTitle = 'An Error Occurred') => {
850
850
  ? error.trim()
851
851
  : String((_a = error.message) !== null && _a !== void 0 ? _a : 'An unknown error occurred.'));
852
852
  const code = (typeof error === 'string'
853
- ? ReactKitErrorCode$3.NoCode
854
- : String((_b = error.code) !== null && _b !== void 0 ? _b : ReactKitErrorCode$3.NoCode));
853
+ ? ReactKitErrorCode$1.NoCode
854
+ : String((_b = error.code) !== null && _b !== void 0 ? _b : ReactKitErrorCode$1.NoCode));
855
855
  // Add log
856
856
  logClientEvent({
857
857
  context: LogBuiltInMetadata.Context.ClientFatalError,
@@ -910,7 +910,7 @@ const AppWrapper = (props) => {
910
910
  let modal;
911
911
  /* -------------- Alert ------------- */
912
912
  if (alertInfo) {
913
- modal = (React__default.createElement(Modal, { key: `alert-${alertInfo.title}-${alertInfo.text}`, title: alertInfo.title, type: ModalType$3.Okay, onClose: () => {
913
+ modal = (React__default.createElement(Modal, { key: `alert-${alertInfo.title}-${alertInfo.text}`, title: alertInfo.title, type: ModalType$1.Okay, onClose: () => {
914
914
  // Alert closed
915
915
  setAlertInfo(undefined);
916
916
  if (onAlertClosed) {
@@ -920,10 +920,10 @@ const AppWrapper = (props) => {
920
920
  }
921
921
  /* ------------- Confirm ------------ */
922
922
  if (confirmInfo) {
923
- modal = (React__default.createElement(Modal, { key: `confirm-${confirmInfo.title}-${confirmInfo.text}`, title: confirmInfo.title, type: ModalType$3.OkayCancel, okayLabel: confirmInfo.opts.confirmButtonText, okayVariant: confirmInfo.opts.confirmButtonVariant, cancelLabel: confirmInfo.opts.cancelButtonText, cancelVariant: confirmInfo.opts.cancelButtonVariant, onClose: (buttonType) => {
923
+ modal = (React__default.createElement(Modal, { key: `confirm-${confirmInfo.title}-${confirmInfo.text}`, title: confirmInfo.title, type: ModalType$1.OkayCancel, okayLabel: confirmInfo.opts.confirmButtonText, okayVariant: confirmInfo.opts.confirmButtonVariant, cancelLabel: confirmInfo.opts.cancelButtonText, cancelVariant: confirmInfo.opts.cancelButtonVariant, onClose: (buttonType) => {
924
924
  setConfirmInfo(undefined);
925
925
  if (onConfirmClosed) {
926
- onConfirmClosed(buttonType === ModalButtonType$3.Okay);
926
+ onConfirmClosed(buttonType === ModalButtonType$1.Okay);
927
927
  }
928
928
  }, dontAllowBackdropExit: true }, confirmInfo.text));
929
929
  }
@@ -936,8 +936,8 @@ const AppWrapper = (props) => {
936
936
  if (fatalErrorMessage || fatalErrorCode || sessionHasExpired) {
937
937
  // Re-encapsulate in an error
938
938
  const error = (sessionHasExpired
939
- ? new ErrorWithCode$1(getSessionExpiredMessage(), ReactKitErrorCode$3.SessionExpired)
940
- : new ErrorWithCode$1((fatalErrorMessage !== null && fatalErrorMessage !== void 0 ? fatalErrorMessage : 'An unknown error has occurred. Please contact support.'), (fatalErrorCode !== null && fatalErrorCode !== void 0 ? fatalErrorCode : ReactKitErrorCode$3.NoCode)));
939
+ ? new ErrorWithCode(getSessionExpiredMessage(), ReactKitErrorCode$1.SessionExpired)
940
+ : new ErrorWithCode((fatalErrorMessage !== null && fatalErrorMessage !== void 0 ? fatalErrorMessage : 'An unknown error has occurred. Please contact support.'), (fatalErrorCode !== null && fatalErrorCode !== void 0 ? fatalErrorCode : ReactKitErrorCode$1.NoCode)));
941
941
  // Build error screen
942
942
  body = (React__default.createElement("div", { style: {
943
943
  display: 'block',
@@ -1162,7 +1162,7 @@ const RadioButton = (props) => {
1162
1162
  /* Setup */
1163
1163
  /*------------------------------------------------------------------------*/
1164
1164
  /* -------------- Props ------------- */
1165
- const { text, onSelected, ariaLabel, title, selected, id, noMarginOnRight, selectedVariant = Variant$3.Secondary, unselectedVariant = Variant$3.Light, small, } = props;
1165
+ const { text, onSelected, ariaLabel, title, selected, id, noMarginOnRight, selectedVariant = Variant$1.Secondary, unselectedVariant = Variant$1.Light, small, } = props;
1166
1166
  /*------------------------------------------------------------------------*/
1167
1167
  /* Render */
1168
1168
  /*------------------------------------------------------------------------*/
@@ -1190,7 +1190,7 @@ const CheckboxButton = (props) => {
1190
1190
  /* Setup */
1191
1191
  /*------------------------------------------------------------------------*/
1192
1192
  /* -------------- Props ------------- */
1193
- const { text, onChanged, ariaLabel, title, checked, id, className, noMarginOnRight, checkedVariant = Variant$3.Secondary, uncheckedVariant = Variant$3.Light, small, dashed, } = props;
1193
+ const { text, onChanged, ariaLabel, title, checked, id, className, noMarginOnRight, checkedVariant = Variant$1.Secondary, uncheckedVariant = Variant$1.Light, small, dashed, } = props;
1194
1194
  /*------------------------------------------------------------------------*/
1195
1195
  /* Render */
1196
1196
  /*------------------------------------------------------------------------*/
@@ -1836,13 +1836,13 @@ const PopPendingMark = (props) => {
1836
1836
  */
1837
1837
  /* ------------- Actions ------------ */
1838
1838
  // Types of actions
1839
- var ActionType$8;
1839
+ var ActionType$6;
1840
1840
  (function (ActionType) {
1841
1841
  // Indicate that the text was recently copied
1842
1842
  ActionType["IndicateRecentlyCopied"] = "indicate-recently-copied";
1843
1843
  // Clear the status
1844
1844
  ActionType["ClearRecentlyCopiedStatus"] = "clear-recently-copied-status";
1845
- })(ActionType$8 || (ActionType$8 = {}));
1845
+ })(ActionType$6 || (ActionType$6 = {}));
1846
1846
  /**
1847
1847
  * Reducer that executes actions
1848
1848
  * @author Gabe Abrams
@@ -1851,12 +1851,12 @@ var ActionType$8;
1851
1851
  */
1852
1852
  const reducer$6 = (state, action) => {
1853
1853
  switch (action.type) {
1854
- case ActionType$8.IndicateRecentlyCopied: {
1854
+ case ActionType$6.IndicateRecentlyCopied: {
1855
1855
  return {
1856
1856
  recentlyCopied: true,
1857
1857
  };
1858
1858
  }
1859
- case ActionType$8.ClearRecentlyCopiedStatus: {
1859
+ case ActionType$6.ClearRecentlyCopiedStatus: {
1860
1860
  return {
1861
1861
  recentlyCopied: false,
1862
1862
  };
@@ -1892,7 +1892,7 @@ const CopiableBox = (props) => {
1892
1892
  * Perform a copy
1893
1893
  * @author Gabe Abrams
1894
1894
  */
1895
- const performCopy = () => __awaiter$1(void 0, void 0, void 0, function* () {
1895
+ const performCopy = () => __awaiter(void 0, void 0, void 0, function* () {
1896
1896
  // Write to clipboard
1897
1897
  try {
1898
1898
  yield navigator.clipboard.writeText(text);
@@ -1902,13 +1902,13 @@ const CopiableBox = (props) => {
1902
1902
  }
1903
1903
  // Show copied notice
1904
1904
  dispatch({
1905
- type: ActionType$8.IndicateRecentlyCopied,
1905
+ type: ActionType$6.IndicateRecentlyCopied,
1906
1906
  });
1907
1907
  // Wait a moment
1908
1908
  yield waitMs(4000);
1909
1909
  // Hide copied notice
1910
1910
  dispatch({
1911
- type: ActionType$8.ClearRecentlyCopiedStatus,
1911
+ type: ActionType$6.ClearRecentlyCopiedStatus,
1912
1912
  });
1913
1913
  });
1914
1914
  /*------------------------------------------------------------------------*/
@@ -1964,11 +1964,11 @@ const CopiableBox = (props) => {
1964
1964
  */
1965
1965
  /* ------------- Actions ------------ */
1966
1966
  // Types of actions
1967
- var ActionType$7;
1967
+ var ActionType$5;
1968
1968
  (function (ActionType) {
1969
1969
  // Toggle whether a child are being shown
1970
1970
  ActionType["ToggleChild"] = "toggle-child";
1971
- })(ActionType$7 || (ActionType$7 = {}));
1971
+ })(ActionType$5 || (ActionType$5 = {}));
1972
1972
  /**
1973
1973
  * Reducer that executes actions
1974
1974
  * @author Gabe Abrams
@@ -1977,7 +1977,7 @@ var ActionType$7;
1977
1977
  */
1978
1978
  const reducer$5 = (state, action) => {
1979
1979
  switch (action.type) {
1980
- case ActionType$7.ToggleChild: {
1980
+ case ActionType$5.ToggleChild: {
1981
1981
  return Object.assign(Object.assign({}, state), { childExpanded: Object.assign(Object.assign({}, state.childExpanded), { [String(action.id)]: !state.childExpanded[String(action.id)] }) });
1982
1982
  }
1983
1983
  default: {
@@ -2096,14 +2096,14 @@ const NestableItemList = (props) => {
2096
2096
  backgroundColor: 'transparent',
2097
2097
  }, type: "button", onClick: () => {
2098
2098
  dispatch({
2099
- type: ActionType$7.ToggleChild,
2099
+ type: ActionType$5.ToggleChild,
2100
2100
  id: item.id,
2101
2101
  });
2102
2102
  }, "aria-label": `${childExpanded[item.id] ? 'Hide' : 'Show'} items in ${item.name}` },
2103
2103
  React__default.createElement(FontAwesomeIcon, { icon: childExpanded[item.id] ? faChevronDown : faChevronRight })))),
2104
2104
  React__default.createElement(CheckboxButton, { className: `NestableItemList-CheckboxButton-${item.id}`, text: item.name, checked: item.isGroup ? allChecked(item.children) : item.checked, dashed: item.isGroup ? !noneChecked(item.children) : false, onChanged: (checked) => {
2105
2105
  onChanged(changeChecked(item.id, checked, items));
2106
- }, ariaLabel: `Select ${item.name}`, checkedVariant: Variant$3.Light }),
2106
+ }, ariaLabel: `Select ${item.name}`, checkedVariant: Variant$1.Light }),
2107
2107
  (item.isGroup && childExpanded[item.id]) && (React__default.createElement("div", { className: "NestableItemList-children-container", style: {
2108
2108
  paddingLeft: '2.2rem',
2109
2109
  } },
@@ -2241,7 +2241,7 @@ var LogAction$1 = LogAction;
2241
2241
  * Server-side API param types
2242
2242
  * @author Gabe Abrams
2243
2243
  */
2244
- var ParamType$2;
2244
+ var ParamType;
2245
2245
  (function (ParamType) {
2246
2246
  ParamType["Boolean"] = "boolean";
2247
2247
  ParamType["BooleanOptional"] = "boolean-optional";
@@ -2253,8 +2253,8 @@ var ParamType$2;
2253
2253
  ParamType["JSONOptional"] = "json-optional";
2254
2254
  ParamType["String"] = "string";
2255
2255
  ParamType["StringOptional"] = "string-optional";
2256
- })(ParamType$2 || (ParamType$2 = {}));
2257
- var ParamType$3 = ParamType$2;
2256
+ })(ParamType || (ParamType = {}));
2257
+ var ParamType$1 = ParamType;
2258
2258
 
2259
2259
  /**
2260
2260
  * Round a number to a certain number of decimals
@@ -2371,7 +2371,7 @@ var SortType;
2371
2371
  })(SortType || (SortType = {}));
2372
2372
  /* ------------- Actions ------------ */
2373
2373
  // Types of actions
2374
- var ActionType$6;
2374
+ var ActionType$4;
2375
2375
  (function (ActionType) {
2376
2376
  // Toggle sort column param
2377
2377
  ActionType["ToggleSortColumn"] = "toggle-sort-column";
@@ -2383,7 +2383,7 @@ var ActionType$6;
2383
2383
  ActionType["ShowAllColumns"] = "show-all-columns";
2384
2384
  // Hide all columns
2385
2385
  ActionType["HideAllColumns"] = "hide-all-columns";
2386
- })(ActionType$6 || (ActionType$6 = {}));
2386
+ })(ActionType$4 || (ActionType$4 = {}));
2387
2387
  /**
2388
2388
  * Reducer that executes actions
2389
2389
  * @author Gabe Abrams
@@ -2392,7 +2392,7 @@ var ActionType$6;
2392
2392
  */
2393
2393
  const reducer$4 = (state, action) => {
2394
2394
  switch (action.type) {
2395
- case ActionType$6.ToggleSortColumn: {
2395
+ case ActionType$4.ToggleSortColumn: {
2396
2396
  if (action.param !== state.sortColumnParam) {
2397
2397
  // Different column param
2398
2398
  return Object.assign(Object.assign({}, state), { sortColumnParam: action.param, sortType: SortType.Ascending });
@@ -2404,22 +2404,22 @@ const reducer$4 = (state, action) => {
2404
2404
  // Stop sorting by column
2405
2405
  return Object.assign(Object.assign({}, state), { sortColumnParam: undefined, sortType: SortType.Ascending });
2406
2406
  }
2407
- case ActionType$6.UpdateColumnVisibility: {
2407
+ case ActionType$4.UpdateColumnVisibility: {
2408
2408
  const { columnVisibilityMap } = state;
2409
2409
  columnVisibilityMap[action.param] = action.visible;
2410
2410
  return Object.assign(Object.assign({}, state), { columnVisibilityMap });
2411
2411
  }
2412
- case ActionType$6.ToggleColVisCusModalVisibility: {
2412
+ case ActionType$4.ToggleColVisCusModalVisibility: {
2413
2413
  return Object.assign(Object.assign({}, state), { columnVisibilityCustomizationModalVisible: !state.columnVisibilityCustomizationModalVisible });
2414
2414
  }
2415
- case ActionType$6.ShowAllColumns: {
2415
+ case ActionType$4.ShowAllColumns: {
2416
2416
  const { columnVisibilityMap } = state;
2417
2417
  Object.keys(columnVisibilityMap).forEach((param) => {
2418
2418
  columnVisibilityMap[param] = true;
2419
2419
  });
2420
2420
  return Object.assign(Object.assign({}, state), { columnVisibilityMap });
2421
2421
  }
2422
- case ActionType$6.HideAllColumns: {
2422
+ case ActionType$4.HideAllColumns: {
2423
2423
  const { columnVisibilityMap } = state;
2424
2424
  Object.keys(columnVisibilityMap).forEach((param) => {
2425
2425
  columnVisibilityMap[param] = false;
@@ -2480,7 +2480,7 @@ const IntelliTable = (props) => {
2480
2480
  /* ------- Col Vis Customization Modal ------ */
2481
2481
  if (columnVisibilityCustomizationModalVisible) {
2482
2482
  // Create modal
2483
- modal = (React__default.createElement(Modal, { type: ModalType$3.Okay, title: "Choose columns to show:", onClose: () => {
2483
+ modal = (React__default.createElement(Modal, { type: ModalType$1.Okay, title: "Choose columns to show:", onClose: () => {
2484
2484
  const noColumnsSelected = (Object.values(columnVisibilityMap)
2485
2485
  .every((isSelected) => {
2486
2486
  return !isSelected;
@@ -2489,27 +2489,27 @@ const IntelliTable = (props) => {
2489
2489
  return alert$1('Choose at least one column', 'To continue, you have to choose at least one column to show');
2490
2490
  }
2491
2491
  dispatch({
2492
- type: ActionType$6.ToggleColVisCusModalVisibility,
2492
+ type: ActionType$4.ToggleColVisCusModalVisibility,
2493
2493
  });
2494
- }, okayVariant: Variant$3.Light },
2494
+ }, okayVariant: Variant$1.Light },
2495
2495
  columns.map((column) => {
2496
2496
  return (React__default.createElement(CheckboxButton, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, className: "mb-2", text: column.title, onChanged: (checked) => {
2497
2497
  dispatch({
2498
- type: ActionType$6.UpdateColumnVisibility,
2498
+ type: ActionType$4.UpdateColumnVisibility,
2499
2499
  param: column.param,
2500
2500
  visible: checked,
2501
2501
  });
2502
- }, checked: columnVisibilityMap[column.param], ariaLabel: `show "${column.title}" column in the ${title} table`, checkedVariant: Variant$3.Light, uncheckedVariant: Variant$3.Secondary }));
2502
+ }, checked: columnVisibilityMap[column.param], ariaLabel: `show "${column.title}" column in the ${title} table`, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Secondary }));
2503
2503
  }),
2504
2504
  React__default.createElement("div", { className: "mt-3" }, "Or you can:"),
2505
2505
  React__default.createElement("button", { type: "button", id: `IntelliTable-${id}-select-all-columns`, className: "btn btn-secondary me-2", "aria-label": `show all columns in the ${title} table`, onClick: () => {
2506
2506
  dispatch({
2507
- type: ActionType$6.ShowAllColumns,
2507
+ type: ActionType$4.ShowAllColumns,
2508
2508
  });
2509
2509
  } }, "Select All"),
2510
2510
  React__default.createElement("button", { type: "button", id: `IntelliTable-${id}-select-none-columns`, className: "btn btn-secondary", "aria-label": `hide all columns in the ${title} table`, onClick: () => {
2511
2511
  dispatch({
2512
- type: ActionType$6.HideAllColumns,
2512
+ type: ActionType$4.HideAllColumns,
2513
2513
  });
2514
2514
  } }, "Deselect All")));
2515
2515
  }
@@ -2560,7 +2560,7 @@ const IntelliTable = (props) => {
2560
2560
  React__default.createElement("div", null,
2561
2561
  React__default.createElement("button", { type: "button", id: `IntelliTable-${id}-sort-by-${column.param}-button`, className: `btn btn-${sortingByThisColumn ? 'light' : 'secondary'} btn-sm ms-1 ps-1 pe-1 pt-0 pb-0`, "aria-label": sortButtonAriaLabel, onClick: () => {
2562
2562
  dispatch({
2563
- type: ActionType$6.ToggleSortColumn,
2563
+ type: ActionType$4.ToggleSortColumn,
2564
2564
  param: column.param,
2565
2565
  });
2566
2566
  } },
@@ -2600,7 +2600,7 @@ const IntelliTable = (props) => {
2600
2600
  }
2601
2601
  // Sort differently based on the data type
2602
2602
  // > Boolean
2603
- if (paramType === ParamType$3.Boolean) {
2603
+ if (paramType === ParamType$1.Boolean) {
2604
2604
  if (aVal && !bVal) {
2605
2605
  return (descending ? -1 : 1);
2606
2606
  }
@@ -2610,14 +2610,14 @@ const IntelliTable = (props) => {
2610
2610
  return tiebreaker;
2611
2611
  }
2612
2612
  // > Number
2613
- if (paramType === ParamType$3.Int
2614
- || paramType === ParamType$3.Float) {
2613
+ if (paramType === ParamType$1.Int
2614
+ || paramType === ParamType$1.Float) {
2615
2615
  return (descending
2616
2616
  ? (bVal - aVal)
2617
2617
  : (aVal - bVal));
2618
2618
  }
2619
2619
  // > String
2620
- if (paramType === ParamType$3.String) {
2620
+ if (paramType === ParamType$1.String) {
2621
2621
  if (aVal < bVal) {
2622
2622
  return (descending ? 1 : -1);
2623
2623
  }
@@ -2627,7 +2627,7 @@ const IntelliTable = (props) => {
2627
2627
  return tiebreaker;
2628
2628
  }
2629
2629
  // > JSON
2630
- if (paramType === ParamType$3.JSON) {
2630
+ if (paramType === ParamType$1.JSON) {
2631
2631
  const aSize = (Array.isArray(aVal)
2632
2632
  ? aVal.length
2633
2633
  : Object.keys(aVal).length);
@@ -2659,7 +2659,7 @@ const IntelliTable = (props) => {
2659
2659
  let fullValue;
2660
2660
  let visibleValue;
2661
2661
  let title = '';
2662
- if (column.type === ParamType$3.Boolean) {
2662
+ if (column.type === ParamType$1.Boolean) {
2663
2663
  fullValue = !!(value);
2664
2664
  const noValue = (value === undefined
2665
2665
  || value === null);
@@ -2671,7 +2671,7 @@ const IntelliTable = (props) => {
2671
2671
  title = 'Empty Cell';
2672
2672
  }
2673
2673
  }
2674
- else if (column.type === ParamType$3.Int) {
2674
+ else if (column.type === ParamType$1.Int) {
2675
2675
  fullValue = Number.parseInt(value, 10);
2676
2676
  const noValue = Number.isNaN(fullValue);
2677
2677
  visibleValue = (noValue
@@ -2682,7 +2682,7 @@ const IntelliTable = (props) => {
2682
2682
  title = 'Empty Cell';
2683
2683
  }
2684
2684
  }
2685
- else if (column.type === ParamType$3.Float) {
2685
+ else if (column.type === ParamType$1.Float) {
2686
2686
  fullValue = Number.parseFloat(value);
2687
2687
  const noValue = Number.isNaN(fullValue);
2688
2688
  visibleValue = (noValue
@@ -2693,7 +2693,7 @@ const IntelliTable = (props) => {
2693
2693
  title = 'Empty Cell';
2694
2694
  }
2695
2695
  }
2696
- else if (column.type === ParamType$3.String) {
2696
+ else if (column.type === ParamType$1.String) {
2697
2697
  fullValue = String(value).trim();
2698
2698
  const noValue = (value === undefined
2699
2699
  || value === null
@@ -2706,7 +2706,7 @@ const IntelliTable = (props) => {
2706
2706
  title = 'Empty Cell';
2707
2707
  }
2708
2708
  }
2709
- else if (column.type === ParamType$3.JSON) {
2709
+ else if (column.type === ParamType$1.JSON) {
2710
2710
  fullValue = JSON.stringify(value);
2711
2711
  const noValue = (Array.isArray(value)
2712
2712
  ? (!value || value.length === 0)
@@ -2749,7 +2749,7 @@ const IntelliTable = (props) => {
2749
2749
  React__default.createElement(CSVDownloadButton, { "aria-label": `download data as csv for ${title}`, id: `IntelliTable-${id}-download-as-csv`, filename: filename, csv: csv }),
2750
2750
  React__default.createElement("button", { type: "button", className: "btn btn-secondary ms-2", "aria-label": `show panel for customizing which columns show in table ${title}`, id: `IntelliTable-${id}-show-column-customization-modal`, onClick: () => {
2751
2751
  dispatch({
2752
- type: ActionType$6.ToggleColVisCusModalVisibility,
2752
+ type: ActionType$4.ToggleColVisCusModalVisibility,
2753
2753
  });
2754
2754
  } },
2755
2755
  "Show/Hide Cols",
@@ -2871,185 +2871,185 @@ const columns = [
2871
2871
  {
2872
2872
  title: 'First Name',
2873
2873
  param: 'userFirstName',
2874
- type: ParamType$3.String,
2874
+ type: ParamType$1.String,
2875
2875
  },
2876
2876
  {
2877
2877
  title: 'Last Name',
2878
2878
  param: 'userLastName',
2879
- type: ParamType$3.String,
2879
+ type: ParamType$1.String,
2880
2880
  },
2881
2881
  {
2882
2882
  title: 'Email',
2883
2883
  param: 'userEmail',
2884
- type: ParamType$3.String,
2884
+ type: ParamType$1.String,
2885
2885
  },
2886
2886
  {
2887
2887
  title: 'Canvas Id',
2888
2888
  param: 'userId',
2889
- type: ParamType$3.Int,
2889
+ type: ParamType$1.Int,
2890
2890
  },
2891
2891
  {
2892
2892
  title: 'Student?',
2893
2893
  param: 'isLearner',
2894
- type: ParamType$3.Boolean,
2894
+ type: ParamType$1.Boolean,
2895
2895
  },
2896
2896
  {
2897
2897
  title: 'Teaching Staff?',
2898
2898
  param: 'isTTM',
2899
- type: ParamType$3.Boolean,
2899
+ type: ParamType$1.Boolean,
2900
2900
  startsHidden: true,
2901
2901
  },
2902
2902
  {
2903
2903
  title: 'Admin?',
2904
2904
  param: 'isAdmin',
2905
- type: ParamType$3.Boolean,
2905
+ type: ParamType$1.Boolean,
2906
2906
  startsHidden: true,
2907
2907
  },
2908
2908
  {
2909
2909
  title: 'Course Canvas Id',
2910
2910
  param: 'courseId',
2911
- type: ParamType$3.Int,
2911
+ type: ParamType$1.Int,
2912
2912
  startsHidden: true,
2913
2913
  },
2914
2914
  {
2915
2915
  title: 'Course Name',
2916
2916
  param: 'courseName',
2917
- type: ParamType$3.String,
2917
+ type: ParamType$1.String,
2918
2918
  },
2919
2919
  {
2920
2920
  title: 'Browser Name',
2921
2921
  param: 'browser.name',
2922
- type: ParamType$3.String,
2922
+ type: ParamType$1.String,
2923
2923
  startsHidden: true,
2924
2924
  },
2925
2925
  {
2926
2926
  title: 'Browser Version',
2927
2927
  param: 'browser.version',
2928
- type: ParamType$3.String,
2928
+ type: ParamType$1.String,
2929
2929
  startsHidden: true,
2930
2930
  },
2931
2931
  {
2932
2932
  title: 'OS',
2933
2933
  param: 'device.os',
2934
- type: ParamType$3.String,
2934
+ type: ParamType$1.String,
2935
2935
  startsHidden: true,
2936
2936
  },
2937
2937
  {
2938
2938
  title: 'Mobile?',
2939
2939
  param: 'device.isMobile',
2940
- type: ParamType$3.Boolean,
2940
+ type: ParamType$1.Boolean,
2941
2941
  startsHidden: true,
2942
2942
  },
2943
2943
  {
2944
2944
  title: 'Year',
2945
2945
  param: 'year',
2946
- type: ParamType$3.Int,
2946
+ type: ParamType$1.Int,
2947
2947
  },
2948
2948
  {
2949
2949
  title: 'Month',
2950
2950
  param: 'month',
2951
- type: ParamType$3.Int,
2951
+ type: ParamType$1.Int,
2952
2952
  },
2953
2953
  {
2954
2954
  title: 'Day',
2955
2955
  param: 'day',
2956
- type: ParamType$3.Int,
2956
+ type: ParamType$1.Int,
2957
2957
  },
2958
2958
  {
2959
2959
  title: 'Hour',
2960
2960
  param: 'hour',
2961
- type: ParamType$3.Int,
2961
+ type: ParamType$1.Int,
2962
2962
  },
2963
2963
  {
2964
2964
  title: 'Minute',
2965
2965
  param: 'minute',
2966
- type: ParamType$3.Int,
2966
+ type: ParamType$1.Int,
2967
2967
  startsHidden: true,
2968
2968
  },
2969
2969
  {
2970
2970
  title: 'Timestamp',
2971
2971
  param: 'timestamp',
2972
- type: ParamType$3.Int,
2972
+ type: ParamType$1.Int,
2973
2973
  startsHidden: true,
2974
2974
  },
2975
2975
  {
2976
2976
  title: 'Context',
2977
2977
  param: 'context',
2978
- type: ParamType$3.String,
2978
+ type: ParamType$1.String,
2979
2979
  },
2980
2980
  {
2981
2981
  title: 'Subcontext',
2982
2982
  param: 'subcontext',
2983
- type: ParamType$3.String,
2983
+ type: ParamType$1.String,
2984
2984
  },
2985
2985
  {
2986
2986
  title: 'Tags',
2987
2987
  param: 'tags',
2988
- type: ParamType$3.JSON,
2988
+ type: ParamType$1.JSON,
2989
2989
  startsHidden: true,
2990
2990
  },
2991
2991
  {
2992
2992
  title: 'Log Level',
2993
2993
  param: 'level',
2994
- type: ParamType$3.String,
2994
+ type: ParamType$1.String,
2995
2995
  startsHidden: true,
2996
2996
  },
2997
2997
  {
2998
2998
  title: 'Metadata',
2999
2999
  param: 'metadata',
3000
- type: ParamType$3.JSON,
3000
+ type: ParamType$1.JSON,
3001
3001
  startsHidden: true,
3002
3002
  },
3003
3003
  {
3004
3004
  title: 'Source',
3005
3005
  param: 'source',
3006
- type: ParamType$3.String,
3006
+ type: ParamType$1.String,
3007
3007
  },
3008
3008
  {
3009
3009
  title: 'Server Route Path',
3010
3010
  param: 'routePath',
3011
- type: ParamType$3.String,
3011
+ type: ParamType$1.String,
3012
3012
  startsHidden: true,
3013
3013
  },
3014
3014
  {
3015
3015
  title: 'Server Route Template',
3016
3016
  param: 'routeTemplate',
3017
- type: ParamType$3.String,
3017
+ type: ParamType$1.String,
3018
3018
  startsHidden: true,
3019
3019
  },
3020
3020
  {
3021
3021
  title: 'Type',
3022
3022
  param: 'type',
3023
- type: ParamType$3.String,
3023
+ type: ParamType$1.String,
3024
3024
  },
3025
3025
  {
3026
3026
  title: 'Error Message',
3027
3027
  param: 'errorMessage',
3028
- type: ParamType$3.String,
3028
+ type: ParamType$1.String,
3029
3029
  startsHidden: true,
3030
3030
  },
3031
3031
  {
3032
3032
  title: 'Error Code',
3033
3033
  param: 'errorCode',
3034
- type: ParamType$3.String,
3034
+ type: ParamType$1.String,
3035
3035
  startsHidden: true,
3036
3036
  },
3037
3037
  {
3038
3038
  title: 'Error Stack',
3039
3039
  param: 'errorStack',
3040
- type: ParamType$3.String,
3040
+ type: ParamType$1.String,
3041
3041
  startsHidden: true,
3042
3042
  },
3043
3043
  {
3044
3044
  title: 'Action Target',
3045
3045
  param: 'target',
3046
- type: ParamType$3.String,
3046
+ type: ParamType$1.String,
3047
3047
  startsHidden: true,
3048
3048
  },
3049
3049
  {
3050
3050
  title: 'Action Type',
3051
3051
  param: 'action',
3052
- type: ParamType$3.String,
3052
+ type: ParamType$1.String,
3053
3053
  startsHidden: true,
3054
3054
  },
3055
3055
  ];
@@ -3115,7 +3115,7 @@ const genHumanReadableName = (machineReadableName) => {
3115
3115
  };
3116
3116
  /* ------------- Actions ------------ */
3117
3117
  // Types of actions
3118
- var ActionType$5;
3118
+ var ActionType$3;
3119
3119
  (function (ActionType) {
3120
3120
  // Show the loading bar
3121
3121
  ActionType["StartLoading"] = "start-loading";
@@ -3137,7 +3137,7 @@ var ActionType$5;
3137
3137
  ActionType["UpdateActionErrorFilterState"] = "update-action-error-filter-state";
3138
3138
  // Update the advanced filter state
3139
3139
  ActionType["UpdateAdvancedFilterState"] = "update-advanced-filter-state";
3140
- })(ActionType$5 || (ActionType$5 = {}));
3140
+ })(ActionType$3 || (ActionType$3 = {}));
3141
3141
  /**
3142
3142
  * Reducer that executes actions
3143
3143
  * @author Gabe Abrams
@@ -3146,36 +3146,36 @@ var ActionType$5;
3146
3146
  */
3147
3147
  const reducer$3 = (state, action) => {
3148
3148
  switch (action.type) {
3149
- case ActionType$5.StartLoading: {
3149
+ case ActionType$3.StartLoading: {
3150
3150
  return Object.assign(Object.assign({}, state), { loading: true });
3151
3151
  }
3152
- case ActionType$5.FinishLoading: {
3152
+ case ActionType$3.FinishLoading: {
3153
3153
  return Object.assign(Object.assign({}, state), { loading: false, logMap: action.logMap });
3154
3154
  }
3155
- case ActionType$5.ToggleFilterDrawer: {
3155
+ case ActionType$3.ToggleFilterDrawer: {
3156
3156
  return Object.assign(Object.assign({}, state), { expandedFilterDrawer: (state.expandedFilterDrawer === action.filterDrawer
3157
3157
  ? undefined // hide
3158
3158
  : action.filterDrawer) });
3159
3159
  }
3160
- case ActionType$5.HideFilterDrawer: {
3160
+ case ActionType$3.HideFilterDrawer: {
3161
3161
  return Object.assign(Object.assign({}, state), { expandedFilterDrawer: undefined });
3162
3162
  }
3163
- case ActionType$5.ResetFilters: {
3163
+ case ActionType$3.ResetFilters: {
3164
3164
  return Object.assign(Object.assign({}, state), { dateFilterState: action.initDateFilterState, contextFilterState: action.initContextFilterState, tagFilterState: action.initTagFilterState, actionErrorFilterState: action.initActionErrorFilterState, advancedFilterState: action.initAdvancedFilterState });
3165
3165
  }
3166
- case ActionType$5.UpdateDateFilterState: {
3166
+ case ActionType$3.UpdateDateFilterState: {
3167
3167
  return Object.assign(Object.assign({}, state), { dateFilterState: action.dateFilterState });
3168
3168
  }
3169
- case ActionType$5.UpdateContextFilterState: {
3169
+ case ActionType$3.UpdateContextFilterState: {
3170
3170
  return Object.assign(Object.assign({}, state), { contextFilterState: action.contextFilterState });
3171
3171
  }
3172
- case ActionType$5.UpdateTagFilterState: {
3172
+ case ActionType$3.UpdateTagFilterState: {
3173
3173
  return Object.assign(Object.assign({}, state), { tagFilterState: action.tagFilterState });
3174
3174
  }
3175
- case ActionType$5.UpdateActionErrorFilterState: {
3175
+ case ActionType$3.UpdateActionErrorFilterState: {
3176
3176
  return Object.assign(Object.assign({}, state), { actionErrorFilterState: action.actionErrorFilterState });
3177
3177
  }
3178
- case ActionType$5.UpdateAdvancedFilterState: {
3178
+ case ActionType$3.UpdateAdvancedFilterState: {
3179
3179
  return Object.assign(Object.assign({}, state), { advancedFilterState: action.advancedFilterState });
3180
3180
  }
3181
3181
  default: {
@@ -3352,10 +3352,10 @@ const LogReviewer = (props) => {
3352
3352
  * @author Gabe Abrams
3353
3353
  * @param newDateFilterState the new date filter state
3354
3354
  */
3355
- const handleDateRangeUpdated = (newDateFilterState) => __awaiter$1(void 0, void 0, void 0, function* () {
3355
+ const handleDateRangeUpdated = (newDateFilterState) => __awaiter(void 0, void 0, void 0, function* () {
3356
3356
  // Update state
3357
3357
  dispatch({
3358
- type: ActionType$5.UpdateDateFilterState,
3358
+ type: ActionType$3.UpdateDateFilterState,
3359
3359
  dateFilterState: newDateFilterState,
3360
3360
  });
3361
3361
  // Check which year/month combos we need to load
@@ -3366,7 +3366,7 @@ const LogReviewer = (props) => {
3366
3366
  }
3367
3367
  // Start loading
3368
3368
  dispatch({
3369
- type: ActionType$5.StartLoading,
3369
+ type: ActionType$3.StartLoading,
3370
3370
  });
3371
3371
  // Load required months
3372
3372
  try {
@@ -3390,7 +3390,7 @@ const LogReviewer = (props) => {
3390
3390
  }
3391
3391
  // Finish loading
3392
3392
  dispatch({
3393
- type: ActionType$5.FinishLoading,
3393
+ type: ActionType$3.FinishLoading,
3394
3394
  logMap,
3395
3395
  });
3396
3396
  });
@@ -3429,7 +3429,7 @@ const LogReviewer = (props) => {
3429
3429
  React__default.createElement("div", { className: "LogReviewer-filter-toggle-buttons alert alert-secondary p-2 m-0" },
3430
3430
  React__default.createElement("button", { type: "button", id: "LogReviewer-toggle-date-filter-drawer", className: `btn btn-${FilterDrawer.Date === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle date filter drawer", onClick: () => {
3431
3431
  dispatch({
3432
- type: ActionType$5.ToggleFilterDrawer,
3432
+ type: ActionType$3.ToggleFilterDrawer,
3433
3433
  filterDrawer: FilterDrawer.Date,
3434
3434
  });
3435
3435
  } },
@@ -3437,7 +3437,7 @@ const LogReviewer = (props) => {
3437
3437
  "Date"),
3438
3438
  React__default.createElement("button", { type: "button", id: "LogReviewer-toggle-context-filter-drawer", className: `btn btn-${FilterDrawer.Context === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle context filter drawer", onClick: () => {
3439
3439
  dispatch({
3440
- type: ActionType$5.ToggleFilterDrawer,
3440
+ type: ActionType$3.ToggleFilterDrawer,
3441
3441
  filterDrawer: FilterDrawer.Context,
3442
3442
  });
3443
3443
  } },
@@ -3445,7 +3445,7 @@ const LogReviewer = (props) => {
3445
3445
  "Context"),
3446
3446
  (LogMetadata.Tag && Object.keys(LogMetadata.Tag).length > 0) && (React__default.createElement("button", { type: "button", id: "LogReviewer-toggle-tag-filter-drawer", className: `btn btn-${FilterDrawer.Tag === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle tag filter drawer", onClick: () => {
3447
3447
  dispatch({
3448
- type: ActionType$5.ToggleFilterDrawer,
3448
+ type: ActionType$3.ToggleFilterDrawer,
3449
3449
  filterDrawer: FilterDrawer.Tag,
3450
3450
  });
3451
3451
  } },
@@ -3453,7 +3453,7 @@ const LogReviewer = (props) => {
3453
3453
  "Tag")),
3454
3454
  React__default.createElement("button", { type: "button", id: "LogReviewer-toggle-action-filter-drawer", className: `btn btn-${FilterDrawer.Action === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle action and error filter drawer", onClick: () => {
3455
3455
  dispatch({
3456
- type: ActionType$5.ToggleFilterDrawer,
3456
+ type: ActionType$3.ToggleFilterDrawer,
3457
3457
  filterDrawer: FilterDrawer.Action,
3458
3458
  });
3459
3459
  } },
@@ -3461,7 +3461,7 @@ const LogReviewer = (props) => {
3461
3461
  "Action"),
3462
3462
  React__default.createElement("button", { type: "button", id: "LogReviewer-toggle-advanced-filter-drawer", className: `btn btn-${FilterDrawer.Advanced === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle advanced filter drawer", onClick: () => {
3463
3463
  dispatch({
3464
- type: ActionType$5.ToggleFilterDrawer,
3464
+ type: ActionType$3.ToggleFilterDrawer,
3465
3465
  filterDrawer: FilterDrawer.Advanced,
3466
3466
  });
3467
3467
  } },
@@ -3469,7 +3469,7 @@ const LogReviewer = (props) => {
3469
3469
  "Advanced"),
3470
3470
  React__default.createElement("button", { type: "button", id: "LogReviewer-reset-filters-button", className: "btn btn-light", "aria-label": "reset filters", onClick: () => {
3471
3471
  dispatch({
3472
- type: ActionType$5.ResetFilters,
3472
+ type: ActionType$3.ResetFilters,
3473
3473
  initActionErrorFilterState,
3474
3474
  initAdvancedFilterState,
3475
3475
  initContextFilterState,
@@ -3591,7 +3591,7 @@ const LogReviewer = (props) => {
3591
3591
  }
3592
3592
  });
3593
3593
  dispatch({
3594
- type: ActionType$5.UpdateContextFilterState,
3594
+ type: ActionType$3.UpdateContextFilterState,
3595
3595
  contextFilterState,
3596
3596
  });
3597
3597
  } }));
@@ -3606,7 +3606,7 @@ const LogReviewer = (props) => {
3606
3606
  return (React__default.createElement(CheckboxButton, { key: tag, id: `LogReviewer-tag-${tag}-checkbox`, text: description, ariaLabel: `require that logs be tagged with "${description}" or any other selected tag`, checked: tagFilterState[tag], onChanged: (checked) => {
3607
3607
  tagFilterState[tag] = checked;
3608
3608
  dispatch({
3609
- type: ActionType$5.UpdateTagFilterState,
3609
+ type: ActionType$3.UpdateTagFilterState,
3610
3610
  tagFilterState,
3611
3611
  });
3612
3612
  } }));
@@ -3619,21 +3619,21 @@ const LogReviewer = (props) => {
3619
3619
  React__default.createElement(RadioButton, { id: "LogReviewer-type-all", text: "All Logs", onSelected: () => {
3620
3620
  actionErrorFilterState.type = undefined;
3621
3621
  dispatch({
3622
- type: ActionType$5.UpdateActionErrorFilterState,
3622
+ type: ActionType$3.UpdateActionErrorFilterState,
3623
3623
  actionErrorFilterState,
3624
3624
  });
3625
3625
  }, ariaLabel: "show logs of all types", selected: actionErrorFilterState.type === undefined }),
3626
3626
  React__default.createElement(RadioButton, { id: "LogReviewer-type-action-only", text: "Action Logs Only", onSelected: () => {
3627
3627
  actionErrorFilterState.type = LogType$1.Action;
3628
3628
  dispatch({
3629
- type: ActionType$5.UpdateActionErrorFilterState,
3629
+ type: ActionType$3.UpdateActionErrorFilterState,
3630
3630
  actionErrorFilterState,
3631
3631
  });
3632
3632
  }, ariaLabel: "only show action logs", selected: actionErrorFilterState.type === LogType$1.Action }),
3633
3633
  React__default.createElement(RadioButton, { id: "LogReviewer-type-error-only", text: "Action Error Only", onSelected: () => {
3634
3634
  actionErrorFilterState.type = LogType$1.Error;
3635
3635
  dispatch({
3636
- type: ActionType$5.UpdateActionErrorFilterState,
3636
+ type: ActionType$3.UpdateActionErrorFilterState,
3637
3637
  actionErrorFilterState,
3638
3638
  });
3639
3639
  }, ariaLabel: "only show error logs", selected: actionErrorFilterState.type === LogType$1.Error, noMarginOnRight: true })),
@@ -3645,7 +3645,7 @@ const LogReviewer = (props) => {
3645
3645
  return (React__default.createElement(CheckboxButton, { key: action, id: `LogReviewer-action-${action}-checkbox`, text: description, ariaLabel: `include logs with action type "${description}" in results`, noMarginOnRight: true, checked: actionErrorFilterState.action[action], onChanged: (checked) => {
3646
3646
  actionErrorFilterState.action[action] = checked;
3647
3647
  dispatch({
3648
- type: ActionType$5.UpdateActionErrorFilterState,
3648
+ type: ActionType$3.UpdateActionErrorFilterState,
3649
3649
  actionErrorFilterState,
3650
3650
  });
3651
3651
  } }));
@@ -3656,7 +3656,7 @@ const LogReviewer = (props) => {
3656
3656
  return (React__default.createElement(CheckboxButton, { key: target, id: `LogReviewer-target-${target}-checkbox`, text: description, ariaLabel: `include logs with target "${description}" in results`, checked: actionErrorFilterState.target[target], noMarginOnRight: true, onChanged: (checked) => {
3657
3657
  actionErrorFilterState.target[target] = checked;
3658
3658
  dispatch({
3659
- type: ActionType$5.UpdateActionErrorFilterState,
3659
+ type: ActionType$3.UpdateActionErrorFilterState,
3660
3660
  actionErrorFilterState,
3661
3661
  });
3662
3662
  } }));
@@ -3668,7 +3668,7 @@ const LogReviewer = (props) => {
3668
3668
  React__default.createElement("input", { type: "text", className: "form-control", "aria-label": "query for error message", value: actionErrorFilterState.errorMessage, placeholder: "e.g. undefined is not a function", onChange: (e) => {
3669
3669
  actionErrorFilterState.errorMessage = e.target.value;
3670
3670
  dispatch({
3671
- type: ActionType$5.UpdateActionErrorFilterState,
3671
+ type: ActionType$3.UpdateActionErrorFilterState,
3672
3672
  actionErrorFilterState,
3673
3673
  });
3674
3674
  } })),
@@ -3679,7 +3679,7 @@ const LogReviewer = (props) => {
3679
3679
  .trim()
3680
3680
  .toUpperCase());
3681
3681
  dispatch({
3682
- type: ActionType$5.UpdateActionErrorFilterState,
3682
+ type: ActionType$3.UpdateActionErrorFilterState,
3683
3683
  actionErrorFilterState,
3684
3684
  });
3685
3685
  } }))))));
@@ -3693,7 +3693,7 @@ const LogReviewer = (props) => {
3693
3693
  React__default.createElement("input", { type: "text", className: "form-control", "aria-label": "query for user first name", value: advancedFilterState.userFirstName, placeholder: "e.g. Divardo", onChange: (e) => {
3694
3694
  advancedFilterState.userFirstName = e.target.value;
3695
3695
  dispatch({
3696
- type: ActionType$5.UpdateAdvancedFilterState,
3696
+ type: ActionType$3.UpdateAdvancedFilterState,
3697
3697
  advancedFilterState,
3698
3698
  });
3699
3699
  } })),
@@ -3702,7 +3702,7 @@ const LogReviewer = (props) => {
3702
3702
  React__default.createElement("input", { type: "text", className: "form-control", "aria-label": "query for user last name", value: advancedFilterState.userLastName, placeholder: "e.g. Calicci", onChange: (e) => {
3703
3703
  advancedFilterState.userLastName = e.target.value;
3704
3704
  dispatch({
3705
- type: ActionType$5.UpdateAdvancedFilterState,
3705
+ type: ActionType$3.UpdateAdvancedFilterState,
3706
3706
  advancedFilterState,
3707
3707
  });
3708
3708
  } })),
@@ -3712,7 +3712,7 @@ const LogReviewer = (props) => {
3712
3712
  advancedFilterState.userEmail = ((e.target.value)
3713
3713
  .trim());
3714
3714
  dispatch({
3715
- type: ActionType$5.UpdateAdvancedFilterState,
3715
+ type: ActionType$3.UpdateAdvancedFilterState,
3716
3716
  advancedFilterState,
3717
3717
  });
3718
3718
  } })),
@@ -3726,7 +3726,7 @@ const LogReviewer = (props) => {
3726
3726
  .trim());
3727
3727
  }
3728
3728
  dispatch({
3729
- type: ActionType$5.UpdateAdvancedFilterState,
3729
+ type: ActionType$3.UpdateAdvancedFilterState,
3730
3730
  advancedFilterState,
3731
3731
  });
3732
3732
  } })),
@@ -3734,21 +3734,21 @@ const LogReviewer = (props) => {
3734
3734
  React__default.createElement(CheckboxButton, { text: "Students", onChanged: (checked) => {
3735
3735
  advancedFilterState.includeLearners = checked;
3736
3736
  dispatch({
3737
- type: ActionType$5.UpdateAdvancedFilterState,
3737
+ type: ActionType$3.UpdateAdvancedFilterState,
3738
3738
  advancedFilterState,
3739
3739
  });
3740
3740
  }, checked: advancedFilterState.includeLearners, ariaLabel: "show logs from students" }),
3741
3741
  React__default.createElement(CheckboxButton, { text: "Teaching Team Members", onChanged: (checked) => {
3742
3742
  advancedFilterState.includeTTMs = checked;
3743
3743
  dispatch({
3744
- type: ActionType$5.UpdateAdvancedFilterState,
3744
+ type: ActionType$3.UpdateAdvancedFilterState,
3745
3745
  advancedFilterState,
3746
3746
  });
3747
3747
  }, checked: advancedFilterState.includeTTMs, ariaLabel: "show logs from teaching team members" }),
3748
3748
  React__default.createElement(CheckboxButton, { text: "Admins", onChanged: (checked) => {
3749
3749
  advancedFilterState.includeAdmins = checked;
3750
3750
  dispatch({
3751
- type: ActionType$5.UpdateAdvancedFilterState,
3751
+ type: ActionType$3.UpdateAdvancedFilterState,
3752
3752
  advancedFilterState,
3753
3753
  });
3754
3754
  }, checked: advancedFilterState.includeAdmins, ariaLabel: "show logs from admins" }))),
@@ -3758,7 +3758,7 @@ const LogReviewer = (props) => {
3758
3758
  React__default.createElement("input", { type: "text", className: "form-control", "aria-label": "query for course name", value: advancedFilterState.courseName, placeholder: "e.g. GLC 200", onChange: (e) => {
3759
3759
  advancedFilterState.courseName = e.target.value;
3760
3760
  dispatch({
3761
- type: ActionType$5.UpdateAdvancedFilterState,
3761
+ type: ActionType$3.UpdateAdvancedFilterState,
3762
3762
  advancedFilterState,
3763
3763
  });
3764
3764
  } })),
@@ -3772,7 +3772,7 @@ const LogReviewer = (props) => {
3772
3772
  .trim());
3773
3773
  }
3774
3774
  dispatch({
3775
- type: ActionType$5.UpdateAdvancedFilterState,
3775
+ type: ActionType$3.UpdateAdvancedFilterState,
3776
3776
  advancedFilterState,
3777
3777
  });
3778
3778
  } }))),
@@ -3781,21 +3781,21 @@ const LogReviewer = (props) => {
3781
3781
  React__default.createElement(RadioButton, { text: "All Devices", ariaLabel: "show logs from all devices", selected: advancedFilterState.isMobile === undefined, onSelected: () => {
3782
3782
  advancedFilterState.isMobile = undefined;
3783
3783
  dispatch({
3784
- type: ActionType$5.UpdateAdvancedFilterState,
3784
+ type: ActionType$3.UpdateAdvancedFilterState,
3785
3785
  advancedFilterState,
3786
3786
  });
3787
3787
  } }),
3788
3788
  React__default.createElement(RadioButton, { text: "Mobile Only", ariaLabel: "show logs from mobile devices", selected: advancedFilterState.isMobile === true, onSelected: () => {
3789
3789
  advancedFilterState.isMobile = true;
3790
3790
  dispatch({
3791
- type: ActionType$5.UpdateAdvancedFilterState,
3791
+ type: ActionType$3.UpdateAdvancedFilterState,
3792
3792
  advancedFilterState,
3793
3793
  });
3794
3794
  } }),
3795
3795
  React__default.createElement(RadioButton, { text: "Desktop Only", ariaLabel: "show logs from desktop devices", selected: advancedFilterState.isMobile === false, onSelected: () => {
3796
3796
  advancedFilterState.isMobile = false;
3797
3797
  dispatch({
3798
- type: ActionType$5.UpdateAdvancedFilterState,
3798
+ type: ActionType$3.UpdateAdvancedFilterState,
3799
3799
  advancedFilterState,
3800
3800
  });
3801
3801
  }, noMarginOnRight: true }))),
@@ -3804,21 +3804,21 @@ const LogReviewer = (props) => {
3804
3804
  React__default.createElement(RadioButton, { text: "Both", ariaLabel: "show logs from all sources", selected: advancedFilterState.source === undefined, onSelected: () => {
3805
3805
  advancedFilterState.source = undefined;
3806
3806
  dispatch({
3807
- type: ActionType$5.UpdateAdvancedFilterState,
3807
+ type: ActionType$3.UpdateAdvancedFilterState,
3808
3808
  advancedFilterState,
3809
3809
  });
3810
3810
  } }),
3811
3811
  React__default.createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected: advancedFilterState.source === LogSource$1.Client, onSelected: () => {
3812
3812
  advancedFilterState.source = LogSource$1.Client;
3813
3813
  dispatch({
3814
- type: ActionType$5.UpdateAdvancedFilterState,
3814
+ type: ActionType$3.UpdateAdvancedFilterState,
3815
3815
  advancedFilterState,
3816
3816
  });
3817
3817
  } }),
3818
3818
  React__default.createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected: advancedFilterState.source === LogSource$1.Server, onSelected: () => {
3819
3819
  advancedFilterState.source = LogSource$1.Server;
3820
3820
  dispatch({
3821
- type: ActionType$5.UpdateAdvancedFilterState,
3821
+ type: ActionType$3.UpdateAdvancedFilterState,
3822
3822
  advancedFilterState,
3823
3823
  });
3824
3824
  }, noMarginOnRight: true })),
@@ -3829,7 +3829,7 @@ const LogReviewer = (props) => {
3829
3829
  advancedFilterState.courseName = ((e.target.value)
3830
3830
  .trim());
3831
3831
  dispatch({
3832
- type: ActionType$5.UpdateAdvancedFilterState,
3832
+ type: ActionType$3.UpdateAdvancedFilterState,
3833
3833
  advancedFilterState,
3834
3834
  });
3835
3835
  } })),
@@ -3839,7 +3839,7 @@ const LogReviewer = (props) => {
3839
3839
  advancedFilterState.courseName = ((e.target.value)
3840
3840
  .trim());
3841
3841
  dispatch({
3842
- type: ActionType$5.UpdateAdvancedFilterState,
3842
+ type: ActionType$3.UpdateAdvancedFilterState,
3843
3843
  advancedFilterState,
3844
3844
  });
3845
3845
  } })))))));
@@ -39439,11 +39439,11 @@ var CreatableSelect$1 = CreatableSelect;
39439
39439
  // Import React
39440
39440
  /* ------------- Actions ------------ */
39441
39441
  // Types of actions
39442
- var ActionType$4;
39442
+ var ActionType$2;
39443
39443
  (function (ActionType) {
39444
39444
  // Update the input value
39445
39445
  ActionType["SetInputValue"] = "SetInputValue";
39446
- })(ActionType$4 || (ActionType$4 = {}));
39446
+ })(ActionType$2 || (ActionType$2 = {}));
39447
39447
  /**
39448
39448
  * Reducer that executes actions
39449
39449
  * @author Yuen Ler Chow
@@ -39452,7 +39452,7 @@ var ActionType$4;
39452
39452
  */
39453
39453
  const reducer$2 = (state, action) => {
39454
39454
  switch (action.type) {
39455
- case ActionType$4.SetInputValue: {
39455
+ case ActionType$2.SetInputValue: {
39456
39456
  return Object.assign(Object.assign({}, state), { inputValue: action.value });
39457
39457
  }
39458
39458
  default: {
@@ -39543,7 +39543,7 @@ const CreatableMultiselect = (props) => {
39543
39543
  }
39544
39544
  // resets text field to empty because the values have been added
39545
39545
  dispatch({
39546
- type: ActionType$4.SetInputValue,
39546
+ type: ActionType$2.SetInputValue,
39547
39547
  value: '',
39548
39548
  });
39549
39549
  };
@@ -39582,7 +39582,7 @@ const CreatableMultiselect = (props) => {
39582
39582
  else {
39583
39583
  // simply update the input value to the new input value
39584
39584
  dispatch({
39585
- type: ActionType$4.SetInputValue,
39585
+ type: ActionType$2.SetInputValue,
39586
39586
  value: newValue,
39587
39587
  });
39588
39588
  }
@@ -39633,13 +39633,13 @@ const style = `
39633
39633
  `;
39634
39634
  /* ------------- Actions ------------ */
39635
39635
  // Types of actions
39636
- var ActionType$3;
39636
+ var ActionType$1;
39637
39637
  (function (ActionType) {
39638
39638
  // Update the DBEntry
39639
39639
  ActionType["UpdateDBEntry"] = "UpdateDBEntry";
39640
39640
  // Start the save spinner
39641
39641
  ActionType["StartSave"] = "StartSave";
39642
- })(ActionType$3 || (ActionType$3 = {}));
39642
+ })(ActionType$1 || (ActionType$1 = {}));
39643
39643
  /**
39644
39644
  * Reducer that executes actions
39645
39645
  * @author Yuen Ler Chow
@@ -39648,10 +39648,10 @@ var ActionType$3;
39648
39648
  */
39649
39649
  const reducer$1 = (state, action) => {
39650
39650
  switch (action.type) {
39651
- case ActionType$3.UpdateDBEntry: {
39651
+ case ActionType$1.UpdateDBEntry: {
39652
39652
  return Object.assign(Object.assign({}, state), { entry: action.dbEntry });
39653
39653
  }
39654
- case ActionType$3.StartSave: {
39654
+ case ActionType$1.StartSave: {
39655
39655
  return Object.assign(Object.assign({}, state), { saving: true });
39656
39656
  }
39657
39657
  default: {
@@ -39686,9 +39686,9 @@ const AddOrEditDBEntry = (props) => {
39686
39686
  * Save changes to the DBEntry and then finish
39687
39687
  * @author Yuen Ler Chow
39688
39688
  */
39689
- const save = () => __awaiter$1(void 0, void 0, void 0, function* () {
39689
+ const save = () => __awaiter(void 0, void 0, void 0, function* () {
39690
39690
  // Start the save loading indicator
39691
- dispatch({ type: ActionType$3.StartSave });
39691
+ dispatch({ type: ActionType$1.StartSave });
39692
39692
  // add all default values to the entry
39693
39693
  entryFields.forEach((field) => {
39694
39694
  if (field.defaultValue && !entry[field.objectKey]) {
@@ -39849,7 +39849,7 @@ const AddOrEditDBEntry = (props) => {
39849
39849
  return (React__default.createElement(RadioButton, { key: choice.value, text: choice.title, selected: entry[field.objectKey] === choice.value, onSelected: () => {
39850
39850
  entry[field.objectKey] = choice.value;
39851
39851
  dispatch({
39852
- type: ActionType$3.UpdateDBEntry,
39852
+ type: ActionType$1.UpdateDBEntry,
39853
39853
  dbEntry: entry,
39854
39854
  });
39855
39855
  }, ariaLabel: choice.title }));
@@ -39861,7 +39861,7 @@ const AddOrEditDBEntry = (props) => {
39861
39861
  React__default.createElement("input", { disabled: disabled, type: "text", className: "form-control", placeholder: field.placeholder, "aria-describedby": "AddOrEditDBEntry-form-name-label", value: entry[field.objectKey] || '', onChange: (e) => {
39862
39862
  entry[field.objectKey] = (e.target.value);
39863
39863
  dispatch({
39864
- type: ActionType$3.UpdateDBEntry,
39864
+ type: ActionType$1.UpdateDBEntry,
39865
39865
  dbEntry: entry,
39866
39866
  });
39867
39867
  } }))));
@@ -39874,7 +39874,7 @@ const AddOrEditDBEntry = (props) => {
39874
39874
  entry[field.objectKey] = (e.target.value
39875
39875
  .replace(/[^0-9]/g, ''));
39876
39876
  dispatch({
39877
- type: ActionType$3.UpdateDBEntry,
39877
+ type: ActionType$1.UpdateDBEntry,
39878
39878
  dbEntry: entry,
39879
39879
  });
39880
39880
  } }))));
@@ -39904,7 +39904,7 @@ const AddOrEditDBEntry = (props) => {
39904
39904
  }
39905
39905
  // Save
39906
39906
  dispatch({
39907
- type: ActionType$3.UpdateDBEntry,
39907
+ type: ActionType$1.UpdateDBEntry,
39908
39908
  dbEntry: entry,
39909
39909
  });
39910
39910
  }, ariaLabel: choice.title }));
@@ -39919,7 +39919,7 @@ const AddOrEditDBEntry = (props) => {
39919
39919
  // Update entry and save
39920
39920
  entry[field.objectKey] = values;
39921
39921
  dispatch({
39922
- type: ActionType$3.UpdateDBEntry,
39922
+ type: ActionType$1.UpdateDBEntry,
39923
39923
  dbEntry: entry,
39924
39924
  });
39925
39925
  } })))));
@@ -39932,7 +39932,7 @@ const AddOrEditDBEntry = (props) => {
39932
39932
  React__default.createElement(CreatableMultiselect, { disabled: disabled, type: DBEntryFieldType$1.NumberArray, values: entry[field.objectKey] || [], onChange: (values) => {
39933
39933
  entry[field.objectKey] = values;
39934
39934
  dispatch({
39935
- type: ActionType$3.UpdateDBEntry,
39935
+ type: ActionType$1.UpdateDBEntry,
39936
39936
  dbEntry: entry,
39937
39937
  });
39938
39938
  } })))));
@@ -39956,7 +39956,7 @@ const AddOrEditDBEntry = (props) => {
39956
39956
  return renderEntryField(field, disabled);
39957
39957
  }),
39958
39958
  React__default.createElement("div", { className: "text-center mt-2" },
39959
- React__default.createElement("button", { type: "button", id: "AddOrEditDBEntry-save-changes-button", className: "btn btn-primary btn-lg me-1", "aria-label": "Save changes", onClick: () => __awaiter$1(void 0, void 0, void 0, function* () {
39959
+ React__default.createElement("button", { type: "button", id: "AddOrEditDBEntry-save-changes-button", className: "btn btn-primary btn-lg me-1", "aria-label": "Save changes", onClick: () => __awaiter(void 0, void 0, void 0, function* () {
39960
39960
  if (validationError) {
39961
39961
  return alert$1('Please fix the following error', validationError);
39962
39962
  }
@@ -40002,7 +40002,7 @@ const generateEndpointPath = (collectionName, adminsOnly) => {
40002
40002
  */
40003
40003
  /* ------------- Actions ------------ */
40004
40004
  // Types of actions
40005
- var ActionType$2;
40005
+ var ActionType;
40006
40006
  (function (ActionType) {
40007
40007
  // Show adder
40008
40008
  ActionType["ShowAdder"] = "ShowAdder";
@@ -40016,7 +40016,7 @@ var ActionType$2;
40016
40016
  ActionType["StartDelete"] = "StartDelete";
40017
40017
  // Finish deletion process
40018
40018
  ActionType["FinishDelete"] = "FinishDelete";
40019
- })(ActionType$2 || (ActionType$2 = {}));
40019
+ })(ActionType || (ActionType = {}));
40020
40020
  /**
40021
40021
  * Reducer that executes actions
40022
40022
  * @author Yuen Ler Chow
@@ -40025,16 +40025,16 @@ var ActionType$2;
40025
40025
  */
40026
40026
  const reducer = (state, action) => {
40027
40027
  switch (action.type) {
40028
- case ActionType$2.FinishLoading: {
40028
+ case ActionType.FinishLoading: {
40029
40029
  return Object.assign(Object.assign({}, state), { loading: false, dbEntries: action.dbEntries });
40030
40030
  }
40031
- case ActionType$2.ShowAdder: {
40031
+ case ActionType.ShowAdder: {
40032
40032
  return Object.assign(Object.assign({}, state), { adding: true, dbEntryToEdit: undefined });
40033
40033
  }
40034
- case ActionType$2.ShowEditor: {
40034
+ case ActionType.ShowEditor: {
40035
40035
  return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: action.dbEntry });
40036
40036
  }
40037
- case ActionType$2.FinishAdd: {
40037
+ case ActionType.FinishAdd: {
40038
40038
  // Handle cancel
40039
40039
  const finishedEntry = action.dbEntry;
40040
40040
  if (!finishedEntry) {
@@ -40058,10 +40058,10 @@ const reducer = (state, action) => {
40058
40058
  // Update the state
40059
40059
  return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: undefined, dbEntries: updatedDbEntries });
40060
40060
  }
40061
- case ActionType$2.StartDelete: {
40061
+ case ActionType.StartDelete: {
40062
40062
  return Object.assign(Object.assign({}, state), { loading: true });
40063
40063
  }
40064
- case ActionType$2.FinishDelete: {
40064
+ case ActionType.FinishDelete: {
40065
40065
  return Object.assign(Object.assign({}, state), { loading: false,
40066
40066
  // Remove the deleted entry from the list
40067
40067
  dbEntries: state.dbEntries.filter((entry) => {
@@ -40100,7 +40100,7 @@ const DBEntryManagerPanel = (props) => {
40100
40100
  * @author Yuen Ler Chow
40101
40101
  * @param entry the database entry to delete
40102
40102
  */
40103
- const deleteEntry = (entry) => __awaiter$1(void 0, void 0, void 0, function* () {
40103
+ const deleteEntry = (entry) => __awaiter(void 0, void 0, void 0, function* () {
40104
40104
  // Confirm
40105
40105
  const confirmed = yield confirm('Remove?', `Are you sure you want to remove this ${itemName}?`, {
40106
40106
  confirmButtonText: 'Remove Item',
@@ -40113,7 +40113,7 @@ const DBEntryManagerPanel = (props) => {
40113
40113
  try {
40114
40114
  // Start loader
40115
40115
  dispatch({
40116
- type: ActionType$2.StartDelete,
40116
+ type: ActionType.StartDelete,
40117
40117
  });
40118
40118
  // Perform deletion
40119
40119
  yield visitServerEndpoint({
@@ -40122,7 +40122,7 @@ const DBEntryManagerPanel = (props) => {
40122
40122
  });
40123
40123
  // Finish loader
40124
40124
  dispatch({
40125
- type: ActionType$2.FinishDelete,
40125
+ type: ActionType.FinishDelete,
40126
40126
  dbEntry: entry,
40127
40127
  idPropName,
40128
40128
  });
@@ -40139,7 +40139,7 @@ const DBEntryManagerPanel = (props) => {
40139
40139
  * @author Yuen Ler Chow
40140
40140
  */
40141
40141
  useEffect(() => {
40142
- (() => __awaiter$1(void 0, void 0, void 0, function* () {
40142
+ (() => __awaiter(void 0, void 0, void 0, function* () {
40143
40143
  // Load list of database entries
40144
40144
  try {
40145
40145
  const data = yield visitServerEndpoint({
@@ -40151,7 +40151,7 @@ const DBEntryManagerPanel = (props) => {
40151
40151
  });
40152
40152
  // Save loaded data
40153
40153
  dispatch({
40154
- type: ActionType$2.FinishLoading,
40154
+ type: ActionType.FinishLoading,
40155
40155
  dbEntries: data,
40156
40156
  });
40157
40157
  }
@@ -40194,7 +40194,7 @@ const DBEntryManagerPanel = (props) => {
40194
40194
  React__default.createElement("span", { className: "d-none d-md-inline ms-1" }, "Remove")),
40195
40195
  !disableEdit && (React__default.createElement("button", { type: "button", id: `DBEntryManagerPanel-edit-with-id-${entry[idPropName]}`, className: "btn btn-primary", "aria-label": `edit db entry: ${entry[titlePropName]}`, onClick: () => {
40196
40196
  dispatch({
40197
- type: ActionType$2.ShowEditor,
40197
+ type: ActionType.ShowEditor,
40198
40198
  dbEntry: entry,
40199
40199
  });
40200
40200
  } },
@@ -40204,7 +40204,7 @@ const DBEntryManagerPanel = (props) => {
40204
40204
  React__default.createElement("div", { className: "d-grid" },
40205
40205
  React__default.createElement("button", { type: "button", id: "DBEntryManagerPanel-add-entry", className: "btn btn-lg btn-primary", "aria-label": `add a new ${itemName} entry to the list of entries`, onClick: () => {
40206
40206
  dispatch({
40207
- type: ActionType$2.ShowAdder,
40207
+ type: ActionType.ShowAdder,
40208
40208
  });
40209
40209
  } },
40210
40210
  React__default.createElement(FontAwesomeIcon, { icon: faPlus, className: "me-2" }),
@@ -40216,7 +40216,7 @@ const DBEntryManagerPanel = (props) => {
40216
40216
  if (!loading && (adding || dbEntryToEdit)) {
40217
40217
  body = (React__default.createElement(AddOrEditDBEntry, { saveEndpointPath: endpoint, validateEntry: validateEntry, modifyEntry: modifyEntry, entryFields: entryFields, dbEntryToEdit: dbEntryToEdit, idPropName: idPropName, entries: dbEntries, onFinished: (entry) => {
40218
40218
  dispatch({
40219
- type: ActionType$2.FinishAdd,
40219
+ type: ActionType.FinishAdd,
40220
40220
  dbEntry: entry,
40221
40221
  idPropName,
40222
40222
  });
@@ -40439,7 +40439,7 @@ const padZerosLeft = (num, numDigits) => {
40439
40439
  const LOG_REVIEW_STATUS_ROUTE = `${ROUTE_PATH_PREFIX}/logs/access_allowed`;
40440
40440
 
40441
40441
  // Stored copy of caccl functions
40442
- let _cacclGetLaunchInfo$1;
40442
+ let _cacclGetLaunchInfo;
40443
40443
  // Stored copy of dce-mango log collection
40444
40444
  let _logCollection;
40445
40445
  /*------------------------------------------------------------------------*/
@@ -40451,11 +40451,11 @@ let _logCollection;
40451
40451
  * @param req express request object
40452
40452
  * @returns object { launched, launchInfo }
40453
40453
  */
40454
- const cacclGetLaunchInfo$1 = (req) => {
40455
- if (!_cacclGetLaunchInfo$1) {
40456
- throw new ErrorWithCode$1('Could not get launch info because server was not initialized with dce-reactkit\'s initServer function', ReactKitErrorCode$3.NoCACCLGetLaunchInfoFunction);
40454
+ const cacclGetLaunchInfo = (req) => {
40455
+ if (!_cacclGetLaunchInfo) {
40456
+ throw new ErrorWithCode('Could not get launch info because server was not initialized with dce-reactkit\'s initServer function', ReactKitErrorCode$1.NoCACCLGetLaunchInfoFunction);
40457
40457
  }
40458
- return _cacclGetLaunchInfo$1(req);
40458
+ return _cacclGetLaunchInfo(req);
40459
40459
  };
40460
40460
  /**
40461
40461
  * Get log collection
@@ -40487,7 +40487,7 @@ const internalGetLogCollection = () => {
40487
40487
  * to review logs
40488
40488
  */
40489
40489
  const initServer = (opts) => {
40490
- _cacclGetLaunchInfo$1 = opts.getLaunchInfo;
40490
+ _cacclGetLaunchInfo = opts.getLaunchInfo;
40491
40491
  _logCollection = opts.logCollection;
40492
40492
  /*----------------------------------------*/
40493
40493
  /* Logging */
@@ -40511,18 +40511,18 @@ const initServer = (opts) => {
40511
40511
  * @param {LogAction} [action] the type of action performed on the target
40512
40512
  * @returns {Log}
40513
40513
  */
40514
- opts.app.post(LOG_ROUTE_PATH, genRouteHandler$1({
40514
+ opts.app.post(LOG_ROUTE_PATH, genRouteHandler({
40515
40515
  paramTypes: {
40516
- context: ParamType$3.String,
40517
- subcontext: ParamType$3.String,
40518
- tags: ParamType$3.JSON,
40519
- level: ParamType$3.String,
40520
- metadata: ParamType$3.JSON,
40521
- errorMessage: ParamType$3.StringOptional,
40522
- errorCode: ParamType$3.StringOptional,
40523
- errorStack: ParamType$3.StringOptional,
40524
- target: ParamType$3.StringOptional,
40525
- action: ParamType$3.StringOptional,
40516
+ context: ParamType$1.String,
40517
+ subcontext: ParamType$1.String,
40518
+ tags: ParamType$1.JSON,
40519
+ level: ParamType$1.String,
40520
+ metadata: ParamType$1.JSON,
40521
+ errorMessage: ParamType$1.StringOptional,
40522
+ errorCode: ParamType$1.StringOptional,
40523
+ errorStack: ParamType$1.StringOptional,
40524
+ target: ParamType$1.StringOptional,
40525
+ action: ParamType$1.StringOptional,
40526
40526
  },
40527
40527
  handler: ({ params, logServerEvent }) => {
40528
40528
  // Create log info
@@ -40568,7 +40568,7 @@ const initServer = (opts) => {
40568
40568
  * @param isAdmin if true, the user is an admin
40569
40569
  * @returns true if the user can review logs
40570
40570
  */
40571
- const canReviewLogs = (userId, isAdmin) => __awaiter$1(void 0, void 0, void 0, function* () {
40571
+ const canReviewLogs = (userId, isAdmin) => __awaiter(void 0, void 0, void 0, function* () {
40572
40572
  // Immediately deny access if user is not an admin
40573
40573
  if (!isAdmin) {
40574
40574
  return false;
@@ -40600,8 +40600,8 @@ const initServer = (opts) => {
40600
40600
  * @author Gabe Abrams
40601
40601
  * @returns {boolean} true if user has access
40602
40602
  */
40603
- opts.app.get(LOG_REVIEW_STATUS_ROUTE, genRouteHandler$1({
40604
- handler: ({ params }) => __awaiter$1(void 0, void 0, void 0, function* () {
40603
+ opts.app.get(LOG_REVIEW_STATUS_ROUTE, genRouteHandler({
40604
+ handler: ({ params }) => __awaiter(void 0, void 0, void 0, function* () {
40605
40605
  const { userId, isAdmin } = params;
40606
40606
  const canReview = yield canReviewLogs(userId, isAdmin);
40607
40607
  return canReview;
@@ -40614,18 +40614,18 @@ const initServer = (opts) => {
40614
40614
  * @param {number} month the month to query (e.g. 1 = January)
40615
40615
  * @returns {Log[]} list of logs from the given month
40616
40616
  */
40617
- opts.app.get(`${LOG_REVIEW_ROUTE_PATH_PREFIX}/years/:year/months/:month`, genRouteHandler$1({
40617
+ opts.app.get(`${LOG_REVIEW_ROUTE_PATH_PREFIX}/years/:year/months/:month`, genRouteHandler({
40618
40618
  paramTypes: {
40619
- year: ParamType$3.Int,
40620
- month: ParamType$3.Int,
40619
+ year: ParamType$1.Int,
40620
+ month: ParamType$1.Int,
40621
40621
  },
40622
- handler: ({ params }) => __awaiter$1(void 0, void 0, void 0, function* () {
40622
+ handler: ({ params }) => __awaiter(void 0, void 0, void 0, function* () {
40623
40623
  // Get user info
40624
40624
  const { year, month, userId, isAdmin, } = params;
40625
40625
  // Validate user
40626
40626
  const canReview = yield canReviewLogs(userId, isAdmin);
40627
40627
  if (!canReview) {
40628
- throw new ErrorWithCode$1('You cannot access this resource because you do not have the appropriate permissions.', ReactKitErrorCode$3.NotAllowedToReviewLogs);
40628
+ throw new ErrorWithCode('You cannot access this resource because you do not have the appropriate permissions.', ReactKitErrorCode$1.NotAllowedToReviewLogs);
40629
40629
  }
40630
40630
  // Query for logs
40631
40631
  const logs = yield _logCollection.find({
@@ -40651,7 +40651,7 @@ const initServer = (opts) => {
40651
40651
  * @param [opts.status=500] the https status code to use
40652
40652
  * defined)
40653
40653
  */
40654
- const handleError$1 = (res, error) => {
40654
+ const handleError = (res, error) => {
40655
40655
  // Get the error message
40656
40656
  let message;
40657
40657
  if (error && error.message) {
@@ -40666,7 +40666,7 @@ const handleError$1 = (res, error) => {
40666
40666
  message = 'An unknown error occurred.';
40667
40667
  }
40668
40668
  // Get the error code
40669
- const code = (error.code || ReactKitErrorCode$3.NoCode);
40669
+ const code = (error.code || ReactKitErrorCode$1.NoCode);
40670
40670
  // Get the status code
40671
40671
  const status = (error.status || 500);
40672
40672
  // Respond to user
@@ -40691,7 +40691,7 @@ const handleError$1 = (res, error) => {
40691
40691
  * @param res express response
40692
40692
  * @param body the body of the response to send to the client
40693
40693
  */
40694
- const handleSuccess$1 = (res, body) => {
40694
+ const handleSuccess = (res, body) => {
40695
40695
  // Send a http 200 json response
40696
40696
  res.json({
40697
40697
  // Include the body as a parameter
@@ -40720,7 +40720,7 @@ const genErrorPage = (opts = {}) => {
40720
40720
  const title = ((_a = opts.title) !== null && _a !== void 0 ? _a : 'An Error Occurred');
40721
40721
  const pageTitle = ((_b = opts.pageTitle) !== null && _b !== void 0 ? _b : title);
40722
40722
  const description = ((_c = opts.description) !== null && _c !== void 0 ? _c : 'An unknown server error occurred. Please contact support.');
40723
- const code = ((_d = opts.code) !== null && _d !== void 0 ? _d : ReactKitErrorCode$3.NoCode);
40723
+ const code = ((_d = opts.code) !== null && _d !== void 0 ? _d : ReactKitErrorCode$1.NoCode);
40724
40724
  return `
40725
40725
  <head>
40726
40726
  <!-- Metadata -->
@@ -40957,9 +40957,9 @@ const parseUserAgent = (userAgent) => {
40957
40957
  * userLastName, isLearner, isTTM, isAdmin, and any other variables that
40958
40958
  * are directly added to the session, if the user does have a session.
40959
40959
  */
40960
- const genRouteHandler$1 = (opts) => {
40960
+ const genRouteHandler = (opts) => {
40961
40961
  // Return a route handler
40962
- return (req, res, next) => __awaiter$1(void 0, void 0, void 0, function* () {
40962
+ return (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
40963
40963
  var _a, _b;
40964
40964
  // Output params
40965
40965
  const output = {};
@@ -40975,17 +40975,17 @@ const genRouteHandler$1 = (opts) => {
40975
40975
  || req.query[name]
40976
40976
  || req.body[name]);
40977
40977
  // Parse
40978
- if (type === ParamType$3.Boolean || type === ParamType$3.BooleanOptional) {
40978
+ if (type === ParamType$1.Boolean || type === ParamType$1.BooleanOptional) {
40979
40979
  // Boolean
40980
40980
  // Handle case where value doesn't exist
40981
40981
  if (value === undefined) {
40982
- if (type === ParamType$3.BooleanOptional) {
40982
+ if (type === ParamType$1.BooleanOptional) {
40983
40983
  output[name] = undefined;
40984
40984
  }
40985
40985
  else {
40986
- return handleError$1(res, {
40986
+ return handleError(res, {
40987
40987
  message: `Parameter ${name} is required, but it was not included.`,
40988
- code: ReactKitErrorCode$3.MissingParameter,
40988
+ code: ReactKitErrorCode$1.MissingParameter,
40989
40989
  status: 422,
40990
40990
  });
40991
40991
  }
@@ -41006,17 +41006,17 @@ const genRouteHandler$1 = (opts) => {
41006
41006
  ].indexOf(simpleVal) >= 0);
41007
41007
  }
41008
41008
  }
41009
- else if (type === ParamType$3.Float || type === ParamType$3.FloatOptional) {
41009
+ else if (type === ParamType$1.Float || type === ParamType$1.FloatOptional) {
41010
41010
  // Float
41011
41011
  // Handle case where value doesn't exist
41012
41012
  if (value === undefined) {
41013
- if (type === ParamType$3.FloatOptional) {
41013
+ if (type === ParamType$1.FloatOptional) {
41014
41014
  output[name] = undefined;
41015
41015
  }
41016
41016
  else {
41017
- return handleError$1(res, {
41017
+ return handleError(res, {
41018
41018
  message: `Parameter ${name} is required, but it was not included.`,
41019
- code: ReactKitErrorCode$3.MissingParameter,
41019
+ code: ReactKitErrorCode$1.MissingParameter,
41020
41020
  status: 422,
41021
41021
  });
41022
41022
  }
@@ -41027,24 +41027,24 @@ const genRouteHandler$1 = (opts) => {
41027
41027
  }
41028
41028
  else {
41029
41029
  // Issue!
41030
- return handleError$1(res, {
41030
+ return handleError(res, {
41031
41031
  message: `Request data was malformed: ${name} was not a valid float.`,
41032
- code: ReactKitErrorCode$3.InvalidParameter,
41032
+ code: ReactKitErrorCode$1.InvalidParameter,
41033
41033
  status: 422,
41034
41034
  });
41035
41035
  }
41036
41036
  }
41037
- else if (type === ParamType$3.Int || type === ParamType$3.IntOptional) {
41037
+ else if (type === ParamType$1.Int || type === ParamType$1.IntOptional) {
41038
41038
  // Int
41039
41039
  // Handle case where value doesn't exist
41040
41040
  if (value === undefined) {
41041
- if (type === ParamType$3.IntOptional) {
41041
+ if (type === ParamType$1.IntOptional) {
41042
41042
  output[name] = undefined;
41043
41043
  }
41044
41044
  else {
41045
- return handleError$1(res, {
41045
+ return handleError(res, {
41046
41046
  message: `Parameter ${name} is required, but it was not included.`,
41047
- code: ReactKitErrorCode$3.MissingParameter,
41047
+ code: ReactKitErrorCode$1.MissingParameter,
41048
41048
  status: 422,
41049
41049
  });
41050
41050
  }
@@ -41055,24 +41055,24 @@ const genRouteHandler$1 = (opts) => {
41055
41055
  }
41056
41056
  else {
41057
41057
  // Issue!
41058
- return handleError$1(res, {
41058
+ return handleError(res, {
41059
41059
  message: `Request data was malformed: ${name} was not a valid int.`,
41060
- code: ReactKitErrorCode$3.InvalidParameter,
41060
+ code: ReactKitErrorCode$1.InvalidParameter,
41061
41061
  status: 422,
41062
41062
  });
41063
41063
  }
41064
41064
  }
41065
- else if (type === ParamType$3.JSON || type === ParamType$3.JSONOptional) {
41065
+ else if (type === ParamType$1.JSON || type === ParamType$1.JSONOptional) {
41066
41066
  // Stringified JSON
41067
41067
  // Handle case where value doesn't exist
41068
41068
  if (value === undefined) {
41069
- if (type === ParamType$3.JSONOptional) {
41069
+ if (type === ParamType$1.JSONOptional) {
41070
41070
  output[name] = undefined;
41071
41071
  }
41072
41072
  else {
41073
- return handleError$1(res, {
41073
+ return handleError(res, {
41074
41074
  message: `Parameter ${name} is required, but it was not included.`,
41075
- code: ReactKitErrorCode$3.MissingParameter,
41075
+ code: ReactKitErrorCode$1.MissingParameter,
41076
41076
  status: 422,
41077
41077
  });
41078
41078
  }
@@ -41084,25 +41084,25 @@ const genRouteHandler$1 = (opts) => {
41084
41084
  output[name] = JSON.parse(String(value));
41085
41085
  }
41086
41086
  catch (err) {
41087
- return handleError$1(res, {
41087
+ return handleError(res, {
41088
41088
  message: `Request data was malformed: ${name} was not a valid JSON payload.`,
41089
- code: ReactKitErrorCode$3.InvalidParameter,
41089
+ code: ReactKitErrorCode$1.InvalidParameter,
41090
41090
  status: 422,
41091
41091
  });
41092
41092
  }
41093
41093
  }
41094
41094
  }
41095
- else if (type === ParamType$3.String || type === ParamType$3.StringOptional) {
41095
+ else if (type === ParamType$1.String || type === ParamType$1.StringOptional) {
41096
41096
  // String
41097
41097
  // Handle case where value doesn't exist
41098
41098
  if (value === undefined) {
41099
- if (type === ParamType$3.StringOptional) {
41099
+ if (type === ParamType$1.StringOptional) {
41100
41100
  output[name] = undefined;
41101
41101
  }
41102
41102
  else {
41103
- return handleError$1(res, {
41103
+ return handleError(res, {
41104
41104
  message: `Parameter ${name} is required, but it was not included.`,
41105
- code: ReactKitErrorCode$3.MissingParameter,
41105
+ code: ReactKitErrorCode$1.MissingParameter,
41106
41106
  status: 422,
41107
41107
  });
41108
41108
  }
@@ -41115,9 +41115,9 @@ const genRouteHandler$1 = (opts) => {
41115
41115
  }
41116
41116
  else {
41117
41117
  // No valid data type
41118
- return handleError$1(res, {
41118
+ return handleError(res, {
41119
41119
  message: `An internal error occurred: we could not determine the type of ${name}.`,
41120
- code: ReactKitErrorCode$3.InvalidParameter,
41120
+ code: ReactKitErrorCode$1.InvalidParameter,
41121
41121
  status: 422,
41122
41122
  });
41123
41123
  }
@@ -41126,15 +41126,15 @@ const genRouteHandler$1 = (opts) => {
41126
41126
  /* Launch Info */
41127
41127
  /*----------------------------------------*/
41128
41128
  // Get launch info
41129
- const { launched, launchInfo } = cacclGetLaunchInfo$1(req);
41129
+ const { launched, launchInfo } = cacclGetLaunchInfo(req);
41130
41130
  if (
41131
41131
  // Not launched
41132
41132
  (!launched || !launchInfo)
41133
41133
  // Not skipping the session check
41134
41134
  && !opts.skipSessionCheck) {
41135
- return handleError$1(res, {
41135
+ return handleError(res, {
41136
41136
  message: 'Your session has expired. Please refresh the page and try again.',
41137
- code: ReactKitErrorCode$3.SessionExpired,
41137
+ code: ReactKitErrorCode$1.SessionExpired,
41138
41138
  status: 401,
41139
41139
  });
41140
41140
  }
@@ -41152,9 +41152,9 @@ const genRouteHandler$1 = (opts) => {
41152
41152
  && !launchInfo.isAdmin))
41153
41153
  // Not skipping the session check
41154
41154
  && !opts.skipSessionCheck) {
41155
- return handleError$1(res, {
41155
+ return handleError(res, {
41156
41156
  message: 'Your session was invalid. Please refresh the page and try again.',
41157
- code: ReactKitErrorCode$3.SessionExpired,
41157
+ code: ReactKitErrorCode$1.SessionExpired,
41158
41158
  status: 401,
41159
41159
  });
41160
41160
  }
@@ -41211,9 +41211,9 @@ const genRouteHandler$1 = (opts) => {
41211
41211
  && !output.isTTM
41212
41212
  && !output.isAdmin) {
41213
41213
  // Course of interest is not the launch course
41214
- return handleError$1(res, {
41214
+ return handleError(res, {
41215
41215
  message: 'You switched sessions by opening this app in another tab. Please refresh the page and try again.',
41216
- code: ReactKitErrorCode$3.WrongCourse,
41216
+ code: ReactKitErrorCode$1.WrongCourse,
41217
41217
  status: 401,
41218
41218
  });
41219
41219
  }
@@ -41231,9 +41231,9 @@ const genRouteHandler$1 = (opts) => {
41231
41231
  // User is not an admin
41232
41232
  && !output.isAdmin)) {
41233
41233
  // User does not have access
41234
- return handleError$1(res, {
41234
+ return handleError(res, {
41235
41235
  message: 'This action is only allowed if you are a teaching team member for the course. Please go back to Canvas, log in as a teaching team member, and try again.',
41236
- code: ReactKitErrorCode$3.NotTTM,
41236
+ code: ReactKitErrorCode$1.NotTTM,
41237
41237
  status: 401,
41238
41238
  });
41239
41239
  }
@@ -41244,9 +41244,9 @@ const genRouteHandler$1 = (opts) => {
41244
41244
  // User is not an admin
41245
41245
  && !output.isAdmin) {
41246
41246
  // User does not have access
41247
- return handleError$1(res, {
41247
+ return handleError(res, {
41248
41248
  message: 'This action is only allowed if you are a Canvas admin. Please go back to Canvas, log in as an admin, and try again.',
41249
- code: ReactKitErrorCode$3.NotAdmin,
41249
+ code: ReactKitErrorCode$1.NotAdmin,
41250
41250
  status: 401,
41251
41251
  });
41252
41252
  }
@@ -41258,7 +41258,7 @@ const genRouteHandler$1 = (opts) => {
41258
41258
  * Log an event on the server
41259
41259
  * @author Gabe Abrams
41260
41260
  */
41261
- const logServerEvent = (opts) => __awaiter$1(void 0, void 0, void 0, function* () {
41261
+ const logServerEvent = (opts) => __awaiter(void 0, void 0, void 0, function* () {
41262
41262
  var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
41263
41263
  // NOTE: internally, we slip through an opts.overrideAsClientEvent boolean
41264
41264
  // that indicates that this is actually a client event, but we don't
@@ -41302,7 +41302,7 @@ const genRouteHandler$1 = (opts) => {
41302
41302
  ? {
41303
41303
  type: LogType$1.Error,
41304
41304
  errorMessage: (_j = opts.error.message) !== null && _j !== void 0 ? _j : 'Unknown message',
41305
- errorCode: (_k = opts.error.code) !== null && _k !== void 0 ? _k : ReactKitErrorCode$3.NoCode,
41305
+ errorCode: (_k = opts.error.code) !== null && _k !== void 0 ? _k : ReactKitErrorCode$1.NoCode,
41306
41306
  errorStack: (_l = opts.error.stack) !== null && _l !== void 0 ? _l : 'No stack',
41307
41307
  }
41308
41308
  : {
@@ -41462,13 +41462,13 @@ const genRouteHandler$1 = (opts) => {
41462
41462
  });
41463
41463
  // Send results to client (only if next wasn't called)
41464
41464
  if (!responseSent) {
41465
- return handleSuccess$1(res, results !== null && results !== void 0 ? results : undefined);
41465
+ return handleSuccess(res, results !== null && results !== void 0 ? results : undefined);
41466
41466
  }
41467
41467
  }
41468
41468
  catch (err) {
41469
41469
  // Send error to client (only if next wasn't called)
41470
41470
  if (!responseSent) {
41471
- handleError$1(res, err);
41471
+ handleError(res, err);
41472
41472
  // Log server-side error
41473
41473
  logServerEvent({
41474
41474
  context: LogBuiltInMetadata.Context.ServerEndpointError,
@@ -41507,7 +41507,7 @@ const startMinWait = (minWaitMs) => {
41507
41507
  * Finish the remaining time to wait
41508
41508
  * @author Gabe Abrams
41509
41509
  */
41510
- return () => __awaiter$1(void 0, void 0, void 0, function* () {
41510
+ return () => __awaiter(void 0, void 0, void 0, function* () {
41511
41511
  const endTimestamp = Date.now();
41512
41512
  // Calculate remaining time to wait
41513
41513
  const elapsedTimeMs = (endTimestamp - startTimestamp);
@@ -41594,7 +41594,7 @@ const onlyKeepLetters = (str) => {
41594
41594
  * once
41595
41595
  * @returns array of resolved values in the same order as the task functions
41596
41596
  */
41597
- const parallelLimit = (taskFunctions, limit) => __awaiter$1(void 0, void 0, void 0, function* () {
41597
+ const parallelLimit = (taskFunctions, limit) => __awaiter(void 0, void 0, void 0, function* () {
41598
41598
  const results = [];
41599
41599
  // Wait until finished with all tasks
41600
41600
  yield new Promise((resolve) => {
@@ -41605,7 +41605,7 @@ const parallelLimit = (taskFunctions, limit) => __awaiter$1(void 0, void 0, void
41605
41605
  * Start the next task
41606
41606
  * @author Gabe Abrams
41607
41607
  */
41608
- const startTask = () => __awaiter$1(void 0, void 0, void 0, function* () {
41608
+ const startTask = () => __awaiter(void 0, void 0, void 0, function* () {
41609
41609
  const taskIndex = nextTaskIndex++;
41610
41610
  // Get the task
41611
41611
  const taskFunction = taskFunctions[taskIndex];
@@ -41658,7 +41658,7 @@ let canReview = undefined;
41658
41658
  * @author Gabe Abrams
41659
41659
  * @returns true if current user can review logs
41660
41660
  */
41661
- const canReviewLogs = () => __awaiter$1(void 0, void 0, void 0, function* () {
41661
+ const canReviewLogs = () => __awaiter(void 0, void 0, void 0, function* () {
41662
41662
  // If cached, use that value
41663
41663
  if (canReview !== undefined) {
41664
41664
  return canReview;
@@ -41772,649 +41772,6 @@ const getLocalTimeInfo = (dateOrTimestamp) => {
41772
41772
  };
41773
41773
  };
41774
41774
 
41775
- /******************************************************************************
41776
- Copyright (c) Microsoft Corporation.
41777
-
41778
- Permission to use, copy, modify, and/or distribute this software for any
41779
- purpose with or without fee is hereby granted.
41780
-
41781
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
41782
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
41783
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
41784
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
41785
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
41786
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
41787
- PERFORMANCE OF THIS SOFTWARE.
41788
- ***************************************************************************** */
41789
-
41790
- function __awaiter(thisArg, _arguments, P, generator) {
41791
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
41792
- return new (P || (P = Promise))(function (resolve, reject) {
41793
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
41794
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41795
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41796
- step((generator = generator.apply(thisArg, _arguments || [])).next());
41797
- });
41798
- }
41799
-
41800
- // Highest error code = DRK10
41801
- /**
41802
- * List of error codes built into the react kit
41803
- * @author Gabe Abrams
41804
- */
41805
- var ReactKitErrorCode;
41806
- (function (ReactKitErrorCode) {
41807
- ReactKitErrorCode["NoResponse"] = "DRK1";
41808
- ReactKitErrorCode["NoCode"] = "DRK2";
41809
- ReactKitErrorCode["SessionExpired"] = "DRK3";
41810
- ReactKitErrorCode["MissingParameter"] = "DRK4";
41811
- ReactKitErrorCode["InvalidParameter"] = "DRK5";
41812
- ReactKitErrorCode["WrongCourse"] = "DRK6";
41813
- ReactKitErrorCode["NoCACCLSendRequestFunction"] = "DRK7";
41814
- ReactKitErrorCode["NoCACCLGetLaunchInfoFunction"] = "DRK8";
41815
- ReactKitErrorCode["NotTTM"] = "DRK9";
41816
- ReactKitErrorCode["NotAdmin"] = "DRK10";
41817
- })(ReactKitErrorCode || (ReactKitErrorCode = {}));
41818
- var ReactKitErrorCode$1 = ReactKitErrorCode;
41819
-
41820
- /**
41821
- * Types of buttons in the modal
41822
- * @author Gabe Abrams
41823
- */
41824
- var ModalButtonType;
41825
- (function (ModalButtonType) {
41826
- ModalButtonType["Okay"] = "okay";
41827
- ModalButtonType["Cancel"] = "cancel";
41828
- ModalButtonType["Yes"] = "yes";
41829
- ModalButtonType["No"] = "no";
41830
- ModalButtonType["Abandon"] = "abandon";
41831
- ModalButtonType["GoBack"] = "goBack";
41832
- ModalButtonType["Continue"] = "continue";
41833
- ModalButtonType["ImSure"] = "imSure";
41834
- ModalButtonType["Delete"] = "delete";
41835
- ModalButtonType["Confirm"] = "confirm";
41836
- })(ModalButtonType || (ModalButtonType = {}));
41837
- var ModalButtonType$1 = ModalButtonType;
41838
-
41839
- /**
41840
- * Types of modals
41841
- * @author Gabe Abrams
41842
- */
41843
- var ModalType;
41844
- (function (ModalType) {
41845
- ModalType["Okay"] = "okay";
41846
- ModalType["OkayCancel"] = "okay-cancel";
41847
- ModalType["YesNo"] = "yes-no";
41848
- ModalType["YesNoCancel"] = "yes-no-cancel";
41849
- ModalType["AbandonGoBack"] = "abandon-goBack";
41850
- ModalType["ImSureCancel"] = "imSure-cancel";
41851
- ModalType["DeleteCancel"] = "delete-cancel";
41852
- ModalType["ConfirmCancel"] = "confirm-cancel";
41853
- ModalType["NoButtons"] = "-";
41854
- })(ModalType || (ModalType = {}));
41855
- var ModalType$1 = ModalType;
41856
-
41857
- /**
41858
- * Bootstrap variants
41859
- * @author Gabe Abrams
41860
- */
41861
- var Variant;
41862
- (function (Variant) {
41863
- Variant["Primary"] = "primary";
41864
- Variant["Secondary"] = "secondary";
41865
- Variant["Success"] = "success";
41866
- Variant["Warning"] = "warning";
41867
- Variant["Info"] = "info";
41868
- Variant["Danger"] = "danger";
41869
- Variant["Light"] = "light";
41870
- Variant["Dark"] = "dark";
41871
- })(Variant || (Variant = {}));
41872
- var Variant$1 = Variant;
41873
-
41874
- /**
41875
- * Modal sizes
41876
- * @author Gabe Abrams
41877
- */
41878
- var ModalSize;
41879
- (function (ModalSize) {
41880
- ModalSize["Small"] = "sm";
41881
- ModalSize["Medium"] = "md";
41882
- ModalSize["Large"] = "lg";
41883
- ModalSize["ExtraLarge"] = "xl";
41884
- })(ModalSize || (ModalSize = {}));
41885
- // Modal type to list of buttons
41886
- ({
41887
- [ModalType$1.Okay]: [
41888
- ModalButtonType$1.Okay,
41889
- ],
41890
- [ModalType$1.OkayCancel]: [
41891
- ModalButtonType$1.Okay,
41892
- ModalButtonType$1.Cancel,
41893
- ],
41894
- [ModalType$1.YesNo]: [
41895
- ModalButtonType$1.Yes,
41896
- ModalButtonType$1.No,
41897
- ],
41898
- [ModalType$1.YesNoCancel]: [
41899
- ModalButtonType$1.Yes,
41900
- ModalButtonType$1.No,
41901
- ModalButtonType$1.Cancel,
41902
- ],
41903
- [ModalType$1.AbandonGoBack]: [
41904
- ModalButtonType$1.Abandon,
41905
- ModalButtonType$1.GoBack,
41906
- ],
41907
- [ModalType$1.ImSureCancel]: [
41908
- ModalButtonType$1.ImSure,
41909
- ModalButtonType$1.Cancel,
41910
- ],
41911
- [ModalType$1.DeleteCancel]: [
41912
- ModalButtonType$1.Delete,
41913
- ModalButtonType$1.Cancel,
41914
- ],
41915
- [ModalType$1.ConfirmCancel]: [
41916
- ModalButtonType$1.Confirm,
41917
- ModalButtonType$1.Cancel,
41918
- ],
41919
- });
41920
- // Button type styling and labels
41921
- ({
41922
- [ModalButtonType$1.Okay]: {
41923
- label: 'Okay',
41924
- variant: Variant$1.Dark,
41925
- },
41926
- [ModalButtonType$1.Cancel]: {
41927
- label: 'Cancel',
41928
- variant: Variant$1.Secondary,
41929
- },
41930
- [ModalButtonType$1.Yes]: {
41931
- label: 'Yes',
41932
- variant: Variant$1.Dark,
41933
- },
41934
- [ModalButtonType$1.No]: {
41935
- label: 'No',
41936
- variant: Variant$1.Secondary,
41937
- },
41938
- [ModalButtonType$1.Abandon]: {
41939
- label: 'Abandon Changes',
41940
- variant: Variant$1.Warning,
41941
- },
41942
- [ModalButtonType$1.GoBack]: {
41943
- label: 'Go Back',
41944
- variant: Variant$1.Secondary,
41945
- },
41946
- [ModalButtonType$1.Continue]: {
41947
- label: 'Continue',
41948
- variant: Variant$1.Dark,
41949
- },
41950
- [ModalButtonType$1.ImSure]: {
41951
- label: 'I am sure',
41952
- variant: Variant$1.Warning,
41953
- },
41954
- [ModalButtonType$1.Delete]: {
41955
- label: 'Yes, Delete',
41956
- variant: Variant$1.Danger,
41957
- },
41958
- [ModalButtonType$1.Confirm]: {
41959
- label: 'Confirm',
41960
- variant: Variant$1.Dark,
41961
- },
41962
- });
41963
-
41964
- /**
41965
- * An error with a code
41966
- * @author Gabe Abrams
41967
- */
41968
- class ErrorWithCode extends Error {
41969
- constructor(message, code) {
41970
- super(message);
41971
- this.name = 'ErrorWithCode';
41972
- this.code = code;
41973
- }
41974
- }
41975
-
41976
- /**
41977
- * Copiable text box
41978
- * @author Gabe Abrams
41979
- */
41980
- /* ------------- Actions ------------ */
41981
- // Types of actions
41982
- var ActionType$1;
41983
- (function (ActionType) {
41984
- // Indicate that the text was recently copied
41985
- ActionType["IndicateRecentlyCopied"] = "indicate-recently-copied";
41986
- // Clear the status
41987
- ActionType["ClearRecentlyCopiedStatus"] = "clear-recently-copied-status";
41988
- })(ActionType$1 || (ActionType$1 = {}));
41989
-
41990
- /**
41991
- * Reusable nested item picker
41992
- * @author Yuen Ler Chow
41993
- */
41994
- /* ------------- Actions ------------ */
41995
- // Types of actions
41996
- var ActionType;
41997
- (function (ActionType) {
41998
- // Toggle whether the children are being shown
41999
- ActionType["ToggleItems"] = "toggle-items";
42000
- })(ActionType || (ActionType = {}));
42001
-
42002
- // Import custom error
42003
- // Stored copy of caccl functions
42004
- let _cacclGetLaunchInfo;
42005
- /*------------------------------------------------------------------------*/
42006
- /* Helpers */
42007
- /*------------------------------------------------------------------------*/
42008
- /**
42009
- * Get launch info via CACCL
42010
- * @author Gabe Abrams
42011
- * @param req express request object
42012
- * @returns object { launched, launchInfo }
42013
- */
42014
- const cacclGetLaunchInfo = (req) => {
42015
- {
42016
- throw new ErrorWithCode('Could not get launch info because server was not initialized with dce-reactkit\'s initServer function', ReactKitErrorCode$1.NoCACCLGetLaunchInfoFunction);
42017
- }
42018
- };
42019
-
42020
- /**
42021
- * Server-side API param types
42022
- * @author Gabe Abrams
42023
- */
42024
- var ParamType;
42025
- (function (ParamType) {
42026
- ParamType["Boolean"] = "boolean";
42027
- ParamType["BooleanOptional"] = "boolean-optional";
42028
- ParamType["Float"] = "float";
42029
- ParamType["FloatOptional"] = "float-optional";
42030
- ParamType["Int"] = "int";
42031
- ParamType["IntOptional"] = "int-optional";
42032
- ParamType["JSON"] = "json";
42033
- ParamType["JSONOptional"] = "json-optional";
42034
- ParamType["String"] = "string";
42035
- ParamType["StringOptional"] = "string-optional";
42036
- })(ParamType || (ParamType = {}));
42037
- var ParamType$1 = ParamType;
42038
-
42039
- // Import shared types
42040
- /**
42041
- * Handle an error and respond to the client
42042
- * @author Gabe Abrams
42043
- * @param res express response
42044
- * @param error error info
42045
- * @param opts.err the error to send to the client
42046
- * or the error message
42047
- * @param [opts.code] an error code (only used if err.code is not
42048
- * included)
42049
- * @param [opts.status=500] the https status code to use
42050
- * defined)
42051
- */
42052
- const handleError = (res, error) => {
42053
- // Get the error message
42054
- let message;
42055
- if (error && error.message) {
42056
- message = (error.message || 'An unknown error occurred.');
42057
- }
42058
- else if (typeof error === 'string') {
42059
- message = (error.trim().length > 0
42060
- ? error
42061
- : 'An unknown error occurred.');
42062
- }
42063
- else {
42064
- message = 'An unknown error occurred.';
42065
- }
42066
- // Get the error code
42067
- const code = (error.code || ReactKitErrorCode$1.NoCode);
42068
- // Get the status code
42069
- const status = (error.status || 500);
42070
- // Respond to user
42071
- res
42072
- // Set the http status code
42073
- .status(status)
42074
- // Send a JSON response
42075
- .json({
42076
- // Error message
42077
- message,
42078
- // Error code
42079
- code,
42080
- // Success = false flag so client can detect server-side errors
42081
- success: false,
42082
- });
42083
- return undefined;
42084
- };
42085
-
42086
- /**
42087
- * Send successful API response
42088
- * @author Gabe Abrams
42089
- * @param res express response
42090
- * @param body the body of the response to send to the client
42091
- */
42092
- const handleSuccess = (res, body) => {
42093
- // Send a http 200 json response
42094
- res.json({
42095
- // Include the body as a parameter
42096
- body,
42097
- // Success = true flag so client can detect successful responses
42098
- success: true,
42099
- });
42100
- return undefined;
42101
- };
42102
-
42103
- /**
42104
- * Generate an express API route handler
42105
- * @author Gabe Abrams
42106
- * @param opts object containing all arguments
42107
- * @param opts.paramTypes map containing the types for each parameter that is
42108
- * included in the request (map: param name => type)
42109
- * @param opts.handler function that processes the request
42110
- * @returns express route handler that takes the following arguments:
42111
- * params (map: param name => value), handleSuccess (function for handling
42112
- * successful requests), handleError (function for handling failed requests),
42113
- * req (express request object), res (express response object),
42114
- * next (express next function). Params also has userId, userFirstName,
42115
- * userLastName, isLearner, isTTM, isAdmin, and any other variables that
42116
- * are directly added to the session
42117
- */
42118
- const genRouteHandler = (opts) => {
42119
- // Return a route handler
42120
- return (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
42121
- var _a, _b;
42122
- // Output params
42123
- const output = {};
42124
- /*----------------------------------------*/
42125
- /* Parse Params */
42126
- /*----------------------------------------*/
42127
- // Process items one by one
42128
- const paramList = Object.entries((_a = opts.paramTypes) !== null && _a !== void 0 ? _a : {});
42129
- for (let i = 0; i < paramList.length; i++) {
42130
- const [name, type] = paramList[i];
42131
- // Find the value as a string
42132
- const value = (req.params[name]
42133
- || req.query[name]
42134
- || req.body[name]);
42135
- // Parse
42136
- if (type === ParamType$1.Boolean || type === ParamType$1.BooleanOptional) {
42137
- // Boolean
42138
- // Handle case where value doesn't exist
42139
- if (value === undefined) {
42140
- if (type === ParamType$1.BooleanOptional) {
42141
- output[name] = undefined;
42142
- }
42143
- else {
42144
- return handleError(res, {
42145
- message: `Parameter ${name} is required, but it was not included.`,
42146
- code: ReactKitErrorCode$1.MissingParameter,
42147
- status: 422,
42148
- });
42149
- }
42150
- }
42151
- else {
42152
- // Value exists
42153
- // Simplify value
42154
- const simpleVal = (String(value)
42155
- .trim()
42156
- .toLowerCase());
42157
- // Parse
42158
- output[name] = ([
42159
- 'true',
42160
- 'yes',
42161
- 'y',
42162
- '1',
42163
- 't',
42164
- ].indexOf(simpleVal) >= 0);
42165
- }
42166
- }
42167
- else if (type === ParamType$1.Float || type === ParamType$1.FloatOptional) {
42168
- // Float
42169
- // Handle case where value doesn't exist
42170
- if (value === undefined) {
42171
- if (type === ParamType$1.FloatOptional) {
42172
- output[name] = undefined;
42173
- }
42174
- else {
42175
- return handleError(res, {
42176
- message: `Parameter ${name} is required, but it was not included.`,
42177
- code: ReactKitErrorCode$1.MissingParameter,
42178
- status: 422,
42179
- });
42180
- }
42181
- }
42182
- else if (!Number.isNaN(Number.parseFloat(String(value)))) {
42183
- // Value is a number
42184
- output[name] = Number.parseFloat(String(value));
42185
- }
42186
- else {
42187
- // Issue!
42188
- return handleError(res, {
42189
- message: `Request data was malformed: ${name} was not a valid float.`,
42190
- code: ReactKitErrorCode$1.InvalidParameter,
42191
- status: 422,
42192
- });
42193
- }
42194
- }
42195
- else if (type === ParamType$1.Int || type === ParamType$1.IntOptional) {
42196
- // Int
42197
- // Handle case where value doesn't exist
42198
- if (value === undefined) {
42199
- if (type === ParamType$1.IntOptional) {
42200
- output[name] = undefined;
42201
- }
42202
- else {
42203
- return handleError(res, {
42204
- message: `Parameter ${name} is required, but it was not included.`,
42205
- code: ReactKitErrorCode$1.MissingParameter,
42206
- status: 422,
42207
- });
42208
- }
42209
- }
42210
- else if (!Number.isNaN(Number.parseInt(String(value), 10))) {
42211
- // Value is a number
42212
- output[name] = Number.parseInt(String(value), 10);
42213
- }
42214
- else {
42215
- // Issue!
42216
- return handleError(res, {
42217
- message: `Request data was malformed: ${name} was not a valid int.`,
42218
- code: ReactKitErrorCode$1.InvalidParameter,
42219
- status: 422,
42220
- });
42221
- }
42222
- }
42223
- else if (type === ParamType$1.JSON || type === ParamType$1.JSONOptional) {
42224
- // Stringified JSON
42225
- // Handle case where value doesn't exist
42226
- if (value === undefined) {
42227
- if (type === ParamType$1.JSONOptional) {
42228
- output[name] = undefined;
42229
- }
42230
- else {
42231
- return handleError(res, {
42232
- message: `Parameter ${name} is required, but it was not included.`,
42233
- code: ReactKitErrorCode$1.MissingParameter,
42234
- status: 422,
42235
- });
42236
- }
42237
- }
42238
- else {
42239
- // Value exists
42240
- // Parse
42241
- try {
42242
- output[name] = JSON.parse(String(value));
42243
- }
42244
- catch (err) {
42245
- return handleError(res, {
42246
- message: `Request data was malformed: ${name} was not a valid JSON payload.`,
42247
- code: ReactKitErrorCode$1.InvalidParameter,
42248
- status: 422,
42249
- });
42250
- }
42251
- }
42252
- }
42253
- else if (type === ParamType$1.String || type === ParamType$1.StringOptional) {
42254
- // String
42255
- // Handle case where value doesn't exist
42256
- if (value === undefined) {
42257
- if (type === ParamType$1.StringOptional) {
42258
- output[name] = undefined;
42259
- }
42260
- else {
42261
- return handleError(res, {
42262
- message: `Parameter ${name} is required, but it was not included.`,
42263
- code: ReactKitErrorCode$1.MissingParameter,
42264
- status: 422,
42265
- });
42266
- }
42267
- }
42268
- else {
42269
- // Value exists
42270
- // Leave as is
42271
- output[name] = value;
42272
- }
42273
- }
42274
- else {
42275
- // No valid data type
42276
- return handleError(res, {
42277
- message: `An internal error occurred: we could not determine the type of ${name}.`,
42278
- code: ReactKitErrorCode$1.InvalidParameter,
42279
- status: 422,
42280
- });
42281
- }
42282
- }
42283
- /*----------------------------------------*/
42284
- /* Launch Info */
42285
- /*----------------------------------------*/
42286
- // Get launch info
42287
- const { launched, launchInfo } = cacclGetLaunchInfo(req);
42288
- if (!launched || !launchInfo) {
42289
- return handleError(res, {
42290
- message: 'Your session has expired. Please refresh the page and try again.',
42291
- code: ReactKitErrorCode$1.SessionExpired,
42292
- status: 440,
42293
- });
42294
- }
42295
- // Error if user info cannot be found
42296
- if (!launchInfo.userId
42297
- || !launchInfo.userFirstName
42298
- || !launchInfo.userLastName
42299
- || (launchInfo.notInCourse
42300
- && !launchInfo.isAdmin)
42301
- || (!launchInfo.isTTM
42302
- && !launchInfo.isLearner
42303
- && !launchInfo.isAdmin)) {
42304
- return handleError(res, {
42305
- message: 'Your session was invalid. Please refresh the page and try again.',
42306
- code: ReactKitErrorCode$1.SessionExpired,
42307
- status: 440,
42308
- });
42309
- }
42310
- // Add launch info to output
42311
- output.userId = launchInfo.userId;
42312
- output.userFirstName = launchInfo.userFirstName;
42313
- output.userLastName = launchInfo.userLastName;
42314
- output.userEmail = launchInfo.userEmail;
42315
- output.isLearner = !!launchInfo.isLearner;
42316
- output.isTTM = !!launchInfo.isTTM;
42317
- output.isAdmin = !!launchInfo.isAdmin;
42318
- output.courseId = ((_b = output.courseId) !== null && _b !== void 0 ? _b : launchInfo.courseId);
42319
- output.courseName = launchInfo.contextLabel;
42320
- // Add other session variables
42321
- Object.keys(req.session).forEach((propName) => {
42322
- // Skip if prop already in output
42323
- if (output[propName] !== undefined) {
42324
- return;
42325
- }
42326
- // Add to output
42327
- const value = req.session[propName];
42328
- if (typeof value === 'string'
42329
- || typeof value === 'boolean'
42330
- || typeof value === 'number') {
42331
- output[propName] = value;
42332
- }
42333
- });
42334
- /*----------------------------------------*/
42335
- /* Require Course Consistency */
42336
- /*----------------------------------------*/
42337
- // Make sure the user actually launched from the appropriate course
42338
- if (output.courseId
42339
- && launchInfo.courseId
42340
- && output.courseId !== launchInfo.courseId
42341
- && !output.isTTM
42342
- && !output.isAdmin) {
42343
- // Course of interest is not the launch course
42344
- return handleError(res, {
42345
- message: 'You switched sessions by opening this app in another tab. Please refresh the page and try again.',
42346
- code: ReactKitErrorCode$1.WrongCourse,
42347
- status: 401,
42348
- });
42349
- }
42350
- /*----------------------------------------*/
42351
- /* Require Proper Permissions */
42352
- /*----------------------------------------*/
42353
- // Add TTM endpoint security
42354
- if (
42355
- // This is a TTM endpoint
42356
- req.path.startsWith('/api/ttm')
42357
- // User is not a TTM
42358
- && (
42359
- // User is not a TTM
42360
- !output.isTTM
42361
- // User is not an admin
42362
- && !output.isAdmin)) {
42363
- // User does not have access
42364
- return handleError(res, {
42365
- message: 'This action is only allowed if you are a teaching team member for the course. Please go back to Canvas, log in as a teaching team member, and try again.',
42366
- code: ReactKitErrorCode$1.NotTTM,
42367
- status: 401,
42368
- });
42369
- }
42370
- // Add Admin endpoint security
42371
- if (
42372
- // This is an admin endpoint
42373
- req.path.startsWith('/api/admin')
42374
- // User is not an admin
42375
- && !output.isAdmin) {
42376
- // User does not have access
42377
- return handleError(res, {
42378
- message: 'This action is only allowed if you are a Canvas admin. Please go back to Canvas, log in as an admin, and try again.',
42379
- code: ReactKitErrorCode$1.NotAdmin,
42380
- status: 401,
42381
- });
42382
- }
42383
- /*------------------------------------------------------------------------*/
42384
- /* Call handler */
42385
- /*------------------------------------------------------------------------*/
42386
- try {
42387
- const results = yield opts.handler({
42388
- params: output,
42389
- req,
42390
- res,
42391
- next,
42392
- });
42393
- // Send results to client
42394
- handleSuccess(res, results !== null && results !== void 0 ? results : undefined);
42395
- }
42396
- catch (err) {
42397
- // Send error to client
42398
- handleError(res, err);
42399
- }
42400
- });
42401
- };
42402
-
42403
- /**
42404
- * Days of the week
42405
- * @author Gabe Abrams
42406
- */
42407
- var DayOfWeek$2;
42408
- (function (DayOfWeek) {
42409
- DayOfWeek["Monday"] = "m";
42410
- DayOfWeek["Tuesday"] = "t";
42411
- DayOfWeek["Wednesday"] = "w";
42412
- DayOfWeek["Thursday"] = "r";
42413
- DayOfWeek["Friday"] = "f";
42414
- DayOfWeek["Saturday"] = "s";
42415
- DayOfWeek["Sunday"] = "u";
42416
- })(DayOfWeek$2 || (DayOfWeek$2 = {}));
42417
-
42418
41775
  /**
42419
41776
  * Add all routes for the DBEditor
42420
41777
  * @author Yuen Ler Chow
@@ -42435,7 +41792,7 @@ const addDBEditorEndpoints = (opts) => {
42435
41792
  paramTypes: {
42436
41793
  filterQuery: ParamType$1.JSONOptional,
42437
41794
  },
42438
- handler: ({ params }) => __awaiter$1(void 0, void 0, void 0, function* () {
41795
+ handler: ({ params }) => __awaiter(void 0, void 0, void 0, function* () {
42439
41796
  var _a;
42440
41797
  const filterQuery = (_a = params.filterQuery) !== null && _a !== void 0 ? _a : {};
42441
41798
  const categories = yield collection.find(filterQuery);
@@ -42451,7 +41808,7 @@ const addDBEditorEndpoints = (opts) => {
42451
41808
  paramTypes: {
42452
41809
  item: ParamType$1.JSON,
42453
41810
  },
42454
- handler: ({ params, }) => __awaiter$1(void 0, void 0, void 0, function* () {
41811
+ handler: ({ params, }) => __awaiter(void 0, void 0, void 0, function* () {
42455
41812
  // Destructure params
42456
41813
  const { item, } = params;
42457
41814
  yield collection.insert(item);
@@ -42465,7 +41822,7 @@ const addDBEditorEndpoints = (opts) => {
42465
41822
  paramTypes: {
42466
41823
  id: ParamType$1.String,
42467
41824
  },
42468
- handler: ({ params, }) => __awaiter$1(void 0, void 0, void 0, function* () {
41825
+ handler: ({ params, }) => __awaiter(void 0, void 0, void 0, function* () {
42469
41826
  // Destructure params
42470
41827
  const { id, } = params;
42471
41828
  yield collection.delete({ id });
@@ -42489,5 +41846,5 @@ var DayOfWeek;
42489
41846
  })(DayOfWeek || (DayOfWeek = {}));
42490
41847
  var DayOfWeek$1 = DayOfWeek;
42491
41848
 
42492
- export { AppWrapper, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntryFieldType$1 as DBEntryFieldType, DBEntryManagerPanel, DayOfWeek$1 as DayOfWeek, Drawer, DynamicWord, ErrorBox, ErrorWithCode$1 as ErrorWithCode, HOUR_IN_MS, IntelliTable, ItemPicker, LoadingSpinner, LogAction$1 as LogAction, LogBuiltInMetadata, LogReviewer, LogSource$1 as LogSource, LogType$1 as LogType, MINUTE_IN_MS, Modal, ModalButtonType$3 as ModalButtonType, ModalSize$2 as ModalSize, ModalType$3 as ModalType, ParamType$3 as ParamType, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode$3 as ReactKitErrorCode, SimpleDateChooser, TabBox, Variant$3 as Variant, abbreviate, addDBEditorEndpoints, alert$1 as alert, avg, canReviewLogs, ceilToNumDecimals, compareArraysByProp, confirm, extractProp, floorToNumDecimals, forceNumIntoBounds, genCSV, genRouteHandler$1 as genRouteHandler, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError$1 as handleError, handleSuccess$1 as handleSuccess, initClient, initLogCollection, initServer, isMobileOrTablet, logClientEvent, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, visitServerEndpoint, waitMs };
41849
+ export { AppWrapper, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DBEntryFieldType$1 as DBEntryFieldType, DBEntryManagerPanel, DayOfWeek$1 as DayOfWeek, Drawer, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, ItemPicker, LoadingSpinner, LogAction$1 as LogAction, LogBuiltInMetadata, LogReviewer, LogSource$1 as LogSource, LogType$1 as LogType, MINUTE_IN_MS, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, ParamType$1 as ParamType, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode$1 as ReactKitErrorCode, SimpleDateChooser, TabBox, Variant$1 as Variant, abbreviate, addDBEditorEndpoints, alert$1 as alert, avg, canReviewLogs, ceilToNumDecimals, compareArraysByProp, confirm, extractProp, floorToNumDecimals, forceNumIntoBounds, genCSV, genRouteHandler, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, initClient, initLogCollection, initServer, isMobileOrTablet, logClientEvent, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, visitServerEndpoint, waitMs };
42493
41850
  //# sourceMappingURL=index.js.map