@dentira/dentira-bulk-upload-widget 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -6687,7 +6687,7 @@ function _setPrototypeOf(e, t) {
6687
6687
  function _inheritsLoose(e, t) {
6688
6688
  e.prototype = Object.create(t.prototype), e.prototype.constructor = e, _setPrototypeOf(e, t);
6689
6689
  }
6690
- const config = {
6690
+ const config$1 = {
6691
6691
  disabled: !1
6692
6692
  };
6693
6693
  var timeoutsShape = process.env.NODE_ENV !== "production" ? PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
@@ -6761,7 +6761,7 @@ var forceReflow = function(t) {
6761
6761
  });
6762
6762
  }, n.performEnter = function(s) {
6763
6763
  var o = this, a = this.props.enter, l = this.context ? this.context.isMounting : s, c = this.props.nodeRef ? [l] : [ReactDOM__default.findDOMNode(this), l], u = c[0], f = c[1], x = this.getTimeouts(), m = l ? x.appear : x.enter;
6764
- if (!s && !a || config.disabled) {
6764
+ if (!s && !a || config$1.disabled) {
6765
6765
  this.safeSetState({
6766
6766
  status: ENTERED
6767
6767
  }, function() {
@@ -6782,7 +6782,7 @@ var forceReflow = function(t) {
6782
6782
  });
6783
6783
  }, n.performExit = function() {
6784
6784
  var s = this, o = this.props.exit, a = this.getTimeouts(), l = this.props.nodeRef ? void 0 : ReactDOM__default.findDOMNode(this);
6785
- if (!o || config.disabled) {
6785
+ if (!o || config$1.disabled) {
6786
6786
  this.safeSetState({
6787
6787
  status: EXITED
6788
6788
  }, function() {
@@ -12084,7 +12084,9 @@ process.env.NODE_ENV !== "production" && (Stack.propTypes = {
12084
12084
  */
12085
12085
  useFlexGap: PropTypes.bool
12086
12086
  });
12087
- const Stack$1 = Stack, BULKUPLOAD_ENDPOINT = "/bulk-upload";
12087
+ const Stack$1 = Stack;
12088
+ var FileType = /* @__PURE__ */ ((e) => (e.EXCEL = "EXCEL", e.CSV = "CSV", e))(FileType || {}), Screen = /* @__PURE__ */ ((e) => (e.MAIN = "MAIN", e.DOWNLOADING_TEMPLATE = "DOWNLOADING_TEMPLATE", e.UPLOADING_FILE = "UPLOADING_FILE", e.EXIT_WARNING = "EXIT_WARNING", e.CHECKING_STATUS = "CHECKING_STATUS", e.UPLOADING_FILE_ERROR = "UPLOADING_FILE_ERROR", e.LOADING_JOBS = "LOADING_JOBS", e.UPLOAD_COMPLETE = "UPLOAD_COMPLETE", e.GENERAL_ERROR = "GENERAL_ERROR", e))(Screen || {}), BulkUploadType = /* @__PURE__ */ ((e) => (e.GROUPITEMLIST = "GROUPITEMLIST", e.USERITEMLIST = "USERITEMLIST", e))(BulkUploadType || {}), BulkUploadJobStatus = /* @__PURE__ */ ((e) => (e.QUEUED = "QUEUED", e.CREATED = "CREATED", e.IN_PROGRESS = "IN_PROGRESS", e.COMPLETED = "COMPLETED", e.FAILED = "FAILED", e))(BulkUploadJobStatus || {}), JobTypes = /* @__PURE__ */ ((e) => (e.UPLOAD = "UPLOAD", e.TEMPLATE_FILE = "TEMPLATE_FILE", e))(JobTypes || {}), DownloadFolders = /* @__PURE__ */ ((e) => (e.DYNAMIC_TEMPLATE = "dynamic-template", e.STATIC_TEMPLATE = "static-template", e.INVALID_ROWS = "invalid-rows", e))(DownloadFolders || {});
12089
+ const BULKUPLOAD_ENDPOINT = "/bulk-upload";
12088
12090
  var shim = { exports: {} }, useSyncExternalStoreShim_production = {};
12089
12091
  /**
12090
12092
  * @license React
@@ -12823,11 +12825,17 @@ const use = React__default.use || // This extra generic is to avoid TypeScript m
12823
12825
  }
12824
12826
  };
12825
12827
  }, useSWRMutation = withMiddleware(useSWR, mutation);
12826
- let apiHost, presignUrl;
12827
12828
  var Et;
12828
- const hostname = (Et = window == null ? void 0 : window.location) == null ? void 0 : Et.hostname;
12829
- hostname.indexOf("dentira.com") > -1 ? (apiHost = "https://bulkupload-api.dentira.com", presignUrl = "https://presign.dentira.com/presign") : (apiHost = "https://qa-bulkupload-api.dentira.com", presignUrl = "https://qapresign.dentira.com/presign");
12830
- const API_HOST = apiHost, PRESIGN_URL_HOST = presignUrl;
12829
+ const hostname = (Et = window == null ? void 0 : window.location) == null ? void 0 : Et.hostname, defaultProdConfig = {
12830
+ apiHost: "https://bulkupload-api.dentira.com",
12831
+ presignUrl: "https://presign.dentira.com/presign"
12832
+ }, defaultQaConfig = {
12833
+ apiHost: "https://qa-bulkupload-api.dentira.com",
12834
+ presignUrl: "https://qapresign.dentira.com/presign"
12835
+ }, config = {
12836
+ "qa.dentira.com": defaultQaConfig,
12837
+ localhost: defaultQaConfig
12838
+ }, { apiHost, presignUrl } = config[hostname] || defaultProdConfig, API_HOST = apiHost, PRESIGN_URL_HOST = presignUrl;
12831
12839
  async function fetcher({
12832
12840
  url: e,
12833
12841
  init: t,
@@ -13001,9 +13009,7 @@ const useCustomQuery = ({ sessionToken: e, APIKey: t }) => {
13001
13009
  i(!1);
13002
13010
  }
13003
13011
  }, isMutating: n, error: s };
13004
- };
13005
- var FileType = /* @__PURE__ */ ((e) => (e.EXCEL = "EXCEL", e.CSV = "CSV", e))(FileType || {}), Screen = /* @__PURE__ */ ((e) => (e.MAIN = "MAIN", e.DOWNLOADING_TEMPLATE = "DOWNLOADING_TEMPLATE", e.UPLOADING_FILE = "UPLOADING_FILE", e.EXIT_WARNING = "EXIT_WARNING", e.CHECKING_STATUS = "CHECKING_STATUS", e.UPLOADING_FILE_ERROR = "UPLOADING_FILE_ERROR", e.LOADING_JOBS = "LOADING_JOBS", e.UPLOAD_COMPLETE = "UPLOAD_COMPLETE", e.GENERAL_ERROR = "GENERAL_ERROR", e))(Screen || {}), BulkUploadType = /* @__PURE__ */ ((e) => (e.SAMPLE = "sample", e.GROUPITEMLIST = "GROUPITEMLIST", e.USERITEMLIST = "USERITEMLIST", e))(BulkUploadType || {}), BulkUploadJobStatus = /* @__PURE__ */ ((e) => (e.QUEUED = "QUEUED", e.CREATED = "CREATED", e.IN_PROGRESS = "IN_PROGRESS", e.COMPLETED = "COMPLETED", e.FAILED = "FAILED", e))(BulkUploadJobStatus || {}), JobTypes = /* @__PURE__ */ ((e) => (e.UPLOAD = "UPLOAD", e.TEMPLATE_FILE = "TEMPLATE_FILE", e))(JobTypes || {}), DownloadFolders = /* @__PURE__ */ ((e) => (e.DYNAMIC_TEMPLATE = "dynamic-template", e.STATIC_TEMPLATE = "static-template", e.INVALID_ROWS = "invalid-rows", e))(DownloadFolders || {});
13006
- const checkStatusIntervally = (e, t, n) => {
13012
+ }, checkStatusIntervally = (e, t, n) => {
13007
13013
  const s = useRef(null), [o, a] = useState(!1), { trigger: l, error: c } = useLazyQuery(
13008
13014
  `${BULKUPLOAD_ENDPOINT}/${t == null ? void 0 : t._id}`,
13009
13015
  e,
@@ -13282,7 +13288,280 @@ const buildPresignedDownloadUrl = ({
13282
13288
  }
13283
13289
  }
13284
13290
  }
13285
- }), stateClasses = ["checked", "disabled", "error", "focused", "focusVisible", "required", "expanded", "selected"];
13291
+ }), SyncIcon = createSvgIcon(/* @__PURE__ */ jsxRuntimeExports.jsx("path", {
13292
+ d: "M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"
13293
+ }), "Sync");
13294
+ function getLoadingButtonUtilityClass(e) {
13295
+ return generateUtilityClass("MuiLoadingButton", e);
13296
+ }
13297
+ const loadingButtonClasses = generateUtilityClasses("MuiLoadingButton", ["root", "label", "loading", "loadingIndicator", "loadingIndicatorCenter", "loadingIndicatorStart", "loadingIndicatorEnd", "endIconLoadingEnd", "startIconLoadingStart"]), loadingButtonClasses$1 = loadingButtonClasses, useUtilityClasses = (e) => {
13298
+ const {
13299
+ loading: t,
13300
+ loadingPosition: n,
13301
+ classes: i
13302
+ } = e, s = {
13303
+ root: ["root", t && "loading"],
13304
+ label: ["label"],
13305
+ startIcon: [t && `startIconLoading${capitalize(n)}`],
13306
+ endIcon: [t && `endIconLoading${capitalize(n)}`],
13307
+ loadingIndicator: ["loadingIndicator", t && `loadingIndicator${capitalize(n)}`]
13308
+ }, o = composeClasses(s, getLoadingButtonUtilityClass, i);
13309
+ return {
13310
+ ...i,
13311
+ // forward the outlined, color, etc. classes to Button
13312
+ ...o
13313
+ };
13314
+ }, rootShouldForwardProp = (e) => e !== "ownerState" && e !== "theme" && e !== "sx" && e !== "as" && e !== "classes", LoadingButtonRoot = styled$1(Button$1, {
13315
+ shouldForwardProp: (e) => rootShouldForwardProp(e) || e === "classes",
13316
+ name: "MuiLoadingButton",
13317
+ slot: "Root",
13318
+ overridesResolver: (e, t) => [t.root, t.startIconLoadingStart && {
13319
+ [`& .${loadingButtonClasses$1.startIconLoadingStart}`]: t.startIconLoadingStart
13320
+ }, t.endIconLoadingEnd && {
13321
+ [`& .${loadingButtonClasses$1.endIconLoadingEnd}`]: t.endIconLoadingEnd
13322
+ }]
13323
+ })(memoTheme$1(({
13324
+ theme: e
13325
+ }) => ({
13326
+ display: "inline-flex",
13327
+ [`& .${loadingButtonClasses$1.startIconLoadingStart}, & .${loadingButtonClasses$1.endIconLoadingEnd}`]: {
13328
+ transition: e.transitions.create(["opacity"], {
13329
+ duration: e.transitions.duration.short
13330
+ }),
13331
+ opacity: 0
13332
+ },
13333
+ variants: [{
13334
+ props: {
13335
+ loadingPosition: "center"
13336
+ },
13337
+ style: {
13338
+ transition: e.transitions.create(["background-color", "box-shadow", "border-color"], {
13339
+ duration: e.transitions.duration.short
13340
+ }),
13341
+ [`&.${loadingButtonClasses$1.loading}`]: {
13342
+ color: "transparent"
13343
+ }
13344
+ }
13345
+ }, {
13346
+ props: ({
13347
+ ownerState: t
13348
+ }) => t.loadingPosition === "start" && t.fullWidth,
13349
+ style: {
13350
+ [`& .${loadingButtonClasses$1.startIconLoadingStart}, & .${loadingButtonClasses$1.endIconLoadingEnd}`]: {
13351
+ transition: e.transitions.create(["opacity"], {
13352
+ duration: e.transitions.duration.short
13353
+ }),
13354
+ opacity: 0,
13355
+ marginRight: -8
13356
+ }
13357
+ }
13358
+ }, {
13359
+ props: ({
13360
+ ownerState: t
13361
+ }) => t.loadingPosition === "end" && t.fullWidth,
13362
+ style: {
13363
+ [`& .${loadingButtonClasses$1.startIconLoadingStart}, & .${loadingButtonClasses$1.endIconLoadingEnd}`]: {
13364
+ transition: e.transitions.create(["opacity"], {
13365
+ duration: e.transitions.duration.short
13366
+ }),
13367
+ opacity: 0,
13368
+ marginLeft: -8
13369
+ }
13370
+ }
13371
+ }]
13372
+ }))), LoadingButtonLoadingIndicator = styled$1("span", {
13373
+ name: "MuiLoadingButton",
13374
+ slot: "LoadingIndicator",
13375
+ overridesResolver: (e, t) => {
13376
+ const {
13377
+ ownerState: n
13378
+ } = e;
13379
+ return [t.loadingIndicator, t[`loadingIndicator${capitalize(n.loadingPosition)}`]];
13380
+ }
13381
+ })(memoTheme$1(({
13382
+ theme: e
13383
+ }) => ({
13384
+ position: "absolute",
13385
+ visibility: "visible",
13386
+ display: "flex",
13387
+ variants: [{
13388
+ props: {
13389
+ loadingPosition: "start",
13390
+ size: "small"
13391
+ },
13392
+ style: {
13393
+ left: 10
13394
+ }
13395
+ }, {
13396
+ props: ({
13397
+ loadingPosition: t,
13398
+ ownerState: n
13399
+ }) => t === "start" && n.size !== "small",
13400
+ style: {
13401
+ left: 14
13402
+ }
13403
+ }, {
13404
+ props: {
13405
+ variant: "text",
13406
+ loadingPosition: "start"
13407
+ },
13408
+ style: {
13409
+ left: 6
13410
+ }
13411
+ }, {
13412
+ props: {
13413
+ loadingPosition: "center"
13414
+ },
13415
+ style: {
13416
+ left: "50%",
13417
+ transform: "translate(-50%)",
13418
+ color: (e.vars || e).palette.action.disabled
13419
+ }
13420
+ }, {
13421
+ props: {
13422
+ loadingPosition: "end",
13423
+ size: "small"
13424
+ },
13425
+ style: {
13426
+ right: 10
13427
+ }
13428
+ }, {
13429
+ props: ({
13430
+ loadingPosition: t,
13431
+ ownerState: n
13432
+ }) => t === "end" && n.size !== "small",
13433
+ style: {
13434
+ right: 14
13435
+ }
13436
+ }, {
13437
+ props: {
13438
+ variant: "text",
13439
+ loadingPosition: "end"
13440
+ },
13441
+ style: {
13442
+ right: 6
13443
+ }
13444
+ }, {
13445
+ props: ({
13446
+ ownerState: t
13447
+ }) => t.loadingPosition === "start" && t.fullWidth,
13448
+ style: {
13449
+ position: "relative",
13450
+ left: -10
13451
+ }
13452
+ }, {
13453
+ props: ({
13454
+ ownerState: t
13455
+ }) => t.loadingPosition === "end" && t.fullWidth,
13456
+ style: {
13457
+ position: "relative",
13458
+ right: -10
13459
+ }
13460
+ }]
13461
+ }))), LoadingButtonLabel = styled$1("span", {
13462
+ name: "MuiLoadingButton",
13463
+ slot: "Label",
13464
+ overridesResolver: (e, t) => [t.label]
13465
+ })({
13466
+ display: "inherit",
13467
+ alignItems: "inherit",
13468
+ justifyContent: "inherit"
13469
+ }), LoadingButton = /* @__PURE__ */ React.forwardRef(function(t, n) {
13470
+ const i = React.useContext(ButtonGroupContext$1), s = resolveProps(i, t), o = useDefaultProps({
13471
+ props: s,
13472
+ name: "MuiLoadingButton"
13473
+ }), {
13474
+ children: a,
13475
+ disabled: l = !1,
13476
+ id: c,
13477
+ loading: u = !1,
13478
+ loadingIndicator: f,
13479
+ loadingPosition: x = "center",
13480
+ variant: m = "text",
13481
+ ...S
13482
+ } = o, E = useId(c), d = f ?? /* @__PURE__ */ jsxRuntimeExports.jsx(CircularProgress$1, {
13483
+ "aria-labelledby": E,
13484
+ color: "inherit",
13485
+ size: 16
13486
+ }), I = {
13487
+ ...o,
13488
+ disabled: l,
13489
+ loading: u,
13490
+ loadingIndicator: d,
13491
+ loadingPosition: x,
13492
+ variant: m
13493
+ }, y = useUtilityClasses(I), P = u ? /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingButtonLoadingIndicator, {
13494
+ className: y.loadingIndicator,
13495
+ ownerState: I,
13496
+ children: d
13497
+ }) : null;
13498
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(LoadingButtonRoot, {
13499
+ disabled: l || u,
13500
+ id: E,
13501
+ ref: n,
13502
+ ...S,
13503
+ variant: m,
13504
+ classes: y,
13505
+ ownerState: I,
13506
+ children: [I.loadingPosition === "end" ? /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingButtonLabel, {
13507
+ className: y.label,
13508
+ children: a
13509
+ }) : P, I.loadingPosition === "end" ? P : /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingButtonLabel, {
13510
+ className: y.label,
13511
+ children: a
13512
+ })]
13513
+ });
13514
+ });
13515
+ process.env.NODE_ENV !== "production" && (LoadingButton.propTypes = {
13516
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
13517
+ // │ These PropTypes are generated from the TypeScript type definitions. │
13518
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
13519
+ // └─────────────────────────────────────────────────────────────────────┘
13520
+ /**
13521
+ * The content of the component.
13522
+ */
13523
+ children: PropTypes.node,
13524
+ /**
13525
+ * Override or extend the styles applied to the component.
13526
+ */
13527
+ classes: PropTypes.object,
13528
+ /**
13529
+ * If `true`, the component is disabled.
13530
+ * @default false
13531
+ */
13532
+ disabled: PropTypes.bool,
13533
+ /**
13534
+ * @ignore
13535
+ */
13536
+ id: PropTypes.string,
13537
+ /**
13538
+ * If `true`, the loading indicator is shown and the button becomes disabled.
13539
+ * @default false
13540
+ */
13541
+ loading: PropTypes.bool,
13542
+ /**
13543
+ * Element placed before the children if the button is in loading state.
13544
+ * The node should contain an element with `role="progressbar"` with an accessible name.
13545
+ * By default we render a `CircularProgress` that is labelled by the button itself.
13546
+ * @default <CircularProgress color="inherit" size={16} />
13547
+ */
13548
+ loadingIndicator: PropTypes.node,
13549
+ /**
13550
+ * The loading indicator can be positioned on the start, end, or the center of the button.
13551
+ * @default 'center'
13552
+ */
13553
+ loadingPosition: chainPropTypes(PropTypes.oneOf(["start", "end", "center"]), (e) => e.loadingPosition === "start" && !e.startIcon ? new Error('MUI: The loadingPosition="start" should be used in combination with startIcon.') : e.loadingPosition === "end" && !e.endIcon ? new Error('MUI: The loadingPosition="end" should be used in combination with endIcon.') : null),
13554
+ /**
13555
+ * The system prop that allows defining system overrides as well as additional CSS styles.
13556
+ */
13557
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
13558
+ /**
13559
+ * The variant to use.
13560
+ * @default 'text'
13561
+ */
13562
+ variant: PropTypes.oneOfType([PropTypes.oneOf(["contained", "outlined", "text"]), PropTypes.string])
13563
+ });
13564
+ const LoadingButton$1 = LoadingButton, stateClasses = ["checked", "disabled", "error", "focused", "focusVisible", "required", "expanded", "selected"];
13286
13565
  function createGenerateClassName(e = {}) {
13287
13566
  const {
13288
13567
  disableGlobal: t = !1,
@@ -15234,280 +15513,7 @@ function makeStyles(e, t = {}) {
15234
15513
  `)), d;
15235
15514
  };
15236
15515
  }
15237
- const SyncIcon = createSvgIcon(/* @__PURE__ */ jsxRuntimeExports.jsx("path", {
15238
- d: "M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"
15239
- }), "Sync");
15240
- function getLoadingButtonUtilityClass(e) {
15241
- return generateUtilityClass("MuiLoadingButton", e);
15242
- }
15243
- const loadingButtonClasses = generateUtilityClasses("MuiLoadingButton", ["root", "label", "loading", "loadingIndicator", "loadingIndicatorCenter", "loadingIndicatorStart", "loadingIndicatorEnd", "endIconLoadingEnd", "startIconLoadingStart"]), loadingButtonClasses$1 = loadingButtonClasses, useUtilityClasses = (e) => {
15244
- const {
15245
- loading: t,
15246
- loadingPosition: n,
15247
- classes: i
15248
- } = e, s = {
15249
- root: ["root", t && "loading"],
15250
- label: ["label"],
15251
- startIcon: [t && `startIconLoading${capitalize(n)}`],
15252
- endIcon: [t && `endIconLoading${capitalize(n)}`],
15253
- loadingIndicator: ["loadingIndicator", t && `loadingIndicator${capitalize(n)}`]
15254
- }, o = composeClasses(s, getLoadingButtonUtilityClass, i);
15255
- return {
15256
- ...i,
15257
- // forward the outlined, color, etc. classes to Button
15258
- ...o
15259
- };
15260
- }, rootShouldForwardProp = (e) => e !== "ownerState" && e !== "theme" && e !== "sx" && e !== "as" && e !== "classes", LoadingButtonRoot = styled$1(Button$1, {
15261
- shouldForwardProp: (e) => rootShouldForwardProp(e) || e === "classes",
15262
- name: "MuiLoadingButton",
15263
- slot: "Root",
15264
- overridesResolver: (e, t) => [t.root, t.startIconLoadingStart && {
15265
- [`& .${loadingButtonClasses$1.startIconLoadingStart}`]: t.startIconLoadingStart
15266
- }, t.endIconLoadingEnd && {
15267
- [`& .${loadingButtonClasses$1.endIconLoadingEnd}`]: t.endIconLoadingEnd
15268
- }]
15269
- })(memoTheme$1(({
15270
- theme: e
15271
- }) => ({
15272
- display: "inline-flex",
15273
- [`& .${loadingButtonClasses$1.startIconLoadingStart}, & .${loadingButtonClasses$1.endIconLoadingEnd}`]: {
15274
- transition: e.transitions.create(["opacity"], {
15275
- duration: e.transitions.duration.short
15276
- }),
15277
- opacity: 0
15278
- },
15279
- variants: [{
15280
- props: {
15281
- loadingPosition: "center"
15282
- },
15283
- style: {
15284
- transition: e.transitions.create(["background-color", "box-shadow", "border-color"], {
15285
- duration: e.transitions.duration.short
15286
- }),
15287
- [`&.${loadingButtonClasses$1.loading}`]: {
15288
- color: "transparent"
15289
- }
15290
- }
15291
- }, {
15292
- props: ({
15293
- ownerState: t
15294
- }) => t.loadingPosition === "start" && t.fullWidth,
15295
- style: {
15296
- [`& .${loadingButtonClasses$1.startIconLoadingStart}, & .${loadingButtonClasses$1.endIconLoadingEnd}`]: {
15297
- transition: e.transitions.create(["opacity"], {
15298
- duration: e.transitions.duration.short
15299
- }),
15300
- opacity: 0,
15301
- marginRight: -8
15302
- }
15303
- }
15304
- }, {
15305
- props: ({
15306
- ownerState: t
15307
- }) => t.loadingPosition === "end" && t.fullWidth,
15308
- style: {
15309
- [`& .${loadingButtonClasses$1.startIconLoadingStart}, & .${loadingButtonClasses$1.endIconLoadingEnd}`]: {
15310
- transition: e.transitions.create(["opacity"], {
15311
- duration: e.transitions.duration.short
15312
- }),
15313
- opacity: 0,
15314
- marginLeft: -8
15315
- }
15316
- }
15317
- }]
15318
- }))), LoadingButtonLoadingIndicator = styled$1("span", {
15319
- name: "MuiLoadingButton",
15320
- slot: "LoadingIndicator",
15321
- overridesResolver: (e, t) => {
15322
- const {
15323
- ownerState: n
15324
- } = e;
15325
- return [t.loadingIndicator, t[`loadingIndicator${capitalize(n.loadingPosition)}`]];
15326
- }
15327
- })(memoTheme$1(({
15328
- theme: e
15329
- }) => ({
15330
- position: "absolute",
15331
- visibility: "visible",
15332
- display: "flex",
15333
- variants: [{
15334
- props: {
15335
- loadingPosition: "start",
15336
- size: "small"
15337
- },
15338
- style: {
15339
- left: 10
15340
- }
15341
- }, {
15342
- props: ({
15343
- loadingPosition: t,
15344
- ownerState: n
15345
- }) => t === "start" && n.size !== "small",
15346
- style: {
15347
- left: 14
15348
- }
15349
- }, {
15350
- props: {
15351
- variant: "text",
15352
- loadingPosition: "start"
15353
- },
15354
- style: {
15355
- left: 6
15356
- }
15357
- }, {
15358
- props: {
15359
- loadingPosition: "center"
15360
- },
15361
- style: {
15362
- left: "50%",
15363
- transform: "translate(-50%)",
15364
- color: (e.vars || e).palette.action.disabled
15365
- }
15366
- }, {
15367
- props: {
15368
- loadingPosition: "end",
15369
- size: "small"
15370
- },
15371
- style: {
15372
- right: 10
15373
- }
15374
- }, {
15375
- props: ({
15376
- loadingPosition: t,
15377
- ownerState: n
15378
- }) => t === "end" && n.size !== "small",
15379
- style: {
15380
- right: 14
15381
- }
15382
- }, {
15383
- props: {
15384
- variant: "text",
15385
- loadingPosition: "end"
15386
- },
15387
- style: {
15388
- right: 6
15389
- }
15390
- }, {
15391
- props: ({
15392
- ownerState: t
15393
- }) => t.loadingPosition === "start" && t.fullWidth,
15394
- style: {
15395
- position: "relative",
15396
- left: -10
15397
- }
15398
- }, {
15399
- props: ({
15400
- ownerState: t
15401
- }) => t.loadingPosition === "end" && t.fullWidth,
15402
- style: {
15403
- position: "relative",
15404
- right: -10
15405
- }
15406
- }]
15407
- }))), LoadingButtonLabel = styled$1("span", {
15408
- name: "MuiLoadingButton",
15409
- slot: "Label",
15410
- overridesResolver: (e, t) => [t.label]
15411
- })({
15412
- display: "inherit",
15413
- alignItems: "inherit",
15414
- justifyContent: "inherit"
15415
- }), LoadingButton = /* @__PURE__ */ React.forwardRef(function(t, n) {
15416
- const i = React.useContext(ButtonGroupContext$1), s = resolveProps(i, t), o = useDefaultProps({
15417
- props: s,
15418
- name: "MuiLoadingButton"
15419
- }), {
15420
- children: a,
15421
- disabled: l = !1,
15422
- id: c,
15423
- loading: u = !1,
15424
- loadingIndicator: f,
15425
- loadingPosition: x = "center",
15426
- variant: m = "text",
15427
- ...S
15428
- } = o, E = useId(c), d = f ?? /* @__PURE__ */ jsxRuntimeExports.jsx(CircularProgress$1, {
15429
- "aria-labelledby": E,
15430
- color: "inherit",
15431
- size: 16
15432
- }), I = {
15433
- ...o,
15434
- disabled: l,
15435
- loading: u,
15436
- loadingIndicator: d,
15437
- loadingPosition: x,
15438
- variant: m
15439
- }, y = useUtilityClasses(I), P = u ? /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingButtonLoadingIndicator, {
15440
- className: y.loadingIndicator,
15441
- ownerState: I,
15442
- children: d
15443
- }) : null;
15444
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(LoadingButtonRoot, {
15445
- disabled: l || u,
15446
- id: E,
15447
- ref: n,
15448
- ...S,
15449
- variant: m,
15450
- classes: y,
15451
- ownerState: I,
15452
- children: [I.loadingPosition === "end" ? /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingButtonLabel, {
15453
- className: y.label,
15454
- children: a
15455
- }) : P, I.loadingPosition === "end" ? P : /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingButtonLabel, {
15456
- className: y.label,
15457
- children: a
15458
- })]
15459
- });
15460
- });
15461
- process.env.NODE_ENV !== "production" && (LoadingButton.propTypes = {
15462
- // ┌────────────────────────────── Warning ──────────────────────────────┐
15463
- // │ These PropTypes are generated from the TypeScript type definitions. │
15464
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
15465
- // └─────────────────────────────────────────────────────────────────────┘
15466
- /**
15467
- * The content of the component.
15468
- */
15469
- children: PropTypes.node,
15470
- /**
15471
- * Override or extend the styles applied to the component.
15472
- */
15473
- classes: PropTypes.object,
15474
- /**
15475
- * If `true`, the component is disabled.
15476
- * @default false
15477
- */
15478
- disabled: PropTypes.bool,
15479
- /**
15480
- * @ignore
15481
- */
15482
- id: PropTypes.string,
15483
- /**
15484
- * If `true`, the loading indicator is shown and the button becomes disabled.
15485
- * @default false
15486
- */
15487
- loading: PropTypes.bool,
15488
- /**
15489
- * Element placed before the children if the button is in loading state.
15490
- * The node should contain an element with `role="progressbar"` with an accessible name.
15491
- * By default we render a `CircularProgress` that is labelled by the button itself.
15492
- * @default <CircularProgress color="inherit" size={16} />
15493
- */
15494
- loadingIndicator: PropTypes.node,
15495
- /**
15496
- * The loading indicator can be positioned on the start, end, or the center of the button.
15497
- * @default 'center'
15498
- */
15499
- loadingPosition: chainPropTypes(PropTypes.oneOf(["start", "end", "center"]), (e) => e.loadingPosition === "start" && !e.startIcon ? new Error('MUI: The loadingPosition="start" should be used in combination with startIcon.') : e.loadingPosition === "end" && !e.endIcon ? new Error('MUI: The loadingPosition="end" should be used in combination with endIcon.') : null),
15500
- /**
15501
- * The system prop that allows defining system overrides as well as additional CSS styles.
15502
- */
15503
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
15504
- /**
15505
- * The variant to use.
15506
- * @default 'text'
15507
- */
15508
- variant: PropTypes.oneOfType([PropTypes.oneOf(["contained", "outlined", "text"]), PropTypes.string])
15509
- });
15510
- const LoadingButton$1 = LoadingButton, useStyles = makeStyles(() => ({
15516
+ const useStyles = makeStyles(() => ({
15511
15517
  listItemText: {
15512
15518
  "&.MuiListItemText-root": {
15513
15519
  margin: "1px",
@@ -15539,15 +15545,12 @@ const LoadingButton$1 = LoadingButton, useStyles = makeStyles(() => ({
15539
15545
  paddingBlock: "10px 8px",
15540
15546
  paddingInline: [Screen.MAIN].includes(e) ? "0px" : "1rem 0px"
15541
15547
  };
15542
- }), ActionsContainer = styled$1(DialogActions$1)(({ theme: e }) => {
15543
- const { screen: t } = useDialogContext();
15544
- return {
15545
- justifyContent: t === Screen.UPLOAD_COMPLETE ? "end" : "center",
15546
- gap: "1rem",
15547
- paddingBlock: "12px",
15548
- paddingInline: e.spacing(themeSpacing)
15549
- };
15550
- }), ActionButton = styled$1(LoadingButton$1)(() => ({
15548
+ }), ActionsContainer = styled$1(DialogActions$1)(({ theme: e, children: t }) => ({
15549
+ justifyContent: (t == null ? void 0 : t.type()).props.children.filter(Boolean).length > 1 ? "center" : "end",
15550
+ gap: "1rem",
15551
+ paddingBlock: "12px",
15552
+ paddingInline: e.spacing(themeSpacing)
15553
+ })), ActionButton = styled$1(LoadingButton$1)(() => ({
15551
15554
  margin: "0px !important",
15552
15555
  width: "250px",
15553
15556
  fontWeight: 600,
@@ -15658,34 +15661,37 @@ const LoadingIcon = (e) => {
15658
15661
  children: "Exit"
15659
15662
  }
15660
15663
  )
15661
- ] }), E = () => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
15662
- /* @__PURE__ */ jsxRuntimeExports.jsx(
15663
- ActionButton,
15664
- {
15665
- variant: "outlined",
15666
- color: "error",
15667
- loading: u,
15668
- loadingIndicator: /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingIcon, { color: "error" }),
15669
- onClick: () => {
15670
- x && m && c(x, m);
15671
- },
15672
- disabled: u && !x,
15673
- children: "Download Error File"
15674
- }
15675
- ),
15676
- /* @__PURE__ */ jsxRuntimeExports.jsx(
15677
- ActionButton,
15678
- {
15679
- variant: "contained",
15680
- color: "error",
15681
- loading: l,
15682
- loadingIndicator: /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingIcon, { color: "error" }),
15683
- onClick: () => a(),
15684
- disabled: l,
15685
- children: "Clear Errors"
15686
- }
15687
- )
15688
- ] }), d = () => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
15664
+ ] }), E = () => {
15665
+ const y = !!(x && m);
15666
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
15667
+ y && /* @__PURE__ */ jsxRuntimeExports.jsx(
15668
+ ActionButton,
15669
+ {
15670
+ variant: "outlined",
15671
+ color: "error",
15672
+ loading: u,
15673
+ loadingIndicator: /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingIcon, { color: "error" }),
15674
+ onClick: () => {
15675
+ c(x, m);
15676
+ },
15677
+ disabled: u && !x,
15678
+ children: "Download Error File"
15679
+ }
15680
+ ),
15681
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
15682
+ ActionButton,
15683
+ {
15684
+ variant: "contained",
15685
+ color: "error",
15686
+ loading: l,
15687
+ loadingIndicator: /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingIcon, { color: "error" }),
15688
+ onClick: () => a(),
15689
+ disabled: l,
15690
+ children: "Clear Errors"
15691
+ }
15692
+ )
15693
+ ] });
15694
+ }, d = () => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
15689
15695
  /* @__PURE__ */ jsxRuntimeExports.jsx(
15690
15696
  ActionButton,
15691
15697
  {
@@ -48356,8 +48362,8 @@ const DialogContent = () => {
48356
48362
  /* @__PURE__ */ jsxRuntimeExports.jsx(CssBaseline, {}),
48357
48363
  /* @__PURE__ */ jsxRuntimeExports.jsx(DialogProvider, { config: e, children: /* @__PURE__ */ jsxRuntimeExports.jsx(BulkUpload, {}) })
48358
48364
  ] }) }), useDialog = () => {
48359
- const [e, t] = useState(!1);
48360
- return { openDialog: () => t(!0), closeDialog: () => t(!1), isOpen: e };
48365
+ const [e, t] = useState(!1), n = useCallback(() => t(!0), []), i = useCallback(() => t(!1), []);
48366
+ return { openDialog: n, closeDialog: i, isOpen: e };
48361
48367
  };
48362
48368
  export {
48363
48369
  BulkUploadDialog,