@docsvision/management-console 6.2.3 → 6.2.4-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -3866,10 +3866,10 @@ function mergeSlotProps$1(externalSlotProps, defaultSlotProps) {
3866
3866
  }
3867
3867
  };
3868
3868
  }
3869
- const WarningIcon$1 = createSvgIcon$1(/* @__PURE__ */ jsx("path", {
3869
+ const WarningIcon = createSvgIcon$1(/* @__PURE__ */ jsx("path", {
3870
3870
  d: "M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"
3871
3871
  }));
3872
- const ErrorIcon$2 = createSvgIcon$1(/* @__PURE__ */ jsx("path", {
3872
+ const ErrorIcon$1 = createSvgIcon$1(/* @__PURE__ */ jsx("path", {
3873
3873
  d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"
3874
3874
  }));
3875
3875
  var AlertType = /* @__PURE__ */ ((AlertType2) => {
@@ -3882,11 +3882,11 @@ function AlertTile(props) {
3882
3882
  switch (props.type) {
3883
3883
  case 0:
3884
3884
  return /* @__PURE__ */ jsxs("span", { className: "alert-tile__icon-wrapper alert-tile__warning-wrapper", children: [
3885
- /* @__PURE__ */ jsx(WarningIcon$1, { fontSize: "large" }),
3885
+ /* @__PURE__ */ jsx(WarningIcon, { fontSize: "large" }),
3886
3886
  props.services.resources.Attention
3887
3887
  ] });
3888
3888
  case 1:
3889
- return /* @__PURE__ */ jsx("span", { className: "alert-tile__icon-wrapper alert-tile__error-wrapper", children: /* @__PURE__ */ jsx(ErrorIcon$2, { fontSize: "large", color: "error" }) });
3889
+ return /* @__PURE__ */ jsx("span", { className: "alert-tile__icon-wrapper alert-tile__error-wrapper", children: /* @__PURE__ */ jsx(ErrorIcon$1, { fontSize: "large", color: "error" }) });
3890
3890
  }
3891
3891
  }
3892
3892
  return /* @__PURE__ */ jsxs("div", { className: "alert-tile", children: [
@@ -9689,163 +9689,6 @@ var RowType;
9689
9689
  RowType2[RowType2["TableHeaderRowItem"] = 0] = "TableHeaderRowItem";
9690
9690
  RowType2[RowType2["TableRowItem"] = 1] = "TableRowItem";
9691
9691
  })(RowType || (RowType = {}));
9692
- var MenuItemCompositionNames = {
9693
- TableHeaderRow: "TableHeaderRowItem",
9694
- TableRow: "TableRowItem"
9695
- };
9696
- var ContextMenuLogic = (
9697
- /** @class */
9698
- function() {
9699
- function ContextMenuLogic2(node, composition) {
9700
- var _this = this;
9701
- this.node = node;
9702
- this.composition = composition;
9703
- this.ACTIVE_ROW_CLASSNAME = "folder-grid-context-menu-selected-row";
9704
- this.openMenu = function() {
9705
- var isOpened;
9706
- if (!_this.composition.services.contextMenuOptions.$stateData) {
9707
- ContextMenuOptionsService.initBase(_this.composition.services.contextMenuOptions, _this.composition.services);
9708
- } else {
9709
- isOpened = _this.composition.services.contextMenuOptions.$stateData.getState().isOpened;
9710
- }
9711
- isOpened && _this.hideContextMenuHandler();
9712
- _this.setRowSelection(_this.targetRow, true);
9713
- _this.composition.services.contextMenuOptions.setOpened(true);
9714
- _this.composition.services.contextMenuOptions.setContext(_this.composition);
9715
- _this.onShow();
9716
- };
9717
- this.closeMenu = function() {
9718
- _this.composition.services.contextMenuOptions.setOpened(false);
9719
- _this.composition.services.contextMenuOptions.setContext(null);
9720
- _this.setRowSelection(_this.targetRow, false);
9721
- _this.onHide();
9722
- };
9723
- this.hideContextMenuHandler = function() {
9724
- var isOpened = _this.composition.services.contextMenuOptions.$stateData.getState().isOpened;
9725
- if (isOpened) {
9726
- _this.closeMenu();
9727
- }
9728
- };
9729
- this.setRowSelection = function(row, selected) {
9730
- if (!row || !_this.shouldShow() || !_this.isMobile()) {
9731
- return;
9732
- }
9733
- selected ? row.classList.add(_this.ACTIVE_ROW_CLASSNAME) : row.classList.remove(_this.ACTIVE_ROW_CLASSNAME);
9734
- };
9735
- this.showContextMenuHandler = function(e2) {
9736
- var _a, _b, _c, _d;
9737
- if (!e2) {
9738
- return;
9739
- }
9740
- e2.preventDefault();
9741
- if (_this.composition.name == TableCompositionNames.TableRow && _this.composition.ref) {
9742
- _this.targetRow = _this.composition.ref;
9743
- } else if (_this.composition.name == TableCompositionNames.TableCell && _this.composition.ref) {
9744
- _this.targetRow = _this.composition.ref.parentNode;
9745
- }
9746
- (_b = (_a = _this.composition.services.contextMenuOptions).setEventTarget) === null || _b === void 0 ? void 0 : _b.call(_a, { target: e2.target, userSelection: window.getSelection().toString() });
9747
- var viewportScroll = (_c = _this.composition.services.scrollContainer) === null || _c === void 0 ? void 0 : _c.getScrollTop();
9748
- var tableCoordinates = (_d = _this.composition.services.tableDom) === null || _d === void 0 ? void 0 : _d.$root.getState().getBoundingClientRect();
9749
- _this.pageCoordinates = {
9750
- top: e2.pageY,
9751
- left: e2.pageX,
9752
- tableWidth: tableCoordinates === null || tableCoordinates === void 0 ? void 0 : tableCoordinates.width,
9753
- tableHeight: tableCoordinates === null || tableCoordinates === void 0 ? void 0 : tableCoordinates.height,
9754
- paddingLeft: tableCoordinates === null || tableCoordinates === void 0 ? void 0 : tableCoordinates.left,
9755
- viewportScroll
9756
- };
9757
- _this.openMenu();
9758
- };
9759
- this.touchstartListener = function() {
9760
- clearInterval(_this.longTapInterval);
9761
- _this.longTapTimer = 0;
9762
- _this.longTapInterval = setInterval(function() {
9763
- _this.longTapTimer += 10;
9764
- }, 10);
9765
- };
9766
- this.touchendListener = function(e2) {
9767
- if (_this.longTapTimer >= 1e3) {
9768
- _this.showContextMenuHandler(e2);
9769
- }
9770
- clearInterval(_this.longTapInterval);
9771
- _this.longTapTimer = 0;
9772
- };
9773
- this.addContextMenuCustom = function(row) {
9774
- row.addEventListener("contextmenu", _this.showContextMenuHandler, false);
9775
- if (_this.composition.services.deviceType != DeviceType.Desktop) {
9776
- row.addEventListener("touchstart", _this.touchstartListener, false);
9777
- row.addEventListener("touchend", _this.touchendListener, false);
9778
- }
9779
- };
9780
- this.removeContextMenuCustom = function(row) {
9781
- row.removeEventListener("contextmenu", _this.showContextMenuHandler, false);
9782
- if (_this.composition.services.deviceType != DeviceType.Desktop) {
9783
- row.removeEventListener("touchstart", _this.touchstartListener);
9784
- row.removeEventListener("touchend", _this.touchendListener, false);
9785
- }
9786
- };
9787
- }
9788
- ContextMenuLogic2.getMenuBarsContainer = function() {
9789
- if (!this.mMenuBarsContainer) {
9790
- this.mMenuBarsContainer = new BodyContainerProvider("adaptive-menu-bar-helpers-container");
9791
- }
9792
- return this.mMenuBarsContainer;
9793
- };
9794
- ContextMenuLogic2.Setup = function(node, composition) {
9795
- if (node) {
9796
- var wrapper = new ContextMenuLogic2(node, composition);
9797
- wrapper.addContextMenuCustom(node);
9798
- }
9799
- };
9800
- ContextMenuLogic2.prototype.renderContextMenu = function() {
9801
- var _this = this;
9802
- var compositionName = this.composition.name;
9803
- var menuState = this.composition.services.contextMenuOptions.$stateData.getState();
9804
- var options = menuState.items;
9805
- menuState.className;
9806
- var isOpened = menuState.isOpened;
9807
- var pluginName = MenuItemCompositionNames[compositionName];
9808
- var children = React__default.createElement(
9809
- Focusable,
9810
- null,
9811
- React__default.createElement(Composition, { key: compositionName, name: pluginName, plugins: this.composition.plugins, services: this.composition.services }, options.map(function(_a, index2) {
9812
- var name = _a.name, action = _a.action, visible = _a.visible, disabled = _a.disabled;
9813
- return React__default.createElement(MenuItem$1, { key: name, name, dataTestId: "menu-item-" + index2, onClick: function() {
9814
- return _this.onMenuItemClick(action, !disabled);
9815
- }, visible }, name);
9816
- }))
9817
- );
9818
- return React__default.createElement(ContextMenu, { children, expanded: isOpened, mode: PopoverMode.UnderCursor, isContextmenuEventNeed: true, handleOutsideClick: true, pageCoordinates: this.pageCoordinates, onClose: function() {
9819
- return _this.hideContextMenuHandler();
9820
- } });
9821
- };
9822
- ContextMenuLogic2.prototype.onShow = function() {
9823
- if (this.shouldShow()) {
9824
- this.mContainer = ContextMenuLogic2.getMenuBarsContainer().createElement("adaptive-menu-bar-helper");
9825
- ReactDOM__default.render(this.renderContextMenu(), this.mContainer);
9826
- }
9827
- };
9828
- ContextMenuLogic2.prototype.shouldShow = function() {
9829
- return !this.isMobile() || !this.composition.services.checkboxService || this.composition.services.checkboxService.$checkboxCellsState.getState().length == 0;
9830
- };
9831
- ContextMenuLogic2.prototype.isMobile = function() {
9832
- return this.composition.services.deviceType == DeviceType.Smartphone;
9833
- };
9834
- ContextMenuLogic2.prototype.onHide = function() {
9835
- ContextMenuLogic2.getMenuBarsContainer().freeElement(this.mContainer);
9836
- };
9837
- ContextMenuLogic2.prototype.componentWillUnmount = function() {
9838
- this.removeContextMenuCustom(this.node);
9839
- };
9840
- ContextMenuLogic2.prototype.onMenuItemClick = function(action, enabled) {
9841
- if (enabled) {
9842
- this.hideContextMenuHandler();
9843
- action(this.composition);
9844
- }
9845
- };
9846
- return ContextMenuLogic2;
9847
- }()
9848
- );
9849
9692
  var GridContextMenuFeature = "GridContextMenuFeature";
9850
9693
  var DisableNativeContextMenuTableDecorator = {
9851
9694
  name: "DisableNativeContextMenuTableDecorator",
@@ -19176,6 +19019,7 @@ const DEFAULT_DASHBOARD_WIDGETS = [
19176
19019
  }]
19177
19020
  }
19178
19021
  ];
19022
+ const getHashLink = (link) => window.location.hash.startsWith("#") ? "#/" + link : link;
19179
19023
  function BreadcrumbsPanel(props) {
19180
19024
  const services = useContext(ServicesContext);
19181
19025
  const { resources } = services || {};
@@ -19208,22 +19052,28 @@ function BreadcrumbsPanel(props) {
19208
19052
  }
19209
19053
  };
19210
19054
  const renderBreadcrumbsDefault = () => {
19055
+ const handleDashboardLinkClick = (event) => {
19056
+ event.preventDefault();
19057
+ goTo(DASHBOARD_ROUTE_PATH);
19058
+ };
19059
+ const dashBoardLink = getHashLink(DASHBOARD_ROUTE_PATH);
19211
19060
  return /* @__PURE__ */ jsxs(Breadcrumbs, { "aria-label": "breadcrumb", children: [
19212
- /* @__PURE__ */ jsx("a", { className: "breadcrumb-label", "data-testid": "breadcrumb-label", onClick: () => goTo(DASHBOARD_ROUTE_PATH), children: resources.Dashboard }),
19061
+ /* @__PURE__ */ jsx("a", { href: dashBoardLink, className: "breadcrumb-label", "data-testid": "breadcrumb-label", onClick: handleDashboardLinkClick, children: resources.Dashboard }),
19213
19062
  /* @__PURE__ */ jsx("a", { className: "breadcrumb-label-active", children: link })
19214
19063
  ] });
19215
19064
  };
19216
19065
  const renderBreadcrumbsItems = () => {
19217
19066
  const activeItem = breadcrumbsItems[breadcrumbsItems.length - 1];
19218
19067
  const clickableItems = breadcrumbsItems.slice(0, -1);
19219
- const onBreadcrumbClick = (path) => {
19068
+ const onBreadcrumbClick = (path) => (event) => {
19069
+ event.preventDefault();
19220
19070
  goTo(path);
19221
19071
  if (services.routingService.getLastRouteResolvedParams().url === path) {
19222
19072
  breadcrumbsItems.pop();
19223
19073
  }
19224
19074
  };
19225
19075
  return /* @__PURE__ */ jsxs(Breadcrumbs, { "aria-label": "breadcrumb", children: [
19226
- clickableItems.map(({ label, path }) => /* @__PURE__ */ jsx("a", { className: "breadcrumb-label", "data-testid": "breadcrumb-label", onClick: () => onBreadcrumbClick(path), children: getBreadcrumbsLabel(label) }, path)),
19076
+ clickableItems.map(({ label, path }) => /* @__PURE__ */ jsx("a", { href: getHashLink(path), className: "breadcrumb-label", "data-testid": "breadcrumb-label", onClick: onBreadcrumbClick(path), children: getBreadcrumbsLabel(label) }, path)),
19227
19077
  /* @__PURE__ */ jsx("a", { className: "breadcrumb-label-active", "data-testid": "breadcrumb-label-active", children: getBreadcrumbsLabel(activeItem.label) })
19228
19078
  ] });
19229
19079
  };
@@ -37736,7 +37586,7 @@ const theme = createTheme$3({
37736
37586
  }
37737
37587
  }
37738
37588
  });
37739
- const InfoIcon$1 = createSvgIcon$1(/* @__PURE__ */ jsx("path", {
37589
+ const InfoIcon = createSvgIcon$1(/* @__PURE__ */ jsx("path", {
37740
37590
  d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"
37741
37591
  }));
37742
37592
  var ButtonColorModes = /* @__PURE__ */ ((ButtonColorModes2) => {
@@ -37747,11 +37597,11 @@ var ButtonColorModes = /* @__PURE__ */ ((ButtonColorModes2) => {
37747
37597
  function getIconByType(type) {
37748
37598
  switch (type) {
37749
37599
  case "error":
37750
- return /* @__PURE__ */ jsx(ErrorIcon$2, {});
37600
+ return /* @__PURE__ */ jsx(ErrorIcon$1, {});
37751
37601
  case "warning":
37752
- return /* @__PURE__ */ jsx(WarningIcon$1, {});
37602
+ return /* @__PURE__ */ jsx(WarningIcon, {});
37753
37603
  default:
37754
- return /* @__PURE__ */ jsx(InfoIcon$1, {});
37604
+ return /* @__PURE__ */ jsx(InfoIcon, {});
37755
37605
  }
37756
37606
  }
37757
37607
  function getColorByType(type, palette) {
@@ -37839,7 +37689,7 @@ function getCustomButtons(parameters) {
37839
37689
  button.id || "buttonConfirm"
37840
37690
  ));
37841
37691
  }
37842
- const CloseIcon$1 = createSvgIcon$1(/* @__PURE__ */ jsx("path", {
37692
+ const CloseIcon = createSvgIcon$1(/* @__PURE__ */ jsx("path", {
37843
37693
  d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
37844
37694
  }));
37845
37695
  function MessageWindow(props) {
@@ -37877,7 +37727,7 @@ function MessageWindow(props) {
37877
37727
  icon,
37878
37728
  title
37879
37729
  ] }),
37880
- /* @__PURE__ */ jsx(IconButton$3, { "data-testid": "message-window-close-button", onClick: onClose, className: "message-window__close-icon", children: /* @__PURE__ */ jsx(CloseIcon$1, {}) }),
37730
+ /* @__PURE__ */ jsx(IconButton$3, { "data-testid": "message-window-close-button", onClick: onClose, className: "message-window__close-icon", children: /* @__PURE__ */ jsx(CloseIcon, {}) }),
37881
37731
  /* @__PURE__ */ jsx(DialogContent$2, { style: { maxHeight: contentMaxHeight }, "data-testid": "message-window-content", children: content }),
37882
37732
  /* @__PURE__ */ jsx(DialogActions$2, { children: buttons })
37883
37733
  ]
@@ -38552,6 +38402,166 @@ function PageFilterButton(props) {
38552
38402
  });
38553
38403
  const OBJECT_COLUMN_ID = "objectID";
38554
38404
  const TYPE_COLUMN_ID = "typeID";
38405
+ const MenuItemCompositionNames = {
38406
+ TableHeaderRow: "TableHeaderRowItem",
38407
+ TableRow: "TableRowItem"
38408
+ };
38409
+ class ContextMenuItemsLogic {
38410
+ constructor(node, composition) {
38411
+ this.node = node;
38412
+ this.composition = composition;
38413
+ this.activeRowClassname = "folder-grid-context-menu-selected-row";
38414
+ this.menuItemClassname = "dv-context-menu__item";
38415
+ this.openMenu = () => {
38416
+ let isOpened;
38417
+ if (!this.composition.services.contextMenuOptions.$stateData) {
38418
+ ContextMenuOptionsService.initBase(this.composition.services.contextMenuOptions, this.composition.services);
38419
+ } else {
38420
+ isOpened = this.composition.services.contextMenuOptions.$stateData.getState().isOpened;
38421
+ }
38422
+ isOpened && this.hideContextMenuHandler();
38423
+ this.setRowSelection(this.targetRow, true);
38424
+ this.composition.services.contextMenuOptions.setOpened(true);
38425
+ this.composition.services.contextMenuOptions.setContext(this.composition);
38426
+ this.onShow();
38427
+ };
38428
+ this.closeMenu = () => {
38429
+ this.composition.services.contextMenuOptions.setOpened(false);
38430
+ this.composition.services.contextMenuOptions.setContext(null);
38431
+ this.setRowSelection(this.targetRow, false);
38432
+ this.onHide();
38433
+ };
38434
+ this.hideContextMenuHandler = () => {
38435
+ const isOpened = this.composition.services.contextMenuOptions.$stateData.getState().isOpened;
38436
+ if (isOpened) {
38437
+ this.closeMenu();
38438
+ }
38439
+ };
38440
+ this.setRowSelection = (row, selected) => {
38441
+ if (!row || !this.shouldShow() || !this.isMobile()) {
38442
+ return;
38443
+ }
38444
+ selected ? row.classList.add(this.activeRowClassname) : row.classList.remove(this.activeRowClassname);
38445
+ };
38446
+ this.showContextMenuHandler = (e2) => {
38447
+ if (!e2) {
38448
+ return;
38449
+ }
38450
+ e2.preventDefault();
38451
+ if (this.composition.name === TableCompositionNames.TableRow && this.composition.ref) {
38452
+ this.targetRow = this.composition.ref;
38453
+ } else if (this.composition.name === TableCompositionNames.TableCell && this.composition.ref) {
38454
+ this.targetRow = this.composition.ref.parentNode;
38455
+ }
38456
+ this.composition.services.contextMenuOptions.setEventTarget?.({ target: e2.target, userSelection: window.getSelection().toString() });
38457
+ const viewportScroll = this.composition.services.scrollContainer?.getScrollTop();
38458
+ const tableCoordinates = this.composition.services.tableDom?.$root.getState().getBoundingClientRect();
38459
+ this.pageCoordinates = {
38460
+ top: e2.pageY,
38461
+ left: e2.pageX,
38462
+ tableWidth: tableCoordinates?.width,
38463
+ tableHeight: tableCoordinates?.height,
38464
+ paddingLeft: tableCoordinates?.left,
38465
+ viewportScroll
38466
+ };
38467
+ this.openMenu();
38468
+ };
38469
+ this.touchstartListener = () => {
38470
+ clearInterval(this.longTapInterval);
38471
+ this.longTapTimer = 0;
38472
+ this.longTapInterval = setInterval(() => {
38473
+ this.longTapTimer += 10;
38474
+ }, 10);
38475
+ };
38476
+ this.touchendListener = (e2) => {
38477
+ if (this.longTapTimer >= 1e3) {
38478
+ this.showContextMenuHandler(e2);
38479
+ }
38480
+ clearInterval(this.longTapInterval);
38481
+ this.longTapTimer = 0;
38482
+ };
38483
+ this.addContextMenuCustom = (row) => {
38484
+ row.addEventListener("contextmenu", this.showContextMenuHandler, false);
38485
+ if (this.composition.services.deviceType !== DeviceType.Desktop) {
38486
+ row.addEventListener("touchstart", this.touchstartListener, false);
38487
+ row.addEventListener("touchend", this.touchendListener, false);
38488
+ }
38489
+ };
38490
+ this.removeContextMenuCustom = (row) => {
38491
+ row.removeEventListener("contextmenu", this.showContextMenuHandler, false);
38492
+ if (this.composition.services.deviceType !== DeviceType.Desktop) {
38493
+ row.removeEventListener("touchstart", this.touchstartListener);
38494
+ row.removeEventListener("touchend", this.touchendListener, false);
38495
+ }
38496
+ };
38497
+ }
38498
+ static getMenuBarsContainer() {
38499
+ if (!this.mMenuBarsContainer) {
38500
+ this.mMenuBarsContainer = new BodyContainerProvider("adaptive-menu-bar-helpers-container");
38501
+ }
38502
+ return this.mMenuBarsContainer;
38503
+ }
38504
+ static Setup(node, composition) {
38505
+ if (node) {
38506
+ const wrapper = new ContextMenuItemsLogic(node, composition);
38507
+ wrapper.addContextMenuCustom(node);
38508
+ }
38509
+ }
38510
+ renderContextMenu() {
38511
+ const compositionName = this.composition.name;
38512
+ const menuState = this.composition.services.contextMenuOptions.$stateData.getState();
38513
+ const options = menuState.items;
38514
+ const isOpened = menuState.isOpened;
38515
+ const pluginName = MenuItemCompositionNames[compositionName];
38516
+ const children = /* @__PURE__ */ jsx(Focusable, { children: /* @__PURE__ */ jsx(Composition, { name: pluginName, plugins: this.composition.plugins, services: this.composition.services, children: options.map(({ name, action, visible, disabled, className }, index2) => /* @__PURE__ */ jsx("li", { className: classNames(className, this.menuItemClassname, { hide: visible !== void 0 && !visible }), children: /* @__PURE__ */ jsx(
38517
+ MenuItem$1,
38518
+ {
38519
+ name,
38520
+ dataTestId: `menu-item-${index2}`,
38521
+ onClick: () => this.onMenuItemClick(action, !disabled),
38522
+ visible,
38523
+ children: name
38524
+ },
38525
+ name
38526
+ ) }, name)) }, compositionName) });
38527
+ return /* @__PURE__ */ jsx(
38528
+ ContextMenu,
38529
+ {
38530
+ expanded: isOpened,
38531
+ mode: PopoverMode.UnderCursor,
38532
+ isContextmenuEventNeed: true,
38533
+ handleOutsideClick: true,
38534
+ pageCoordinates: this.pageCoordinates,
38535
+ onClose: () => this.hideContextMenuHandler(),
38536
+ children
38537
+ }
38538
+ );
38539
+ }
38540
+ onShow() {
38541
+ if (this.shouldShow()) {
38542
+ this.mContainer = ContextMenuItemsLogic.getMenuBarsContainer().createElement("adaptive-menu-bar-helper");
38543
+ ReactDOM__default.render(this.renderContextMenu(), this.mContainer);
38544
+ }
38545
+ }
38546
+ shouldShow() {
38547
+ return !this.isMobile() || !this.composition.services.checkboxService || this.composition.services.checkboxService.$checkboxCellsState.getState().length === 0;
38548
+ }
38549
+ isMobile() {
38550
+ return this.composition.services.deviceType === DeviceType.Smartphone;
38551
+ }
38552
+ onHide() {
38553
+ ContextMenuItemsLogic.getMenuBarsContainer().freeElement(this.mContainer);
38554
+ }
38555
+ componentWillUnmount() {
38556
+ this.removeContextMenuCustom(this.node);
38557
+ }
38558
+ onMenuItemClick(action, enabled) {
38559
+ if (enabled) {
38560
+ this.hideContextMenuHandler();
38561
+ action(this.composition);
38562
+ }
38563
+ }
38564
+ }
38555
38565
  const AddingContextMenuCustomTableRowPlugin = {
38556
38566
  name: "AddingContextMenuCustomTableRowPlugin",
38557
38567
  description: "Добавляет контекстное меню для строки с непустым objectId.",
@@ -38560,7 +38570,7 @@ const AddingContextMenuCustomTableRowPlugin = {
38560
38570
  compositionDidMount: (composition) => {
38561
38571
  const objectId = composition.data.row.cells.find((cell) => cell.columnId === OBJECT_COLUMN_ID)?.value && getCardId(composition.data.row)?.value;
38562
38572
  if (objectId !== EMPTY_GUID$1) {
38563
- ContextMenuLogic.Setup(composition.ref, composition);
38573
+ ContextMenuItemsLogic.Setup(composition.ref, composition);
38564
38574
  }
38565
38575
  }
38566
38576
  };
@@ -38688,8 +38698,10 @@ function showNotification(text) {
38688
38698
  const CONTEXT_MENU_COPY_CARD_ID_ID = "CONTEXT_MENU_COPY_CARD_ID_ID";
38689
38699
  const CONTEXT_MENU_OPEN_WEB_CLIENT_ID = "CONTEXT_MENU_OPEN_WEB_CLIENT_ID";
38690
38700
  const CONTEXT_MENU_OPEN_WIN_CLIENT_ID = "CONTEXT_MENU_OPEN_WIN_CLIENT_ID";
38701
+ const CONTEXT_MENU_FOLDER_OPEN_NEW_TAB_ID = "CONTEXT_MENU_FOLDER_OPEN_NEW_TAB_ID";
38702
+ const CONTEXT_MENU_FOLDER_OPEN_NEW_WINDOW_ID = "CONTEXT_MENU_FOLDER_OPEN_NEW_WINDOW_ID";
38691
38703
  const getContextMenuOptions = (parameters, context) => {
38692
- const { dvConnectionId, currentCardId } = parameters;
38704
+ const { dvConnectionId, currentCardId, getCardLink, hasCardLink } = parameters;
38693
38705
  const { resources, cardUrl, messageWindow, contextMenuOptions } = context.props.services;
38694
38706
  if (!context.data || !context.data.row) {
38695
38707
  return [];
@@ -38703,7 +38715,7 @@ const getContextMenuOptions = (parameters, context) => {
38703
38715
  return value || context2?.props?.data?.row?.entityId;
38704
38716
  }
38705
38717
  };
38706
- const openLink = async (dvCardId, linkType, messageText) => {
38718
+ const openLinkExternal = async (dvCardId, linkType, messageText) => {
38707
38719
  let url = "";
38708
38720
  try {
38709
38721
  url = linkType === 0 ? await cardUrl.getLinkToWebClient(dvConnectionId, dvCardId) : await cardUrl.getLinkToWindowsClient(dvConnectionId, dvCardId);
@@ -38717,6 +38729,18 @@ const getContextMenuOptions = (parameters, context) => {
38717
38729
  window.open(url, "_blank");
38718
38730
  }
38719
38731
  };
38732
+ const openLink = (context2, target) => {
38733
+ if (hasCardLink && !hasCardLink(context2) || !getCardLink) return;
38734
+ const cardId = getCardId2(context2);
38735
+ const cardLink = getCardLink(cardId, context2);
38736
+ if (!cardLink) return;
38737
+ const hashedCardlink = getHashLink(cardLink);
38738
+ if (target === "_blank") {
38739
+ window.open(hashedCardlink, "_blank");
38740
+ } else {
38741
+ window.open(hashedCardlink, "", "top=0,left=0");
38742
+ }
38743
+ };
38720
38744
  const menuItems = {
38721
38745
  copyCardId: {
38722
38746
  id: CONTEXT_MENU_COPY_CARD_ID_ID,
@@ -38727,26 +38751,50 @@ const getContextMenuOptions = (parameters, context) => {
38727
38751
  const host = menuClassName && document.querySelector(`.${menuClassName}`);
38728
38752
  copyTextToClipboard(cardID, host);
38729
38753
  showNotification(resources.CopySuccess);
38730
- }
38754
+ },
38755
+ blockId: "cardOperations"
38756
+ /* CardOperations */
38731
38757
  },
38732
38758
  openWebClient: {
38733
38759
  id: CONTEXT_MENU_OPEN_WEB_CLIENT_ID,
38734
38760
  name: resources.OpenCardInWebClient,
38735
38761
  action: async (context2) => {
38736
38762
  const cardID = getCardId2(context2);
38737
- await openLink(cardID, 0, resources.ContextMenu_WrongAddress_WebClient);
38738
- }
38763
+ await openLinkExternal(cardID, 0, resources.ContextMenu_WrongAddress_WebClient);
38764
+ },
38765
+ blockId: "cardOperations"
38766
+ /* CardOperations */
38739
38767
  },
38740
38768
  openWinClient: {
38741
38769
  id: CONTEXT_MENU_OPEN_WIN_CLIENT_ID,
38742
38770
  name: resources.OpenCardInWinClient,
38743
38771
  action: async (context2) => {
38744
38772
  const cardID = getCardId2(context2);
38745
- await openLink(cardID, 1, resources.ContextMenu_WrongAddress_WinClient);
38746
- }
38773
+ await openLinkExternal(cardID, 1, resources.ContextMenu_WrongAddress_WinClient);
38774
+ },
38775
+ blockId: "cardOperations"
38776
+ /* CardOperations */
38777
+ },
38778
+ openInNewTab: {
38779
+ id: CONTEXT_MENU_FOLDER_OPEN_NEW_TAB_ID,
38780
+ name: resources.OpenInNewTab,
38781
+ action: (context2) => {
38782
+ openLink(context2, "_blank");
38783
+ },
38784
+ blockId: "linkOperations",
38785
+ visible: !!getCardLink && (hasCardLink?.(context) ?? true)
38786
+ },
38787
+ openInNewWindow: {
38788
+ id: CONTEXT_MENU_FOLDER_OPEN_NEW_WINDOW_ID,
38789
+ name: resources.OpenInNewWindow,
38790
+ action: (context2) => {
38791
+ openLink(context2, "window");
38792
+ },
38793
+ blockId: "linkOperations",
38794
+ visible: !!getCardLink && (hasCardLink?.(context) ?? true)
38747
38795
  }
38748
38796
  };
38749
- return [menuItems.copyCardId, menuItems.openWebClient, menuItems.openWinClient];
38797
+ return [menuItems.copyCardId, menuItems.openWebClient, menuItems.openWinClient, menuItems.openInNewTab, menuItems.openInNewWindow];
38750
38798
  };
38751
38799
  function PageTabLabel(props) {
38752
38800
  return /* @__PURE__ */ jsx("li", { className: classNames("page-tab-label", classIf(props.selected, "selected")), "data-testid": "page-tab-label", onClick: props.onTabLabelClick, children: props.text });
@@ -38796,8 +38844,12 @@ function WidgetHorizontalLine(props) {
38796
38844
  return /* @__PURE__ */ jsx("hr", { className: classNames("widget-horizontal-line", props.className), ...props });
38797
38845
  }
38798
38846
  function WidgetName(props) {
38799
- const { className, title, onClick, dataTestId } = props;
38800
- return /* @__PURE__ */ jsx(LightTooltip, { title, placement: "top-start", disableHoverListener: !title, children: /* @__PURE__ */ jsx("div", { className: classNames("widget-name", className), onClick, "data-testid": dataTestId, children: props.children }) });
38847
+ const { className, title, onClick, dataTestId, link } = props;
38848
+ const handleClick = (event) => {
38849
+ event.preventDefault();
38850
+ onClick(event);
38851
+ };
38852
+ return /* @__PURE__ */ jsx(LightTooltip, { title, placement: "top-start", disableHoverListener: !title, children: /* @__PURE__ */ jsx("a", { href: link, className: classNames("widget-name", className), onClick: handleClick, "data-testid": dataTestId, children: props.children }) });
38801
38853
  }
38802
38854
  var reactInputMask = { exports: {} };
38803
38855
  var reactInputMask_production_min;
@@ -57216,7 +57268,7 @@ function ClearButton(props) {
57216
57268
  function DeleteIcon$1({ onClick }) {
57217
57269
  return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", version: "1.1", width: "24", height: "24", viewBox: "0 0 24 24", onClick, children: /* @__PURE__ */ jsx("path", { d: "M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z", fill: "#607d8b" }) });
57218
57270
  }
57219
- function ErrorIcon$1() {
57271
+ function ErrorIcon() {
57220
57272
  return /* @__PURE__ */ jsx("svg", { width: "24px", height: "24px", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("g", { "data-name": "Layer 2", children: /* @__PURE__ */ jsxs("g", { "data-name": "close", children: [
57221
57273
  /* @__PURE__ */ jsx("rect", { width: "24", height: "24", transform: "rotate(180 12 12)", opacity: "0" }),
57222
57274
  /* @__PURE__ */ jsx("path", { d: "M13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29-4.3 4.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l4.29-4.3 4.29 4.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z" })
@@ -57224,7 +57276,7 @@ function ErrorIcon$1() {
57224
57276
  }
57225
57277
  function ErrorBlock({ text, close }) {
57226
57278
  return /* @__PURE__ */ jsxs("div", { className: "error-block", children: [
57227
- /* @__PURE__ */ jsx("div", { className: "error-block__button_close", onClick: close, children: /* @__PURE__ */ jsx(ErrorIcon$1, {}) }),
57279
+ /* @__PURE__ */ jsx("div", { className: "error-block__button_close", onClick: close, children: /* @__PURE__ */ jsx(ErrorIcon, {}) }),
57228
57280
  /* @__PURE__ */ jsx("p", { className: "error-block__text", children: text })
57229
57281
  ] });
57230
57282
  }
@@ -59473,14 +59525,14 @@ function DatabaseSelectionModal(props) {
59473
59525
  children: [
59474
59526
  /* @__PURE__ */ jsxs(DialogTitle, { variant: "h6", className: "database-selection-modal__title", children: [
59475
59527
  resources.ConnectDatabase,
59476
- /* @__PURE__ */ jsx(IconButton$3, { onClick: onCancel, children: /* @__PURE__ */ jsx(CloseIcon$1, {}) })
59528
+ /* @__PURE__ */ jsx(IconButton$3, { onClick: onCancel, children: /* @__PURE__ */ jsx(CloseIcon, {}) })
59477
59529
  ] }),
59478
59530
  /* @__PURE__ */ jsxs(DialogContent$2, { className: "database-selection-modal__content", children: [
59479
59531
  /* @__PURE__ */ jsx(Typography$3, { variant: "body1", className: "database-selection-modal__description", children: resources.SelectDatabasesToConnect }),
59480
59532
  !hasDatabases ? /* @__PURE__ */ jsx(Typography$3, { variant: "body2", className: "database-selection-modal__empty", children: resources.NoDatabasesAvailableForConnection }) : /* @__PURE__ */ jsx("div", { className: "database-selection-modal__table-wrapper", children: /* @__PURE__ */ jsx(TableContainer, { children: /* @__PURE__ */ jsxs(Table$1, { size: "small", children: [
59481
59533
  /* @__PURE__ */ jsx(TableHead, { children: columns.map((column) => /* @__PURE__ */ jsx(TableCell$2, { children: column }, column)) }),
59482
59534
  /* @__PURE__ */ jsx(TableBody$1, { children: databases.map((database) => {
59483
- const hasError = !!database.error;
59535
+ const hasError = !!database.error || typeof database.errorType !== "undefined" && database.errorType === ElementErrorType.StorageRead;
59484
59536
  const isSelected = selectedIds.has(database.hash);
59485
59537
  const handleRowClick = hasError ? void 0 : () => handleToggle(database.hash);
59486
59538
  return /* @__PURE__ */ jsx(
@@ -63150,6 +63202,12 @@ const getRoute = (item) => {
63150
63202
  }
63151
63203
  };
63152
63204
  const CONFIGURATION_ROUTE_PATH = "configuration/servers/:serverId/:serviceId/:layoutId";
63205
+ const TABS = ["Dashboard", "Servers", "Settings"];
63206
+ const TAB_LINK = {
63207
+ Dashboard: DASHBOARD_ROUTE_PATH,
63208
+ Servers: SERVERS_ROUTE_PATH,
63209
+ Settings: SETTINGS_ROUTE_PATH
63210
+ };
63153
63211
  function Sidebar() {
63154
63212
  const services = useContext(ServicesContext);
63155
63213
  const lastResolved = services.routingService.getLastRouteResolvedParams();
@@ -63179,50 +63237,29 @@ function Sidebar() {
63179
63237
  const goTo = (item) => {
63180
63238
  services.routingService.navigateToRoute(getRoute(item));
63181
63239
  };
63182
- return /* @__PURE__ */ jsx("nav", { className: "frame-sidebar", children: /* @__PURE__ */ jsx("div", { className: "frame-sidebar__content", children: /* @__PURE__ */ jsxs("div", { className: "frame-sidebar__menu", children: [
63183
- /* @__PURE__ */ jsx(LightTooltip, { title: services.resources.Dashboard, placement: "right", children: /* @__PURE__ */ jsx(
63184
- "button",
63185
- {
63186
- className: classNames(
63187
- "frame-sidebar__button",
63188
- "frame-sidebar__button-dashboard",
63189
- selectedItem() === SidebarItems.Dashboard && "frame-sidebar__button_selected"
63190
- ),
63191
- "data-testid": "frame-sidebar__button-dashboard",
63192
- onClick: selectedItem() !== SidebarItems.Dashboard ? () => goTo(SidebarItems.Dashboard) : () => {
63193
- },
63194
- children: /* @__PURE__ */ jsx("div", { className: "frame-sidebar__button-dashboard-icon" })
63195
- }
63196
- ) }),
63197
- /* @__PURE__ */ jsx(LightTooltip, { title: services.resources.Servers, placement: "right", disableFocusListener: true, disableTouchListener: true, children: /* @__PURE__ */ jsx(
63198
- "button",
63199
- {
63200
- className: classNames(
63201
- "frame-sidebar__button",
63202
- "frame-sidebar__button-servers",
63203
- selectedItem() === SidebarItems.Servers && "frame-sidebar__button_selected"
63204
- ),
63205
- "data-testid": "frame-sidebar__button-servers",
63206
- onClick: selectedItem() !== SidebarItems.Servers ? () => goTo(SidebarItems.Servers) : () => {
63207
- },
63208
- children: /* @__PURE__ */ jsx("div", { className: "frame-sidebar__button-servers-icon" })
63209
- }
63210
- ) }),
63211
- /* @__PURE__ */ jsx(LightTooltip, { title: services.resources.Settings, placement: "right", disableFocusListener: true, disableTouchListener: true, children: /* @__PURE__ */ jsx(
63212
- "button",
63240
+ const handleNavigate = (isSelected, tab) => (event) => {
63241
+ event.preventDefault();
63242
+ if (isSelected) return;
63243
+ goTo(SidebarItems[tab]);
63244
+ };
63245
+ return /* @__PURE__ */ jsx("nav", { className: "frame-sidebar", children: /* @__PURE__ */ jsx("div", { className: "frame-sidebar__content", children: /* @__PURE__ */ jsx("div", { className: "frame-sidebar__menu", children: TABS.map((tab) => {
63246
+ const isSelected = selectedItem() === SidebarItems[tab];
63247
+ const tabLink = getHashLink(TAB_LINK[tab]);
63248
+ return /* @__PURE__ */ jsx(LightTooltip, { title: services.resources[tab], placement: "right", children: /* @__PURE__ */ jsx(
63249
+ "a",
63213
63250
  {
63214
63251
  className: classNames(
63215
63252
  "frame-sidebar__button",
63216
- "frame-sidebar__button-settings",
63217
- selectedItem() === SidebarItems.Settings && "frame-sidebar__button_selected"
63253
+ `frame-sidebar__button-${tab.toLowerCase()}`,
63254
+ isSelected && "frame-sidebar__button_selected"
63218
63255
  ),
63219
- "data-testid": "frame-sidebar__button-settings",
63220
- onClick: selectedItem() !== SidebarItems.Settings ? () => goTo(SidebarItems.Settings) : () => {
63221
- },
63222
- children: /* @__PURE__ */ jsx("div", { className: "frame-sidebar__button-settings-icon" })
63256
+ "data-testid": `frame-sidebar__button-${tab.toLowerCase()}`,
63257
+ onClick: handleNavigate(isSelected, tab),
63258
+ href: tabLink,
63259
+ children: /* @__PURE__ */ jsx("div", { className: `frame-sidebar__button-${tab.toLowerCase()}-icon` })
63223
63260
  }
63224
- ) })
63225
- ] }) }) });
63261
+ ) }, tab);
63262
+ }) }) }) });
63226
63263
  }
63227
63264
  const WIDGET_SETTINGS_DASHBOARD_POSITION = "Dashboard.Position";
63228
63265
  const getDashboardPosition = (settings) => {
@@ -63820,13 +63857,23 @@ function Toolbar$1() {
63820
63857
  await getResources();
63821
63858
  location.reload();
63822
63859
  };
63823
- const showStartPage = () => {
63860
+ const showStartPage = (event) => {
63861
+ event.preventDefault();
63824
63862
  services.routingService.navigateToRoute(defaultDashboardRoute.path);
63825
63863
  };
63826
63864
  const isToolbarCollapsed = useHideOnScroll();
63865
+ const dashboardLink = getHashLink(defaultDashboardRoute.path);
63827
63866
  return /* @__PURE__ */ jsx("header", { className: classNames("frame-toolbar", !isToolbarCollapsed && "frame-toolbar_expand" || "frame-toolbar_collapsed"), children: /* @__PURE__ */ jsxs("div", { className: "frame-toolbar__content", children: [
63828
63867
  /* @__PURE__ */ jsxs("div", { className: "frame-toolbar__label", children: [
63829
- /* @__PURE__ */ jsx("div", { className: "frame-toolbar__company-logo", children: /* @__PURE__ */ jsx("button", { className: "frame-toolbar__company-logo-icon", onClick: showStartPage, "data-testid": "frame-toolbar__company-logo-icon" }) }),
63868
+ /* @__PURE__ */ jsx("div", { className: "frame-toolbar__company-logo", children: /* @__PURE__ */ jsx(
63869
+ "a",
63870
+ {
63871
+ href: dashboardLink,
63872
+ className: "frame-toolbar__company-logo-icon",
63873
+ onClick: showStartPage,
63874
+ "data-testid": "frame-toolbar__company-logo-icon"
63875
+ }
63876
+ ) }),
63830
63877
  /* @__PURE__ */ jsx("div", { className: "frame-toolbar__company-name", children: /* @__PURE__ */ jsx("span", { className: "frame-toolbar__company-name-text", children: applicationName }) })
63831
63878
  ] }),
63832
63879
  /* @__PURE__ */ jsxs("div", { className: "frame-toolbar__buttons", children: [
@@ -63854,1086 +63901,6 @@ function Toolbar$1() {
63854
63901
  ] })
63855
63902
  ] }) });
63856
63903
  }
63857
- function __insertCSS(code) {
63858
- if (typeof document == "undefined") return;
63859
- let head = document.head || document.getElementsByTagName("head")[0];
63860
- let style = document.createElement("style");
63861
- style.type = "text/css";
63862
- head.appendChild(style);
63863
- style.styleSheet ? style.styleSheet.cssText = code : style.appendChild(document.createTextNode(code));
63864
- }
63865
- const getAsset = (type) => {
63866
- switch (type) {
63867
- case "success":
63868
- return SuccessIcon;
63869
- case "info":
63870
- return InfoIcon;
63871
- case "warning":
63872
- return WarningIcon;
63873
- case "error":
63874
- return ErrorIcon;
63875
- default:
63876
- return null;
63877
- }
63878
- };
63879
- const bars = Array(12).fill(0);
63880
- const Loader = ({ visible, className }) => {
63881
- return /* @__PURE__ */ React__default.createElement("div", {
63882
- className: [
63883
- "sonner-loading-wrapper",
63884
- className
63885
- ].filter(Boolean).join(" "),
63886
- "data-visible": visible
63887
- }, /* @__PURE__ */ React__default.createElement("div", {
63888
- className: "sonner-spinner"
63889
- }, bars.map((_2, i2) => /* @__PURE__ */ React__default.createElement("div", {
63890
- className: "sonner-loading-bar",
63891
- key: `spinner-bar-${i2}`
63892
- }))));
63893
- };
63894
- const SuccessIcon = /* @__PURE__ */ React__default.createElement("svg", {
63895
- xmlns: "http://www.w3.org/2000/svg",
63896
- viewBox: "0 0 20 20",
63897
- fill: "currentColor",
63898
- height: "20",
63899
- width: "20"
63900
- }, /* @__PURE__ */ React__default.createElement("path", {
63901
- fillRule: "evenodd",
63902
- d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
63903
- clipRule: "evenodd"
63904
- }));
63905
- const WarningIcon = /* @__PURE__ */ React__default.createElement("svg", {
63906
- xmlns: "http://www.w3.org/2000/svg",
63907
- viewBox: "0 0 24 24",
63908
- fill: "currentColor",
63909
- height: "20",
63910
- width: "20"
63911
- }, /* @__PURE__ */ React__default.createElement("path", {
63912
- fillRule: "evenodd",
63913
- d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
63914
- clipRule: "evenodd"
63915
- }));
63916
- const InfoIcon = /* @__PURE__ */ React__default.createElement("svg", {
63917
- xmlns: "http://www.w3.org/2000/svg",
63918
- viewBox: "0 0 20 20",
63919
- fill: "currentColor",
63920
- height: "20",
63921
- width: "20"
63922
- }, /* @__PURE__ */ React__default.createElement("path", {
63923
- fillRule: "evenodd",
63924
- d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
63925
- clipRule: "evenodd"
63926
- }));
63927
- const ErrorIcon = /* @__PURE__ */ React__default.createElement("svg", {
63928
- xmlns: "http://www.w3.org/2000/svg",
63929
- viewBox: "0 0 20 20",
63930
- fill: "currentColor",
63931
- height: "20",
63932
- width: "20"
63933
- }, /* @__PURE__ */ React__default.createElement("path", {
63934
- fillRule: "evenodd",
63935
- d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
63936
- clipRule: "evenodd"
63937
- }));
63938
- const CloseIcon = /* @__PURE__ */ React__default.createElement("svg", {
63939
- xmlns: "http://www.w3.org/2000/svg",
63940
- width: "12",
63941
- height: "12",
63942
- viewBox: "0 0 24 24",
63943
- fill: "none",
63944
- stroke: "currentColor",
63945
- strokeWidth: "1.5",
63946
- strokeLinecap: "round",
63947
- strokeLinejoin: "round"
63948
- }, /* @__PURE__ */ React__default.createElement("line", {
63949
- x1: "18",
63950
- y1: "6",
63951
- x2: "6",
63952
- y2: "18"
63953
- }), /* @__PURE__ */ React__default.createElement("line", {
63954
- x1: "6",
63955
- y1: "6",
63956
- x2: "18",
63957
- y2: "18"
63958
- }));
63959
- const useIsDocumentHidden = () => {
63960
- const [isDocumentHidden, setIsDocumentHidden] = React__default.useState(document.hidden);
63961
- React__default.useEffect(() => {
63962
- const callback = () => {
63963
- setIsDocumentHidden(document.hidden);
63964
- };
63965
- document.addEventListener("visibilitychange", callback);
63966
- return () => window.removeEventListener("visibilitychange", callback);
63967
- }, []);
63968
- return isDocumentHidden;
63969
- };
63970
- let toastsCounter = 1;
63971
- class Observer {
63972
- constructor() {
63973
- this.subscribe = (subscriber) => {
63974
- this.subscribers.push(subscriber);
63975
- return () => {
63976
- const index2 = this.subscribers.indexOf(subscriber);
63977
- this.subscribers.splice(index2, 1);
63978
- };
63979
- };
63980
- this.publish = (data) => {
63981
- this.subscribers.forEach((subscriber) => subscriber(data));
63982
- };
63983
- this.addToast = (data) => {
63984
- this.publish(data);
63985
- this.toasts = [
63986
- ...this.toasts,
63987
- data
63988
- ];
63989
- };
63990
- this.create = (data) => {
63991
- var _data_id;
63992
- const { message, ...rest } = data;
63993
- const id = typeof (data == null ? void 0 : data.id) === "number" || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;
63994
- const alreadyExists = this.toasts.find((toast2) => {
63995
- return toast2.id === id;
63996
- });
63997
- const dismissible = data.dismissible === void 0 ? true : data.dismissible;
63998
- if (this.dismissedToasts.has(id)) {
63999
- this.dismissedToasts.delete(id);
64000
- }
64001
- if (alreadyExists) {
64002
- this.toasts = this.toasts.map((toast2) => {
64003
- if (toast2.id === id) {
64004
- this.publish({
64005
- ...toast2,
64006
- ...data,
64007
- id,
64008
- title: message
64009
- });
64010
- return {
64011
- ...toast2,
64012
- ...data,
64013
- id,
64014
- dismissible,
64015
- title: message
64016
- };
64017
- }
64018
- return toast2;
64019
- });
64020
- } else {
64021
- this.addToast({
64022
- title: message,
64023
- ...rest,
64024
- dismissible,
64025
- id
64026
- });
64027
- }
64028
- return id;
64029
- };
64030
- this.dismiss = (id) => {
64031
- if (id) {
64032
- this.dismissedToasts.add(id);
64033
- requestAnimationFrame(() => this.subscribers.forEach((subscriber) => subscriber({
64034
- id,
64035
- dismiss: true
64036
- })));
64037
- } else {
64038
- this.toasts.forEach((toast2) => {
64039
- this.subscribers.forEach((subscriber) => subscriber({
64040
- id: toast2.id,
64041
- dismiss: true
64042
- }));
64043
- });
64044
- }
64045
- return id;
64046
- };
64047
- this.message = (message, data) => {
64048
- return this.create({
64049
- ...data,
64050
- message
64051
- });
64052
- };
64053
- this.error = (message, data) => {
64054
- return this.create({
64055
- ...data,
64056
- message,
64057
- type: "error"
64058
- });
64059
- };
64060
- this.success = (message, data) => {
64061
- return this.create({
64062
- ...data,
64063
- type: "success",
64064
- message
64065
- });
64066
- };
64067
- this.info = (message, data) => {
64068
- return this.create({
64069
- ...data,
64070
- type: "info",
64071
- message
64072
- });
64073
- };
64074
- this.warning = (message, data) => {
64075
- return this.create({
64076
- ...data,
64077
- type: "warning",
64078
- message
64079
- });
64080
- };
64081
- this.loading = (message, data) => {
64082
- return this.create({
64083
- ...data,
64084
- type: "loading",
64085
- message
64086
- });
64087
- };
64088
- this.promise = (promise, data) => {
64089
- if (!data) {
64090
- return;
64091
- }
64092
- let id = void 0;
64093
- if (data.loading !== void 0) {
64094
- id = this.create({
64095
- ...data,
64096
- promise,
64097
- type: "loading",
64098
- message: data.loading,
64099
- description: typeof data.description !== "function" ? data.description : void 0
64100
- });
64101
- }
64102
- const p2 = Promise.resolve(promise instanceof Function ? promise() : promise);
64103
- let shouldDismiss = id !== void 0;
64104
- let result;
64105
- const originalPromise = p2.then(async (response) => {
64106
- result = [
64107
- "resolve",
64108
- response
64109
- ];
64110
- const isReactElementResponse = React__default.isValidElement(response);
64111
- if (isReactElementResponse) {
64112
- shouldDismiss = false;
64113
- this.create({
64114
- id,
64115
- type: "default",
64116
- message: response
64117
- });
64118
- } else if (isHttpResponse(response) && !response.ok) {
64119
- shouldDismiss = false;
64120
- const promiseData = typeof data.error === "function" ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
64121
- const description = typeof data.description === "function" ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
64122
- const isExtendedResult = typeof promiseData === "object" && !React__default.isValidElement(promiseData);
64123
- const toastSettings = isExtendedResult ? promiseData : {
64124
- message: promiseData
64125
- };
64126
- this.create({
64127
- id,
64128
- type: "error",
64129
- description,
64130
- ...toastSettings
64131
- });
64132
- } else if (response instanceof Error) {
64133
- shouldDismiss = false;
64134
- const promiseData = typeof data.error === "function" ? await data.error(response) : data.error;
64135
- const description = typeof data.description === "function" ? await data.description(response) : data.description;
64136
- const isExtendedResult = typeof promiseData === "object" && !React__default.isValidElement(promiseData);
64137
- const toastSettings = isExtendedResult ? promiseData : {
64138
- message: promiseData
64139
- };
64140
- this.create({
64141
- id,
64142
- type: "error",
64143
- description,
64144
- ...toastSettings
64145
- });
64146
- } else if (data.success !== void 0) {
64147
- shouldDismiss = false;
64148
- const promiseData = typeof data.success === "function" ? await data.success(response) : data.success;
64149
- const description = typeof data.description === "function" ? await data.description(response) : data.description;
64150
- const isExtendedResult = typeof promiseData === "object" && !React__default.isValidElement(promiseData);
64151
- const toastSettings = isExtendedResult ? promiseData : {
64152
- message: promiseData
64153
- };
64154
- this.create({
64155
- id,
64156
- type: "success",
64157
- description,
64158
- ...toastSettings
64159
- });
64160
- }
64161
- }).catch(async (error) => {
64162
- result = [
64163
- "reject",
64164
- error
64165
- ];
64166
- if (data.error !== void 0) {
64167
- shouldDismiss = false;
64168
- const promiseData = typeof data.error === "function" ? await data.error(error) : data.error;
64169
- const description = typeof data.description === "function" ? await data.description(error) : data.description;
64170
- const isExtendedResult = typeof promiseData === "object" && !React__default.isValidElement(promiseData);
64171
- const toastSettings = isExtendedResult ? promiseData : {
64172
- message: promiseData
64173
- };
64174
- this.create({
64175
- id,
64176
- type: "error",
64177
- description,
64178
- ...toastSettings
64179
- });
64180
- }
64181
- }).finally(() => {
64182
- if (shouldDismiss) {
64183
- this.dismiss(id);
64184
- id = void 0;
64185
- }
64186
- data.finally == null ? void 0 : data.finally.call(data);
64187
- });
64188
- const unwrap = () => new Promise((resolve, reject) => originalPromise.then(() => result[0] === "reject" ? reject(result[1]) : resolve(result[1])).catch(reject));
64189
- if (typeof id !== "string" && typeof id !== "number") {
64190
- return {
64191
- unwrap
64192
- };
64193
- } else {
64194
- return Object.assign(id, {
64195
- unwrap
64196
- });
64197
- }
64198
- };
64199
- this.custom = (jsx2, data) => {
64200
- const id = (data == null ? void 0 : data.id) || toastsCounter++;
64201
- this.create({
64202
- jsx: jsx2(id),
64203
- id,
64204
- ...data
64205
- });
64206
- return id;
64207
- };
64208
- this.getActiveToasts = () => {
64209
- return this.toasts.filter((toast2) => !this.dismissedToasts.has(toast2.id));
64210
- };
64211
- this.subscribers = [];
64212
- this.toasts = [];
64213
- this.dismissedToasts = /* @__PURE__ */ new Set();
64214
- }
64215
- }
64216
- const ToastState = new Observer();
64217
- const toastFunction = (message, data) => {
64218
- const id = (data == null ? void 0 : data.id) || toastsCounter++;
64219
- ToastState.addToast({
64220
- title: message,
64221
- ...data,
64222
- id
64223
- });
64224
- return id;
64225
- };
64226
- const isHttpResponse = (data) => {
64227
- return data && typeof data === "object" && "ok" in data && typeof data.ok === "boolean" && "status" in data && typeof data.status === "number";
64228
- };
64229
- const basicToast = toastFunction;
64230
- const getHistory = () => ToastState.toasts;
64231
- const getToasts = () => ToastState.getActiveToasts();
64232
- const toast = Object.assign(basicToast, {
64233
- success: ToastState.success,
64234
- info: ToastState.info,
64235
- warning: ToastState.warning,
64236
- error: ToastState.error,
64237
- custom: ToastState.custom,
64238
- message: ToastState.message,
64239
- promise: ToastState.promise,
64240
- dismiss: ToastState.dismiss,
64241
- loading: ToastState.loading
64242
- }, {
64243
- getHistory,
64244
- getToasts
64245
- });
64246
- __insertCSS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
64247
- function isAction(action) {
64248
- return action.label !== void 0;
64249
- }
64250
- const VISIBLE_TOASTS_AMOUNT = 3;
64251
- const VIEWPORT_OFFSET = "24px";
64252
- const MOBILE_VIEWPORT_OFFSET = "16px";
64253
- const TOAST_LIFETIME = 4e3;
64254
- const TOAST_WIDTH = 356;
64255
- const GAP = 14;
64256
- const SWIPE_THRESHOLD = 45;
64257
- const TIME_BEFORE_UNMOUNT = 200;
64258
- function cn(...classes2) {
64259
- return classes2.filter(Boolean).join(" ");
64260
- }
64261
- function getDefaultSwipeDirections(position) {
64262
- const [y2, x2] = position.split("-");
64263
- const directions2 = [];
64264
- if (y2) {
64265
- directions2.push(y2);
64266
- }
64267
- if (x2) {
64268
- directions2.push(x2);
64269
- }
64270
- return directions2;
64271
- }
64272
- const Toast = (props) => {
64273
- var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;
64274
- const { invert: ToasterInvert, toast: toast2, unstyled, interacting, setHeights, visibleToasts, heights, index: index2, toasts, expanded, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style, cancelButtonStyle, actionButtonStyle, className = "", descriptionClassName = "", duration: durationFromToaster, position, gap: gap2, expandByDefault, classNames: classNames2, icons, closeButtonAriaLabel = "Close toast" } = props;
64275
- const [swipeDirection, setSwipeDirection] = React__default.useState(null);
64276
- const [swipeOutDirection, setSwipeOutDirection] = React__default.useState(null);
64277
- const [mounted, setMounted] = React__default.useState(false);
64278
- const [removed, setRemoved] = React__default.useState(false);
64279
- const [swiping, setSwiping] = React__default.useState(false);
64280
- const [swipeOut, setSwipeOut] = React__default.useState(false);
64281
- const [isSwiped, setIsSwiped] = React__default.useState(false);
64282
- const [offsetBeforeRemove, setOffsetBeforeRemove] = React__default.useState(0);
64283
- const [initialHeight, setInitialHeight] = React__default.useState(0);
64284
- const remainingTime = React__default.useRef(toast2.duration || durationFromToaster || TOAST_LIFETIME);
64285
- const dragStartTime = React__default.useRef(null);
64286
- const toastRef = React__default.useRef(null);
64287
- const isFront = index2 === 0;
64288
- const isVisible2 = index2 + 1 <= visibleToasts;
64289
- const toastType = toast2.type;
64290
- const dismissible = toast2.dismissible !== false;
64291
- const toastClassname = toast2.className || "";
64292
- const toastDescriptionClassname = toast2.descriptionClassName || "";
64293
- const heightIndex = React__default.useMemo(() => heights.findIndex((height2) => height2.toastId === toast2.id) || 0, [
64294
- heights,
64295
- toast2.id
64296
- ]);
64297
- const closeButton = React__default.useMemo(() => {
64298
- var _toast_closeButton;
64299
- return (_toast_closeButton = toast2.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;
64300
- }, [
64301
- toast2.closeButton,
64302
- closeButtonFromToaster
64303
- ]);
64304
- const duration2 = React__default.useMemo(() => toast2.duration || durationFromToaster || TOAST_LIFETIME, [
64305
- toast2.duration,
64306
- durationFromToaster
64307
- ]);
64308
- const closeTimerStartTimeRef = React__default.useRef(0);
64309
- const offset2 = React__default.useRef(0);
64310
- const lastCloseTimerStartTimeRef = React__default.useRef(0);
64311
- const pointerStartRef = React__default.useRef(null);
64312
- const [y2, x2] = position.split("-");
64313
- const toastsHeightBefore = React__default.useMemo(() => {
64314
- return heights.reduce((prev, curr, reducerIndex) => {
64315
- if (reducerIndex >= heightIndex) {
64316
- return prev;
64317
- }
64318
- return prev + curr.height;
64319
- }, 0);
64320
- }, [
64321
- heights,
64322
- heightIndex
64323
- ]);
64324
- const isDocumentHidden = useIsDocumentHidden();
64325
- const invert = toast2.invert || ToasterInvert;
64326
- const disabled = toastType === "loading";
64327
- offset2.current = React__default.useMemo(() => heightIndex * gap2 + toastsHeightBefore, [
64328
- heightIndex,
64329
- toastsHeightBefore
64330
- ]);
64331
- React__default.useEffect(() => {
64332
- remainingTime.current = duration2;
64333
- }, [
64334
- duration2
64335
- ]);
64336
- React__default.useEffect(() => {
64337
- setMounted(true);
64338
- }, []);
64339
- React__default.useEffect(() => {
64340
- const toastNode = toastRef.current;
64341
- if (toastNode) {
64342
- const height2 = toastNode.getBoundingClientRect().height;
64343
- setInitialHeight(height2);
64344
- setHeights((h2) => [
64345
- {
64346
- toastId: toast2.id,
64347
- height: height2,
64348
- position: toast2.position
64349
- },
64350
- ...h2
64351
- ]);
64352
- return () => setHeights((h2) => h2.filter((height3) => height3.toastId !== toast2.id));
64353
- }
64354
- }, [
64355
- setHeights,
64356
- toast2.id
64357
- ]);
64358
- React__default.useLayoutEffect(() => {
64359
- if (!mounted) return;
64360
- const toastNode = toastRef.current;
64361
- const originalHeight = toastNode.style.height;
64362
- toastNode.style.height = "auto";
64363
- const newHeight = toastNode.getBoundingClientRect().height;
64364
- toastNode.style.height = originalHeight;
64365
- setInitialHeight(newHeight);
64366
- setHeights((heights2) => {
64367
- const alreadyExists = heights2.find((height2) => height2.toastId === toast2.id);
64368
- if (!alreadyExists) {
64369
- return [
64370
- {
64371
- toastId: toast2.id,
64372
- height: newHeight,
64373
- position: toast2.position
64374
- },
64375
- ...heights2
64376
- ];
64377
- } else {
64378
- return heights2.map((height2) => height2.toastId === toast2.id ? {
64379
- ...height2,
64380
- height: newHeight
64381
- } : height2);
64382
- }
64383
- });
64384
- }, [
64385
- mounted,
64386
- toast2.title,
64387
- toast2.description,
64388
- setHeights,
64389
- toast2.id,
64390
- toast2.jsx,
64391
- toast2.action,
64392
- toast2.cancel
64393
- ]);
64394
- const deleteToast = React__default.useCallback(() => {
64395
- setRemoved(true);
64396
- setOffsetBeforeRemove(offset2.current);
64397
- setHeights((h2) => h2.filter((height2) => height2.toastId !== toast2.id));
64398
- setTimeout(() => {
64399
- removeToast(toast2);
64400
- }, TIME_BEFORE_UNMOUNT);
64401
- }, [
64402
- toast2,
64403
- removeToast,
64404
- setHeights,
64405
- offset2
64406
- ]);
64407
- React__default.useEffect(() => {
64408
- if (toast2.promise && toastType === "loading" || toast2.duration === Infinity || toast2.type === "loading") return;
64409
- let timeoutId;
64410
- const pauseTimer = () => {
64411
- if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {
64412
- const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;
64413
- remainingTime.current = remainingTime.current - elapsedTime;
64414
- }
64415
- lastCloseTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
64416
- };
64417
- const startTimer = () => {
64418
- if (remainingTime.current === Infinity) return;
64419
- closeTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
64420
- timeoutId = setTimeout(() => {
64421
- toast2.onAutoClose == null ? void 0 : toast2.onAutoClose.call(toast2, toast2);
64422
- deleteToast();
64423
- }, remainingTime.current);
64424
- };
64425
- if (expanded || interacting || isDocumentHidden) {
64426
- pauseTimer();
64427
- } else {
64428
- startTimer();
64429
- }
64430
- return () => clearTimeout(timeoutId);
64431
- }, [
64432
- expanded,
64433
- interacting,
64434
- toast2,
64435
- toastType,
64436
- isDocumentHidden,
64437
- deleteToast
64438
- ]);
64439
- React__default.useEffect(() => {
64440
- if (toast2.delete) {
64441
- deleteToast();
64442
- toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
64443
- }
64444
- }, [
64445
- deleteToast,
64446
- toast2.delete
64447
- ]);
64448
- function getLoadingIcon() {
64449
- var _toast_classNames9;
64450
- if (icons == null ? void 0 : icons.loading) {
64451
- var _toast_classNames12;
64452
- return /* @__PURE__ */ React__default.createElement("div", {
64453
- className: cn(classNames2 == null ? void 0 : classNames2.loader, toast2 == null ? void 0 : (_toast_classNames12 = toast2.classNames) == null ? void 0 : _toast_classNames12.loader, "sonner-loader"),
64454
- "data-visible": toastType === "loading"
64455
- }, icons.loading);
64456
- }
64457
- return /* @__PURE__ */ React__default.createElement(Loader, {
64458
- className: cn(classNames2 == null ? void 0 : classNames2.loader, toast2 == null ? void 0 : (_toast_classNames9 = toast2.classNames) == null ? void 0 : _toast_classNames9.loader),
64459
- visible: toastType === "loading"
64460
- });
64461
- }
64462
- const icon = toast2.icon || (icons == null ? void 0 : icons[toastType]) || getAsset(toastType);
64463
- var _toast_richColors, _icons_close;
64464
- return /* @__PURE__ */ React__default.createElement("li", {
64465
- tabIndex: 0,
64466
- ref: toastRef,
64467
- className: cn(className, toastClassname, classNames2 == null ? void 0 : classNames2.toast, toast2 == null ? void 0 : (_toast_classNames = toast2.classNames) == null ? void 0 : _toast_classNames.toast, classNames2 == null ? void 0 : classNames2.default, classNames2 == null ? void 0 : classNames2[toastType], toast2 == null ? void 0 : (_toast_classNames1 = toast2.classNames) == null ? void 0 : _toast_classNames1[toastType]),
64468
- "data-sonner-toast": "",
64469
- "data-rich-colors": (_toast_richColors = toast2.richColors) != null ? _toast_richColors : defaultRichColors,
64470
- "data-styled": !Boolean(toast2.jsx || toast2.unstyled || unstyled),
64471
- "data-mounted": mounted,
64472
- "data-promise": Boolean(toast2.promise),
64473
- "data-swiped": isSwiped,
64474
- "data-removed": removed,
64475
- "data-visible": isVisible2,
64476
- "data-y-position": y2,
64477
- "data-x-position": x2,
64478
- "data-index": index2,
64479
- "data-front": isFront,
64480
- "data-swiping": swiping,
64481
- "data-dismissible": dismissible,
64482
- "data-type": toastType,
64483
- "data-invert": invert,
64484
- "data-swipe-out": swipeOut,
64485
- "data-swipe-direction": swipeOutDirection,
64486
- "data-expanded": Boolean(expanded || expandByDefault && mounted),
64487
- "data-testid": toast2.testId,
64488
- style: {
64489
- "--index": index2,
64490
- "--toasts-before": index2,
64491
- "--z-index": toasts.length - index2,
64492
- "--offset": `${removed ? offsetBeforeRemove : offset2.current}px`,
64493
- "--initial-height": expandByDefault ? "auto" : `${initialHeight}px`,
64494
- ...style,
64495
- ...toast2.style
64496
- },
64497
- onDragEnd: () => {
64498
- setSwiping(false);
64499
- setSwipeDirection(null);
64500
- pointerStartRef.current = null;
64501
- },
64502
- onPointerDown: (event) => {
64503
- if (event.button === 2) return;
64504
- if (disabled || !dismissible) return;
64505
- dragStartTime.current = /* @__PURE__ */ new Date();
64506
- setOffsetBeforeRemove(offset2.current);
64507
- event.target.setPointerCapture(event.pointerId);
64508
- if (event.target.tagName === "BUTTON") return;
64509
- setSwiping(true);
64510
- pointerStartRef.current = {
64511
- x: event.clientX,
64512
- y: event.clientY
64513
- };
64514
- },
64515
- onPointerUp: () => {
64516
- var _toastRef_current, _toastRef_current1, _dragStartTime_current;
64517
- if (swipeOut || !dismissible) return;
64518
- pointerStartRef.current = null;
64519
- const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0);
64520
- const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0);
64521
- const timeTaken = (/* @__PURE__ */ new Date()).getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? void 0 : _dragStartTime_current.getTime());
64522
- const swipeAmount = swipeDirection === "x" ? swipeAmountX : swipeAmountY;
64523
- const velocity = Math.abs(swipeAmount) / timeTaken;
64524
- if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
64525
- setOffsetBeforeRemove(offset2.current);
64526
- toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
64527
- if (swipeDirection === "x") {
64528
- setSwipeOutDirection(swipeAmountX > 0 ? "right" : "left");
64529
- } else {
64530
- setSwipeOutDirection(swipeAmountY > 0 ? "down" : "up");
64531
- }
64532
- deleteToast();
64533
- setSwipeOut(true);
64534
- return;
64535
- } else {
64536
- var _toastRef_current2, _toastRef_current3;
64537
- (_toastRef_current2 = toastRef.current) == null ? void 0 : _toastRef_current2.style.setProperty("--swipe-amount-x", `0px`);
64538
- (_toastRef_current3 = toastRef.current) == null ? void 0 : _toastRef_current3.style.setProperty("--swipe-amount-y", `0px`);
64539
- }
64540
- setIsSwiped(false);
64541
- setSwiping(false);
64542
- setSwipeDirection(null);
64543
- },
64544
- onPointerMove: (event) => {
64545
- var _window_getSelection, _toastRef_current, _toastRef_current1;
64546
- if (!pointerStartRef.current || !dismissible) return;
64547
- const isHighlighted = ((_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString().length) > 0;
64548
- if (isHighlighted) return;
64549
- const yDelta = event.clientY - pointerStartRef.current.y;
64550
- const xDelta = event.clientX - pointerStartRef.current.x;
64551
- var _props_swipeDirections;
64552
- const swipeDirections = (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position);
64553
- if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {
64554
- setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y");
64555
- }
64556
- let swipeAmount = {
64557
- x: 0,
64558
- y: 0
64559
- };
64560
- const getDampening = (delta) => {
64561
- const factor = Math.abs(delta) / 20;
64562
- return 1 / (1.5 + factor);
64563
- };
64564
- if (swipeDirection === "y") {
64565
- if (swipeDirections.includes("top") || swipeDirections.includes("bottom")) {
64566
- if (swipeDirections.includes("top") && yDelta < 0 || swipeDirections.includes("bottom") && yDelta > 0) {
64567
- swipeAmount.y = yDelta;
64568
- } else {
64569
- const dampenedDelta = yDelta * getDampening(yDelta);
64570
- swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
64571
- }
64572
- }
64573
- } else if (swipeDirection === "x") {
64574
- if (swipeDirections.includes("left") || swipeDirections.includes("right")) {
64575
- if (swipeDirections.includes("left") && xDelta < 0 || swipeDirections.includes("right") && xDelta > 0) {
64576
- swipeAmount.x = xDelta;
64577
- } else {
64578
- const dampenedDelta = xDelta * getDampening(xDelta);
64579
- swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
64580
- }
64581
- }
64582
- }
64583
- if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {
64584
- setIsSwiped(true);
64585
- }
64586
- (_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.setProperty("--swipe-amount-x", `${swipeAmount.x}px`);
64587
- (_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.setProperty("--swipe-amount-y", `${swipeAmount.y}px`);
64588
- }
64589
- }, closeButton && !toast2.jsx && toastType !== "loading" ? /* @__PURE__ */ React__default.createElement("button", {
64590
- "aria-label": closeButtonAriaLabel,
64591
- "data-disabled": disabled,
64592
- "data-close-button": true,
64593
- onClick: disabled || !dismissible ? () => {
64594
- } : () => {
64595
- deleteToast();
64596
- toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
64597
- },
64598
- className: cn(classNames2 == null ? void 0 : classNames2.closeButton, toast2 == null ? void 0 : (_toast_classNames2 = toast2.classNames) == null ? void 0 : _toast_classNames2.closeButton)
64599
- }, (_icons_close = icons == null ? void 0 : icons.close) != null ? _icons_close : CloseIcon) : null, (toastType || toast2.icon || toast2.promise) && toast2.icon !== null && ((icons == null ? void 0 : icons[toastType]) !== null || toast2.icon) ? /* @__PURE__ */ React__default.createElement("div", {
64600
- "data-icon": "",
64601
- className: cn(classNames2 == null ? void 0 : classNames2.icon, toast2 == null ? void 0 : (_toast_classNames3 = toast2.classNames) == null ? void 0 : _toast_classNames3.icon)
64602
- }, toast2.promise || toast2.type === "loading" && !toast2.icon ? toast2.icon || getLoadingIcon() : null, toast2.type !== "loading" ? icon : null) : null, /* @__PURE__ */ React__default.createElement("div", {
64603
- "data-content": "",
64604
- className: cn(classNames2 == null ? void 0 : classNames2.content, toast2 == null ? void 0 : (_toast_classNames4 = toast2.classNames) == null ? void 0 : _toast_classNames4.content)
64605
- }, /* @__PURE__ */ React__default.createElement("div", {
64606
- "data-title": "",
64607
- className: cn(classNames2 == null ? void 0 : classNames2.title, toast2 == null ? void 0 : (_toast_classNames5 = toast2.classNames) == null ? void 0 : _toast_classNames5.title)
64608
- }, toast2.jsx ? toast2.jsx : typeof toast2.title === "function" ? toast2.title() : toast2.title), toast2.description ? /* @__PURE__ */ React__default.createElement("div", {
64609
- "data-description": "",
64610
- className: cn(descriptionClassName, toastDescriptionClassname, classNames2 == null ? void 0 : classNames2.description, toast2 == null ? void 0 : (_toast_classNames6 = toast2.classNames) == null ? void 0 : _toast_classNames6.description)
64611
- }, typeof toast2.description === "function" ? toast2.description() : toast2.description) : null), /* @__PURE__ */ React__default.isValidElement(toast2.cancel) ? toast2.cancel : toast2.cancel && isAction(toast2.cancel) ? /* @__PURE__ */ React__default.createElement("button", {
64612
- "data-button": true,
64613
- "data-cancel": true,
64614
- style: toast2.cancelButtonStyle || cancelButtonStyle,
64615
- onClick: (event) => {
64616
- if (!isAction(toast2.cancel)) return;
64617
- if (!dismissible) return;
64618
- toast2.cancel.onClick == null ? void 0 : toast2.cancel.onClick.call(toast2.cancel, event);
64619
- deleteToast();
64620
- },
64621
- className: cn(classNames2 == null ? void 0 : classNames2.cancelButton, toast2 == null ? void 0 : (_toast_classNames7 = toast2.classNames) == null ? void 0 : _toast_classNames7.cancelButton)
64622
- }, toast2.cancel.label) : null, /* @__PURE__ */ React__default.isValidElement(toast2.action) ? toast2.action : toast2.action && isAction(toast2.action) ? /* @__PURE__ */ React__default.createElement("button", {
64623
- "data-button": true,
64624
- "data-action": true,
64625
- style: toast2.actionButtonStyle || actionButtonStyle,
64626
- onClick: (event) => {
64627
- if (!isAction(toast2.action)) return;
64628
- toast2.action.onClick == null ? void 0 : toast2.action.onClick.call(toast2.action, event);
64629
- if (event.defaultPrevented) return;
64630
- deleteToast();
64631
- },
64632
- className: cn(classNames2 == null ? void 0 : classNames2.actionButton, toast2 == null ? void 0 : (_toast_classNames8 = toast2.classNames) == null ? void 0 : _toast_classNames8.actionButton)
64633
- }, toast2.action.label) : null);
64634
- };
64635
- function getDocumentDirection() {
64636
- if (typeof window === "undefined") return "ltr";
64637
- if (typeof document === "undefined") return "ltr";
64638
- const dirAttribute = document.documentElement.getAttribute("dir");
64639
- if (dirAttribute === "auto" || !dirAttribute) {
64640
- return window.getComputedStyle(document.documentElement).direction;
64641
- }
64642
- return dirAttribute;
64643
- }
64644
- function assignOffset(defaultOffset, mobileOffset) {
64645
- const styles5 = {};
64646
- [
64647
- defaultOffset,
64648
- mobileOffset
64649
- ].forEach((offset2, index2) => {
64650
- const isMobile = index2 === 1;
64651
- const prefix2 = isMobile ? "--mobile-offset" : "--offset";
64652
- const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
64653
- function assignAll(offset3) {
64654
- [
64655
- "top",
64656
- "right",
64657
- "bottom",
64658
- "left"
64659
- ].forEach((key) => {
64660
- styles5[`${prefix2}-${key}`] = typeof offset3 === "number" ? `${offset3}px` : offset3;
64661
- });
64662
- }
64663
- if (typeof offset2 === "number" || typeof offset2 === "string") {
64664
- assignAll(offset2);
64665
- } else if (typeof offset2 === "object") {
64666
- [
64667
- "top",
64668
- "right",
64669
- "bottom",
64670
- "left"
64671
- ].forEach((key) => {
64672
- if (offset2[key] === void 0) {
64673
- styles5[`${prefix2}-${key}`] = defaultValue;
64674
- } else {
64675
- styles5[`${prefix2}-${key}`] = typeof offset2[key] === "number" ? `${offset2[key]}px` : offset2[key];
64676
- }
64677
- });
64678
- } else {
64679
- assignAll(defaultValue);
64680
- }
64681
- });
64682
- return styles5;
64683
- }
64684
- const Toaster = /* @__PURE__ */ React__default.forwardRef(function Toaster2(props, ref) {
64685
- const { id, invert, position = "bottom-right", hotkey = [
64686
- "altKey",
64687
- "KeyT"
64688
- ], expand, closeButton, className, offset: offset2, mobileOffset, theme: theme2 = "light", richColors, duration: duration2, style, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap: gap2 = GAP, icons, containerAriaLabel = "Notifications" } = props;
64689
- const [toasts, setToasts] = React__default.useState([]);
64690
- const filteredToasts = React__default.useMemo(() => {
64691
- if (id) {
64692
- return toasts.filter((toast2) => toast2.toasterId === id);
64693
- }
64694
- return toasts.filter((toast2) => !toast2.toasterId);
64695
- }, [
64696
- toasts,
64697
- id
64698
- ]);
64699
- const possiblePositions = React__default.useMemo(() => {
64700
- return Array.from(new Set([
64701
- position
64702
- ].concat(filteredToasts.filter((toast2) => toast2.position).map((toast2) => toast2.position))));
64703
- }, [
64704
- filteredToasts,
64705
- position
64706
- ]);
64707
- const [heights, setHeights] = React__default.useState([]);
64708
- const [expanded, setExpanded] = React__default.useState(false);
64709
- const [interacting, setInteracting] = React__default.useState(false);
64710
- const [actualTheme, setActualTheme] = React__default.useState(theme2 !== "system" ? theme2 : typeof window !== "undefined" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "light");
64711
- const listRef = React__default.useRef(null);
64712
- const hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
64713
- const lastFocusedElementRef = React__default.useRef(null);
64714
- const isFocusWithinRef = React__default.useRef(false);
64715
- const removeToast = React__default.useCallback((toastToRemove) => {
64716
- setToasts((toasts2) => {
64717
- var _toasts_find;
64718
- if (!((_toasts_find = toasts2.find((toast2) => toast2.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) {
64719
- ToastState.dismiss(toastToRemove.id);
64720
- }
64721
- return toasts2.filter(({ id: id2 }) => id2 !== toastToRemove.id);
64722
- });
64723
- }, []);
64724
- React__default.useEffect(() => {
64725
- return ToastState.subscribe((toast2) => {
64726
- if (toast2.dismiss) {
64727
- requestAnimationFrame(() => {
64728
- setToasts((toasts2) => toasts2.map((t2) => t2.id === toast2.id ? {
64729
- ...t2,
64730
- delete: true
64731
- } : t2));
64732
- });
64733
- return;
64734
- }
64735
- setTimeout(() => {
64736
- ReactDOM__default.flushSync(() => {
64737
- setToasts((toasts2) => {
64738
- const indexOfExistingToast = toasts2.findIndex((t2) => t2.id === toast2.id);
64739
- if (indexOfExistingToast !== -1) {
64740
- return [
64741
- ...toasts2.slice(0, indexOfExistingToast),
64742
- {
64743
- ...toasts2[indexOfExistingToast],
64744
- ...toast2
64745
- },
64746
- ...toasts2.slice(indexOfExistingToast + 1)
64747
- ];
64748
- }
64749
- return [
64750
- toast2,
64751
- ...toasts2
64752
- ];
64753
- });
64754
- });
64755
- });
64756
- });
64757
- }, [
64758
- toasts
64759
- ]);
64760
- React__default.useEffect(() => {
64761
- if (theme2 !== "system") {
64762
- setActualTheme(theme2);
64763
- return;
64764
- }
64765
- if (theme2 === "system") {
64766
- if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
64767
- setActualTheme("dark");
64768
- } else {
64769
- setActualTheme("light");
64770
- }
64771
- }
64772
- if (typeof window === "undefined") return;
64773
- const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
64774
- try {
64775
- darkMediaQuery.addEventListener("change", ({ matches }) => {
64776
- if (matches) {
64777
- setActualTheme("dark");
64778
- } else {
64779
- setActualTheme("light");
64780
- }
64781
- });
64782
- } catch (error) {
64783
- darkMediaQuery.addListener(({ matches }) => {
64784
- try {
64785
- if (matches) {
64786
- setActualTheme("dark");
64787
- } else {
64788
- setActualTheme("light");
64789
- }
64790
- } catch (e2) {
64791
- console.error(e2);
64792
- }
64793
- });
64794
- }
64795
- }, [
64796
- theme2
64797
- ]);
64798
- React__default.useEffect(() => {
64799
- if (toasts.length <= 1) {
64800
- setExpanded(false);
64801
- }
64802
- }, [
64803
- toasts
64804
- ]);
64805
- React__default.useEffect(() => {
64806
- const handleKeyDown2 = (event) => {
64807
- var _listRef_current;
64808
- const isHotkeyPressed = hotkey.every((key) => event[key] || event.code === key);
64809
- if (isHotkeyPressed) {
64810
- var _listRef_current1;
64811
- setExpanded(true);
64812
- (_listRef_current1 = listRef.current) == null ? void 0 : _listRef_current1.focus();
64813
- }
64814
- if (event.code === "Escape" && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? void 0 : _listRef_current.contains(document.activeElement)))) {
64815
- setExpanded(false);
64816
- }
64817
- };
64818
- document.addEventListener("keydown", handleKeyDown2);
64819
- return () => document.removeEventListener("keydown", handleKeyDown2);
64820
- }, [
64821
- hotkey
64822
- ]);
64823
- React__default.useEffect(() => {
64824
- if (listRef.current) {
64825
- return () => {
64826
- if (lastFocusedElementRef.current) {
64827
- lastFocusedElementRef.current.focus({
64828
- preventScroll: true
64829
- });
64830
- lastFocusedElementRef.current = null;
64831
- isFocusWithinRef.current = false;
64832
- }
64833
- };
64834
- }
64835
- }, [
64836
- listRef.current
64837
- ]);
64838
- return (
64839
- // Remove item from normal navigation flow, only available via hotkey
64840
- /* @__PURE__ */ React__default.createElement("section", {
64841
- ref,
64842
- "aria-label": `${containerAriaLabel} ${hotkeyLabel}`,
64843
- tabIndex: -1,
64844
- "aria-live": "polite",
64845
- "aria-relevant": "additions text",
64846
- "aria-atomic": "false",
64847
- suppressHydrationWarning: true
64848
- }, possiblePositions.map((position2, index2) => {
64849
- var _heights_;
64850
- const [y2, x2] = position2.split("-");
64851
- if (!filteredToasts.length) return null;
64852
- return /* @__PURE__ */ React__default.createElement("ol", {
64853
- key: position2,
64854
- dir: dir === "auto" ? getDocumentDirection() : dir,
64855
- tabIndex: -1,
64856
- ref: listRef,
64857
- className,
64858
- "data-sonner-toaster": true,
64859
- "data-sonner-theme": actualTheme,
64860
- "data-y-position": y2,
64861
- "data-x-position": x2,
64862
- style: {
64863
- "--front-toast-height": `${((_heights_ = heights[0]) == null ? void 0 : _heights_.height) || 0}px`,
64864
- "--width": `${TOAST_WIDTH}px`,
64865
- "--gap": `${gap2}px`,
64866
- ...style,
64867
- ...assignOffset(offset2, mobileOffset)
64868
- },
64869
- onBlur: (event) => {
64870
- if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {
64871
- isFocusWithinRef.current = false;
64872
- if (lastFocusedElementRef.current) {
64873
- lastFocusedElementRef.current.focus({
64874
- preventScroll: true
64875
- });
64876
- lastFocusedElementRef.current = null;
64877
- }
64878
- }
64879
- },
64880
- onFocus: (event) => {
64881
- const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
64882
- if (isNotDismissible) return;
64883
- if (!isFocusWithinRef.current) {
64884
- isFocusWithinRef.current = true;
64885
- lastFocusedElementRef.current = event.relatedTarget;
64886
- }
64887
- },
64888
- onMouseEnter: () => setExpanded(true),
64889
- onMouseMove: () => setExpanded(true),
64890
- onMouseLeave: () => {
64891
- if (!interacting) {
64892
- setExpanded(false);
64893
- }
64894
- },
64895
- onDragEnd: () => setExpanded(false),
64896
- onPointerDown: (event) => {
64897
- const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
64898
- if (isNotDismissible) return;
64899
- setInteracting(true);
64900
- },
64901
- onPointerUp: () => setInteracting(false)
64902
- }, filteredToasts.filter((toast2) => !toast2.position && index2 === 0 || toast2.position === position2).map((toast2, index3) => {
64903
- var _toastOptions_duration, _toastOptions_closeButton;
64904
- return /* @__PURE__ */ React__default.createElement(Toast, {
64905
- key: toast2.id,
64906
- icons,
64907
- index: index3,
64908
- toast: toast2,
64909
- defaultRichColors: richColors,
64910
- duration: (_toastOptions_duration = toastOptions == null ? void 0 : toastOptions.duration) != null ? _toastOptions_duration : duration2,
64911
- className: toastOptions == null ? void 0 : toastOptions.className,
64912
- descriptionClassName: toastOptions == null ? void 0 : toastOptions.descriptionClassName,
64913
- invert,
64914
- visibleToasts,
64915
- closeButton: (_toastOptions_closeButton = toastOptions == null ? void 0 : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton,
64916
- interacting,
64917
- position: position2,
64918
- style: toastOptions == null ? void 0 : toastOptions.style,
64919
- unstyled: toastOptions == null ? void 0 : toastOptions.unstyled,
64920
- classNames: toastOptions == null ? void 0 : toastOptions.classNames,
64921
- cancelButtonStyle: toastOptions == null ? void 0 : toastOptions.cancelButtonStyle,
64922
- actionButtonStyle: toastOptions == null ? void 0 : toastOptions.actionButtonStyle,
64923
- closeButtonAriaLabel: toastOptions == null ? void 0 : toastOptions.closeButtonAriaLabel,
64924
- removeToast,
64925
- toasts: filteredToasts.filter((t2) => t2.position == toast2.position),
64926
- heights: heights.filter((h2) => h2.position == toast2.position),
64927
- setHeights,
64928
- expandByDefault: expand,
64929
- gap: gap2,
64930
- expanded,
64931
- swipeDirections: props.swipeDirections
64932
- });
64933
- }));
64934
- }))
64935
- );
64936
- });
64937
63904
  function ApplicationFrame(props) {
64938
63905
  const { application } = props;
64939
63906
  useDefaultRoute(application);
@@ -64950,15 +63917,12 @@ function ApplicationFrame(props) {
64950
63917
  addCssVariables(selectedTheme);
64951
63918
  return () => removeCssVariables(selectedTheme);
64952
63919
  }, [selectedTheme]);
64953
- return /* @__PURE__ */ jsxs(ThemeProvider$1, { theme, children: [
64954
- /* @__PURE__ */ jsx(ServicesContext.Provider, { value: application, children: /* @__PURE__ */ jsxs("div", { children: [
64955
- /* @__PURE__ */ jsx(Toolbar$1, {}),
64956
- /* @__PURE__ */ jsx(Sidebar, {}),
64957
- contentComponent,
64958
- /* @__PURE__ */ jsx(Footer, {})
64959
- ] }) }),
64960
- /* @__PURE__ */ jsx(Toaster, { expand: true, closeButton: false, richColors: false, visibleToasts: 5 })
64961
- ] });
63920
+ return /* @__PURE__ */ jsx(ThemeProvider$1, { theme, children: /* @__PURE__ */ jsx(ServicesContext.Provider, { value: application, children: /* @__PURE__ */ jsxs("div", { children: [
63921
+ /* @__PURE__ */ jsx(Toolbar$1, {}),
63922
+ /* @__PURE__ */ jsx(Sidebar, {}),
63923
+ contentComponent,
63924
+ /* @__PURE__ */ jsx(Footer, {})
63925
+ ] }) }) });
64962
63926
  }
64963
63927
  function LineWrap(props) {
64964
63928
  const { message, required, ...divProps } = props;
@@ -69298,152 +68262,2375 @@ var ILongOperationScope = /* @__PURE__ */ ((ILongOperationScope2) => {
69298
68262
  ILongOperationScope2[ILongOperationScope2["Local"] = 1] = "Local";
69299
68263
  return ILongOperationScope2;
69300
68264
  })(ILongOperationScope || {});
69301
- const _PopupNotification = class _PopupNotification {
69302
- constructor(options) {
69303
- this.renderToast = (toastId) => {
69304
- const classes2 = classNames(
69305
- "noty_bar",
69306
- `noty_theme__${this.options.theme}`,
69307
- `noty_type__${this.type}`,
69308
- this.getLayoutClass(),
69309
- {
69310
- noty_has_timeout: this.timeout !== false,
69311
- noty_has_progressbar: this.showProgress(),
69312
- noty_close_with_click: this.closeWith.includes("click")
69313
- }
68265
+ var noty$1 = { exports: {} };
68266
+ /*
68267
+ @package NOTY - Dependency-free notification library
68268
+ @version version: 3.2.0-beta
68269
+ @contributors https://github.com/needim/noty/graphs/contributors
68270
+ @documentation Examples and Documentation - https://ned.im/noty
68271
+ @license Licensed under the MIT licenses: http://www.opensource.org/licenses/mit-license.php
68272
+ */
68273
+ var noty = noty$1.exports;
68274
+ var hasRequiredNoty;
68275
+ function requireNoty() {
68276
+ if (hasRequiredNoty) return noty$1.exports;
68277
+ hasRequiredNoty = 1;
68278
+ (function(module2, exports) {
68279
+ (function webpackUniversalModuleDefinition(root, factory) {
68280
+ module2.exports = factory();
68281
+ })(noty, function() {
68282
+ return (
68283
+ /******/
68284
+ function(modules) {
68285
+ var installedModules = {};
68286
+ function __webpack_require__2(moduleId2) {
68287
+ if (installedModules[moduleId2]) {
68288
+ return installedModules[moduleId2].exports;
68289
+ }
68290
+ var module3 = installedModules[moduleId2] = {
68291
+ /******/
68292
+ i: moduleId2,
68293
+ /******/
68294
+ l: false,
68295
+ /******/
68296
+ exports: {}
68297
+ /******/
68298
+ };
68299
+ modules[moduleId2].call(module3.exports, module3, module3.exports, __webpack_require__2);
68300
+ module3.l = true;
68301
+ return module3.exports;
68302
+ }
68303
+ __webpack_require__2.m = modules;
68304
+ __webpack_require__2.c = installedModules;
68305
+ __webpack_require__2.i = function(value) {
68306
+ return value;
68307
+ };
68308
+ __webpack_require__2.d = function(exports2, name, getter) {
68309
+ if (!__webpack_require__2.o(exports2, name)) {
68310
+ Object.defineProperty(exports2, name, {
68311
+ /******/
68312
+ configurable: false,
68313
+ /******/
68314
+ enumerable: true,
68315
+ /******/
68316
+ get: getter
68317
+ /******/
68318
+ });
68319
+ }
68320
+ };
68321
+ __webpack_require__2.n = function(module3) {
68322
+ var getter = module3 && module3.__esModule ? (
68323
+ /******/
68324
+ function getDefault() {
68325
+ return module3["default"];
68326
+ }
68327
+ ) : (
68328
+ /******/
68329
+ function getModuleExports() {
68330
+ return module3;
68331
+ }
68332
+ );
68333
+ __webpack_require__2.d(getter, "a", getter);
68334
+ return getter;
68335
+ };
68336
+ __webpack_require__2.o = function(object, property) {
68337
+ return Object.prototype.hasOwnProperty.call(object, property);
68338
+ };
68339
+ __webpack_require__2.p = "";
68340
+ return __webpack_require__2(__webpack_require__2.s = 6);
68341
+ }([
68342
+ /* 0 */
68343
+ /***/
68344
+ function(module3, exports2, __webpack_require__2) {
68345
+ Object.defineProperty(exports2, "__esModule", {
68346
+ value: true
68347
+ });
68348
+ exports2.css = exports2.deepExtend = exports2.animationEndEvents = void 0;
68349
+ var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
68350
+ return typeof obj;
68351
+ } : function(obj) {
68352
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
68353
+ };
68354
+ exports2.inArray = inArray;
68355
+ exports2.stopPropagation = stopPropagation2;
68356
+ exports2.generateID = generateID;
68357
+ exports2.outerHeight = outerHeight;
68358
+ exports2.addListener = addListener;
68359
+ exports2.hasClass = hasClass2;
68360
+ exports2.addClass = addClass2;
68361
+ exports2.removeClass = removeClass3;
68362
+ exports2.remove = remove;
68363
+ exports2.classList = classList;
68364
+ exports2.visibilityChangeFlow = visibilityChangeFlow;
68365
+ exports2.createAudioElements = createAudioElements;
68366
+ var _api = __webpack_require__2(1);
68367
+ var API = _interopRequireWildcard(_api);
68368
+ function _interopRequireWildcard(obj) {
68369
+ if (obj && obj.__esModule) {
68370
+ return obj;
68371
+ } else {
68372
+ var newObj = {};
68373
+ if (obj != null) {
68374
+ for (var key in obj) {
68375
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
68376
+ }
68377
+ }
68378
+ newObj.default = obj;
68379
+ return newObj;
68380
+ }
68381
+ }
68382
+ exports2.animationEndEvents = "webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend";
68383
+ function inArray(needle, haystack, argStrict) {
68384
+ var key = void 0;
68385
+ var strict = !!argStrict;
68386
+ if (strict) {
68387
+ for (key in haystack) {
68388
+ if (haystack.hasOwnProperty(key) && haystack[key] === needle) {
68389
+ return true;
68390
+ }
68391
+ }
68392
+ } else {
68393
+ for (key in haystack) {
68394
+ if (haystack.hasOwnProperty(key) && haystack[key] === needle) {
68395
+ return true;
68396
+ }
68397
+ }
68398
+ }
68399
+ return false;
68400
+ }
68401
+ function stopPropagation2(evt) {
68402
+ evt = evt || window.event;
68403
+ if (typeof evt.stopPropagation !== "undefined") {
68404
+ evt.stopPropagation();
68405
+ } else {
68406
+ evt.cancelBubble = true;
68407
+ }
68408
+ }
68409
+ exports2.deepExtend = function deepExtend(out) {
68410
+ out = out || {};
68411
+ for (var i2 = 1; i2 < arguments.length; i2++) {
68412
+ var obj = arguments[i2];
68413
+ if (!obj) continue;
68414
+ for (var key in obj) {
68415
+ if (obj.hasOwnProperty(key)) {
68416
+ if (Array.isArray(obj[key])) {
68417
+ out[key] = obj[key];
68418
+ } else if (_typeof2(obj[key]) === "object" && obj[key] !== null) {
68419
+ out[key] = deepExtend(out[key], obj[key]);
68420
+ } else {
68421
+ out[key] = obj[key];
68422
+ }
68423
+ }
68424
+ }
68425
+ }
68426
+ return out;
68427
+ };
68428
+ function generateID() {
68429
+ var prefix2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
68430
+ var id = "noty_" + prefix2 + "_";
68431
+ id += "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c2) {
68432
+ var r2 = Math.random() * 16 | 0;
68433
+ var v2 = c2 === "x" ? r2 : r2 & 3 | 8;
68434
+ return v2.toString(16);
68435
+ });
68436
+ return id;
68437
+ }
68438
+ function outerHeight(el2) {
68439
+ var height2 = el2.offsetHeight;
68440
+ var style = window.getComputedStyle(el2);
68441
+ height2 += parseInt(style.marginTop) + parseInt(style.marginBottom);
68442
+ return height2;
68443
+ }
68444
+ exports2.css = /* @__PURE__ */ function() {
68445
+ var cssPrefixes = ["Webkit", "O", "Moz", "ms"];
68446
+ var cssProps = {};
68447
+ function camelCase2(string) {
68448
+ return string.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function(match, letter) {
68449
+ return letter.toUpperCase();
68450
+ });
68451
+ }
68452
+ function getVendorProp(name) {
68453
+ var style = document.body.style;
68454
+ if (name in style) return name;
68455
+ var i2 = cssPrefixes.length;
68456
+ var capName = name.charAt(0).toUpperCase() + name.slice(1);
68457
+ var vendorName = void 0;
68458
+ while (i2--) {
68459
+ vendorName = cssPrefixes[i2] + capName;
68460
+ if (vendorName in style) return vendorName;
68461
+ }
68462
+ return name;
68463
+ }
68464
+ function getStyleProp(name) {
68465
+ name = camelCase2(name);
68466
+ return cssProps[name] || (cssProps[name] = getVendorProp(name));
68467
+ }
68468
+ function applyCss(element, prop, value) {
68469
+ prop = getStyleProp(prop);
68470
+ element.style[prop] = value;
68471
+ }
68472
+ return function(element, properties2) {
68473
+ var args = arguments;
68474
+ var prop = void 0;
68475
+ var value = void 0;
68476
+ if (args.length === 2) {
68477
+ for (prop in properties2) {
68478
+ if (properties2.hasOwnProperty(prop)) {
68479
+ value = properties2[prop];
68480
+ if (value !== void 0 && properties2.hasOwnProperty(prop)) {
68481
+ applyCss(element, prop, value);
68482
+ }
68483
+ }
68484
+ }
68485
+ } else {
68486
+ applyCss(element, args[1], args[2]);
68487
+ }
68488
+ };
68489
+ }();
68490
+ function addListener(el2, events, cb) {
68491
+ var useCapture = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
68492
+ events = events.split(" ");
68493
+ for (var i2 = 0; i2 < events.length; i2++) {
68494
+ if (document.addEventListener) {
68495
+ el2.addEventListener(events[i2], cb, useCapture);
68496
+ } else if (document.attachEvent) {
68497
+ el2.attachEvent("on" + events[i2], cb);
68498
+ }
68499
+ }
68500
+ }
68501
+ function hasClass2(element, name) {
68502
+ var list = typeof element === "string" ? element : classList(element);
68503
+ return list.indexOf(" " + name + " ") >= 0;
68504
+ }
68505
+ function addClass2(element, name) {
68506
+ var oldList = classList(element);
68507
+ var newList = oldList + name;
68508
+ if (hasClass2(oldList, name)) return;
68509
+ element.className = newList.substring(1);
68510
+ }
68511
+ function removeClass3(element, name) {
68512
+ var oldList = classList(element);
68513
+ var newList = void 0;
68514
+ if (!hasClass2(element, name)) return;
68515
+ newList = oldList.replace(" " + name + " ", " ");
68516
+ element.className = newList.substring(1, newList.length - 1);
68517
+ }
68518
+ function remove(element) {
68519
+ if (element.parentNode) {
68520
+ element.parentNode.removeChild(element);
68521
+ }
68522
+ }
68523
+ function classList(element) {
68524
+ return (" " + (element && element.className || "") + " ").replace(/\s+/gi, " ");
68525
+ }
68526
+ function visibilityChangeFlow() {
68527
+ var hidden = void 0;
68528
+ var visibilityChange = void 0;
68529
+ if (typeof document.hidden !== "undefined") {
68530
+ hidden = "hidden";
68531
+ visibilityChange = "visibilitychange";
68532
+ } else if (typeof document.msHidden !== "undefined") {
68533
+ hidden = "msHidden";
68534
+ visibilityChange = "msvisibilitychange";
68535
+ } else if (typeof document.webkitHidden !== "undefined") {
68536
+ hidden = "webkitHidden";
68537
+ visibilityChange = "webkitvisibilitychange";
68538
+ }
68539
+ function onVisibilityChange() {
68540
+ API.PageHidden = document[hidden];
68541
+ handleVisibilityChange2();
68542
+ }
68543
+ function onBlur() {
68544
+ API.PageHidden = true;
68545
+ handleVisibilityChange2();
68546
+ }
68547
+ function onFocus() {
68548
+ API.PageHidden = false;
68549
+ handleVisibilityChange2();
68550
+ }
68551
+ function handleVisibilityChange2() {
68552
+ if (API.PageHidden) stopAll();
68553
+ else resumeAll();
68554
+ }
68555
+ function stopAll() {
68556
+ setTimeout(function() {
68557
+ Object.keys(API.Store).forEach(function(id) {
68558
+ if (API.Store.hasOwnProperty(id)) {
68559
+ if (API.Store[id].options.visibilityControl) {
68560
+ API.Store[id].stop();
68561
+ }
68562
+ }
68563
+ });
68564
+ }, 100);
68565
+ }
68566
+ function resumeAll() {
68567
+ setTimeout(function() {
68568
+ Object.keys(API.Store).forEach(function(id) {
68569
+ if (API.Store.hasOwnProperty(id)) {
68570
+ if (API.Store[id].options.visibilityControl) {
68571
+ API.Store[id].resume();
68572
+ }
68573
+ }
68574
+ });
68575
+ API.queueRenderAll();
68576
+ }, 100);
68577
+ }
68578
+ if (visibilityChange) {
68579
+ addListener(document, visibilityChange, onVisibilityChange);
68580
+ }
68581
+ addListener(window, "blur", onBlur);
68582
+ addListener(window, "focus", onFocus);
68583
+ }
68584
+ function createAudioElements(ref) {
68585
+ if (ref.hasSound) {
68586
+ var audioElement = document.createElement("audio");
68587
+ ref.options.sounds.sources.forEach(function(s2) {
68588
+ var source = document.createElement("source");
68589
+ source.src = s2;
68590
+ source.type = "audio/" + getExtension(s2);
68591
+ audioElement.appendChild(source);
68592
+ });
68593
+ if (ref.barDom) {
68594
+ ref.barDom.appendChild(audioElement);
68595
+ } else {
68596
+ document.querySelector("body").appendChild(audioElement);
68597
+ }
68598
+ audioElement.volume = ref.options.sounds.volume;
68599
+ if (!ref.soundPlayed) {
68600
+ audioElement.play();
68601
+ ref.soundPlayed = true;
68602
+ }
68603
+ audioElement.onended = function() {
68604
+ remove(audioElement);
68605
+ };
68606
+ }
68607
+ }
68608
+ function getExtension(fileName) {
68609
+ return fileName.match(/\.([^.]+)$/)[1];
68610
+ }
68611
+ },
68612
+ /* 1 */
68613
+ /***/
68614
+ function(module3, exports2, __webpack_require__2) {
68615
+ Object.defineProperty(exports2, "__esModule", {
68616
+ value: true
68617
+ });
68618
+ exports2.Defaults = exports2.Store = exports2.Queues = exports2.DefaultMaxVisible = exports2.docTitle = exports2.DocModalCount = exports2.PageHidden = void 0;
68619
+ exports2.getQueueCounts = getQueueCounts;
68620
+ exports2.addToQueue = addToQueue;
68621
+ exports2.removeFromQueue = removeFromQueue;
68622
+ exports2.queueRender = queueRender;
68623
+ exports2.queueRenderAll = queueRenderAll;
68624
+ exports2.ghostFix = ghostFix;
68625
+ exports2.build = build;
68626
+ exports2.hasButtons = hasButtons;
68627
+ exports2.handleModal = handleModal;
68628
+ exports2.handleModalClose = handleModalClose;
68629
+ exports2.queueClose = queueClose;
68630
+ exports2.dequeueClose = dequeueClose;
68631
+ exports2.fire = fire;
68632
+ exports2.openFlow = openFlow;
68633
+ exports2.closeFlow = closeFlow;
68634
+ var _utils = __webpack_require__2(0);
68635
+ var Utils = _interopRequireWildcard(_utils);
68636
+ function _interopRequireWildcard(obj) {
68637
+ if (obj && obj.__esModule) {
68638
+ return obj;
68639
+ } else {
68640
+ var newObj = {};
68641
+ if (obj != null) {
68642
+ for (var key in obj) {
68643
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
68644
+ }
68645
+ }
68646
+ newObj.default = obj;
68647
+ return newObj;
68648
+ }
68649
+ }
68650
+ exports2.PageHidden = false;
68651
+ var DocModalCount = exports2.DocModalCount = 0;
68652
+ var DocTitleProps = {
68653
+ originalTitle: null,
68654
+ count: 0,
68655
+ changed: false
68656
+ };
68657
+ var docTitle = exports2.docTitle = {
68658
+ increment: function increment2() {
68659
+ DocTitleProps.count++;
68660
+ docTitle._update();
68661
+ },
68662
+ decrement: function decrement() {
68663
+ DocTitleProps.count--;
68664
+ if (DocTitleProps.count <= 0) {
68665
+ docTitle._clear();
68666
+ return;
68667
+ }
68668
+ docTitle._update();
68669
+ },
68670
+ _update: function _update() {
68671
+ var title = document.title;
68672
+ if (!DocTitleProps.changed) {
68673
+ DocTitleProps.originalTitle = title;
68674
+ document.title = "(" + DocTitleProps.count + ") " + title;
68675
+ DocTitleProps.changed = true;
68676
+ } else {
68677
+ document.title = "(" + DocTitleProps.count + ") " + DocTitleProps.originalTitle;
68678
+ }
68679
+ },
68680
+ _clear: function _clear() {
68681
+ if (DocTitleProps.changed) {
68682
+ DocTitleProps.count = 0;
68683
+ document.title = DocTitleProps.originalTitle;
68684
+ DocTitleProps.changed = false;
68685
+ }
68686
+ }
68687
+ };
68688
+ var DefaultMaxVisible = exports2.DefaultMaxVisible = 5;
68689
+ var Queues = exports2.Queues = {
68690
+ global: {
68691
+ maxVisible: DefaultMaxVisible,
68692
+ queue: []
68693
+ }
68694
+ };
68695
+ var Store2 = exports2.Store = {};
68696
+ exports2.Defaults = {
68697
+ type: "alert",
68698
+ layout: "topRight",
68699
+ theme: "mint",
68700
+ text: "",
68701
+ timeout: false,
68702
+ progressBar: true,
68703
+ closeWith: ["click"],
68704
+ animation: {
68705
+ open: "noty_effects_open",
68706
+ close: "noty_effects_close"
68707
+ },
68708
+ id: false,
68709
+ force: false,
68710
+ killer: false,
68711
+ queue: "global",
68712
+ container: false,
68713
+ buttons: [],
68714
+ callbacks: {
68715
+ beforeShow: null,
68716
+ onShow: null,
68717
+ afterShow: null,
68718
+ onClose: null,
68719
+ afterClose: null,
68720
+ onClick: null,
68721
+ onHover: null,
68722
+ onTemplate: null
68723
+ },
68724
+ sounds: {
68725
+ sources: [],
68726
+ volume: 1,
68727
+ conditions: []
68728
+ },
68729
+ titleCount: {
68730
+ conditions: []
68731
+ },
68732
+ modal: false,
68733
+ visibilityControl: false
68734
+ /**
68735
+ * @param {string} queueName
68736
+ * @return {object}
68737
+ */
68738
+ };
68739
+ function getQueueCounts() {
68740
+ var queueName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "global";
68741
+ var count = 0;
68742
+ var max2 = DefaultMaxVisible;
68743
+ if (Queues.hasOwnProperty(queueName)) {
68744
+ max2 = Queues[queueName].maxVisible;
68745
+ Object.keys(Store2).forEach(function(i2) {
68746
+ if (Store2[i2].options.queue === queueName && !Store2[i2].closed) count++;
68747
+ });
68748
+ }
68749
+ return {
68750
+ current: count,
68751
+ maxVisible: max2
68752
+ };
68753
+ }
68754
+ function addToQueue(ref) {
68755
+ if (!Queues.hasOwnProperty(ref.options.queue)) {
68756
+ Queues[ref.options.queue] = { maxVisible: DefaultMaxVisible, queue: [] };
68757
+ }
68758
+ Queues[ref.options.queue].queue.push(ref);
68759
+ }
68760
+ function removeFromQueue(ref) {
68761
+ if (Queues.hasOwnProperty(ref.options.queue)) {
68762
+ var queue = [];
68763
+ Object.keys(Queues[ref.options.queue].queue).forEach(function(i2) {
68764
+ if (Queues[ref.options.queue].queue[i2].id !== ref.id) {
68765
+ queue.push(Queues[ref.options.queue].queue[i2]);
68766
+ }
68767
+ });
68768
+ Queues[ref.options.queue].queue = queue;
68769
+ }
68770
+ }
68771
+ function queueRender() {
68772
+ var queueName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "global";
68773
+ if (Queues.hasOwnProperty(queueName)) {
68774
+ var noty2 = Queues[queueName].queue.shift();
68775
+ if (noty2) noty2.show();
68776
+ }
68777
+ }
68778
+ function queueRenderAll() {
68779
+ Object.keys(Queues).forEach(function(queueName) {
68780
+ queueRender(queueName);
68781
+ });
68782
+ }
68783
+ function ghostFix(ref) {
68784
+ var ghostID = Utils.generateID("ghost");
68785
+ var ghost = document.createElement("div");
68786
+ ghost.setAttribute("id", ghostID);
68787
+ Utils.css(ghost, {
68788
+ height: Utils.outerHeight(ref.barDom) + "px"
68789
+ });
68790
+ ref.barDom.insertAdjacentHTML("afterend", ghost.outerHTML);
68791
+ Utils.remove(ref.barDom);
68792
+ ghost = document.getElementById(ghostID);
68793
+ Utils.addClass(ghost, "noty_fix_effects_height");
68794
+ Utils.addListener(ghost, Utils.animationEndEvents, function() {
68795
+ Utils.remove(ghost);
68796
+ });
68797
+ }
68798
+ function build(ref) {
68799
+ findOrCreateContainer(ref);
68800
+ var markup = '<div class="noty_body">' + ref.options.text + "</div>" + buildButtons(ref) + '<div class="noty_progressbar"></div>';
68801
+ ref.barDom = document.createElement("div");
68802
+ ref.barDom.setAttribute("id", ref.id);
68803
+ Utils.addClass(ref.barDom, "noty_bar noty_type__" + ref.options.type + " noty_theme__" + ref.options.theme);
68804
+ ref.barDom.innerHTML = markup;
68805
+ fire(ref, "onTemplate");
68806
+ }
68807
+ function hasButtons(ref) {
68808
+ return !!(ref.options.buttons && Object.keys(ref.options.buttons).length);
68809
+ }
68810
+ function buildButtons(ref) {
68811
+ if (hasButtons(ref)) {
68812
+ var buttons = document.createElement("div");
68813
+ Utils.addClass(buttons, "noty_buttons");
68814
+ Object.keys(ref.options.buttons).forEach(function(key) {
68815
+ buttons.appendChild(ref.options.buttons[key].dom);
68816
+ });
68817
+ ref.options.buttons.forEach(function(btn) {
68818
+ buttons.appendChild(btn.dom);
68819
+ });
68820
+ return buttons.outerHTML;
68821
+ }
68822
+ return "";
68823
+ }
68824
+ function handleModal(ref) {
68825
+ if (ref.options.modal) {
68826
+ if (DocModalCount === 0) {
68827
+ createModal();
68828
+ }
68829
+ exports2.DocModalCount = DocModalCount += 1;
68830
+ }
68831
+ }
68832
+ function handleModalClose(ref) {
68833
+ if (ref.options.modal && DocModalCount > 0) {
68834
+ exports2.DocModalCount = DocModalCount -= 1;
68835
+ if (DocModalCount <= 0) {
68836
+ var modal = document.querySelector(".noty_modal");
68837
+ if (modal) {
68838
+ Utils.removeClass(modal, "noty_modal_open");
68839
+ Utils.addClass(modal, "noty_modal_close");
68840
+ Utils.addListener(modal, Utils.animationEndEvents, function() {
68841
+ Utils.remove(modal);
68842
+ });
68843
+ }
68844
+ }
68845
+ }
68846
+ }
68847
+ function createModal() {
68848
+ var body = document.querySelector("body");
68849
+ var modal = document.createElement("div");
68850
+ Utils.addClass(modal, "noty_modal");
68851
+ body.insertBefore(modal, body.firstChild);
68852
+ Utils.addClass(modal, "noty_modal_open");
68853
+ Utils.addListener(modal, Utils.animationEndEvents, function() {
68854
+ Utils.removeClass(modal, "noty_modal_open");
68855
+ });
68856
+ }
68857
+ function findOrCreateContainer(ref) {
68858
+ if (ref.options.container) {
68859
+ ref.layoutDom = document.querySelector(ref.options.container);
68860
+ return;
68861
+ }
68862
+ var layoutID = "noty_layout__" + ref.options.layout;
68863
+ ref.layoutDom = document.querySelector("div#" + layoutID);
68864
+ if (!ref.layoutDom) {
68865
+ ref.layoutDom = document.createElement("div");
68866
+ ref.layoutDom.setAttribute("id", layoutID);
68867
+ ref.layoutDom.setAttribute("role", "alert");
68868
+ ref.layoutDom.setAttribute("aria-live", "polite");
68869
+ Utils.addClass(ref.layoutDom, "noty_layout");
68870
+ document.querySelector("body").appendChild(ref.layoutDom);
68871
+ }
68872
+ }
68873
+ function queueClose(ref) {
68874
+ if (ref.options.timeout) {
68875
+ if (ref.options.progressBar && ref.progressDom) {
68876
+ Utils.css(ref.progressDom, {
68877
+ transition: "width " + ref.options.timeout + "ms linear",
68878
+ width: "0%"
68879
+ });
68880
+ }
68881
+ clearTimeout(ref.closeTimer);
68882
+ ref.closeTimer = setTimeout(function() {
68883
+ ref.close();
68884
+ }, ref.options.timeout);
68885
+ }
68886
+ }
68887
+ function dequeueClose(ref) {
68888
+ if (ref.options.timeout && ref.closeTimer) {
68889
+ clearTimeout(ref.closeTimer);
68890
+ ref.closeTimer = -1;
68891
+ if (ref.options.progressBar && ref.progressDom) {
68892
+ Utils.css(ref.progressDom, {
68893
+ transition: "width 0ms linear",
68894
+ width: "100%"
68895
+ });
68896
+ }
68897
+ }
68898
+ }
68899
+ function fire(ref, eventName) {
68900
+ if (ref.listeners.hasOwnProperty(eventName)) {
68901
+ ref.listeners[eventName].forEach(function(cb) {
68902
+ if (typeof cb === "function") {
68903
+ cb.apply(ref);
68904
+ }
68905
+ });
68906
+ }
68907
+ }
68908
+ function openFlow(ref) {
68909
+ fire(ref, "afterShow");
68910
+ queueClose(ref);
68911
+ Utils.addListener(ref.barDom, "mouseenter", function() {
68912
+ dequeueClose(ref);
68913
+ });
68914
+ Utils.addListener(ref.barDom, "mouseleave", function() {
68915
+ queueClose(ref);
68916
+ });
68917
+ }
68918
+ function closeFlow(ref) {
68919
+ delete Store2[ref.id];
68920
+ ref.closing = false;
68921
+ fire(ref, "afterClose");
68922
+ Utils.remove(ref.barDom);
68923
+ if (ref.layoutDom.querySelectorAll(".noty_bar").length === 0 && !ref.options.container) {
68924
+ Utils.remove(ref.layoutDom);
68925
+ }
68926
+ if (Utils.inArray("docVisible", ref.options.titleCount.conditions) || Utils.inArray("docHidden", ref.options.titleCount.conditions)) {
68927
+ docTitle.decrement();
68928
+ }
68929
+ queueRender(ref.options.queue);
68930
+ }
68931
+ },
68932
+ /* 2 */
68933
+ /***/
68934
+ function(module3, exports2, __webpack_require__2) {
68935
+ Object.defineProperty(exports2, "__esModule", {
68936
+ value: true
68937
+ });
68938
+ exports2.NotyButton = void 0;
68939
+ var _utils = __webpack_require__2(0);
68940
+ var Utils = _interopRequireWildcard(_utils);
68941
+ function _interopRequireWildcard(obj) {
68942
+ if (obj && obj.__esModule) {
68943
+ return obj;
68944
+ } else {
68945
+ var newObj = {};
68946
+ if (obj != null) {
68947
+ for (var key in obj) {
68948
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
68949
+ }
68950
+ }
68951
+ newObj.default = obj;
68952
+ return newObj;
68953
+ }
68954
+ }
68955
+ function _classCallCheck2(instance, Constructor) {
68956
+ if (!(instance instanceof Constructor)) {
68957
+ throw new TypeError("Cannot call a class as a function");
68958
+ }
68959
+ }
68960
+ exports2.NotyButton = function NotyButton(html, classes2, cb) {
68961
+ var _this = this;
68962
+ var attributes = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
68963
+ _classCallCheck2(this, NotyButton);
68964
+ this.dom = document.createElement("button");
68965
+ this.dom.innerHTML = html;
68966
+ this.id = attributes.id = attributes.id || Utils.generateID("button");
68967
+ this.cb = cb;
68968
+ Object.keys(attributes).forEach(function(propertyName) {
68969
+ _this.dom.setAttribute(propertyName, attributes[propertyName]);
68970
+ });
68971
+ Utils.addClass(this.dom, classes2 || "noty_btn");
68972
+ return this;
68973
+ };
68974
+ },
68975
+ /* 3 */
68976
+ /***/
68977
+ function(module3, exports2, __webpack_require__2) {
68978
+ Object.defineProperty(exports2, "__esModule", {
68979
+ value: true
68980
+ });
68981
+ var _createClass2 = /* @__PURE__ */ function() {
68982
+ function defineProperties(target, props) {
68983
+ for (var i2 = 0; i2 < props.length; i2++) {
68984
+ var descriptor = props[i2];
68985
+ descriptor.enumerable = descriptor.enumerable || false;
68986
+ descriptor.configurable = true;
68987
+ if ("value" in descriptor) descriptor.writable = true;
68988
+ Object.defineProperty(target, descriptor.key, descriptor);
68989
+ }
68990
+ }
68991
+ return function(Constructor, protoProps, staticProps) {
68992
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
68993
+ if (staticProps) defineProperties(Constructor, staticProps);
68994
+ return Constructor;
68995
+ };
68996
+ }();
68997
+ function _classCallCheck2(instance, Constructor) {
68998
+ if (!(instance instanceof Constructor)) {
68999
+ throw new TypeError("Cannot call a class as a function");
69000
+ }
69001
+ }
69002
+ exports2.Push = function() {
69003
+ function Push() {
69004
+ var workerPath = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "/service-worker.js";
69005
+ _classCallCheck2(this, Push);
69006
+ this.subData = {};
69007
+ this.workerPath = workerPath;
69008
+ this.listeners = {
69009
+ onPermissionGranted: [],
69010
+ onPermissionDenied: [],
69011
+ onSubscriptionSuccess: [],
69012
+ onSubscriptionCancel: [],
69013
+ onWorkerError: [],
69014
+ onWorkerSuccess: [],
69015
+ onWorkerNotSupported: []
69016
+ };
69017
+ return this;
69018
+ }
69019
+ _createClass2(Push, [{
69020
+ key: "on",
69021
+ value: function on(eventName) {
69022
+ var cb = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() {
69023
+ };
69024
+ if (typeof cb === "function" && this.listeners.hasOwnProperty(eventName)) {
69025
+ this.listeners[eventName].push(cb);
69026
+ }
69027
+ return this;
69028
+ }
69029
+ }, {
69030
+ key: "fire",
69031
+ value: function fire(eventName) {
69032
+ var _this = this;
69033
+ var params = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
69034
+ if (this.listeners.hasOwnProperty(eventName)) {
69035
+ this.listeners[eventName].forEach(function(cb) {
69036
+ if (typeof cb === "function") {
69037
+ cb.apply(_this, params);
69038
+ }
69039
+ });
69040
+ }
69041
+ }
69042
+ }, {
69043
+ key: "create",
69044
+ value: function create2() {
69045
+ console.log("NOT IMPLEMENTED YET");
69046
+ }
69047
+ /**
69048
+ * @return {boolean}
69049
+ */
69050
+ }, {
69051
+ key: "isSupported",
69052
+ value: function isSupported() {
69053
+ var result = false;
69054
+ try {
69055
+ result = window.Notification || window.webkitNotifications || navigator.mozNotification || window.external && window.external.msIsSiteMode() !== void 0;
69056
+ } catch (e2) {
69057
+ }
69058
+ return result;
69059
+ }
69060
+ /**
69061
+ * @return {string}
69062
+ */
69063
+ }, {
69064
+ key: "getPermissionStatus",
69065
+ value: function getPermissionStatus() {
69066
+ var perm = "default";
69067
+ if (window.Notification && window.Notification.permissionLevel) {
69068
+ perm = window.Notification.permissionLevel;
69069
+ } else if (window.webkitNotifications && window.webkitNotifications.checkPermission) {
69070
+ switch (window.webkitNotifications.checkPermission()) {
69071
+ case 1:
69072
+ perm = "default";
69073
+ break;
69074
+ case 0:
69075
+ perm = "granted";
69076
+ break;
69077
+ default:
69078
+ perm = "denied";
69079
+ }
69080
+ } else if (window.Notification && window.Notification.permission) {
69081
+ perm = window.Notification.permission;
69082
+ } else if (navigator.mozNotification) {
69083
+ perm = "granted";
69084
+ } else if (window.external && window.external.msIsSiteMode() !== void 0) {
69085
+ perm = window.external.msIsSiteMode() ? "granted" : "default";
69086
+ }
69087
+ return perm.toString().toLowerCase();
69088
+ }
69089
+ /**
69090
+ * @return {string}
69091
+ */
69092
+ }, {
69093
+ key: "getEndpoint",
69094
+ value: function getEndpoint(subscription) {
69095
+ var endpoint = subscription.endpoint;
69096
+ var subscriptionId = subscription.subscriptionId;
69097
+ if (subscriptionId && endpoint.indexOf(subscriptionId) === -1) {
69098
+ endpoint += "/" + subscriptionId;
69099
+ }
69100
+ return endpoint;
69101
+ }
69102
+ /**
69103
+ * @return {boolean}
69104
+ */
69105
+ }, {
69106
+ key: "isSWRegistered",
69107
+ value: function isSWRegistered() {
69108
+ try {
69109
+ return navigator.serviceWorker.controller.state === "activated";
69110
+ } catch (e2) {
69111
+ return false;
69112
+ }
69113
+ }
69114
+ /**
69115
+ * @return {void}
69116
+ */
69117
+ }, {
69118
+ key: "unregisterWorker",
69119
+ value: function unregisterWorker() {
69120
+ var self2 = this;
69121
+ if ("serviceWorker" in navigator) {
69122
+ navigator.serviceWorker.getRegistrations().then(function(registrations) {
69123
+ var _iteratorNormalCompletion = true;
69124
+ var _didIteratorError = false;
69125
+ var _iteratorError = void 0;
69126
+ try {
69127
+ for (var _iterator = registrations[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
69128
+ var registration = _step.value;
69129
+ registration.unregister();
69130
+ self2.fire("onSubscriptionCancel");
69131
+ }
69132
+ } catch (err) {
69133
+ _didIteratorError = true;
69134
+ _iteratorError = err;
69135
+ } finally {
69136
+ try {
69137
+ if (!_iteratorNormalCompletion && _iterator.return) {
69138
+ _iterator.return();
69139
+ }
69140
+ } finally {
69141
+ if (_didIteratorError) {
69142
+ throw _iteratorError;
69143
+ }
69144
+ }
69145
+ }
69146
+ });
69147
+ }
69148
+ }
69149
+ /**
69150
+ * @return {void}
69151
+ */
69152
+ }, {
69153
+ key: "requestSubscription",
69154
+ value: function requestSubscription() {
69155
+ var _this2 = this;
69156
+ var userVisibleOnly = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
69157
+ var self2 = this;
69158
+ var current = this.getPermissionStatus();
69159
+ var cb = function cb2(result) {
69160
+ if (result === "granted") {
69161
+ _this2.fire("onPermissionGranted");
69162
+ if ("serviceWorker" in navigator) {
69163
+ navigator.serviceWorker.register(_this2.workerPath).then(function() {
69164
+ navigator.serviceWorker.ready.then(function(serviceWorkerRegistration) {
69165
+ self2.fire("onWorkerSuccess");
69166
+ serviceWorkerRegistration.pushManager.subscribe({
69167
+ userVisibleOnly
69168
+ }).then(function(subscription) {
69169
+ var key = subscription.getKey("p256dh");
69170
+ var token2 = subscription.getKey("auth");
69171
+ self2.subData = {
69172
+ endpoint: self2.getEndpoint(subscription),
69173
+ p256dh: key ? window.btoa(String.fromCharCode.apply(null, new Uint8Array(key))) : null,
69174
+ auth: token2 ? window.btoa(String.fromCharCode.apply(null, new Uint8Array(token2))) : null
69175
+ };
69176
+ self2.fire("onSubscriptionSuccess", [self2.subData]);
69177
+ }).catch(function(err) {
69178
+ self2.fire("onWorkerError", [err]);
69179
+ });
69180
+ });
69181
+ });
69182
+ } else {
69183
+ self2.fire("onWorkerNotSupported");
69184
+ }
69185
+ } else if (result === "denied") {
69186
+ _this2.fire("onPermissionDenied");
69187
+ _this2.unregisterWorker();
69188
+ }
69189
+ };
69190
+ if (current === "default") {
69191
+ if (window.Notification && window.Notification.requestPermission) {
69192
+ window.Notification.requestPermission(cb);
69193
+ } else if (window.webkitNotifications && window.webkitNotifications.checkPermission) {
69194
+ window.webkitNotifications.requestPermission(cb);
69195
+ }
69196
+ } else {
69197
+ cb(current);
69198
+ }
69199
+ }
69200
+ }]);
69201
+ return Push;
69202
+ }();
69203
+ },
69204
+ /* 4 */
69205
+ /***/
69206
+ function(module3, exports2, __webpack_require__2) {
69207
+ (function(process2, global2) {
69208
+ var require2;
69209
+ /*!
69210
+ * @overview es6-promise - a tiny implementation of Promises/A+.
69211
+ * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
69212
+ * @license Licensed under MIT license
69213
+ * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
69214
+ * @version 4.1.1
69215
+ */
69216
+ (function(global3, factory) {
69217
+ module3.exports = factory();
69218
+ })(this, function() {
69219
+ function objectOrFunction(x2) {
69220
+ var type = typeof x2;
69221
+ return x2 !== null && (type === "object" || type === "function");
69222
+ }
69223
+ function isFunction2(x2) {
69224
+ return typeof x2 === "function";
69225
+ }
69226
+ var _isArray = void 0;
69227
+ if (Array.isArray) {
69228
+ _isArray = Array.isArray;
69229
+ } else {
69230
+ _isArray = function(x2) {
69231
+ return Object.prototype.toString.call(x2) === "[object Array]";
69232
+ };
69233
+ }
69234
+ var isArray2 = _isArray;
69235
+ var len = 0;
69236
+ var vertxNext = void 0;
69237
+ var customSchedulerFn = void 0;
69238
+ var asap = function asap2(callback, arg) {
69239
+ queue[len] = callback;
69240
+ queue[len + 1] = arg;
69241
+ len += 2;
69242
+ if (len === 2) {
69243
+ if (customSchedulerFn) {
69244
+ customSchedulerFn(flush);
69245
+ } else {
69246
+ scheduleFlush();
69247
+ }
69248
+ }
69249
+ };
69250
+ function setScheduler(scheduleFn) {
69251
+ customSchedulerFn = scheduleFn;
69252
+ }
69253
+ function setAsap(asapFn) {
69254
+ asap = asapFn;
69255
+ }
69256
+ var browserWindow = typeof window !== "undefined" ? window : void 0;
69257
+ var browserGlobal = browserWindow || {};
69258
+ var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
69259
+ var isNode = typeof self === "undefined" && typeof process2 !== "undefined" && {}.toString.call(process2) === "[object process]";
69260
+ var isWorker = typeof Uint8ClampedArray !== "undefined" && typeof importScripts !== "undefined" && typeof MessageChannel !== "undefined";
69261
+ function useNextTick() {
69262
+ return function() {
69263
+ return process2.nextTick(flush);
69264
+ };
69265
+ }
69266
+ function useVertxTimer() {
69267
+ if (typeof vertxNext !== "undefined") {
69268
+ return function() {
69269
+ vertxNext(flush);
69270
+ };
69271
+ }
69272
+ return useSetTimeout();
69273
+ }
69274
+ function useMutationObserver() {
69275
+ var iterations = 0;
69276
+ var observer = new BrowserMutationObserver(flush);
69277
+ var node = document.createTextNode("");
69278
+ observer.observe(node, { characterData: true });
69279
+ return function() {
69280
+ node.data = iterations = ++iterations % 2;
69281
+ };
69282
+ }
69283
+ function useMessageChannel() {
69284
+ var channel = new MessageChannel();
69285
+ channel.port1.onmessage = flush;
69286
+ return function() {
69287
+ return channel.port2.postMessage(0);
69288
+ };
69289
+ }
69290
+ function useSetTimeout() {
69291
+ var globalSetTimeout = setTimeout;
69292
+ return function() {
69293
+ return globalSetTimeout(flush, 1);
69294
+ };
69295
+ }
69296
+ var queue = new Array(1e3);
69297
+ function flush() {
69298
+ for (var i2 = 0; i2 < len; i2 += 2) {
69299
+ var callback = queue[i2];
69300
+ var arg = queue[i2 + 1];
69301
+ callback(arg);
69302
+ queue[i2] = void 0;
69303
+ queue[i2 + 1] = void 0;
69304
+ }
69305
+ len = 0;
69306
+ }
69307
+ function attemptVertx() {
69308
+ try {
69309
+ var r2 = require2;
69310
+ var vertx = __webpack_require__2(9);
69311
+ vertxNext = vertx.runOnLoop || vertx.runOnContext;
69312
+ return useVertxTimer();
69313
+ } catch (e2) {
69314
+ return useSetTimeout();
69315
+ }
69316
+ }
69317
+ var scheduleFlush = void 0;
69318
+ if (isNode) {
69319
+ scheduleFlush = useNextTick();
69320
+ } else if (BrowserMutationObserver) {
69321
+ scheduleFlush = useMutationObserver();
69322
+ } else if (isWorker) {
69323
+ scheduleFlush = useMessageChannel();
69324
+ } else if (browserWindow === void 0 && true) {
69325
+ scheduleFlush = attemptVertx();
69326
+ } else {
69327
+ scheduleFlush = useSetTimeout();
69328
+ }
69329
+ function then(onFulfillment, onRejection) {
69330
+ var _arguments = arguments;
69331
+ var parent = this;
69332
+ var child = new this.constructor(noop2);
69333
+ if (child[PROMISE_ID] === void 0) {
69334
+ makePromise(child);
69335
+ }
69336
+ var _state = parent._state;
69337
+ if (_state) {
69338
+ (function() {
69339
+ var callback = _arguments[_state - 1];
69340
+ asap(function() {
69341
+ return invokeCallback(_state, child, callback, parent._result);
69342
+ });
69343
+ })();
69344
+ } else {
69345
+ subscribe(parent, child, onFulfillment, onRejection);
69346
+ }
69347
+ return child;
69348
+ }
69349
+ function resolve$1(object) {
69350
+ var Constructor = this;
69351
+ if (object && typeof object === "object" && object.constructor === Constructor) {
69352
+ return object;
69353
+ }
69354
+ var promise = new Constructor(noop2);
69355
+ resolve(promise, object);
69356
+ return promise;
69357
+ }
69358
+ var PROMISE_ID = Math.random().toString(36).substring(16);
69359
+ function noop2() {
69360
+ }
69361
+ var PENDING = void 0;
69362
+ var FULFILLED = 1;
69363
+ var REJECTED = 2;
69364
+ var GET_THEN_ERROR = new ErrorObject();
69365
+ function selfFulfillment() {
69366
+ return new TypeError("You cannot resolve a promise with itself");
69367
+ }
69368
+ function cannotReturnOwn() {
69369
+ return new TypeError("A promises callback cannot return that same promise.");
69370
+ }
69371
+ function getThen(promise) {
69372
+ try {
69373
+ return promise.then;
69374
+ } catch (error) {
69375
+ GET_THEN_ERROR.error = error;
69376
+ return GET_THEN_ERROR;
69377
+ }
69378
+ }
69379
+ function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
69380
+ try {
69381
+ then$$1.call(value, fulfillmentHandler, rejectionHandler);
69382
+ } catch (e2) {
69383
+ return e2;
69384
+ }
69385
+ }
69386
+ function handleForeignThenable(promise, thenable, then$$1) {
69387
+ asap(function(promise2) {
69388
+ var sealed = false;
69389
+ var error = tryThen(then$$1, thenable, function(value) {
69390
+ if (sealed) {
69391
+ return;
69392
+ }
69393
+ sealed = true;
69394
+ if (thenable !== value) {
69395
+ resolve(promise2, value);
69396
+ } else {
69397
+ fulfill(promise2, value);
69398
+ }
69399
+ }, function(reason) {
69400
+ if (sealed) {
69401
+ return;
69402
+ }
69403
+ sealed = true;
69404
+ reject(promise2, reason);
69405
+ }, "Settle: " + (promise2._label || " unknown promise"));
69406
+ if (!sealed && error) {
69407
+ sealed = true;
69408
+ reject(promise2, error);
69409
+ }
69410
+ }, promise);
69411
+ }
69412
+ function handleOwnThenable(promise, thenable) {
69413
+ if (thenable._state === FULFILLED) {
69414
+ fulfill(promise, thenable._result);
69415
+ } else if (thenable._state === REJECTED) {
69416
+ reject(promise, thenable._result);
69417
+ } else {
69418
+ subscribe(thenable, void 0, function(value) {
69419
+ return resolve(promise, value);
69420
+ }, function(reason) {
69421
+ return reject(promise, reason);
69422
+ });
69423
+ }
69424
+ }
69425
+ function handleMaybeThenable(promise, maybeThenable, then$$1) {
69426
+ if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
69427
+ handleOwnThenable(promise, maybeThenable);
69428
+ } else {
69429
+ if (then$$1 === GET_THEN_ERROR) {
69430
+ reject(promise, GET_THEN_ERROR.error);
69431
+ GET_THEN_ERROR.error = null;
69432
+ } else if (then$$1 === void 0) {
69433
+ fulfill(promise, maybeThenable);
69434
+ } else if (isFunction2(then$$1)) {
69435
+ handleForeignThenable(promise, maybeThenable, then$$1);
69436
+ } else {
69437
+ fulfill(promise, maybeThenable);
69438
+ }
69439
+ }
69440
+ }
69441
+ function resolve(promise, value) {
69442
+ if (promise === value) {
69443
+ reject(promise, selfFulfillment());
69444
+ } else if (objectOrFunction(value)) {
69445
+ handleMaybeThenable(promise, value, getThen(value));
69446
+ } else {
69447
+ fulfill(promise, value);
69448
+ }
69449
+ }
69450
+ function publishRejection(promise) {
69451
+ if (promise._onerror) {
69452
+ promise._onerror(promise._result);
69453
+ }
69454
+ publish(promise);
69455
+ }
69456
+ function fulfill(promise, value) {
69457
+ if (promise._state !== PENDING) {
69458
+ return;
69459
+ }
69460
+ promise._result = value;
69461
+ promise._state = FULFILLED;
69462
+ if (promise._subscribers.length !== 0) {
69463
+ asap(publish, promise);
69464
+ }
69465
+ }
69466
+ function reject(promise, reason) {
69467
+ if (promise._state !== PENDING) {
69468
+ return;
69469
+ }
69470
+ promise._state = REJECTED;
69471
+ promise._result = reason;
69472
+ asap(publishRejection, promise);
69473
+ }
69474
+ function subscribe(parent, child, onFulfillment, onRejection) {
69475
+ var _subscribers = parent._subscribers;
69476
+ var length = _subscribers.length;
69477
+ parent._onerror = null;
69478
+ _subscribers[length] = child;
69479
+ _subscribers[length + FULFILLED] = onFulfillment;
69480
+ _subscribers[length + REJECTED] = onRejection;
69481
+ if (length === 0 && parent._state) {
69482
+ asap(publish, parent);
69483
+ }
69484
+ }
69485
+ function publish(promise) {
69486
+ var subscribers = promise._subscribers;
69487
+ var settled = promise._state;
69488
+ if (subscribers.length === 0) {
69489
+ return;
69490
+ }
69491
+ var child = void 0, callback = void 0, detail = promise._result;
69492
+ for (var i2 = 0; i2 < subscribers.length; i2 += 3) {
69493
+ child = subscribers[i2];
69494
+ callback = subscribers[i2 + settled];
69495
+ if (child) {
69496
+ invokeCallback(settled, child, callback, detail);
69497
+ } else {
69498
+ callback(detail);
69499
+ }
69500
+ }
69501
+ promise._subscribers.length = 0;
69502
+ }
69503
+ function ErrorObject() {
69504
+ this.error = null;
69505
+ }
69506
+ var TRY_CATCH_ERROR = new ErrorObject();
69507
+ function tryCatch(callback, detail) {
69508
+ try {
69509
+ return callback(detail);
69510
+ } catch (e2) {
69511
+ TRY_CATCH_ERROR.error = e2;
69512
+ return TRY_CATCH_ERROR;
69513
+ }
69514
+ }
69515
+ function invokeCallback(settled, promise, callback, detail) {
69516
+ var hasCallback = isFunction2(callback), value = void 0, error = void 0, succeeded = void 0, failed = void 0;
69517
+ if (hasCallback) {
69518
+ value = tryCatch(callback, detail);
69519
+ if (value === TRY_CATCH_ERROR) {
69520
+ failed = true;
69521
+ error = value.error;
69522
+ value.error = null;
69523
+ } else {
69524
+ succeeded = true;
69525
+ }
69526
+ if (promise === value) {
69527
+ reject(promise, cannotReturnOwn());
69528
+ return;
69529
+ }
69530
+ } else {
69531
+ value = detail;
69532
+ succeeded = true;
69533
+ }
69534
+ if (promise._state !== PENDING) ;
69535
+ else if (hasCallback && succeeded) {
69536
+ resolve(promise, value);
69537
+ } else if (failed) {
69538
+ reject(promise, error);
69539
+ } else if (settled === FULFILLED) {
69540
+ fulfill(promise, value);
69541
+ } else if (settled === REJECTED) {
69542
+ reject(promise, value);
69543
+ }
69544
+ }
69545
+ function initializePromise(promise, resolver) {
69546
+ try {
69547
+ resolver(function resolvePromise(value) {
69548
+ resolve(promise, value);
69549
+ }, function rejectPromise(reason) {
69550
+ reject(promise, reason);
69551
+ });
69552
+ } catch (e2) {
69553
+ reject(promise, e2);
69554
+ }
69555
+ }
69556
+ var id = 0;
69557
+ function nextId() {
69558
+ return id++;
69559
+ }
69560
+ function makePromise(promise) {
69561
+ promise[PROMISE_ID] = id++;
69562
+ promise._state = void 0;
69563
+ promise._result = void 0;
69564
+ promise._subscribers = [];
69565
+ }
69566
+ function Enumerator$1(Constructor, input) {
69567
+ this._instanceConstructor = Constructor;
69568
+ this.promise = new Constructor(noop2);
69569
+ if (!this.promise[PROMISE_ID]) {
69570
+ makePromise(this.promise);
69571
+ }
69572
+ if (isArray2(input)) {
69573
+ this.length = input.length;
69574
+ this._remaining = input.length;
69575
+ this._result = new Array(this.length);
69576
+ if (this.length === 0) {
69577
+ fulfill(this.promise, this._result);
69578
+ } else {
69579
+ this.length = this.length || 0;
69580
+ this._enumerate(input);
69581
+ if (this._remaining === 0) {
69582
+ fulfill(this.promise, this._result);
69583
+ }
69584
+ }
69585
+ } else {
69586
+ reject(this.promise, validationError());
69587
+ }
69588
+ }
69589
+ function validationError() {
69590
+ return new Error("Array Methods must be provided an Array");
69591
+ }
69592
+ Enumerator$1.prototype._enumerate = function(input) {
69593
+ for (var i2 = 0; this._state === PENDING && i2 < input.length; i2++) {
69594
+ this._eachEntry(input[i2], i2);
69595
+ }
69596
+ };
69597
+ Enumerator$1.prototype._eachEntry = function(entry, i2) {
69598
+ var c2 = this._instanceConstructor;
69599
+ var resolve$$1 = c2.resolve;
69600
+ if (resolve$$1 === resolve$1) {
69601
+ var _then = getThen(entry);
69602
+ if (_then === then && entry._state !== PENDING) {
69603
+ this._settledAt(entry._state, i2, entry._result);
69604
+ } else if (typeof _then !== "function") {
69605
+ this._remaining--;
69606
+ this._result[i2] = entry;
69607
+ } else if (c2 === Promise$2) {
69608
+ var promise = new c2(noop2);
69609
+ handleMaybeThenable(promise, entry, _then);
69610
+ this._willSettleAt(promise, i2);
69611
+ } else {
69612
+ this._willSettleAt(new c2(function(resolve$$12) {
69613
+ return resolve$$12(entry);
69614
+ }), i2);
69615
+ }
69616
+ } else {
69617
+ this._willSettleAt(resolve$$1(entry), i2);
69618
+ }
69619
+ };
69620
+ Enumerator$1.prototype._settledAt = function(state, i2, value) {
69621
+ var promise = this.promise;
69622
+ if (promise._state === PENDING) {
69623
+ this._remaining--;
69624
+ if (state === REJECTED) {
69625
+ reject(promise, value);
69626
+ } else {
69627
+ this._result[i2] = value;
69628
+ }
69629
+ }
69630
+ if (this._remaining === 0) {
69631
+ fulfill(promise, this._result);
69632
+ }
69633
+ };
69634
+ Enumerator$1.prototype._willSettleAt = function(promise, i2) {
69635
+ var enumerator = this;
69636
+ subscribe(promise, void 0, function(value) {
69637
+ return enumerator._settledAt(FULFILLED, i2, value);
69638
+ }, function(reason) {
69639
+ return enumerator._settledAt(REJECTED, i2, reason);
69640
+ });
69641
+ };
69642
+ function all$1(entries) {
69643
+ return new Enumerator$1(this, entries).promise;
69644
+ }
69645
+ function race$1(entries) {
69646
+ var Constructor = this;
69647
+ if (!isArray2(entries)) {
69648
+ return new Constructor(function(_2, reject2) {
69649
+ return reject2(new TypeError("You must pass an array to race."));
69650
+ });
69651
+ } else {
69652
+ return new Constructor(function(resolve2, reject2) {
69653
+ var length = entries.length;
69654
+ for (var i2 = 0; i2 < length; i2++) {
69655
+ Constructor.resolve(entries[i2]).then(resolve2, reject2);
69656
+ }
69657
+ });
69658
+ }
69659
+ }
69660
+ function reject$1(reason) {
69661
+ var Constructor = this;
69662
+ var promise = new Constructor(noop2);
69663
+ reject(promise, reason);
69664
+ return promise;
69665
+ }
69666
+ function needsResolver() {
69667
+ throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");
69668
+ }
69669
+ function needsNew() {
69670
+ throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
69671
+ }
69672
+ function Promise$2(resolver) {
69673
+ this[PROMISE_ID] = nextId();
69674
+ this._result = this._state = void 0;
69675
+ this._subscribers = [];
69676
+ if (noop2 !== resolver) {
69677
+ typeof resolver !== "function" && needsResolver();
69678
+ this instanceof Promise$2 ? initializePromise(this, resolver) : needsNew();
69679
+ }
69680
+ }
69681
+ Promise$2.all = all$1;
69682
+ Promise$2.race = race$1;
69683
+ Promise$2.resolve = resolve$1;
69684
+ Promise$2.reject = reject$1;
69685
+ Promise$2._setScheduler = setScheduler;
69686
+ Promise$2._setAsap = setAsap;
69687
+ Promise$2._asap = asap;
69688
+ Promise$2.prototype = {
69689
+ constructor: Promise$2,
69690
+ /**
69691
+ The primary way of interacting with a promise is through its `then` method,
69692
+ which registers callbacks to receive either a promise's eventual value or the
69693
+ reason why the promise cannot be fulfilled.
69694
+
69695
+ ```js
69696
+ findUser().then(function(user){
69697
+ // user is available
69698
+ }, function(reason){
69699
+ // user is unavailable, and you are given the reason why
69700
+ });
69701
+ ```
69702
+
69703
+ Chaining
69704
+ --------
69705
+
69706
+ The return value of `then` is itself a promise. This second, 'downstream'
69707
+ promise is resolved with the return value of the first promise's fulfillment
69708
+ or rejection handler, or rejected if the handler throws an exception.
69709
+
69710
+ ```js
69711
+ findUser().then(function (user) {
69712
+ return user.name;
69713
+ }, function (reason) {
69714
+ return 'default name';
69715
+ }).then(function (userName) {
69716
+ // If `findUser` fulfilled, `userName` will be the user's name, otherwise it
69717
+ // will be `'default name'`
69718
+ });
69719
+
69720
+ findUser().then(function (user) {
69721
+ throw new Error('Found user, but still unhappy');
69722
+ }, function (reason) {
69723
+ throw new Error('`findUser` rejected and we're unhappy');
69724
+ }).then(function (value) {
69725
+ // never reached
69726
+ }, function (reason) {
69727
+ // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
69728
+ // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
69729
+ });
69730
+ ```
69731
+ If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
69732
+
69733
+ ```js
69734
+ findUser().then(function (user) {
69735
+ throw new PedagogicalException('Upstream error');
69736
+ }).then(function (value) {
69737
+ // never reached
69738
+ }).then(function (value) {
69739
+ // never reached
69740
+ }, function (reason) {
69741
+ // The `PedgagocialException` is propagated all the way down to here
69742
+ });
69743
+ ```
69744
+
69745
+ Assimilation
69746
+ ------------
69747
+
69748
+ Sometimes the value you want to propagate to a downstream promise can only be
69749
+ retrieved asynchronously. This can be achieved by returning a promise in the
69750
+ fulfillment or rejection handler. The downstream promise will then be pending
69751
+ until the returned promise is settled. This is called *assimilation*.
69752
+
69753
+ ```js
69754
+ findUser().then(function (user) {
69755
+ return findCommentsByAuthor(user);
69756
+ }).then(function (comments) {
69757
+ // The user's comments are now available
69758
+ });
69759
+ ```
69760
+
69761
+ If the assimliated promise rejects, then the downstream promise will also reject.
69762
+
69763
+ ```js
69764
+ findUser().then(function (user) {
69765
+ return findCommentsByAuthor(user);
69766
+ }).then(function (comments) {
69767
+ // If `findCommentsByAuthor` fulfills, we'll have the value here
69768
+ }, function (reason) {
69769
+ // If `findCommentsByAuthor` rejects, we'll have the reason here
69770
+ });
69771
+ ```
69772
+
69773
+ Simple Example
69774
+ --------------
69775
+
69776
+ Synchronous Example
69777
+
69778
+ ```javascript
69779
+ let result;
69780
+
69781
+ try {
69782
+ result = findResult();
69783
+ // success
69784
+ } catch(reason) {
69785
+ // failure
69786
+ }
69787
+ ```
69788
+
69789
+ Errback Example
69790
+
69791
+ ```js
69792
+ findResult(function(result, err){
69793
+ if (err) {
69794
+ // failure
69795
+ } else {
69796
+ // success
69797
+ }
69798
+ });
69799
+ ```
69800
+
69801
+ Promise Example;
69802
+
69803
+ ```javascript
69804
+ findResult().then(function(result){
69805
+ // success
69806
+ }, function(reason){
69807
+ // failure
69808
+ });
69809
+ ```
69810
+
69811
+ Advanced Example
69812
+ --------------
69813
+
69814
+ Synchronous Example
69815
+
69816
+ ```javascript
69817
+ let author, books;
69818
+
69819
+ try {
69820
+ author = findAuthor();
69821
+ books = findBooksByAuthor(author);
69822
+ // success
69823
+ } catch(reason) {
69824
+ // failure
69825
+ }
69826
+ ```
69827
+
69828
+ Errback Example
69829
+
69830
+ ```js
69831
+
69832
+ function foundBooks(books) {
69833
+
69834
+ }
69835
+
69836
+ function failure(reason) {
69837
+
69838
+ }
69839
+
69840
+ findAuthor(function(author, err){
69841
+ if (err) {
69842
+ failure(err);
69843
+ // failure
69844
+ } else {
69845
+ try {
69846
+ findBoooksByAuthor(author, function(books, err) {
69847
+ if (err) {
69848
+ failure(err);
69849
+ } else {
69850
+ try {
69851
+ foundBooks(books);
69852
+ } catch(reason) {
69853
+ failure(reason);
69854
+ }
69855
+ }
69856
+ });
69857
+ } catch(error) {
69858
+ failure(err);
69859
+ }
69860
+ // success
69861
+ }
69862
+ });
69863
+ ```
69864
+
69865
+ Promise Example;
69866
+
69867
+ ```javascript
69868
+ findAuthor().
69869
+ then(findBooksByAuthor).
69870
+ then(function(books){
69871
+ // found books
69872
+ }).catch(function(reason){
69873
+ // something went wrong
69874
+ });
69875
+ ```
69876
+
69877
+ @method then
69878
+ @param {Function} onFulfilled
69879
+ @param {Function} onRejected
69880
+ Useful for tooling.
69881
+ @return {Promise}
69882
+ */
69883
+ then,
69884
+ /**
69885
+ `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
69886
+ as the catch block of a try/catch statement.
69887
+
69888
+ ```js
69889
+ function findAuthor(){
69890
+ throw new Error('couldn't find that author');
69891
+ }
69892
+
69893
+ // synchronous
69894
+ try {
69895
+ findAuthor();
69896
+ } catch(reason) {
69897
+ // something went wrong
69898
+ }
69899
+
69900
+ // async with promises
69901
+ findAuthor().catch(function(reason){
69902
+ // something went wrong
69903
+ });
69904
+ ```
69905
+
69906
+ @method catch
69907
+ @param {Function} onRejection
69908
+ Useful for tooling.
69909
+ @return {Promise}
69910
+ */
69911
+ "catch": function _catch(onRejection) {
69912
+ return this.then(null, onRejection);
69913
+ }
69914
+ };
69915
+ function polyfill$1() {
69916
+ var local = void 0;
69917
+ if (typeof global2 !== "undefined") {
69918
+ local = global2;
69919
+ } else if (typeof self !== "undefined") {
69920
+ local = self;
69921
+ } else {
69922
+ try {
69923
+ local = Function("return this")();
69924
+ } catch (e2) {
69925
+ throw new Error("polyfill failed because global object is unavailable in this environment");
69926
+ }
69927
+ }
69928
+ var P2 = local.Promise;
69929
+ if (P2) {
69930
+ var promiseToString = null;
69931
+ try {
69932
+ promiseToString = Object.prototype.toString.call(P2.resolve());
69933
+ } catch (e2) {
69934
+ }
69935
+ if (promiseToString === "[object Promise]" && !P2.cast) {
69936
+ return;
69937
+ }
69938
+ }
69939
+ local.Promise = Promise$2;
69940
+ }
69941
+ Promise$2.polyfill = polyfill$1;
69942
+ Promise$2.Promise = Promise$2;
69943
+ return Promise$2;
69944
+ });
69945
+ }).call(exports2, __webpack_require__2(7), __webpack_require__2(8));
69946
+ },
69947
+ /* 5 */
69948
+ /***/
69949
+ function(module3, exports2) {
69950
+ },
69951
+ /* 6 */
69952
+ /***/
69953
+ function(module3, exports2, __webpack_require__2) {
69954
+ Object.defineProperty(exports2, "__esModule", {
69955
+ value: true
69956
+ });
69957
+ var _createClass2 = /* @__PURE__ */ function() {
69958
+ function defineProperties(target, props) {
69959
+ for (var i2 = 0; i2 < props.length; i2++) {
69960
+ var descriptor = props[i2];
69961
+ descriptor.enumerable = descriptor.enumerable || false;
69962
+ descriptor.configurable = true;
69963
+ if ("value" in descriptor) descriptor.writable = true;
69964
+ Object.defineProperty(target, descriptor.key, descriptor);
69965
+ }
69966
+ }
69967
+ return function(Constructor, protoProps, staticProps) {
69968
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
69969
+ if (staticProps) defineProperties(Constructor, staticProps);
69970
+ return Constructor;
69971
+ };
69972
+ }();
69973
+ __webpack_require__2(5);
69974
+ var _es6Promise = __webpack_require__2(4);
69975
+ var _es6Promise2 = _interopRequireDefault(_es6Promise);
69976
+ var _utils = __webpack_require__2(0);
69977
+ var Utils = _interopRequireWildcard(_utils);
69978
+ var _api = __webpack_require__2(1);
69979
+ var API = _interopRequireWildcard(_api);
69980
+ var _button = __webpack_require__2(2);
69981
+ var _push = __webpack_require__2(3);
69982
+ function _interopRequireWildcard(obj) {
69983
+ if (obj && obj.__esModule) {
69984
+ return obj;
69985
+ } else {
69986
+ var newObj = {};
69987
+ if (obj != null) {
69988
+ for (var key in obj) {
69989
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
69990
+ }
69991
+ }
69992
+ newObj.default = obj;
69993
+ return newObj;
69994
+ }
69995
+ }
69996
+ function _interopRequireDefault(obj) {
69997
+ return obj && obj.__esModule ? obj : { default: obj };
69998
+ }
69999
+ function _classCallCheck2(instance, Constructor) {
70000
+ if (!(instance instanceof Constructor)) {
70001
+ throw new TypeError("Cannot call a class as a function");
70002
+ }
70003
+ }
70004
+ var Noty2 = function() {
70005
+ function Noty3() {
70006
+ var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
70007
+ _classCallCheck2(this, Noty3);
70008
+ this.options = Utils.deepExtend({}, API.Defaults, options);
70009
+ if (API.Store[this.options.id]) {
70010
+ return API.Store[this.options.id];
70011
+ }
70012
+ this.id = this.options.id || Utils.generateID("bar");
70013
+ this.closeTimer = -1;
70014
+ this.barDom = null;
70015
+ this.layoutDom = null;
70016
+ this.progressDom = null;
70017
+ this.showing = false;
70018
+ this.shown = false;
70019
+ this.closed = false;
70020
+ this.closing = false;
70021
+ this.killable = this.options.timeout || this.options.closeWith.length > 0;
70022
+ this.hasSound = this.options.sounds.sources.length > 0;
70023
+ this.soundPlayed = false;
70024
+ this.listeners = {
70025
+ beforeShow: [],
70026
+ onShow: [],
70027
+ afterShow: [],
70028
+ onClose: [],
70029
+ afterClose: [],
70030
+ onClick: [],
70031
+ onHover: [],
70032
+ onTemplate: []
70033
+ };
70034
+ this.promises = {
70035
+ show: null,
70036
+ close: null
70037
+ };
70038
+ this.on("beforeShow", this.options.callbacks.beforeShow);
70039
+ this.on("onShow", this.options.callbacks.onShow);
70040
+ this.on("afterShow", this.options.callbacks.afterShow);
70041
+ this.on("onClose", this.options.callbacks.onClose);
70042
+ this.on("afterClose", this.options.callbacks.afterClose);
70043
+ this.on("onClick", this.options.callbacks.onClick);
70044
+ this.on("onHover", this.options.callbacks.onHover);
70045
+ this.on("onTemplate", this.options.callbacks.onTemplate);
70046
+ return this;
70047
+ }
70048
+ _createClass2(Noty3, [{
70049
+ key: "on",
70050
+ value: function on(eventName) {
70051
+ var cb = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() {
70052
+ };
70053
+ if (typeof cb === "function" && this.listeners.hasOwnProperty(eventName)) {
70054
+ this.listeners[eventName].push(cb);
70055
+ }
70056
+ return this;
70057
+ }
70058
+ /**
70059
+ * @return {Noty}
70060
+ */
70061
+ }, {
70062
+ key: "show",
70063
+ value: function show() {
70064
+ var _this = this;
70065
+ if (this.showing || this.shown) {
70066
+ return this;
70067
+ }
70068
+ if (this.options.killer === true) {
70069
+ Noty3.closeAll();
70070
+ } else if (typeof this.options.killer === "string") {
70071
+ Noty3.closeAll(this.options.killer);
70072
+ }
70073
+ var queueCounts = API.getQueueCounts(this.options.queue);
70074
+ if (queueCounts.current >= queueCounts.maxVisible || API.PageHidden && this.options.visibilityControl) {
70075
+ API.addToQueue(this);
70076
+ if (API.PageHidden && this.hasSound && Utils.inArray("docHidden", this.options.sounds.conditions)) {
70077
+ Utils.createAudioElements(this);
70078
+ }
70079
+ if (API.PageHidden && Utils.inArray("docHidden", this.options.titleCount.conditions)) {
70080
+ API.docTitle.increment();
70081
+ }
70082
+ return this;
70083
+ }
70084
+ API.Store[this.id] = this;
70085
+ API.fire(this, "beforeShow");
70086
+ this.showing = true;
70087
+ if (this.closing) {
70088
+ this.showing = false;
70089
+ return this;
70090
+ }
70091
+ API.build(this);
70092
+ API.handleModal(this);
70093
+ if (this.options.force) {
70094
+ this.layoutDom.insertBefore(this.barDom, this.layoutDom.firstChild);
70095
+ } else {
70096
+ this.layoutDom.appendChild(this.barDom);
70097
+ }
70098
+ if (this.hasSound && !this.soundPlayed && Utils.inArray("docVisible", this.options.sounds.conditions)) {
70099
+ Utils.createAudioElements(this);
70100
+ }
70101
+ if (Utils.inArray("docVisible", this.options.titleCount.conditions)) {
70102
+ API.docTitle.increment();
70103
+ }
70104
+ this.shown = true;
70105
+ this.closed = false;
70106
+ if (API.hasButtons(this)) {
70107
+ Object.keys(this.options.buttons).forEach(function(key) {
70108
+ var btn = _this.barDom.querySelector("#" + _this.options.buttons[key].id);
70109
+ Utils.addListener(btn, "click", function(e2) {
70110
+ Utils.stopPropagation(e2);
70111
+ _this.options.buttons[key].cb(_this);
70112
+ });
70113
+ });
70114
+ }
70115
+ this.progressDom = this.barDom.querySelector(".noty_progressbar");
70116
+ if (Utils.inArray("click", this.options.closeWith)) {
70117
+ Utils.addClass(this.barDom, "noty_close_with_click");
70118
+ Utils.addListener(this.barDom, "click", function(e2) {
70119
+ Utils.stopPropagation(e2);
70120
+ API.fire(_this, "onClick");
70121
+ _this.close();
70122
+ }, false);
70123
+ }
70124
+ Utils.addListener(this.barDom, "mouseenter", function() {
70125
+ API.fire(_this, "onHover");
70126
+ }, false);
70127
+ if (this.options.timeout) Utils.addClass(this.barDom, "noty_has_timeout");
70128
+ if (this.options.progressBar) {
70129
+ Utils.addClass(this.barDom, "noty_has_progressbar");
70130
+ }
70131
+ if (Utils.inArray("button", this.options.closeWith)) {
70132
+ Utils.addClass(this.barDom, "noty_close_with_button");
70133
+ var closeButton = document.createElement("div");
70134
+ Utils.addClass(closeButton, "noty_close_button");
70135
+ closeButton.innerHTML = "×";
70136
+ this.barDom.appendChild(closeButton);
70137
+ Utils.addListener(closeButton, "click", function(e2) {
70138
+ Utils.stopPropagation(e2);
70139
+ _this.close();
70140
+ }, false);
70141
+ }
70142
+ API.fire(this, "onShow");
70143
+ if (this.options.animation.open === null) {
70144
+ this.promises.show = new _es6Promise2.default(function(resolve) {
70145
+ resolve();
70146
+ });
70147
+ } else if (typeof this.options.animation.open === "function") {
70148
+ this.promises.show = new _es6Promise2.default(this.options.animation.open.bind(this));
70149
+ } else {
70150
+ Utils.addClass(this.barDom, this.options.animation.open);
70151
+ this.promises.show = new _es6Promise2.default(function(resolve) {
70152
+ Utils.addListener(_this.barDom, Utils.animationEndEvents, function() {
70153
+ Utils.removeClass(_this.barDom, _this.options.animation.open);
70154
+ resolve();
70155
+ });
70156
+ });
70157
+ }
70158
+ this.promises.show.then(function() {
70159
+ var _t = _this;
70160
+ setTimeout(function() {
70161
+ API.openFlow(_t);
70162
+ }, 100);
70163
+ });
70164
+ return this;
70165
+ }
70166
+ /**
70167
+ * @return {Noty}
70168
+ */
70169
+ }, {
70170
+ key: "stop",
70171
+ value: function stop() {
70172
+ API.dequeueClose(this);
70173
+ return this;
70174
+ }
70175
+ /**
70176
+ * @return {Noty}
70177
+ */
70178
+ }, {
70179
+ key: "resume",
70180
+ value: function resume() {
70181
+ API.queueClose(this);
70182
+ return this;
70183
+ }
70184
+ /**
70185
+ * @param {int|boolean} ms
70186
+ * @return {Noty}
70187
+ */
70188
+ }, {
70189
+ key: "setTimeout",
70190
+ value: function(_setTimeout) {
70191
+ function setTimeout2(_x) {
70192
+ return _setTimeout.apply(this, arguments);
70193
+ }
70194
+ setTimeout2.toString = function() {
70195
+ return _setTimeout.toString();
70196
+ };
70197
+ return setTimeout2;
70198
+ }(function(ms2) {
70199
+ this.stop();
70200
+ this.options.timeout = ms2;
70201
+ if (this.barDom) {
70202
+ if (this.options.timeout) {
70203
+ Utils.addClass(this.barDom, "noty_has_timeout");
70204
+ } else {
70205
+ Utils.removeClass(this.barDom, "noty_has_timeout");
70206
+ }
70207
+ var _t = this;
70208
+ setTimeout(function() {
70209
+ _t.resume();
70210
+ }, 100);
70211
+ }
70212
+ return this;
70213
+ })
70214
+ /**
70215
+ * @param {string} html
70216
+ * @param {boolean} optionsOverride
70217
+ * @return {Noty}
70218
+ */
70219
+ }, {
70220
+ key: "setText",
70221
+ value: function setText(html) {
70222
+ var optionsOverride = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
70223
+ if (this.barDom) {
70224
+ this.barDom.querySelector(".noty_body").innerHTML = html;
70225
+ }
70226
+ if (optionsOverride) this.options.text = html;
70227
+ return this;
70228
+ }
70229
+ /**
70230
+ * @param {string} type
70231
+ * @param {boolean} optionsOverride
70232
+ * @return {Noty}
70233
+ */
70234
+ }, {
70235
+ key: "setType",
70236
+ value: function setType(type) {
70237
+ var _this2 = this;
70238
+ var optionsOverride = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
70239
+ if (this.barDom) {
70240
+ var classList = Utils.classList(this.barDom).split(" ");
70241
+ classList.forEach(function(c2) {
70242
+ if (c2.substring(0, 11) === "noty_type__") {
70243
+ Utils.removeClass(_this2.barDom, c2);
70244
+ }
70245
+ });
70246
+ Utils.addClass(this.barDom, "noty_type__" + type);
70247
+ }
70248
+ if (optionsOverride) this.options.type = type;
70249
+ return this;
70250
+ }
70251
+ /**
70252
+ * @param {string} theme
70253
+ * @param {boolean} optionsOverride
70254
+ * @return {Noty}
70255
+ */
70256
+ }, {
70257
+ key: "setTheme",
70258
+ value: function setTheme(theme2) {
70259
+ var _this3 = this;
70260
+ var optionsOverride = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
70261
+ if (this.barDom) {
70262
+ var classList = Utils.classList(this.barDom).split(" ");
70263
+ classList.forEach(function(c2) {
70264
+ if (c2.substring(0, 12) === "noty_theme__") {
70265
+ Utils.removeClass(_this3.barDom, c2);
70266
+ }
70267
+ });
70268
+ Utils.addClass(this.barDom, "noty_theme__" + theme2);
70269
+ }
70270
+ if (optionsOverride) this.options.theme = theme2;
70271
+ return this;
70272
+ }
70273
+ /**
70274
+ * @return {Noty}
70275
+ */
70276
+ }, {
70277
+ key: "close",
70278
+ value: function close() {
70279
+ var _this4 = this;
70280
+ if (this.closed) return this;
70281
+ if (!this.shown) {
70282
+ API.removeFromQueue(this);
70283
+ return this;
70284
+ }
70285
+ API.fire(this, "onClose");
70286
+ this.closing = true;
70287
+ if (this.options.animation.close === null || this.options.animation.close === false) {
70288
+ this.promises.close = new _es6Promise2.default(function(resolve) {
70289
+ resolve();
70290
+ });
70291
+ } else if (typeof this.options.animation.close === "function") {
70292
+ this.promises.close = new _es6Promise2.default(this.options.animation.close.bind(this));
70293
+ } else {
70294
+ Utils.addClass(this.barDom, this.options.animation.close);
70295
+ this.promises.close = new _es6Promise2.default(function(resolve) {
70296
+ Utils.addListener(_this4.barDom, Utils.animationEndEvents, function() {
70297
+ if (_this4.options.force) {
70298
+ Utils.remove(_this4.barDom);
70299
+ } else {
70300
+ API.ghostFix(_this4);
70301
+ }
70302
+ resolve();
70303
+ });
70304
+ });
70305
+ }
70306
+ this.promises.close.then(function() {
70307
+ API.closeFlow(_this4);
70308
+ API.handleModalClose(_this4);
70309
+ });
70310
+ this.closed = true;
70311
+ return this;
70312
+ }
70313
+ // API functions
70314
+ /**
70315
+ * @param {boolean|string} queueName
70316
+ * @return {Noty}
70317
+ */
70318
+ }], [{
70319
+ key: "closeAll",
70320
+ value: function closeAll() {
70321
+ var queueName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
70322
+ Object.keys(API.Store).forEach(function(id) {
70323
+ if (queueName) {
70324
+ if (API.Store[id].options.queue === queueName && API.Store[id].killable) {
70325
+ API.Store[id].close();
70326
+ }
70327
+ } else if (API.Store[id].killable) {
70328
+ API.Store[id].close();
70329
+ }
70330
+ });
70331
+ return this;
70332
+ }
70333
+ /**
70334
+ * @param {string} queueName
70335
+ * @return {Noty}
70336
+ */
70337
+ }, {
70338
+ key: "clearQueue",
70339
+ value: function clearQueue() {
70340
+ var queueName = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "global";
70341
+ if (API.Queues.hasOwnProperty(queueName)) {
70342
+ API.Queues[queueName].queue = [];
70343
+ }
70344
+ return this;
70345
+ }
70346
+ /**
70347
+ * @return {API.Queues}
70348
+ */
70349
+ }, {
70350
+ key: "overrideDefaults",
70351
+ /**
70352
+ * @param {Object} obj
70353
+ * @return {Noty}
70354
+ */
70355
+ value: function overrideDefaults(obj) {
70356
+ API.Defaults = Utils.deepExtend({}, API.Defaults, obj);
70357
+ return this;
70358
+ }
70359
+ /**
70360
+ * @param {int} amount
70361
+ * @param {string} queueName
70362
+ * @return {Noty}
70363
+ */
70364
+ }, {
70365
+ key: "setMaxVisible",
70366
+ value: function setMaxVisible() {
70367
+ var amount = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : API.DefaultMaxVisible;
70368
+ var queueName = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "global";
70369
+ if (!API.Queues.hasOwnProperty(queueName)) {
70370
+ API.Queues[queueName] = { maxVisible: amount, queue: [] };
70371
+ }
70372
+ API.Queues[queueName].maxVisible = amount;
70373
+ return this;
70374
+ }
70375
+ /**
70376
+ * @param {string} innerHtml
70377
+ * @param {String} classes
70378
+ * @param {Function} cb
70379
+ * @param {Object} attributes
70380
+ * @return {NotyButton}
70381
+ */
70382
+ }, {
70383
+ key: "button",
70384
+ value: function button(innerHtml) {
70385
+ var classes2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
70386
+ var cb = arguments[2];
70387
+ var attributes = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
70388
+ return new _button.NotyButton(innerHtml, classes2, cb, attributes);
70389
+ }
70390
+ /**
70391
+ * @return {string}
70392
+ */
70393
+ }, {
70394
+ key: "version",
70395
+ value: function version2() {
70396
+ return "3.2.0-beta";
70397
+ }
70398
+ /**
70399
+ * @param {String} workerPath
70400
+ * @return {Push}
70401
+ */
70402
+ }, {
70403
+ key: "Push",
70404
+ value: function Push(workerPath) {
70405
+ return new _push.Push(workerPath);
70406
+ }
70407
+ }, {
70408
+ key: "Queues",
70409
+ get: function get3() {
70410
+ return API.Queues;
70411
+ }
70412
+ /**
70413
+ * @return {API.PageHidden}
70414
+ */
70415
+ }, {
70416
+ key: "PageHidden",
70417
+ get: function get3() {
70418
+ return API.PageHidden;
70419
+ }
70420
+ }]);
70421
+ return Noty3;
70422
+ }();
70423
+ exports2.default = Noty2;
70424
+ if (typeof window !== "undefined") {
70425
+ Utils.visibilityChangeFlow();
70426
+ }
70427
+ module3.exports = exports2["default"];
70428
+ },
70429
+ /* 7 */
70430
+ /***/
70431
+ function(module3, exports2) {
70432
+ var process2 = module3.exports = {};
70433
+ var cachedSetTimeout;
70434
+ var cachedClearTimeout;
70435
+ function defaultSetTimout() {
70436
+ throw new Error("setTimeout has not been defined");
70437
+ }
70438
+ function defaultClearTimeout() {
70439
+ throw new Error("clearTimeout has not been defined");
70440
+ }
70441
+ (function() {
70442
+ try {
70443
+ if (typeof setTimeout === "function") {
70444
+ cachedSetTimeout = setTimeout;
70445
+ } else {
70446
+ cachedSetTimeout = defaultSetTimout;
70447
+ }
70448
+ } catch (e2) {
70449
+ cachedSetTimeout = defaultSetTimout;
70450
+ }
70451
+ try {
70452
+ if (typeof clearTimeout === "function") {
70453
+ cachedClearTimeout = clearTimeout;
70454
+ } else {
70455
+ cachedClearTimeout = defaultClearTimeout;
70456
+ }
70457
+ } catch (e2) {
70458
+ cachedClearTimeout = defaultClearTimeout;
70459
+ }
70460
+ })();
70461
+ function runTimeout(fun) {
70462
+ if (cachedSetTimeout === setTimeout) {
70463
+ return setTimeout(fun, 0);
70464
+ }
70465
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
70466
+ cachedSetTimeout = setTimeout;
70467
+ return setTimeout(fun, 0);
70468
+ }
70469
+ try {
70470
+ return cachedSetTimeout(fun, 0);
70471
+ } catch (e2) {
70472
+ try {
70473
+ return cachedSetTimeout.call(null, fun, 0);
70474
+ } catch (e3) {
70475
+ return cachedSetTimeout.call(this, fun, 0);
70476
+ }
70477
+ }
70478
+ }
70479
+ function runClearTimeout(marker) {
70480
+ if (cachedClearTimeout === clearTimeout) {
70481
+ return clearTimeout(marker);
70482
+ }
70483
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
70484
+ cachedClearTimeout = clearTimeout;
70485
+ return clearTimeout(marker);
70486
+ }
70487
+ try {
70488
+ return cachedClearTimeout(marker);
70489
+ } catch (e2) {
70490
+ try {
70491
+ return cachedClearTimeout.call(null, marker);
70492
+ } catch (e3) {
70493
+ return cachedClearTimeout.call(this, marker);
70494
+ }
70495
+ }
70496
+ }
70497
+ var queue = [];
70498
+ var draining = false;
70499
+ var currentQueue;
70500
+ var queueIndex = -1;
70501
+ function cleanUpNextTick() {
70502
+ if (!draining || !currentQueue) {
70503
+ return;
70504
+ }
70505
+ draining = false;
70506
+ if (currentQueue.length) {
70507
+ queue = currentQueue.concat(queue);
70508
+ } else {
70509
+ queueIndex = -1;
70510
+ }
70511
+ if (queue.length) {
70512
+ drainQueue();
70513
+ }
70514
+ }
70515
+ function drainQueue() {
70516
+ if (draining) {
70517
+ return;
70518
+ }
70519
+ var timeout = runTimeout(cleanUpNextTick);
70520
+ draining = true;
70521
+ var len = queue.length;
70522
+ while (len) {
70523
+ currentQueue = queue;
70524
+ queue = [];
70525
+ while (++queueIndex < len) {
70526
+ if (currentQueue) {
70527
+ currentQueue[queueIndex].run();
70528
+ }
70529
+ }
70530
+ queueIndex = -1;
70531
+ len = queue.length;
70532
+ }
70533
+ currentQueue = null;
70534
+ draining = false;
70535
+ runClearTimeout(timeout);
70536
+ }
70537
+ process2.nextTick = function(fun) {
70538
+ var args = new Array(arguments.length - 1);
70539
+ if (arguments.length > 1) {
70540
+ for (var i2 = 1; i2 < arguments.length; i2++) {
70541
+ args[i2 - 1] = arguments[i2];
70542
+ }
70543
+ }
70544
+ queue.push(new Item(fun, args));
70545
+ if (queue.length === 1 && !draining) {
70546
+ runTimeout(drainQueue);
70547
+ }
70548
+ };
70549
+ function Item(fun, array) {
70550
+ this.fun = fun;
70551
+ this.array = array;
70552
+ }
70553
+ Item.prototype.run = function() {
70554
+ this.fun.apply(null, this.array);
70555
+ };
70556
+ process2.title = "browser";
70557
+ process2.browser = true;
70558
+ process2.env = {};
70559
+ process2.argv = [];
70560
+ process2.version = "";
70561
+ process2.versions = {};
70562
+ function noop2() {
70563
+ }
70564
+ process2.on = noop2;
70565
+ process2.addListener = noop2;
70566
+ process2.once = noop2;
70567
+ process2.off = noop2;
70568
+ process2.removeListener = noop2;
70569
+ process2.removeAllListeners = noop2;
70570
+ process2.emit = noop2;
70571
+ process2.prependListener = noop2;
70572
+ process2.prependOnceListener = noop2;
70573
+ process2.listeners = function(name) {
70574
+ return [];
70575
+ };
70576
+ process2.binding = function(name) {
70577
+ throw new Error("process.binding is not supported");
70578
+ };
70579
+ process2.cwd = function() {
70580
+ return "/";
70581
+ };
70582
+ process2.chdir = function(dir) {
70583
+ throw new Error("process.chdir is not supported");
70584
+ };
70585
+ process2.umask = function() {
70586
+ return 0;
70587
+ };
70588
+ },
70589
+ /* 8 */
70590
+ /***/
70591
+ function(module3, exports2) {
70592
+ var g2;
70593
+ g2 = /* @__PURE__ */ function() {
70594
+ return this;
70595
+ }();
70596
+ try {
70597
+ g2 = g2 || Function("return this")() || (1, eval)("this");
70598
+ } catch (e2) {
70599
+ if (typeof window === "object")
70600
+ g2 = window;
70601
+ }
70602
+ module3.exports = g2;
70603
+ },
70604
+ /* 9 */
70605
+ /***/
70606
+ function(module3, exports2) {
70607
+ }
70608
+ /******/
70609
+ ])
69314
70610
  );
69315
- const handleLayoutClick = () => {
69316
- this.callbacks.onClick?.();
69317
- if (this.closeWith.includes("click")) {
69318
- toast.dismiss(toastId);
69319
- }
69320
- };
69321
- const handleCloseButtonClick = (e2) => {
69322
- e2.stopPropagation();
69323
- toast.dismiss(toastId);
69324
- };
69325
- const handleButtonClick = (btn) => () => btn.onClick(this);
69326
- return /* @__PURE__ */ jsxs("div", { className: classes2, onMouseEnter: this.callbacks.onHover, onClick: handleLayoutClick, children: [
69327
- this.closeWith.includes("button") && /* @__PURE__ */ jsx("div", { className: "noty_close_button", onClick: handleCloseButtonClick, children: "×" }),
69328
- /* @__PURE__ */ jsx("div", { className: "noty_body", children: this.text }),
69329
- this.options.buttons?.length ? /* @__PURE__ */ jsx("div", { className: "noty_buttons", children: this.options.buttons.map((btn, idx) => /* @__PURE__ */ jsx("button", { className: classNames("noty_btn", btn.className), "data-testid": btn.dataTestId, onClick: handleButtonClick(btn), children: btn.text }, idx)) }) : null,
69330
- this.showProgress() && /* @__PURE__ */ jsx("div", { className: "noty_progressbar", style: { animationDuration: `${this.timeout}ms` } })
69331
- ] });
69332
- };
69333
- const mergedOptions = {
69334
- ..._PopupNotification.getDefaultOptions(),
69335
- ...options
69336
- };
69337
- this.options = mergedOptions;
69338
- this.text = mergedOptions.text;
69339
- this.type = mergedOptions.type;
69340
- this.timeout = mergedOptions.timeout;
69341
- this.callbacks = mergedOptions.callbacks ?? {};
69342
- this.closeWith = mergedOptions.closeWith ?? ["click"];
69343
- }
69344
- static getDefaultOptions() {
69345
- return {
69346
- type: "alert",
69347
- layout: "bottomRight",
69348
- timeout: 15e3,
69349
- theme: "dv"
69350
- };
69351
- }
69352
- static create(options, show = true) {
69353
- const popup = new _PopupNotification(options);
69354
- if (show) {
69355
- popup.show();
69356
- }
69357
- return popup;
69358
- }
69359
- static ensureToaster() {
69360
- if (document.getElementById(this.containerId)) return;
69361
- const container = document.createElement("div");
69362
- container.id = this.containerId;
69363
- document.body.appendChild(container);
69364
- ReactDOM__default.render(
69365
- /* @__PURE__ */ jsx(Toaster, { expand: true, closeButton: false, richColors: false, visibleToasts: 5 }),
69366
- container
69367
- );
69368
- }
69369
- getDuration() {
69370
- return this.timeout === false || this.timeout === 0 ? Infinity : this.timeout;
69371
- }
69372
- showProgress() {
69373
- return typeof this.timeout === "number" && this.timeout > 0;
69374
- }
69375
- getLayoutClass() {
69376
- return `noty_layout__${this.options.layout}`;
69377
- }
69378
- show() {
69379
- this.callbacks.beforeShow?.();
69380
- if (this.options.killer) {
69381
- toast.dismiss();
69382
- }
69383
- const toastOptions = {
69384
- duration: this.getDuration(),
69385
- position: _PopupNotification.mapLayout(this.options.layout)
69386
- };
69387
- this.toastId = toast.custom(this.renderToast, {
69388
- ...toastOptions,
69389
- onDismiss: () => {
69390
- this.callbacks.onClose?.();
69391
- this.callbacks.afterClose?.();
69392
- },
69393
- onAutoClose: () => {
69394
- this.callbacks.onClose?.();
69395
- this.callbacks.afterClose?.();
69396
- }
69397
- });
69398
- this.callbacks.onShow?.();
69399
- requestAnimationFrame(() => {
69400
- this.callbacks.afterShow?.();
69401
- });
69402
- }
69403
- update() {
69404
- if (this.toastId === void 0) return;
69405
- toast.custom(this.renderToast, {
69406
- id: this.toastId,
69407
- duration: this.getDuration()
69408
70611
  });
69409
- }
69410
- close() {
69411
- if (this.toastId !== void 0) {
69412
- toast.dismiss(this.toastId);
69413
- }
69414
- }
69415
- setText(text) {
69416
- this.text = text;
69417
- this.update();
69418
- }
69419
- setType(type) {
69420
- this.type = type;
69421
- this.update();
69422
- }
69423
- setTimeout(timeout) {
69424
- this.timeout = timeout;
69425
- this.update();
69426
- }
69427
- on(event, handler) {
69428
- this.callbacks[event] = handler;
69429
- }
69430
- static closeAll() {
69431
- toast.dismiss();
69432
- }
69433
- static mapLayout(layout) {
69434
- const map2 = {
69435
- topLeft: "top-left",
69436
- topCenter: "top-center",
69437
- topRight: "top-right",
69438
- bottomLeft: "bottom-left",
69439
- bottomCenter: "bottom-center",
69440
- bottomRight: "bottom-right"
69441
- };
69442
- return map2[layout ?? "bottomRight"];
69443
- }
70612
+ })(noty$1);
70613
+ return noty$1.exports;
70614
+ }
70615
+ var notyExports = requireNoty();
70616
+ const Noty = /* @__PURE__ */ getDefaultExportFromCjs(notyExports);
70617
+ const showNote = (options) => {
70618
+ const buttons = options.buttonsProps?.map(({ text, onClick, className, dataTestId }) => Noty.button(text, className, onClick, { "data-test-id": dataTestId })) || [];
70619
+ const defaultOptions2 = {
70620
+ type: "info",
70621
+ layout: "bottomRight",
70622
+ timeout: 15e3,
70623
+ closeWith: ["click"],
70624
+ theme: "dv"
70625
+ };
70626
+ const note = new Noty({ ...defaultOptions2, ...options, buttons: [...buttons, ...options.buttons ?? []] });
70627
+ note.show();
70628
+ return note;
70629
+ };
70630
+ const hideNote = (note) => {
70631
+ if (!note) return;
70632
+ note.close();
69444
70633
  };
69445
- _PopupNotification.containerId = "popup-notification-toaster";
69446
- let PopupNotification = _PopupNotification;
69447
70634
  function TextMessage(props) {
69448
70635
  const { content, wrapperClassName, footer, footerClassName, header, headerClassName, contentClassName } = props;
69449
70636
  const textContent = getTextContent(content, contentClassName);
@@ -69498,10 +70685,10 @@ class SettingsPageLogic extends ComponentLogic {
69498
70685
  if (isLocalScope && (!isCurrentPage || !isCurrentService)) return;
69499
70686
  const buttonsProps = isCurrentService ? [{ text: resources.RefreshPage, onClick: () => location.reload(), dataTestId: "reload-button" }] : [];
69500
70687
  const notyType = notification.status === ILongOperationCompleteStatus.Success ? "info" : "error";
69501
- const note = PopupNotification.create({ type: notyType, timeout: 0, text: notification.message, buttons: buttonsProps });
70688
+ const note = showNote({ type: notyType, timeout: 0, text: notification.message, buttonsProps });
69502
70689
  const router = routingService.getInternalRouterInstance();
69503
70690
  const cleanUpLeaveHook = router.addLeaveHook(route?.path, (done) => {
69504
- note.close();
70691
+ hideNote(note);
69505
70692
  done();
69506
70693
  cleanUpLeaveHook();
69507
70694
  });
@@ -69776,7 +70963,7 @@ function SettingsPage(props) {
69776
70963
  className: classNames("setting-page__scroll-element", classIf(readOnly, "setting-page__readonly-layout")),
69777
70964
  ref: onScrollElementSet,
69778
70965
  children: /* @__PURE__ */ jsx(CustomFormProvider, { ...methods, children: /* @__PURE__ */ jsx("form", { className: "settings-page", ref: formRef, children: pageData?.elements?.map((data) => {
69779
- const Component2 = data.error ? ErrorEditor : editorFactory.get(data.editorType);
70966
+ const Component2 = data.error && data.errorType === ElementErrorType.Internal ? ErrorEditor : editorFactory.get(data.editorType);
69780
70967
  return /* @__PURE__ */ jsx(Component2, { ...data, services, formMethods: methods }, data.id);
69781
70968
  }) }, serviceId) })
69782
70969
  }
@@ -70082,6 +71269,7 @@ const ICON_COLOR = "#607d8b";
70082
71269
  function ServerList(props) {
70083
71270
  const { services, servers, selectServer, reloadServerList, selectedServerId, loading } = props;
70084
71271
  const [expanded, setExpanded] = useState(true);
71272
+ const router = services.routingService.getInternalRouterInstance();
70085
71273
  return /* @__PURE__ */ jsxs("div", { className: "server-list", "data-testid": "server-list", children: [
70086
71274
  /* @__PURE__ */ jsxs("div", { className: "server-list__title", children: [
70087
71275
  /* @__PURE__ */ jsxs(Typography$3, { variant: "h5", className: "server-list__title__text", children: [
@@ -70096,23 +71284,30 @@ function ServerList(props) {
70096
71284
  expanded,
70097
71285
  selectServer,
70098
71286
  selectedServerId,
70099
- server
71287
+ server,
71288
+ generateLink: router.generate
70100
71289
  },
70101
71290
  server.id
70102
71291
  ))
70103
71292
  ] });
70104
71293
  }
70105
71294
  function ServerListItem(props) {
70106
- const { expanded, server, selectedServerId, selectServer } = props;
71295
+ const { expanded, server, selectedServerId, selectServer, generateLink } = props;
70107
71296
  const titleRef = React__default.useRef(null);
70108
71297
  const showTooltip = titleRef.current?.scrollWidth > titleRef.current?.offsetWidth;
71298
+ const link = getHashLink(generateLink(SERVER_PAGE_ROUTE_PATH, { serverId: server.id }, { includeRoot: false }));
71299
+ const handleSelectServer = (event) => {
71300
+ event.preventDefault();
71301
+ selectServer(server);
71302
+ };
70109
71303
  return /* @__PURE__ */ jsxs("div", { className: classIf(!expanded, "hide") + "server-list__item", "data-testid": `server-list-item-${server.id}`, children: [
70110
71304
  /* @__PURE__ */ jsx(ListItemMarker, {}),
70111
71305
  /* @__PURE__ */ jsx(LightTooltip, { placement: "top-start", title: server.name, disableHoverListener: !showTooltip, children: /* @__PURE__ */ jsx(
70112
- "div",
71306
+ "a",
70113
71307
  {
71308
+ href: link,
70114
71309
  className: "server-list__item-content" + classIf(selectedServerId === server.id, "selected"),
70115
- onClick: () => selectServer(server),
71310
+ onClick: handleSelectServer,
70116
71311
  "data-testid": `server-list-item-title-${server.id}`,
70117
71312
  children: /* @__PURE__ */ jsx(Typography$3, { ref: titleRef, overflow: "hidden", textOverflow: "ellipsis", variant: "body2", component: "span", children: server.name })
70118
71313
  }
@@ -70633,7 +71828,7 @@ class ImportSettingsLogic extends ComponentLogic {
70633
71828
  }
70634
71829
  function WarningBanner(props) {
70635
71830
  return /* @__PURE__ */ jsxs("div", { className: "warning-banner", children: [
70636
- /* @__PURE__ */ jsx(WarningIcon$1, { className: "warning-banner__warning-icon", fontSize: "large" }),
71831
+ /* @__PURE__ */ jsx(WarningIcon, { className: "warning-banner__warning-icon", fontSize: "large" }),
70637
71832
  /* @__PURE__ */ jsx(Typography$3, { variant: "caption", children: props.services.resources.Attention + " " + props.text })
70638
71833
  ] });
70639
71834
  }
@@ -70659,7 +71854,7 @@ function ImportSettingsDialog(props) {
70659
71854
  await services.messageWindow.showConfirmation(
70660
71855
  formatString$1(resources.ImportSettingsConfirmationWithDateMessage, dateStr),
70661
71856
  {
70662
- modalIcon: /* @__PURE__ */ jsx(WarningIcon$1, { className: "import-settings-dialog__warning-icon", fontSize: "small" }),
71857
+ modalIcon: /* @__PURE__ */ jsx(WarningIcon, { className: "import-settings-dialog__warning-icon", fontSize: "small" }),
70663
71858
  customCaptionText: services.resources.Attention,
70664
71859
  color: theme.palette.warning.main
70665
71860
  }
@@ -70668,14 +71863,14 @@ function ImportSettingsDialog(props) {
70668
71863
  await services.messageWindow.showConfirmation(
70669
71864
  resources.ImportSettingsConfirmationMessage,
70670
71865
  {
70671
- modalIcon: /* @__PURE__ */ jsx(WarningIcon$1, { className: "import-settings-dialog__warning-icon", fontSize: "small" }),
71866
+ modalIcon: /* @__PURE__ */ jsx(WarningIcon, { className: "import-settings-dialog__warning-icon", fontSize: "small" }),
70672
71867
  customCaptionText: services.resources.Attention,
70673
71868
  color: theme.palette.warning.main
70674
71869
  }
70675
71870
  );
70676
71871
  }
70677
71872
  await logic.copyFx({ targetServiceId: serviceId, sourceServiceId: selectedPeer.id });
70678
- PopupNotification.create({ timeout: 3e3, text: formatString$1(resources.ImportSettingsCompletedMessage, selectedPeer.serverName, serverName) });
71873
+ showNote({ timeout: 3e3, text: formatString$1(resources.ImportSettingsCompletedMessage, selectedPeer.serverName, serverName) });
70679
71874
  onClose();
70680
71875
  };
70681
71876
  return /* @__PURE__ */ jsx(ThemeProvider$1, { theme, children: /* @__PURE__ */ jsxs(
@@ -70696,7 +71891,7 @@ function ImportSettingsDialog(props) {
70696
71891
  children: [
70697
71892
  /* @__PURE__ */ jsxs(DialogTitle, { variant: "h6", className: "import-settings-dialog__title", children: [
70698
71893
  resources.ImportSettings,
70699
- /* @__PURE__ */ jsx(IconButton$3, { "aria-label": "close", onClick: onClose, children: /* @__PURE__ */ jsx(CloseIcon$1, {}) })
71894
+ /* @__PURE__ */ jsx(IconButton$3, { "aria-label": "close", onClick: onClose, children: /* @__PURE__ */ jsx(CloseIcon, {}) })
70700
71895
  ] }),
70701
71896
  /* @__PURE__ */ jsxs(DialogContent$2, { className: "import-settings-dialog__content", children: [
70702
71897
  /* @__PURE__ */ jsx(Typography$3, { variant: "subtitle2", color: "inherit", children: resources.SelectImportSettingsFrom }),
@@ -70753,6 +71948,7 @@ function ComponentMenu(props) {
70753
71948
  const [anchorEl, setAnchorEl] = useState(null);
70754
71949
  const open = Boolean(anchorEl);
70755
71950
  const handleMenuButtonClick = (event) => {
71951
+ event.preventDefault();
70756
71952
  event.stopPropagation();
70757
71953
  setAnchorEl(event.currentTarget);
70758
71954
  };
@@ -70771,7 +71967,7 @@ function ComponentMenu(props) {
70771
71967
  formatString$1(services.resources.ConfirmDeleteService, component.serviceName),
70772
71968
  {
70773
71969
  customButtonOkText: services.resources.Delete,
70774
- modalIcon: /* @__PURE__ */ jsx(WarningIcon$1, { className: "component-menu__warning-icon", fontSize: "medium" }),
71970
+ modalIcon: /* @__PURE__ */ jsx(WarningIcon, { className: "component-menu__warning-icon", fontSize: "medium" }),
70775
71971
  customCaptionText: services.resources.Attention,
70776
71972
  color: theme.palette.warning.main
70777
71973
  }
@@ -70843,23 +72039,46 @@ function ComponentMenu(props) {
70843
72039
  }
70844
72040
  function ComponentList(props) {
70845
72041
  const { components, serverName, services, onComponentClick, onDeleteClick } = props;
72042
+ const handleComponentClick = (component) => (event) => {
72043
+ event.preventDefault();
72044
+ onComponentClick(component);
72045
+ };
72046
+ const getComponentLink = (component) => {
72047
+ const { data } = services.routingService.getLastRouteResolvedParams() || {};
72048
+ const link = services.settingsNavigation.getSettingsPageUrl(
72049
+ data.serverId,
72050
+ component.serviceId,
72051
+ component.configurationLayoutId,
72052
+ component.serviceName
72053
+ );
72054
+ return getHashLink(link);
72055
+ };
70846
72056
  return /* @__PURE__ */ jsxs("div", { className: "component-list", children: [
70847
72057
  /* @__PURE__ */ jsx("div", { className: "component-list__title", children: services.resources.Components }),
70848
72058
  components.map((component) => {
70849
- return /* @__PURE__ */ jsxs("div", { className: "component-list__item", onClick: () => onComponentClick(component), children: [
70850
- /* @__PURE__ */ jsx(ComponentIcon, { color: ICON_COLOR }),
70851
- /* @__PURE__ */ jsx(Typography$3, { className: "component-list__item__content", children: component.serviceName }),
70852
- /* @__PURE__ */ jsx(
70853
- ComponentMenu,
70854
- {
70855
- services,
70856
- serverName,
70857
- component,
70858
- onDeleteClick
70859
- }
70860
- ),
70861
- /* @__PURE__ */ jsx(ExpandMoreIcon, { color: ICON_COLOR })
70862
- ] }, component.serviceId);
72059
+ return /* @__PURE__ */ jsxs(
72060
+ "a",
72061
+ {
72062
+ className: "component-list__item",
72063
+ onClick: handleComponentClick(component),
72064
+ href: getComponentLink(component),
72065
+ children: [
72066
+ /* @__PURE__ */ jsx(ComponentIcon, { color: ICON_COLOR }),
72067
+ /* @__PURE__ */ jsx(Typography$3, { className: "component-list__item__content", children: component.serviceName }),
72068
+ /* @__PURE__ */ jsx(
72069
+ ComponentMenu,
72070
+ {
72071
+ services,
72072
+ serverName,
72073
+ component,
72074
+ onDeleteClick
72075
+ }
72076
+ ),
72077
+ /* @__PURE__ */ jsx(ExpandMoreIcon, { color: ICON_COLOR })
72078
+ ]
72079
+ },
72080
+ component.serviceId
72081
+ );
70863
72082
  })
70864
72083
  ] });
70865
72084
  }
@@ -71299,7 +72518,12 @@ class ExtendedConfigurationLogic extends ComponentLogic {
71299
72518
  });
71300
72519
  });
71301
72520
  this.onSave.use(async (params) => {
71302
- await this.options.services.extendedConfigurationController.saveConfiguration(this.options.serviceId, params);
72521
+ const { serviceId, services: { messageWindow, settingsNavigation, extendedConfigurationController, resources } } = this.options;
72522
+ await messageWindow.showConfirmation(formatString$1(
72523
+ resources.ExtendedConfigurationConfirmation,
72524
+ settingsNavigation.resolveServiceName(void 0, serviceId)
72525
+ ));
72526
+ await extendedConfigurationController.saveConfiguration(serviceId, params);
71303
72527
  });
71304
72528
  v$2({
71305
72529
  clock: this.onSave.doneData,
@@ -103989,6 +105213,7 @@ function ExtendedConfiguration(props) {
103989
105213
  const logic = useLogic(props, ExtendedConfigurationLogic);
103990
105214
  const filteredRows = e(logic.$filteredRows);
103991
105215
  const rows = e(logic.$rows);
105216
+ const initialRows = e(logic.$initialRows);
103992
105217
  const breadcrumbsItems = settingsNavigation.getBreadcrumbsItems();
103993
105218
  const changes = e(logic.$changes);
103994
105219
  const pathSet = e(logic.$uniquePathList);
@@ -104050,6 +105275,9 @@ function ExtendedConfiguration(props) {
104050
105275
  return row;
104051
105276
  };
104052
105277
  function NoRowsOverlay({ resources: resources2 }) {
105278
+ if (!initialRows) {
105279
+ return null;
105280
+ }
104053
105281
  return /* @__PURE__ */ jsx("div", { className: "extended-configuration__empty-message", children: !rows?.length ? resources2.NoSettingsMessage : resources2.NothingFoundMessage });
104054
105282
  }
104055
105283
  return /* @__PURE__ */ jsxs("div", { className: "extended-configuration__wrapper", children: [
@@ -107353,6 +108581,12 @@ var SavePageStatus = /* @__PURE__ */ ((SavePageStatus2) => {
107353
108581
  SavePageStatus2[SavePageStatus2["Error"] = 1] = "Error";
107354
108582
  return SavePageStatus2;
107355
108583
  })(SavePageStatus || {});
108584
+ var ElementErrorType = /* @__PURE__ */ ((ElementErrorType2) => {
108585
+ ElementErrorType2[ElementErrorType2["Internal"] = 0] = "Internal";
108586
+ ElementErrorType2[ElementErrorType2["StorageRead"] = 1] = "StorageRead";
108587
+ ElementErrorType2[ElementErrorType2["StorageWrite"] = 2] = "StorageWrite";
108588
+ return ElementErrorType2;
108589
+ })(ElementErrorType || {});
107356
108590
  const generateUrl = (model) => {
107357
108591
  const { typeId, connectionId, connectionName, periodId, beginDate: beginDate2, endDate: endDate2, cardId, messageCardId, messageId, breadcrumbsItems, source, database } = model;
107358
108592
  const urlParams = [
@@ -107440,7 +108674,7 @@ function CheckBox(props) {
107440
108674
  ] });
107441
108675
  }
107442
108676
  function TextBox(props) {
107443
- const { required, id: fieldName, value = "", parameters } = props;
108677
+ const { required, id: fieldName, value = "", parameters, error: editorError } = props;
107444
108678
  const validationPatternRegExp = RegExp(parameters?.pattern, "g");
107445
108679
  const services = useContext(ServicesContext);
107446
108680
  const { resetField, control } = useCustomFormContext();
@@ -107457,6 +108691,7 @@ function TextBox(props) {
107457
108691
  defaultValue: value
107458
108692
  });
107459
108693
  return /* @__PURE__ */ jsxs(EditorContainer, { isChanged: isDirty, resetValue: () => resetField(fieldName, { defaultValue: value }), ...props, children: [
108694
+ editorError && /* @__PURE__ */ jsx(ErrorMessage, { message: editorError }),
107460
108695
  /* @__PURE__ */ jsx(TextField$3, { variant: "outlined", size: "small", fullWidth: true, ...field, slotProps: { htmlInput: { "data-testid": "text-input" } }, className: "textbox" }),
107461
108696
  error && /* @__PURE__ */ jsx(ErrorMessage, { message: error.message })
107462
108697
  ] });
@@ -109076,7 +110311,7 @@ function Subgroup(props) {
109076
110311
  return /* @__PURE__ */ jsx(SectionContentWrapper, { ...props, className: "subgroup" });
109077
110312
  }
109078
110313
  function TextArea(props) {
109079
- const { required, id: fieldName, value = "" } = props;
110314
+ const { required, id: fieldName, value = "", error: editorError } = props;
109080
110315
  const services = useContext(ServicesContext);
109081
110316
  const { resetField, control } = useCustomFormContext();
109082
110317
  const {
@@ -109096,6 +110331,7 @@ function TextArea(props) {
109096
110331
  resetValue: () => resetField(fieldName, { defaultValue: value }),
109097
110332
  ...props,
109098
110333
  children: [
110334
+ editorError && /* @__PURE__ */ jsx(ErrorMessage, { message: editorError }),
109099
110335
  /* @__PURE__ */ jsx(
109100
110336
  TextField$3,
109101
110337
  {
@@ -109162,7 +110398,7 @@ function RadioButton(props) {
109162
110398
  );
109163
110399
  }
109164
110400
  function Password(props) {
109165
- const { required, id: fieldName, value } = props;
110401
+ const { required, id: fieldName, value, error: editorError } = props;
109166
110402
  const services = useContext(ServicesContext);
109167
110403
  const { resetField, control } = useCustomFormContext();
109168
110404
  const defaultValue = value && value.isSet ? "*****" : "";
@@ -109180,6 +110416,7 @@ function Password(props) {
109180
110416
  field.onChange(getPasswordValue(e2.target?.value));
109181
110417
  };
109182
110418
  return /* @__PURE__ */ jsxs(EditorContainer, { isChanged: isDirty, resetValue: () => resetField(fieldName, { defaultValue }), ...props, children: [
110419
+ editorError && /* @__PURE__ */ jsx(ErrorMessage, { message: editorError }),
109183
110420
  /* @__PURE__ */ jsx(
109184
110421
  TextField$3,
109185
110422
  {
@@ -109962,6 +111199,7 @@ var He = function(e2) {
109962
111199
  ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "marquee", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "textPath", "tspan"].forEach(function(e2) {
109963
111200
  He[e2] = He(e2);
109964
111201
  });
111202
+ serviceName((s2) => s2.navigation);
109965
111203
  He.div`
109966
111204
  height: 100%;
109967
111205
  display: flex;
@@ -110264,10 +111502,11 @@ export {
110264
111502
  EditorInnerWrapper,
110265
111503
  EditorName,
110266
111504
  EditorWrapper,
111505
+ ElementErrorType,
110267
111506
  EngineType,
110268
111507
  Error$1 as Error,
110269
111508
  ErrorBlock,
110270
- ErrorIcon$1 as ErrorIcon,
111509
+ ErrorIcon,
110271
111510
  ErrorMessage,
110272
111511
  ExpandButton$1 as ExpandButton,
110273
111512
  ExpandMoreIcon,
@@ -110299,7 +111538,6 @@ export {
110299
111538
  PageTabPanel,
110300
111539
  PageTable,
110301
111540
  PageTitle,
110302
- PopupNotification,
110303
111541
  ProcessOverlay,
110304
111542
  ResourcesManagement,
110305
111543
  RootElementService,
@@ -110356,12 +111594,14 @@ export {
110356
111594
  getThisMonthBeginAndEndDays,
110357
111595
  getWidgetsOrder,
110358
111596
  handleOnEscape,
111597
+ hideNote,
110359
111598
  newGuid,
110360
111599
  parseQueryString,
110361
111600
  registerEditors,
110362
111601
  removeCssVariables,
110363
111602
  renderButtons,
110364
111603
  setDashboardPosition,
111604
+ showNote,
110365
111605
  showNotification,
110366
111606
  theme,
110367
111607
  toWidgetSettings,