@copart/ops-tool-kit 1.13.0-beta.25 → 1.13.0-beta.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ops-tool-kit.js +1165 -617
- package/dist/ops-tool-kit.js.map +1 -1
- package/package.json +1 -1
package/dist/ops-tool-kit.js
CHANGED
|
@@ -47,7 +47,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
47
47
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
48
48
|
|
|
49
49
|
const name$1 = "@copart/ops-tool-kit";
|
|
50
|
-
const version$3 = "1.13.0-beta.
|
|
50
|
+
const version$3 = "1.13.0-beta.27";
|
|
51
51
|
const main$1 = "dist/ops-tool-kit.js";
|
|
52
52
|
const style = "dist/ops-tool-kit.css";
|
|
53
53
|
const files = [
|
|
@@ -290,54 +290,6 @@ function _createClass$2(e, r, t) {
|
|
|
290
290
|
writable: !1
|
|
291
291
|
}), e;
|
|
292
292
|
}
|
|
293
|
-
function _createForOfIteratorHelper(r, e) {
|
|
294
|
-
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
295
|
-
if (!t) {
|
|
296
|
-
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
297
|
-
t && (r = t);
|
|
298
|
-
var n = 0,
|
|
299
|
-
F = function () {};
|
|
300
|
-
return {
|
|
301
|
-
s: F,
|
|
302
|
-
n: function () {
|
|
303
|
-
return n >= r.length ? {
|
|
304
|
-
done: !0
|
|
305
|
-
} : {
|
|
306
|
-
done: !1,
|
|
307
|
-
value: r[n++]
|
|
308
|
-
};
|
|
309
|
-
},
|
|
310
|
-
e: function (r) {
|
|
311
|
-
throw r;
|
|
312
|
-
},
|
|
313
|
-
f: F
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
317
|
-
}
|
|
318
|
-
var o,
|
|
319
|
-
a = !0,
|
|
320
|
-
u = !1;
|
|
321
|
-
return {
|
|
322
|
-
s: function () {
|
|
323
|
-
t = t.call(r);
|
|
324
|
-
},
|
|
325
|
-
n: function () {
|
|
326
|
-
var r = t.next();
|
|
327
|
-
return a = r.done, r;
|
|
328
|
-
},
|
|
329
|
-
e: function (r) {
|
|
330
|
-
u = !0, o = r;
|
|
331
|
-
},
|
|
332
|
-
f: function () {
|
|
333
|
-
try {
|
|
334
|
-
a || null == t.return || t.return();
|
|
335
|
-
} finally {
|
|
336
|
-
if (u) throw o;
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
293
|
function _defineProperty$2(e, r, t) {
|
|
342
294
|
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
343
295
|
value: t,
|
|
@@ -2886,13 +2838,13 @@ var Breadcrumbs = withBreadcrumbs(index$1.purist(function (props) {
|
|
|
2886
2838
|
props.history.push(isEmbedded && (_props$appTile2 = props.appTile) !== null && _props$appTile2 !== void 0 && _props$appTile2.path ? props.appTile.path : '/');
|
|
2887
2839
|
},
|
|
2888
2840
|
className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb"
|
|
2889
|
-
}, props === null || props === void 0 ? void 0 : (_props$appTile3 = props.appTile) === null || _props$appTile3 === void 0 ? void 0 : _props$appTile3.title) : null, props.breadcrumbs.crumbs.map(function (crumb,
|
|
2841
|
+
}, props === null || props === void 0 ? void 0 : (_props$appTile3 = props.appTile) === null || _props$appTile3 === void 0 ? void 0 : _props$appTile3.title) : null, props.breadcrumbs.crumbs.map(function (crumb, idx) {
|
|
2890
2842
|
return /*#__PURE__*/React__namespace.createElement("a", {
|
|
2891
2843
|
onClick: function onClick() {
|
|
2892
2844
|
return props.history.push(crumb.to);
|
|
2893
2845
|
},
|
|
2894
2846
|
className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb",
|
|
2895
|
-
key: crumb.
|
|
2847
|
+
key: crumb.crumbId != null ? crumb.crumbId : idx
|
|
2896
2848
|
}, crumb.children);
|
|
2897
2849
|
}, this)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
2898
2850
|
id: "notCrumbs",
|
|
@@ -2969,10 +2921,10 @@ var BreadcrumbsProvider = /*#__PURE__*/function (_React$Component) {
|
|
|
2969
2921
|
}(React__namespace.Component);
|
|
2970
2922
|
|
|
2971
2923
|
var _class;
|
|
2972
|
-
var _excluded$
|
|
2924
|
+
var _excluded$6 = ["breadcrumbs"];
|
|
2973
2925
|
var getCrumbProps = function getCrumbProps(props) {
|
|
2974
2926
|
props.breadcrumbs;
|
|
2975
|
-
var crumbProps = _objectWithoutProperties(props, _excluded$
|
|
2927
|
+
var crumbProps = _objectWithoutProperties(props, _excluded$6);
|
|
2976
2928
|
return crumbProps;
|
|
2977
2929
|
};
|
|
2978
2930
|
var Crumb$1 = withBreadcrumbs(_class = /*#__PURE__*/function (_React$Component) {
|
|
@@ -21345,7 +21297,7 @@ FeedbackDialog.defaultProps = {
|
|
|
21345
21297
|
}
|
|
21346
21298
|
};
|
|
21347
21299
|
|
|
21348
|
-
var css_248z$m = ".utilities_ops-app-frame_AppBarComponent_AppBar--root {\n background-color: var(--blue);\n background-color: var(--blue);\n height: 48px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n white-space: nowrap;\n /* padding-top: env(safe-area-inset-top, 0px); */\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--leftItems {\n width: 100%;\n display: flex;\n justify-content: start;\n align-items: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--appBarIcons {\n margin: 0 12px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--copartLogo {\n display: flex;\n align-items: center;\n flex-direction: column;\n margin-left: 5px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--copartLogoNew {\n display: flex;\n margin: 3px 0 0 16px;\n grid-gap: 10px;\n gap: 10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--moduleName {\n color: white;\n font-size: 11px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items {\n color: white;\n cursor: pointer;\n font-size: 18px;\n display: flex;\n justify-content: center;\n margin: 8px !important;\n position: relative;\n width: 25px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--logout {\n margin-right: 24px !important;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items i {\n color: #fff;\n font-size: 20px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--lightBulbIcon i {\n color: #ffff00;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--language {\n width: auto;\n grid-gap: 4px;\n grid-gap: 5px;\n gap: 5px;\n display: flex;\n font-size: 14px;\n font-weight: 600;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--yard {\n width: auto;\n cursor: pointer;\n display: flex;\n align-items: center;\n background: #fff;\n color: #1D5AB9;\n font-weight: 600;\n border-radius: 4px;\n font-size: 14px;\n grid-gap: 8px;\n grid-gap: 8px;\n gap: 8px;\n padding: 2px 8px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--yard span i {\n color: #1D5AB9;\n font-size: 16px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--yard .utilities_ops-app-frame_AppBarComponent_AppBar--yardNumber {\n font-size: 14px;\n font-weight: 400;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid .utilities_ops-app-frame_AppBarComponent_AppBar--col {\n display: flex;\n color: white;\n font-size: 13px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid .utilities_ops-app-frame_AppBarComponent_AppBar--col svg {\n color: white;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--logo {\n width: 6rem;\n margin-top: 0rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--text {\n margin-top: 0.6rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--iconText {\n margin-top: 0.4rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchBar,\n.utilities_ops-app-frame_AppBarComponent_AppBar--placeholderDiv {\n margin-top: -0.2rem;\n margin-left: 2rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--appBarLeft > img.utilities_ops-app-frame_AppBarComponent_AppBar--logo {\n display: inline;\n display: initial;\n}\n\n@font-face {\n font-family: 'Open Sans';\n font-style: italic;\n font-weight: 600;\n src: url(https://fonts.gstatic.com/s/opensans/v18/memnYaGs126MiZpBA-UFUKXGUdhmIqOjjg.woff2)\n format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--appTitle {\n color: #fff;\n font-family: 'Open Sans', sans-serif;\n font-weight: 600;\n font-style: italic;\n font-size: 14px;\n position: relative;\n left: 16px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--item {\n display: flex;\n color: white;\n font-size: 13px;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchIcon {\n /* margin-left: 10px;\n margin-right: 7px; */\n cursor: pointer;\n display: flex;\n align-items: center;\n background: #fff;\n color: #1D5AB9;\n font-weight: 600;\n border-radius: 4px;\n box-shadow: inset 0px -2px 0px rgba(0, 0, 0, 0.4), 0px 1.6px 3.6px 0px rgba(0, 0, 0, 0.13), 0px 0.3px 0.9px 0px rgba(0, 0, 0, 0.10);\n font-size: 14px;\n grid-gap: 8px;\n gap: 8px;\n margin: 0 8px;\n padding: 6px 20px 7px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchIcon span {\n display: flex;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchIcon span i {\n font-size: 18px;\n color: #1D5AB9;\n}\n\n/* .searchIcon > div {\n margin-left: 7px;\n} */\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchWrapper i {\n color: #fff;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchWrapper span {\n display: flex;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneDefault {\n color: white;\n cursor: default;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable,\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneUnvailable {\n background-color: white;\n border-radius: 20px;\n margin: 5px;\n padding: 0px 10px;\n height: 25px;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--light {\n border: 1px solid #1d5ab9;\n justify-content: flex-start;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--lightDefault {\n color: black;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneOffline,\n.utilities_ops-app-frame_AppBarComponent_AppBar--lightAvailable {\n background-color: white;\n border-radius: 20px;\n display: flex;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--lightAvailable {\n color: green;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--lightAvailable i {\n color: green;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneOffline {\n color: red;\n margin: 5px 0px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneOffline svg {\n margin-right: 5px;\n margin-left: 5px;\n width: 24px;\n height: 24px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--SpinnerWrapper {\n margin-left: 5px;\n display: inline-flex;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneDefault i {\n font-size: 16px;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable i {\n line-height: unset;\n font-size: 16px;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable {\n color: green;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneDefault i,\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable i,\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneUnvailable svg {\n margin-right: 5px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneUnvailable {\n color: red;\n}\n\n/* .userMenu {\n margin-left: 10px !important;\n margin-right: 5px !important;\n} */\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--roleAndFlag {\n margin: 8px;\n display: flex;\n align-items: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--roleAndFlag > div {\n margin-left: 7px;\n font-size: 14px;\n font-weight: 600;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--feedback {\n margin: 0 !important;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--overflowItems {\n width: 100%;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelp_button {\n cursor: pointer;\n position: relative;\n top: -2px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelp_button i {\n color: #fff;\n font-size: 22px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpDot {\n background-color: #ef5350;\n border-radius: 50%;\n position: absolute;\n top: 3px;\n left: 13px;\n width: 10px;\n height: 10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpTooltip{\n position: absolute;\n background: #fff;\n padding: 8px;\n right: 30px;\n top: -2px;\n border-radius: 2px;\n font-weight: 400;\n font-size: 12px;\n cursor: auto;\n color: #000;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpTooltip::before{\n content: \"\";\n position: absolute;\n top: 50%;\n left: 100%;\n margin-top: -5px;\n border-width: 5px;\n border-style: solid;\n border-color: transparent transparent transparent #fff;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpTooltip i{\n color: #000;\n font-size: 12px;\n margin-left: 5px;\n position: relative;\n top: 1px;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer {\n position: absolute;\n display: flex;\n width: 100vw;\n bottom: 0;\n z-index: 10000;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer .utilities_ops-app-frame_AppBarComponent_AppBar--ideaNoteIframe {\n position: absolute;\n bottom: 0;\n right: 0;\n height: 100%;\n width: 425px;\n max-width: 425px;\n background-color: white;\n border: 0px solid;\n padding: 20px 30px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHide {\n background-color: rgba(0,0,0,.5);\n width: 100%;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--st0{fill:#0075E6;}\n.utilities_ops-app-frame_AppBarComponent_AppBar--st1{fill:#6A819C;}\n.utilities_ops-app-frame_AppBarComponent_AppBar--st2{fill:#FFFFFF;}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHideButton {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 2px;\n right: 510px;\n height: 38px;\n width: 38px;\n background-color: white;\n z-index: 11000;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--profile {\n padding: 5px 7px;\n background: #fff;\n border-radius: 50%;\n font-weight: 600;\n color: #1d5ab9;\n font-size: 12px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchContainer {\n background: rgba(255, 255, 255, 0.40);\n backdrop-filter: blur(20px);\n position: absolute;\n top: 50px;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 999;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper{\n position: absolute;\n z-index: 10000;\n height: 100vh;\n width: 100vw;\n background-color: rgba(0,0,0,.5);\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper .utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebar {\n width: 425px;\n max-width: 425px;\n position: absolute;\n right: 0;\n /* height: calc(100vh - 100px); */\n /* padding: 15px; */\n background-color: white;\n overflow-y: auto;\n}\n\n@media only screen and (max-width: 1024px) {\n .utilities_ops-app-frame_AppBarComponent_AppBar--phoneDefault i,\n .utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable i,\n .utilities_ops-app-frame_AppBarComponent_AppBar--phoneUnvailable svg {\n margin-right: 2px;\n }\n\n /* .searchIcon {\n margin-left: 5px;\n margin-right: 2px;\n }\n\n .searchIcon > div {\n margin-left: 2px;\n } */\n\n /* .userMenu {\n margin-left: 3px !important;\n margin-right: 3px !important;\n } */\n\n .utilities_ops-app-frame_AppBarComponent_AppBar--roleAndFlag {\n margin-left: 3px !important;\n margin-right: 3px !important;\n }\n\n .utilities_ops-app-frame_AppBarComponent_AppBar--roleAndFlag > div {\n margin-left: 2px;\n }\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--sideBarWrapper\n{\n position: absolute;\n z-index: 10000;\n height: 100vh;\n top: 100px;\n width: 100vw;\n background-color: rgba(0,0,0,.5);\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv\n{\n width: 425px;\n max-width: 425px;\n position: absolute;\n right: 0;\n /* height: calc(100vh - 100px); */\n background-color: white;\n overflow-y: hidden;\n padding: 10px;\n display: flex;\n flex-direction: column;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv::-webkit-scrollbar {\n width: 12px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv::-webkit-scrollbar-track {\n background: #f1f1f1;\n border-radius: 10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv::-webkit-scrollbar-thumb {\n background-color: #888;\n border-radius: 10px;\n border: 3px solid #f1f1f1;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv::-webkit-scrollbar-thumb:hover {\n background-color: #555;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationsHeader{\n font-size: 24px;\n font-weight: 700;\n padding-bottom: 10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationsWrapper{\n flex: 1;\n min-height: 0;\n overflow: hidden;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount{\n background-color: #ef5350;\n color: white;\n font-size: 12px;\n width: 1rem;\n border-radius: 50%;\n position: absolute;\n top: -5px;\n left: 11px;\n height: 1rem;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount.utilities_ops-app-frame_AppBarComponent_AppBar--twoChars {\n width: 1.1rem;\n height: 1.1rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount.utilities_ops-app-frame_AppBarComponent_AppBar--threeChars {\n width: 1.3rem;\n height: 1.3rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--notificationIconWrapper {\n cursor: pointer;\n margin-left: 12px;\n position: relative;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer {\n width: 0px;\n height: 0px;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-bottom: 11px solid white;\n position: absolute;\n bottom: -13px;\n right: 5px;\n}\n\n/* .arrowTipContainer.ideaNoteArrow {\n right: 16px;\n} */\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpArrow {\n right: 3px;\n bottom: -10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer.utilities_ops-app-frame_AppBarComponent_AppBar--profileArrow {\n bottom: -12px;\n right: 8px;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n border-bottom: 10px solid white;\n}\n\n@media (max-width: 1366px) {\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer .utilities_ops-app-frame_AppBarComponent_AppBar--ideaNoteIframe {\n width: 400px;\n max-width: 400px;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv {\n width: 400px;\n max-width: 400px;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper .utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebar {\n width: 400px;\n max-width: 400px;\n}\n}\n\n@media (max-width: 768px) {\n .utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv {\n width: 85%;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount{\n left: 12px;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer {\n right: 5px;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer .utilities_ops-app-frame_AppBarComponent_AppBar--ideaNoteIframe {\n width: 85% !important;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer iframe {\n width: 85% !important;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHide .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHideButton {\n display: none;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper .utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebar {\n width: 85%;\n }\n}";
|
|
21300
|
+
var css_248z$m = ".utilities_ops-app-frame_AppBarComponent_AppBar--root {\n background-color: var(--blue);\n background-color: var(--blue);\n height: 48px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n white-space: nowrap;\n /* padding-top: env(safe-area-inset-top, 0px); */\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--leftItems {\n width: 100%;\n display: flex;\n justify-content: start;\n align-items: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--appBarIcons {\n margin: 0 12px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--copartLogo {\n display: flex;\n align-items: center;\n flex-direction: column;\n margin-left: 5px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--copartLogoNew {\n display: flex;\n margin: 3px 0 0 16px;\n grid-gap: 10px;\n gap: 10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--moduleName {\n color: white;\n font-size: 11px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items {\n color: white;\n cursor: pointer;\n font-size: 18px;\n display: flex;\n justify-content: center;\n margin: 8px !important;\n position: relative;\n width: 25px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--logout {\n margin-right: 24px !important;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items i {\n color: #fff;\n font-size: 20px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--lightBulbIcon i {\n color: #ffff00;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--language {\n width: auto;\n grid-gap: 4px;\n grid-gap: 5px;\n gap: 5px;\n display: flex;\n font-size: 14px;\n font-weight: 600;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--yard {\n width: auto;\n cursor: pointer;\n display: flex;\n align-items: center;\n background: #fff;\n color: #1D5AB9;\n font-weight: 600;\n border-radius: 4px;\n font-size: 14px;\n grid-gap: 8px;\n grid-gap: 8px;\n gap: 8px;\n padding: 2px 8px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--yard span i {\n color: #1D5AB9;\n font-size: 16px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--yard .utilities_ops-app-frame_AppBarComponent_AppBar--yardNumber {\n font-size: 14px;\n font-weight: 400;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid .utilities_ops-app-frame_AppBarComponent_AppBar--col {\n display: flex;\n color: white;\n font-size: 13px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid .utilities_ops-app-frame_AppBarComponent_AppBar--col svg {\n color: white;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--logo {\n width: 6rem;\n margin-top: 0rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--text {\n margin-top: 0.6rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--iconText {\n margin-top: 0.4rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchBar,\n.utilities_ops-app-frame_AppBarComponent_AppBar--placeholderDiv {\n margin-top: -0.2rem;\n margin-left: 2rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--appBarLeft > img.utilities_ops-app-frame_AppBarComponent_AppBar--logo {\n display: inline;\n display: initial;\n}\n\n@font-face {\n font-family: 'Open Sans';\n font-style: italic;\n font-weight: 600;\n src: url(https://fonts.gstatic.com/s/opensans/v18/memnYaGs126MiZpBA-UFUKXGUdhmIqOjjg.woff2)\n format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--appTitle {\n color: #fff;\n font-family: 'Open Sans', sans-serif;\n font-weight: 600;\n font-style: italic;\n font-size: 14px;\n position: relative;\n left: 16px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--item {\n display: flex;\n color: white;\n font-size: 13px;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchIcon {\n /* margin-left: 10px;\n margin-right: 7px; */\n cursor: pointer;\n display: flex;\n align-items: center;\n background: #fff;\n color: #1D5AB9;\n font-weight: 600;\n border-radius: 4px;\n box-shadow: inset 0px -2px 0px rgba(0, 0, 0, 0.4), 0px 1.6px 3.6px 0px rgba(0, 0, 0, 0.13), 0px 0.3px 0.9px 0px rgba(0, 0, 0, 0.10);\n font-size: 14px;\n grid-gap: 8px;\n gap: 8px;\n margin: 0 8px;\n padding: 6px 20px 7px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchIcon span {\n display: flex;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchIcon span i {\n font-size: 18px;\n color: #1D5AB9;\n}\n\n/* .searchIcon > div {\n margin-left: 7px;\n} */\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchWrapper i {\n color: #fff;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchWrapper span {\n display: flex;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneDefault {\n color: white;\n cursor: default;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable,\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneUnvailable {\n background-color: white;\n border-radius: 20px;\n margin: 5px;\n padding: 0px 10px;\n height: 25px;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--light {\n border: 1px solid #1d5ab9;\n justify-content: flex-start;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--lightDefault {\n color: black;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneOffline,\n.utilities_ops-app-frame_AppBarComponent_AppBar--lightAvailable {\n background-color: white;\n border-radius: 20px;\n display: flex;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--lightAvailable {\n color: green;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--lightAvailable i {\n color: green;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneOffline {\n color: red;\n margin: 5px 0px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneOffline svg {\n margin-right: 5px;\n margin-left: 5px;\n width: 24px;\n height: 24px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--SpinnerWrapper {\n margin-left: 5px;\n display: inline-flex;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneDefault i {\n font-size: 16px;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable i {\n line-height: unset;\n font-size: 16px;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable {\n color: green;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneDefault i,\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable i,\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneUnvailable svg {\n margin-right: 5px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--phoneUnvailable {\n color: red;\n}\n\n/* .userMenu {\n margin-left: 10px !important;\n margin-right: 5px !important;\n} */\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--roleAndFlag {\n margin: 8px;\n display: flex;\n align-items: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--roleAndFlag > div {\n margin-left: 7px;\n font-size: 14px;\n font-weight: 600;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--feedback {\n margin: 0 !important;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--overflowItems {\n width: 100%;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelp_button {\n cursor: pointer;\n position: relative;\n top: -2px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelp_button i {\n color: #fff;\n font-size: 22px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpDot {\n background-color: #ef5350;\n border-radius: 50%;\n position: absolute;\n top: 3px;\n left: 13px;\n width: 10px;\n height: 10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpTooltip{\n position: absolute;\n background: #fff;\n padding: 8px;\n right: 30px;\n top: -2px;\n border-radius: 2px;\n font-weight: 400;\n font-size: 12px;\n cursor: auto;\n color: #000;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpTooltip::before{\n content: \"\";\n position: absolute;\n top: 50%;\n left: 100%;\n margin-top: -5px;\n border-width: 5px;\n border-style: solid;\n border-color: transparent transparent transparent #fff;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpTooltip i{\n color: #000;\n font-size: 12px;\n margin-left: 5px;\n position: relative;\n top: 1px;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer {\n position: absolute;\n display: flex;\n width: 100vw;\n bottom: 0;\n z-index: 10000;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer .utilities_ops-app-frame_AppBarComponent_AppBar--ideaNoteIframe {\n position: absolute;\n bottom: 0;\n right: 0;\n height: 100%;\n width: 425px;\n max-width: 425px;\n background-color: white;\n border: 0px solid;\n padding: 20px 30px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHide {\n background-color: rgba(0,0,0,.5);\n width: 100%;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--st0{fill:#0075E6;}\n.utilities_ops-app-frame_AppBarComponent_AppBar--st1{fill:#6A819C;}\n.utilities_ops-app-frame_AppBarComponent_AppBar--st2{fill:#FFFFFF;}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHideButton {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 2px;\n right: 510px;\n height: 38px;\n width: 38px;\n background-color: white;\n z-index: 11000;\n cursor: pointer;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--profile {\n padding: 5px 7px;\n background: #fff;\n border-radius: 50%;\n font-weight: 600;\n color: #1d5ab9;\n font-size: 12px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--searchContainer {\n background: rgba(255, 255, 255, 0.40);\n backdrop-filter: blur(20px);\n position: absolute;\n top: 50px;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 999;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper{\n position: absolute;\n z-index: 10000;\n height: 100vh;\n width: 100vw;\n background-color: rgba(0,0,0,.5);\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper .utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebar {\n width: 425px;\n max-width: 425px;\n position: absolute;\n right: 0;\n /* height: calc(100vh - 100px); */\n /* padding: 15px; */\n background-color: white;\n overflow-y: auto;\n}\n\n@media only screen and (max-width: 1024px) {\n .utilities_ops-app-frame_AppBarComponent_AppBar--phoneDefault i,\n .utilities_ops-app-frame_AppBarComponent_AppBar--phoneAvailable i,\n .utilities_ops-app-frame_AppBarComponent_AppBar--phoneUnvailable svg {\n margin-right: 2px;\n }\n\n /* .searchIcon {\n margin-left: 5px;\n margin-right: 2px;\n }\n\n .searchIcon > div {\n margin-left: 2px;\n } */\n\n /* .userMenu {\n margin-left: 3px !important;\n margin-right: 3px !important;\n } */\n\n .utilities_ops-app-frame_AppBarComponent_AppBar--roleAndFlag {\n margin-left: 3px !important;\n margin-right: 3px !important;\n }\n\n .utilities_ops-app-frame_AppBarComponent_AppBar--roleAndFlag > div {\n margin-left: 2px;\n }\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--sideBarWrapper\n{\n position: absolute;\n z-index: 10000;\n height: 100vh;\n top: 100px;\n width: 100vw;\n background-color: rgba(0,0,0,.5);\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv\n{\n width: 425px;\n max-width: 425px;\n position: absolute;\n right: 0;\n /* height: calc(100vh - 100px); */\n background-color: white;\n overflow-y: hidden;\n padding: 10px;\n display: flex;\n flex-direction: column;\n}\n\n/* Stable marker for NAC sidebar v2 detection — must remain in bundle */\n.g2-notifications-sidebar-v2 {\n display: flex;\n flex-direction: column;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv::-webkit-scrollbar {\n width: 12px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv::-webkit-scrollbar-track {\n background: #f1f1f1;\n border-radius: 10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv::-webkit-scrollbar-thumb {\n background-color: #888;\n border-radius: 10px;\n border: 3px solid #f1f1f1;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv::-webkit-scrollbar-thumb:hover {\n background-color: #555;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationsHeader{\n font-size: 20px;\n font-weight: 700;\n padding: 0 20px 12px;\n margin: 0 -10px 12px;\n border-bottom: 1px solid #edebe9;\n color: #323130;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationsHeaderCount{\n font-size: 16px;\n font-weight: 600;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationsWrapper{\n flex: 1;\n min-height: 0;\n overflow: hidden;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount{\n background-color: #ef5350;\n color: white;\n font-size: 12px;\n width: 1rem;\n border-radius: 50%;\n position: absolute;\n top: -5px;\n left: 11px;\n height: 1rem;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount.utilities_ops-app-frame_AppBarComponent_AppBar--twoChars {\n width: 1.1rem;\n height: 1.1rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount.utilities_ops-app-frame_AppBarComponent_AppBar--threeChars {\n width: 1.3rem;\n height: 1.3rem;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items.utilities_ops-app-frame_AppBarComponent_AppBar--notificationIconWrapper {\n cursor: pointer;\n margin-left: 12px;\n position: relative;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer {\n width: 0px;\n height: 0px;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-bottom: 11px solid white;\n position: absolute;\n bottom: -13px;\n right: 5px;\n}\n\n/* .arrowTipContainer.ideaNoteArrow {\n right: 16px;\n} */\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer.utilities_ops-app-frame_AppBarComponent_AppBar--mihelpArrow {\n right: 3px;\n bottom: -10px;\n}\n\n.utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer.utilities_ops-app-frame_AppBarComponent_AppBar--profileArrow {\n bottom: -12px;\n right: 8px;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n border-bottom: 10px solid white;\n}\n\n@media (max-width: 1366px) {\n.utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer .utilities_ops-app-frame_AppBarComponent_AppBar--ideaNoteIframe {\n width: 400px;\n max-width: 400px;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv {\n width: 400px;\n max-width: 400px;\n}\n.utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper .utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebar {\n width: 400px;\n max-width: 400px;\n}\n}\n\n@media (max-width: 768px) {\n .utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv {\n width: 85%;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount{\n left: 12px;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer {\n right: 5px;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer .utilities_ops-app-frame_AppBarComponent_AppBar--ideaNoteIframe {\n width: 85% !important;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer iframe {\n width: 85% !important;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHide .utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHideButton {\n display: none;\n }\n .utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper .utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebar {\n width: 85%;\n }\n}";
|
|
21349
21301
|
styleInject(css_248z$m);
|
|
21350
21302
|
|
|
21351
21303
|
var LogOutMenu = function LogOutMenu(_ref) {
|
|
@@ -21531,15 +21483,17 @@ var MobileMenu = function MobileMenu(props) {
|
|
|
21531
21483
|
var closeSidebar = props.closeSidebar,
|
|
21532
21484
|
logout = props.logout,
|
|
21533
21485
|
items = props.items,
|
|
21534
|
-
|
|
21486
|
+
_props$bannerNotifica = props.bannerNotifications,
|
|
21487
|
+
bannerNotifications = _props$bannerNotifica === void 0 ? [] : _props$bannerNotifica,
|
|
21535
21488
|
sideBarTopValue = props.sideBarTopValue,
|
|
21536
21489
|
availableStatuses = props.availableStatuses,
|
|
21537
21490
|
currentUserStatus = props.currentUserStatus,
|
|
21538
21491
|
onUserStatusUpdate = props.onUserStatusUpdate;
|
|
21492
|
+
var hasBannerNotifications = bannerNotifications.length > 0;
|
|
21539
21493
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
21540
21494
|
className: "utilities_ops-app-frame_AppBarComponent_MobileMenu_MobileMenu--mobileMenuSidebarWrapper",
|
|
21541
21495
|
style: {
|
|
21542
|
-
top:
|
|
21496
|
+
top: hasBannerNotifications ? "".concat(sideBarTopValue, "px") : '48px'
|
|
21543
21497
|
},
|
|
21544
21498
|
onClick: closeSidebar
|
|
21545
21499
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -21584,7 +21538,8 @@ var isEmbeddedPath = function isEmbeddedPath() {
|
|
|
21584
21538
|
};
|
|
21585
21539
|
var CopartLogo = function CopartLogo() {
|
|
21586
21540
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
21587
|
-
history = _ref.history
|
|
21541
|
+
history = _ref.history,
|
|
21542
|
+
onNavigate = _ref.onNavigate;
|
|
21588
21543
|
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
|
|
21589
21544
|
var enableNewToolkitFeatures = coreAppConfig.enableNewToolkitFeatures;
|
|
21590
21545
|
enableNewToolkitFeatures = enableNewToolkitFeatures || isAuthRoute && !isCoreRoute;
|
|
@@ -21594,6 +21549,10 @@ var CopartLogo = function CopartLogo() {
|
|
|
21594
21549
|
// Outside embedded: keep default <a href="/"> full navigation.
|
|
21595
21550
|
if (history && typeof history.push === 'function' && isEmbeddedPath()) {
|
|
21596
21551
|
e.preventDefault();
|
|
21552
|
+
// SPA nav keeps the header mounted, so any open sidebar (settings /
|
|
21553
|
+
// notifications / mihelp / search / mobile menu) would otherwise stay
|
|
21554
|
+
// open after landing on Home. Close them before navigating.
|
|
21555
|
+
if (typeof onNavigate === 'function') onNavigate();
|
|
21597
21556
|
history.push('/');
|
|
21598
21557
|
}
|
|
21599
21558
|
};
|
|
@@ -22531,7 +22490,8 @@ var HelpSideBar = function HelpSideBar(_ref) {
|
|
|
22531
22490
|
feedbackConfig = _ref.feedbackConfig,
|
|
22532
22491
|
showMihelpDot = _ref.showMihelpDot,
|
|
22533
22492
|
sideBarTopValue = _ref.sideBarTopValue,
|
|
22534
|
-
|
|
22493
|
+
_ref$bannerNotificati = _ref.bannerNotifications,
|
|
22494
|
+
bannerNotifications = _ref$bannerNotificati === void 0 ? [] : _ref$bannerNotificati;
|
|
22535
22495
|
var _useState = React.useState(null),
|
|
22536
22496
|
_useState2 = _slicedToArray(_useState, 2),
|
|
22537
22497
|
helpContent = _useState2[0],
|
|
@@ -23070,11 +23030,11 @@ var HelpSideBar = function HelpSideBar(_ref) {
|
|
|
23070
23030
|
className: "utilities_ops-app-frame_Help_Help--backdrop",
|
|
23071
23031
|
onClick: handleBackDropClick,
|
|
23072
23032
|
style: {
|
|
23073
|
-
top:
|
|
23033
|
+
top: bannerNotifications.length ? "".concat(sideBarTopValue, "px") : '48px'
|
|
23074
23034
|
}
|
|
23075
23035
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
23076
23036
|
style: {
|
|
23077
|
-
height: "calc(100dvh - ".concat(
|
|
23037
|
+
height: "calc(100dvh - ".concat(bannerNotifications.length ? sideBarTopValue : 48, "px)")
|
|
23078
23038
|
},
|
|
23079
23039
|
ref: mihelpRef,
|
|
23080
23040
|
className: _getClassName("miHelpSideBar ".concat(!helpContent || isChrome() && overFlowHidden || !isChrome() && showQuestionSection ? 'overFlowHidden' : ''), _styleModuleImportMap$5, {
|
|
@@ -23521,7 +23481,7 @@ var RoleSelector$2 = function RoleSelector(_ref) {
|
|
|
23521
23481
|
}));
|
|
23522
23482
|
};
|
|
23523
23483
|
|
|
23524
|
-
var _excluded$
|
|
23484
|
+
var _excluded$5 = ["selectedYard", "name", "handleChange", "yardOptions", "label"];
|
|
23525
23485
|
var getDescription = function getDescription(yardOptions) {
|
|
23526
23486
|
return function (code) {
|
|
23527
23487
|
return yardOptions[code].yard_number;
|
|
@@ -23537,7 +23497,7 @@ var YardNumberMenu$2 = function YardNumberMenu(_ref) {
|
|
|
23537
23497
|
handleChange = _ref.handleChange,
|
|
23538
23498
|
yardOptions = _ref.yardOptions,
|
|
23539
23499
|
label = _ref.label,
|
|
23540
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
23500
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$5);
|
|
23541
23501
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
23542
23502
|
className: "utilities_ops-app-frame_AppBarComponent_Settings_SettingsView--col-1-1"
|
|
23543
23503
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.AutoSelect, _extends$1({}, otherProps, {
|
|
@@ -24481,14 +24441,14 @@ var HierarchyMenu = function HierarchyMenu(props) {
|
|
|
24481
24441
|
});
|
|
24482
24442
|
};
|
|
24483
24443
|
|
|
24484
|
-
var _excluded$
|
|
24444
|
+
var _excluded$4 = ["value", "handleChange", "yardOptions", "label", "disabled"];
|
|
24485
24445
|
var YardNumberMenu$1 = function YardNumberMenu(_ref) {
|
|
24486
24446
|
var value = _ref.value,
|
|
24487
24447
|
handleChange = _ref.handleChange,
|
|
24488
24448
|
yardOptions = _ref.yardOptions;
|
|
24489
24449
|
_ref.label;
|
|
24490
24450
|
var disabled = _ref.disabled,
|
|
24491
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$
|
|
24451
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$4);
|
|
24492
24452
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
24493
24453
|
className: "utilities_ops-app-frame_AppBarComponent_Settings_SettingsView--col-1-1"
|
|
24494
24454
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.AutoSelect, _extends$1({}, otherProps, {
|
|
@@ -25576,17 +25536,24 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
|
|
|
25576
25536
|
}]);
|
|
25577
25537
|
}(React__default["default"].Component);
|
|
25578
25538
|
|
|
25579
|
-
var css_248z$9 = ".utilities_ops-announcements_Banner--appBarContentBox {\n word-break: break-word;\n word-wrap: anywhere;\n white-space: pre-wrap;\n font-weight: 600;\n max-width: 100%;\n}\n\n.utilities_ops-announcements_Banner--notificationBarContent {\n padding: 10px 10px;\n font-size: 13px;\n width: 95%;\n display: flex;\n align-items: center;\n grid-gap: 20px;\n gap: 20px;\n}\n\n.utilities_ops-announcements_Banner--tabNotificationInfoBar {\n display: flex;\n color: #6c7a89;\n grid-gap: 8px;\n gap: 8px;\n width: 90%;\n font-size: 12px;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--tabNotificationInfoBar b {\n color: #171717;\n}\n\n.utilities_ops-announcements_Banner--tabNotificationInfoBox {\n color: white;\n width: 26px;\n min-height: 26px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--notificationBarContentBox {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n overflow: hidden;\n /* font-weight: 600; */\n /* autoprefixer: off */\n -webkit-box-orient: vertical;\n /* autoprefixer: on */\n font-size: 12px;\n color: #201f1e;\n cursor: default;\n}\n\n.utilities_ops-announcements_Banner--notificationBarContentBox * {\n display: inline;\n}\n\n.utilities_ops-announcements_Banner--notificationBarContentBox a {\n text-decoration: underline;\n}\n\n.utilities_ops-announcements_Banner--tabNotificationBarContentBox {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n overflow: hidden;\n width: 95%;\n /* font-weight: 600; */\n /* autoprefixer: off */\n -webkit-box-orient: vertical;\n /* autoprefixer: on */\n font-size: 12px;\n padding: 5px 5px;\n min-height: 20px;\n padding: 4px 5px 3px;\n}\n\n.utilities_ops-announcements_Banner--notificationInfoBox b {\n color: #171717;\n}\n\n.utilities_ops-announcements_Banner--notificationInfoBox i {\n font-size: 20px !important;\n}\n\n.utilities_ops-announcements_Banner--notificationBtnContainer {\n display: flex;\n flex-direction: row;\n justify-content: center;\n grid-gap: 10px;\n gap: 10px;\n font-size: 12px;\n align-items: center;\n padding: 0px 10px;\n}\n\n.utilities_ops-announcements_Banner--notificationBtnContainer .utilities_ops-announcements_Banner--notificationLeftBtn i {\n position: relative;\n right: -4px;\n}\n\n.utilities_ops-announcements_Banner--notificationBtnContainer .utilities_ops-announcements_Banner--notificationCountContainer {\n width: 50px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.utilities_ops-announcements_Banner--notificationContainer {\n display: flex;\n flex-direction: row;\n /* padding: 10px 10px; */\n grid-gap: 5px;\n gap: 5px;\n min-height: 40px;\n width: 100%;\n /* padding-top: env(safe-area-inset-top, 0px);\n position: sticky;\n top: 0; */\n}\n\n.utilities_ops-announcements_Banner--sideBar.utilities_ops-announcements_Banner--notificationContainer {\n padding: 8px 6px;\n min-width: 0;\n}\n\n.utilities_ops-announcements_Banner--notificationInfoBox {\n color: white;\n width: 52px;\n min-height: 52px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationInfoBox {\n color: white;\n width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: 6px;\n}\n.utilities_ops-announcements_Banner--notificationBarBtn {\n width: 52px;\n min-height: 52px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--sideBar .utilities_ops-announcements_Banner--notificationBarBtn {\n width: auto;\n min-height: auto;\n align-items: flex-start;\n}\n\n.utilities_ops-announcements_Banner--notificationBtnContainer i {\n font-size: 22px;\n}\n\n.utilities_ops-announcements_Banner--sideBar .utilities_ops-announcements_Banner--notificationBarBtn i {\n font-size: 20px;\n}\n\n.utilities_ops-announcements_Banner--notificationContainer.utilities_ops-announcements_Banner--tabNotificationBar {\n flex-direction: column;\n /* padding: 10px 10px; */\n grid-gap: 0px;\n}\n\n.utilities_ops-announcements_Banner--notificationContainer.utilities_ops-announcements_Banner--tabNotificationBar i {\n font-size: 13px;\n}\n\n.utilities_ops-announcements_Banner--arrowTipContainer {\n width: 0px;\n height: 0px;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-bottom: 13px solid white;\n position: absolute;\n top: 51px;\n right: 50px;\n}\n\n.utilities_ops-announcements_Banner--appBarContentWrapper {\n padding-right: 10px;\n font-size: 12px;\n flex: 1 1 0%;\n min-width: 0;\n display: flex;\n flex-direction: column;\n grid-gap: 4px;\n gap: 4px;\n margin-top: 5px;\n max-width: 100%;\n}\n\n.utilities_ops-announcements_Banner--sideBarNotificationMeta {\n display: flex;\n flex-wrap: wrap;\n min-width: 0;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--sideBar .utilities_ops-announcements_Banner--appBarContentWrapper {\n padding-left: 10px;\n}\n\n.utilities_ops-announcements_Banner--appBarContentWrapper b {\n color: #171717;\n}\n\n.utilities_ops-announcements_Banner--feedUrl {\n text-decoration: none !important;\n}\n\n.utilities_ops-announcements_Banner--feedUrl i {\n font-size: 14px;\n cursor: pointer;\n color: #1d5ab9;\n left: 2px;\n position: relative;\n top: 2px;\n margin-right: 3px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroup {\n border: 1px solid #e1dfdd;\n border-radius: 8px;\n padding: 12px;\n margin-bottom: 12px;\n background-color: #ffffff;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupHeader {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-bottom: 10px;\n min-height: 28px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupHeaderWithBack {\n position: relative;\n justify-content: center;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupHeaderTitle {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 8px;\n gap: 8px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationBackBtn {\n position: absolute;\n left: 0;\n top: 50%;\n -webkit-transform: translateY(-50%);\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n margin: 0;\n border: none;\n background: none;\n color: #3261bd;\n cursor: pointer;\n width: 28px;\n height: 28px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationBackBtn i {\n font-size: 18px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupAppIcon {\n width: 20px;\n height: 20px;\n -o-object-fit: contain;\n object-fit: contain;\n -webkit-filter: invert(24%) sepia(100%) saturate(1350%) hue-rotate(201deg) brightness(96%) contrast(93%);\n filter: invert(24%) sepia(100%) saturate(1350%) hue-rotate(201deg) brightness(96%) contrast(93%);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupAppIconPlaceholder {\n width: 20px;\n height: 20px;\n border-radius: 4px;\n background-color: #deecf9;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupAppName {\n color: #3261bd;\n color: var(--Type-Copart-Neue-Rest, #3261bd);\n font-family: 'Segoe UI', SegoeUI, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Droid Sans, Helvetica Neue, sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 600;\n line-height: 20px;\n text-transform: uppercase;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupList {\n display: flex;\n flex-direction: column;\n grid-gap: 6px;\n gap: 6px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRow {\n display: flex;\n align-items: flex-start;\n grid-gap: 8px;\n gap: 8px;\n padding: 8px 10px;\n border-radius: 4px;\n min-height: 36px;\n min-width: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRowIcon {\n color: white;\n width: 20px;\n height: 20px;\n min-width: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-top: 1px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRowContent {\n flex: 1;\n min-width: 0;\n font-size: 12px;\n font-weight: 600;\n color: #201f1e;\n line-height: 1.35;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRowText {\n word-break: break-word;\n word-wrap: anywhere;\n white-space: normal;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRowText * {\n display: inline;\n word-wrap: inherit;\n word-break: inherit;\n white-space: inherit;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRowMeta {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n grid-gap: 4px;\n gap: 4px;\n flex-shrink: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRowLink {\n text-decoration: none;\n line-height: 1;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRowLink i {\n font-size: 16px;\n color: #1d5ab9;\n cursor: pointer;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationRowTime {\n font-size: 11px;\n color: #605e5c;\n font-weight: 400;\n white-space: nowrap;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationViewAll {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n grid-gap: 6px;\n gap: 6px;\n width: 100%;\n margin-top: 10px;\n padding: 0;\n border: none;\n background: none;\n color: #0f4cab;\n font-size: 13px;\n font-weight: 600;\n line-height: 1;\n cursor: pointer;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationViewAll i {\n display: inline-flex;\n align-items: center;\n font-size: 16px;\n line-height: 1;\n}\n\n@media (max-width: 1760px) {\n .utilities_ops-announcements_Banner--notificationBarContent input {\n width: 331px !important;\n }\n}\n";
|
|
25539
|
+
var css_248z$9 = ".utilities_ops-announcements_Banner--appBarContentBox {\n word-break: break-word;\n word-wrap: anywhere;\n white-space: pre-wrap;\n font-weight: 600;\n max-width: 100%;\n}\n\n.utilities_ops-announcements_Banner--notificationBarContent {\n padding: 10px 10px;\n font-size: 13px;\n width: 95%;\n display: flex;\n align-items: center;\n grid-gap: 20px;\n gap: 20px;\n}\n\n.utilities_ops-announcements_Banner--tabNotificationInfoBar {\n display: flex;\n color: #6c7a89;\n grid-gap: 8px;\n gap: 8px;\n width: 90%;\n font-size: 12px;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--tabNotificationInfoBar b {\n color: #171717;\n}\n\n.utilities_ops-announcements_Banner--tabNotificationInfoBox {\n color: white;\n width: 26px;\n min-height: 26px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--notificationBarContentBox {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n overflow: hidden;\n /* font-weight: 600; */\n /* autoprefixer: off */\n -webkit-box-orient: vertical;\n /* autoprefixer: on */\n font-size: 12px;\n color: #201f1e;\n cursor: default;\n}\n\n.utilities_ops-announcements_Banner--notificationBarContentBox * {\n display: inline;\n}\n\n.utilities_ops-announcements_Banner--notificationBarContentBox a {\n text-decoration: underline;\n}\n\n.utilities_ops-announcements_Banner--tabNotificationBarContentBox {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n overflow: hidden;\n width: 95%;\n /* font-weight: 600; */\n /* autoprefixer: off */\n -webkit-box-orient: vertical;\n /* autoprefixer: on */\n font-size: 12px;\n padding: 5px 5px;\n min-height: 20px;\n padding: 4px 5px 3px;\n}\n\n.utilities_ops-announcements_Banner--notificationInfoBox b {\n color: #171717;\n}\n\n.utilities_ops-announcements_Banner--notificationInfoBox i {\n font-size: 20px !important;\n}\n\n.utilities_ops-announcements_Banner--notificationBtnContainer {\n display: flex;\n flex-direction: row;\n justify-content: center;\n grid-gap: 10px;\n gap: 10px;\n font-size: 12px;\n align-items: center;\n padding: 0px 10px;\n}\n\n.utilities_ops-announcements_Banner--notificationBtnContainer .utilities_ops-announcements_Banner--notificationLeftBtn i {\n position: relative;\n right: -4px;\n}\n\n.utilities_ops-announcements_Banner--notificationBtnContainer .utilities_ops-announcements_Banner--notificationCountContainer {\n width: 50px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.utilities_ops-announcements_Banner--notificationContainer {\n display: flex;\n flex-direction: row;\n /* padding: 10px 10px; */\n grid-gap: 5px;\n gap: 5px;\n min-height: 40px;\n width: 100%;\n /* padding-top: env(safe-area-inset-top, 0px);\n position: sticky;\n top: 0; */\n}\n\n.utilities_ops-announcements_Banner--sideBar.utilities_ops-announcements_Banner--notificationContainer {\n padding: 8px 6px;\n min-width: 0;\n}\n\n.utilities_ops-announcements_Banner--notificationInfoBox {\n color: white;\n width: 52px;\n min-height: 52px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationInfoBox {\n color: white;\n width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: 6px;\n}\n.utilities_ops-announcements_Banner--notificationBarBtn {\n width: 52px;\n min-height: 52px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--sideBar .utilities_ops-announcements_Banner--notificationBarBtn {\n width: auto;\n min-height: auto;\n align-items: flex-start;\n}\n\n.utilities_ops-announcements_Banner--notificationBtnContainer i {\n font-size: 22px;\n}\n\n.utilities_ops-announcements_Banner--sideBar .utilities_ops-announcements_Banner--notificationBarBtn i {\n font-size: 20px;\n}\n\n.utilities_ops-announcements_Banner--notificationContainer.utilities_ops-announcements_Banner--tabNotificationBar {\n flex-direction: column;\n /* padding: 10px 10px; */\n grid-gap: 0px;\n}\n\n.utilities_ops-announcements_Banner--notificationContainer.utilities_ops-announcements_Banner--tabNotificationBar i {\n font-size: 13px;\n}\n\n.utilities_ops-announcements_Banner--arrowTipContainer {\n width: 0px;\n height: 0px;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-bottom: 13px solid white;\n position: absolute;\n top: 51px;\n right: 50px;\n}\n\n.utilities_ops-announcements_Banner--appBarContentWrapper {\n padding-right: 10px;\n font-size: 12px;\n flex: 1 1 0%;\n min-width: 0;\n display: flex;\n flex-direction: column;\n grid-gap: 4px;\n gap: 4px;\n margin-top: 5px;\n max-width: 100%;\n}\n\n.utilities_ops-announcements_Banner--sideBarNotificationMeta {\n display: flex;\n flex-wrap: wrap;\n min-width: 0;\n align-items: center;\n}\n\n.utilities_ops-announcements_Banner--sideBar .utilities_ops-announcements_Banner--appBarContentWrapper {\n padding-left: 10px;\n}\n\n.utilities_ops-announcements_Banner--appBarContentWrapper b {\n color: #171717;\n}\n\n.utilities_ops-announcements_Banner--feedUrl {\n text-decoration: none !important;\n}\n\n.utilities_ops-announcements_Banner--feedUrl i {\n font-size: 14px;\n cursor: pointer;\n color: #1d5ab9;\n left: 2px;\n position: relative;\n top: 2px;\n margin-right: 3px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationSidebarList {\n display: flex;\n flex-direction: column;\n grid-gap: 8px;\n gap: 8px;\n min-width: 0;\n width: 100%;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardWrapper {\n position: relative;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardWrapperStacked {\n padding-bottom: 12px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardWrapperExpanded {\n padding-bottom: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardWrapperExpanded .utilities_ops-announcements_Banner--sideNotificationStackContainer {\n opacity: 0;\n visibility: hidden;\n -webkit-transform: none;\n transform: none;\n transition: none;\n pointer-events: none;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedGroup {\n display: flex;\n flex-direction: column;\n grid-gap: 5px;\n gap: 5px;\n min-width: 0;\n width: 100%;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationSecondaryBody {\n width: 100%;\n min-width: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationAnimateCollapse {\n display: grid;\n grid-template-rows: 0fr;\n opacity: 0;\n transition:\n grid-template-rows 0.4s cubic-bezier(0.32, 0.72, 0, 1),\n opacity 0.35s cubic-bezier(0.32, 0.72, 0, 1);\n transition:\n grid-template-rows 0.4s cubic-bezier(0.32, 0.72, 0, 1),\n opacity 0.35s cubic-bezier(0.32, 0.72, 0, 1),\n -ms-grid-rows 0.4s cubic-bezier(0.32, 0.72, 0, 1);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationAnimateCollapseOpen {\n grid-template-rows: 1fr;\n opacity: 1;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCollapseBody {\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationAnimateCollapseInner {\n overflow: hidden;\n min-height: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCollapseBodyWrap,\n.utilities_ops-announcements_Banner--sideNotificationExpandedItemsWrap {\n min-width: 0;\n width: 100%;\n}\n\n/* Nested white notification cards inside the expanded app group container */\n.utilities_ops-announcements_Banner--sideNotificationExpandedItemsList {\n display: flex;\n flex-direction: column;\n grid-gap: 8px;\n gap: 8px;\n min-width: 0;\n width: 100%;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationItemCard {\n background-color: #ffffff;\n border-radius: 8px;\n padding: 10px 12px;\n min-width: 0;\n width: 100%;\n overflow: hidden;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationStackContainer {\n position: absolute;\n left: 8px;\n right: 8px;\n bottom: 0;\n height: 16px;\n cursor: pointer;\n z-index: 0;\n opacity: 1;\n -webkit-transform: translateY(0);\n transform: translateY(0);\n transition:\n opacity 0.24s cubic-bezier(0.4, 0, 0.2, 1),\n -webkit-transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);\n transition:\n opacity 0.24s cubic-bezier(0.4, 0, 0.2, 1),\n transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);\n transition:\n opacity 0.24s cubic-bezier(0.4, 0, 0.2, 1),\n transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),\n -webkit-transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationStackContainerHidden {\n opacity: 0;\n -webkit-transform: translateY(6px);\n transform: translateY(6px);\n pointer-events: none;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationStackLayer {\n position: absolute;\n left: 0;\n right: 0;\n height: 8px;\n background-color: #d6e4f7;\n border-radius: 0 0 8px 8px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationStackLayer1 {\n bottom: 6px;\n background-color: rgba(223, 233, 251, 0.70);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationStackLayer2 {\n bottom: 0px;\n left: 6px;\n right: 6px;\n background-color: rgba(223, 233, 251, 0.50);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCard {\n position: relative;\n z-index: 1;\n background-color: #DFE9FB;\n border-radius: 8px;\n padding: 12px 14px;\n min-width: 0;\n overflow: hidden;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n grid-gap: 8px;\n gap: 8px;\n margin: 0 -14px 10px;\n padding: 0 14px 10px;\n border-bottom: 1px solid #C7D1E5;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardHeaderLeft {\n display: flex;\n align-items: center;\n grid-gap: 8px;\n gap: 8px;\n min-width: 0;\n flex: 1;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardHeaderRight {\n display: flex;\n align-items: center;\n grid-gap: 6px;\n gap: 6px;\n flex-shrink: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardHeaderTime {\n font-size: 11px;\n color: rgba(0, 0, 0, 0.20);\n font-weight: 600;\n white-space: nowrap;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationChevronBtn {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n margin: 0;\n border: none;\n background: none;\n color: #000;\n cursor: pointer;\n width: 24px;\n height: 24px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationChevronBtn i,\n.utilities_ops-announcements_Banner--sideNotificationChevronBtn svg {\n font-size: 16px;\n color: #000;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationChevronIcon {\n display: inline-flex;\n transition: -webkit-transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);\n transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);\n transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationChevronIconExpanded {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardPreview {\n font-size: 13px;\n font-weight: 600;\n color: #201f1e;\n line-height: 1.4;\n min-width: 0;\n overflow: hidden;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n text-overflow: ellipsis;\n word-break: break-word;\n word-wrap: anywhere;\n /* autoprefixer: off */\n -webkit-box-orient: vertical;\n /* autoprefixer: on */\n}\n\n.utilities_ops-announcements_Banner--sideNotificationCardPreview * {\n display: inline;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationMoreBtn {\n display: block;\n margin-top: 8px;\n padding: 0;\n border: none;\n background: none;\n color: #1E54AD;\n font-size: 12px;\n font-weight: 400;\n line-height: 1.2;\n cursor: pointer;\n text-align: left;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationLoadMoreSentinel {\n height: 1px;\n width: 100%;\n flex-shrink: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRowMain {\n flex: 1;\n min-width: 0;\n font-size: 13px;\n font-weight: 600;\n color: #201f1e;\n line-height: 1.35;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRowText {\n word-break: break-word;\n word-wrap: anywhere;\n white-space: normal;\n display: inline;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRowText * {\n white-space: normal;\n word-wrap: anywhere;\n word-break: break-word;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRowLink {\n display: inline-flex;\n vertical-align: middle;\n text-decoration: none;\n line-height: 1;\n margin-left: 5px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRowLink i {\n font-size: 16px;\n color: #1d5ab9;\n cursor: pointer;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRow {\n display: flex;\n align-items: flex-start;\n grid-gap: 8px;\n gap: 8px;\n min-width: 0;\n width: 100%;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRowAction {\n width: 100%;\n margin-top: 8px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRowMeta {\n display: flex;\n grid-gap: 8px;\n gap: 8px;\n flex-shrink: 0;\n align-self: flex-start;\n padding-top: 1px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationExpandedRowTime {\n font-size: 11px;\n color: rgba(0, 0, 0, 0.20);\n font-weight: 600;\n white-space: nowrap;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationDismissBtn {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n margin: 0;\n border: none;\n background: none;\n cursor: pointer;\n color: #000;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationDismissBtn i {\n font-size: 18px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupAppIconWrap {\n width: 24px;\n height: 24px;\n border-radius: 4px;\n background-color: #ffffff;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupAppIcon {\n width: 16px;\n height: 16px;\n -o-object-fit: contain;\n object-fit: contain;\n -webkit-filter: invert(24%) sepia(100%) saturate(1350%) hue-rotate(201deg) brightness(96%) contrast(93%);\n filter: invert(24%) sepia(100%) saturate(1350%) hue-rotate(201deg) brightness(96%) contrast(93%);\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupAppIconPlaceholder {\n width: 24px;\n height: 24px;\n border-radius: 4px;\n background-color: #ffffff;\n flex-shrink: 0;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationGroupAppName {\n color: #3261bd;\n font-family: 'Segoe UI', SegoeUI, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Droid Sans, Helvetica Neue, sans-serif;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 20px;\n text-transform: uppercase;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n@media (max-width: 1760px) {\n .utilities_ops-announcements_Banner--notificationBarContent input {\n width: 331px !important;\n }\n}\n\n.utilities_ops-announcements_Banner--sideNotificationEmptyState {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n height: 100%;\n grid-gap: 16px;\n gap: 16px;\n margin-top: 75px;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationEmptyIcon {\n display: block;\n width: auto;\n height: auto;\n max-width: 100%;\n}\n\n.utilities_ops-announcements_Banner--sideNotificationEmptyText {\n font-family: 'Segoe UI', SegoeUI, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Droid Sans, Helvetica Neue, sans-serif;\n font-size: 14px;\n font-weight: 600;\n color: #323130;\n}\n";
|
|
25580
25540
|
styleInject(css_248z$9);
|
|
25581
25541
|
|
|
25582
|
-
|
|
25583
|
-
|
|
25584
|
-
|
|
25585
|
-
|
|
25586
|
-
|
|
25587
|
-
|
|
25588
|
-
|
|
25589
|
-
|
|
25542
|
+
var PREFERENCE_KEY = 'g2-viewedNotifications';
|
|
25543
|
+
|
|
25544
|
+
// Backward-compat bridge for apps still on older toolkit versions that read/write
|
|
25545
|
+
// viewedNotifications via localStorage only. New toolkit uses user preferences as
|
|
25546
|
+
// source of truth but mirrors to localStorage on init and dismiss so mixed-version
|
|
25547
|
+
// apps stay in sync on the same browser.
|
|
25548
|
+
// TODO: Remove LEGACY_LOCAL_STORAGE_KEY, readLegacyLocalStorageMap,
|
|
25549
|
+
// writeLegacyLocalStorageMap, mergeMapsWithLatestDismissed dual-read logic, and
|
|
25550
|
+
// localStorage writes in syncViewedNotificationsStores / addNotificationToViewedList
|
|
25551
|
+
// once all apps have migrated to the latest toolkit.
|
|
25552
|
+
var LEGACY_LOCAL_STORAGE_KEY = 'viewedNotifications';
|
|
25553
|
+
|
|
25554
|
+
/** In-memory map for O(1) dismiss lookups during filterNotifications. */
|
|
25555
|
+
var viewedNotificationsMap = {};
|
|
25556
|
+
var initPromise = null;
|
|
25590
25557
|
function injectDismissedAt(notification) {
|
|
25591
25558
|
return _objectSpread2(_objectSpread2({}, notification), {}, {
|
|
25592
25559
|
dismissedAt: new Date().toISOString()
|
|
@@ -25595,40 +25562,222 @@ function injectDismissedAt(notification) {
|
|
|
25595
25562
|
function getNotificationSignatureToStore(notification) {
|
|
25596
25563
|
return compose(injectDismissedAt, pick$1(['notificationId', 'endsAt', 'startsAt']))(notification);
|
|
25597
25564
|
}
|
|
25598
|
-
function
|
|
25565
|
+
function arrayToMap(entries) {
|
|
25566
|
+
if (!Array.isArray(entries)) return {};
|
|
25567
|
+
return entries.reduce(function (acc, entry) {
|
|
25568
|
+
if (entry !== null && entry !== void 0 && entry.notificationId) {
|
|
25569
|
+
acc[entry.notificationId] = entry;
|
|
25570
|
+
}
|
|
25571
|
+
return acc;
|
|
25572
|
+
}, {});
|
|
25573
|
+
}
|
|
25574
|
+
function mapToPayload(map) {
|
|
25575
|
+
return {
|
|
25576
|
+
viewedNotifications: Object.values(map)
|
|
25577
|
+
};
|
|
25578
|
+
}
|
|
25579
|
+
function normalizePreferenceData(data) {
|
|
25580
|
+
if (!data || _typeof$1(data) !== 'object') return {};
|
|
25581
|
+
if (Array.isArray(data.viewedNotifications)) {
|
|
25582
|
+
return arrayToMap(data.viewedNotifications);
|
|
25583
|
+
}
|
|
25584
|
+
|
|
25585
|
+
// Support legacy object-map shape if ever stored that way.
|
|
25586
|
+
if (!Array.isArray(data.viewedNotifications) && !data.viewedNotifications && Object.values(data).every(function (entry) {
|
|
25587
|
+
return entry && _typeof$1(entry) === 'object' && entry.notificationId;
|
|
25588
|
+
})) {
|
|
25589
|
+
return data;
|
|
25590
|
+
}
|
|
25591
|
+
return {};
|
|
25592
|
+
}
|
|
25593
|
+
function readLegacyLocalStorageMap() {
|
|
25599
25594
|
try {
|
|
25600
|
-
|
|
25595
|
+
var raw = localStorage.getItem(LEGACY_LOCAL_STORAGE_KEY);
|
|
25596
|
+
if (!raw) return {};
|
|
25597
|
+
var parsed = JSON.parse(raw);
|
|
25598
|
+
if (Array.isArray(parsed)) {
|
|
25599
|
+
return arrayToMap(parsed);
|
|
25600
|
+
}
|
|
25601
|
+
if (parsed && _typeof$1(parsed) === 'object') {
|
|
25602
|
+
return parsed;
|
|
25603
|
+
}
|
|
25604
|
+
return {};
|
|
25601
25605
|
} catch (err) {
|
|
25602
25606
|
console.error(err);
|
|
25607
|
+
return {};
|
|
25603
25608
|
}
|
|
25604
25609
|
}
|
|
25605
|
-
|
|
25606
|
-
// Removes entries whose endsAt has already passed.
|
|
25607
|
-
// endsAt is stored as a UTC string without Z (e.g. '2024-01-15 14:30:00'),
|
|
25608
|
-
// matching the end_date_ts_utc format used in generateQuery's Solr filter.
|
|
25609
|
-
// Any entry with endsAt < now will never be returned by the API again, so it
|
|
25610
|
-
// can be safely dropped.
|
|
25611
|
-
function pruneExpiredViewedNotifications() {
|
|
25610
|
+
function writeLegacyLocalStorageMap(map) {
|
|
25612
25611
|
try {
|
|
25613
|
-
|
|
25614
|
-
if (!viewed || _typeof$1(viewed) !== 'object' || Array.isArray(viewed)) return;
|
|
25615
|
-
var entries = Object.entries(viewed);
|
|
25616
|
-
if (!entries.length) return;
|
|
25617
|
-
var now = new Date();
|
|
25618
|
-
var pruned = Object.fromEntries(entries.filter(function (_ref) {
|
|
25619
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
25620
|
-
entry = _ref2[1];
|
|
25621
|
-
if (!entry || !entry.endsAt) return false;
|
|
25622
|
-
var endsAt = new Date(String(entry.endsAt).replace(' ', 'T') + 'Z');
|
|
25623
|
-
return !isNaN(endsAt.getTime()) && endsAt > now;
|
|
25624
|
-
}));
|
|
25625
|
-
// Skip the write if nothing was pruned to avoid unnecessary localStorage I/O
|
|
25626
|
-
if (Object.keys(pruned).length === entries.length) return;
|
|
25627
|
-
localStorage.setItem('viewedNotifications', JSON.stringify(pruned));
|
|
25612
|
+
localStorage.setItem(LEGACY_LOCAL_STORAGE_KEY, JSON.stringify(map));
|
|
25628
25613
|
} catch (err) {
|
|
25629
25614
|
console.error(err);
|
|
25630
25615
|
}
|
|
25631
25616
|
}
|
|
25617
|
+
function getDismissedAtTime(entry) {
|
|
25618
|
+
if (!(entry !== null && entry !== void 0 && entry.dismissedAt)) return 0;
|
|
25619
|
+
var time = new Date(entry.dismissedAt).getTime();
|
|
25620
|
+
return Number.isNaN(time) ? 0 : time;
|
|
25621
|
+
}
|
|
25622
|
+
|
|
25623
|
+
// When preferences and localStorage diverge, keep the most recently dismissed entry.
|
|
25624
|
+
function mergeMapsWithLatestDismissed() {
|
|
25625
|
+
for (var _len = arguments.length, maps = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25626
|
+
maps[_key] = arguments[_key];
|
|
25627
|
+
}
|
|
25628
|
+
return maps.reduce(function (acc, map) {
|
|
25629
|
+
Object.entries(map || {}).forEach(function (_ref) {
|
|
25630
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
25631
|
+
id = _ref2[0],
|
|
25632
|
+
entry = _ref2[1];
|
|
25633
|
+
if (!(entry !== null && entry !== void 0 && entry.notificationId)) return;
|
|
25634
|
+
var existing = acc[id];
|
|
25635
|
+
if (!existing || getDismissedAtTime(entry) >= getDismissedAtTime(existing)) {
|
|
25636
|
+
acc[id] = entry;
|
|
25637
|
+
}
|
|
25638
|
+
});
|
|
25639
|
+
return acc;
|
|
25640
|
+
}, {});
|
|
25641
|
+
}
|
|
25642
|
+
function mapsAreEqual(left, right) {
|
|
25643
|
+
var leftKeys = Object.keys(left);
|
|
25644
|
+
var rightKeys = Object.keys(right);
|
|
25645
|
+
if (leftKeys.length !== rightKeys.length) return false;
|
|
25646
|
+
return leftKeys.every(function (key) {
|
|
25647
|
+
return JSON.stringify(left[key]) === JSON.stringify(right[key]);
|
|
25648
|
+
});
|
|
25649
|
+
}
|
|
25650
|
+
|
|
25651
|
+
// Removes entries whose endsAt has already passed.
|
|
25652
|
+
// endsAt is stored as a UTC string without Z (e.g. '2024-01-15 14:30:00'),
|
|
25653
|
+
// matching the end_date_ts_utc format used in generateQuery's Solr filter.
|
|
25654
|
+
function pruneExpiredViewedNotificationsMap(map) {
|
|
25655
|
+
if (!map || _typeof$1(map) !== 'object') return {};
|
|
25656
|
+
var now = new Date();
|
|
25657
|
+
return Object.fromEntries(Object.entries(map).filter(function (_ref3) {
|
|
25658
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
25659
|
+
entry = _ref4[1];
|
|
25660
|
+
if (!entry || !entry.endsAt) return false;
|
|
25661
|
+
var endsAt = new Date(String(entry.endsAt).replace(' ', 'T') + 'Z');
|
|
25662
|
+
return !isNaN(endsAt.getTime()) && endsAt > now;
|
|
25663
|
+
}));
|
|
25664
|
+
}
|
|
25665
|
+
function persistViewedNotificationsMap(_x) {
|
|
25666
|
+
return _persistViewedNotificationsMap.apply(this, arguments);
|
|
25667
|
+
}
|
|
25668
|
+
function _persistViewedNotificationsMap() {
|
|
25669
|
+
_persistViewedNotificationsMap = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee(map) {
|
|
25670
|
+
var _t;
|
|
25671
|
+
return _regenerator().w(function (_context) {
|
|
25672
|
+
while (1) switch (_context.p = _context.n) {
|
|
25673
|
+
case 0:
|
|
25674
|
+
_context.p = 0;
|
|
25675
|
+
_context.n = 1;
|
|
25676
|
+
return fetcher$1.setUserPreferences(PREFERENCE_KEY, mapToPayload(map));
|
|
25677
|
+
case 1:
|
|
25678
|
+
_context.n = 3;
|
|
25679
|
+
break;
|
|
25680
|
+
case 2:
|
|
25681
|
+
_context.p = 2;
|
|
25682
|
+
_t = _context.v;
|
|
25683
|
+
console.error('setUserPreferences viewed notifications error', _t);
|
|
25684
|
+
case 3:
|
|
25685
|
+
return _context.a(2);
|
|
25686
|
+
}
|
|
25687
|
+
}, _callee, null, [[0, 2]]);
|
|
25688
|
+
}));
|
|
25689
|
+
return _persistViewedNotificationsMap.apply(this, arguments);
|
|
25690
|
+
}
|
|
25691
|
+
function syncViewedNotificationsStores(_x2) {
|
|
25692
|
+
return _syncViewedNotificationsStores.apply(this, arguments);
|
|
25693
|
+
}
|
|
25694
|
+
function _syncViewedNotificationsStores() {
|
|
25695
|
+
_syncViewedNotificationsStores = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee2(map) {
|
|
25696
|
+
var preferenceMapBeforeSync,
|
|
25697
|
+
_args2 = arguments;
|
|
25698
|
+
return _regenerator().w(function (_context2) {
|
|
25699
|
+
while (1) switch (_context2.n) {
|
|
25700
|
+
case 0:
|
|
25701
|
+
preferenceMapBeforeSync = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : null;
|
|
25702
|
+
writeLegacyLocalStorageMap(map);
|
|
25703
|
+
if (!(preferenceMapBeforeSync && mapsAreEqual(map, preferenceMapBeforeSync))) {
|
|
25704
|
+
_context2.n = 1;
|
|
25705
|
+
break;
|
|
25706
|
+
}
|
|
25707
|
+
return _context2.a(2);
|
|
25708
|
+
case 1:
|
|
25709
|
+
_context2.n = 2;
|
|
25710
|
+
return persistViewedNotificationsMap(map);
|
|
25711
|
+
case 2:
|
|
25712
|
+
return _context2.a(2);
|
|
25713
|
+
}
|
|
25714
|
+
}, _callee2);
|
|
25715
|
+
}));
|
|
25716
|
+
return _syncViewedNotificationsStores.apply(this, arguments);
|
|
25717
|
+
}
|
|
25718
|
+
function setViewedNotificationsMap(map) {
|
|
25719
|
+
viewedNotificationsMap = map;
|
|
25720
|
+
}
|
|
25721
|
+
function isNotificationViewed(notificationId) {
|
|
25722
|
+
return Boolean(viewedNotificationsMap[notificationId]);
|
|
25723
|
+
}
|
|
25724
|
+
function initViewedNotifications() {
|
|
25725
|
+
return _initViewedNotifications.apply(this, arguments);
|
|
25726
|
+
}
|
|
25727
|
+
function _initViewedNotifications() {
|
|
25728
|
+
_initViewedNotifications = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
25729
|
+
return _regenerator().w(function (_context4) {
|
|
25730
|
+
while (1) switch (_context4.n) {
|
|
25731
|
+
case 0:
|
|
25732
|
+
if (!initPromise) {
|
|
25733
|
+
_context4.n = 1;
|
|
25734
|
+
break;
|
|
25735
|
+
}
|
|
25736
|
+
return _context4.a(2, initPromise);
|
|
25737
|
+
case 1:
|
|
25738
|
+
initPromise = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
25739
|
+
var preferenceMap, preferenceData, legacyMap, mergedMap, prunedMap, _t2;
|
|
25740
|
+
return _regenerator().w(function (_context3) {
|
|
25741
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
25742
|
+
case 0:
|
|
25743
|
+
preferenceMap = {};
|
|
25744
|
+
_context3.p = 1;
|
|
25745
|
+
_context3.n = 2;
|
|
25746
|
+
return fetcher$1.getUserPreferences(PREFERENCE_KEY);
|
|
25747
|
+
case 2:
|
|
25748
|
+
preferenceData = _context3.v;
|
|
25749
|
+
preferenceMap = normalizePreferenceData(preferenceData);
|
|
25750
|
+
_context3.n = 4;
|
|
25751
|
+
break;
|
|
25752
|
+
case 3:
|
|
25753
|
+
_context3.p = 3;
|
|
25754
|
+
_t2 = _context3.v;
|
|
25755
|
+
console.error('getUserPreferences viewed notifications error', _t2);
|
|
25756
|
+
case 4:
|
|
25757
|
+
legacyMap = readLegacyLocalStorageMap();
|
|
25758
|
+
mergedMap = mergeMapsWithLatestDismissed(preferenceMap, legacyMap);
|
|
25759
|
+
prunedMap = pruneExpiredViewedNotificationsMap(mergedMap);
|
|
25760
|
+
setViewedNotificationsMap(prunedMap);
|
|
25761
|
+
_context3.n = 5;
|
|
25762
|
+
return syncViewedNotificationsStores(prunedMap, preferenceMap);
|
|
25763
|
+
case 5:
|
|
25764
|
+
return _context3.a(2);
|
|
25765
|
+
}
|
|
25766
|
+
}, _callee3, null, [[1, 3]]);
|
|
25767
|
+
}))();
|
|
25768
|
+
return _context4.a(2, initPromise);
|
|
25769
|
+
}
|
|
25770
|
+
}, _callee4);
|
|
25771
|
+
}));
|
|
25772
|
+
return _initViewedNotifications.apply(this, arguments);
|
|
25773
|
+
}
|
|
25774
|
+
function addNotificationToViewedList(notification) {
|
|
25775
|
+
if (!(notification !== null && notification !== void 0 && notification.notificationId)) return;
|
|
25776
|
+
var nextMap = _objectSpread2(_objectSpread2({}, viewedNotificationsMap), {}, _defineProperty$2({}, notification.notificationId, getNotificationSignatureToStore(notification)));
|
|
25777
|
+
setViewedNotificationsMap(nextMap);
|
|
25778
|
+
writeLegacyLocalStorageMap(nextMap);
|
|
25779
|
+
persistViewedNotificationsMap(nextMap);
|
|
25780
|
+
}
|
|
25632
25781
|
|
|
25633
25782
|
// Parses a UTC date string like '2024-01-15 14:30:00' (no Z suffix) into a Date object.
|
|
25634
25783
|
// startsAt/endsAt come from the API with the T and Z stripped, so we restore them here.
|
|
@@ -25672,12 +25821,29 @@ function filterOutExpiredNotifications(notifications) {
|
|
|
25672
25821
|
return startDate < now && now < endDate;
|
|
25673
25822
|
})(notifications);
|
|
25674
25823
|
}
|
|
25824
|
+
var NOTIFICATION_DISPLAY_LOCATION = {
|
|
25825
|
+
BANNER: 'BANNER',
|
|
25826
|
+
SIDEBAR: 'SIDEBAR'
|
|
25827
|
+
};
|
|
25828
|
+
function getNotificationDisplayLocation(notification) {
|
|
25829
|
+
var value = (notification === null || notification === void 0 ? void 0 : notification.displayLocation) || NOTIFICATION_DISPLAY_LOCATION.BANNER;
|
|
25830
|
+
var normalized = String(value).toUpperCase();
|
|
25831
|
+
return normalized === NOTIFICATION_DISPLAY_LOCATION.SIDEBAR ? NOTIFICATION_DISPLAY_LOCATION.SIDEBAR : NOTIFICATION_DISPLAY_LOCATION.BANNER;
|
|
25832
|
+
}
|
|
25833
|
+
function filterBannerNotifications(notifications) {
|
|
25834
|
+
return (notifications || []).filter(function (notification) {
|
|
25835
|
+
return getNotificationDisplayLocation(notification) === NOTIFICATION_DISPLAY_LOCATION.BANNER;
|
|
25836
|
+
});
|
|
25837
|
+
}
|
|
25838
|
+
function filterSidebarNotifications(notifications) {
|
|
25839
|
+
return (notifications || []).filter(function (notification) {
|
|
25840
|
+
return getNotificationDisplayLocation(notification) === NOTIFICATION_DISPLAY_LOCATION.SIDEBAR;
|
|
25841
|
+
});
|
|
25842
|
+
}
|
|
25675
25843
|
function filterNotifications(notifications) {
|
|
25676
25844
|
try {
|
|
25677
25845
|
var coreAppConfig = storage$2.getLocalItem('opsportal-core:config') || {};
|
|
25678
25846
|
var filterByTargets = coreAppConfig.filterNotificationsByTargets;
|
|
25679
|
-
// filterOutViewedNotifications
|
|
25680
|
-
var viewedNotifications = getViewedNotifications();
|
|
25681
25847
|
// filterOutExpiredNotifications
|
|
25682
25848
|
var now = new Date();
|
|
25683
25849
|
// filterOutNotificationByAudience — only when filterNotificationsByTargets is true;
|
|
@@ -25694,7 +25860,7 @@ function filterNotifications(notifications) {
|
|
|
25694
25860
|
if ((notification === null || notification === void 0 ? void 0 : notification.status) !== 'A') return false;
|
|
25695
25861
|
|
|
25696
25862
|
// filterOutViewedNotifications
|
|
25697
|
-
if (
|
|
25863
|
+
if (isNotificationViewed(notification.notificationId)) return false;
|
|
25698
25864
|
|
|
25699
25865
|
// filterOutExpiredNotifications
|
|
25700
25866
|
var startsAt = notification.startsAt,
|
|
@@ -25746,7 +25912,6 @@ function getPriorityCode(category) {
|
|
|
25746
25912
|
information: 1
|
|
25747
25913
|
}[category.toLowerCase()];
|
|
25748
25914
|
}
|
|
25749
|
-
var MAX_NOTIFICATIONS_PER_APP_GROUP = 5;
|
|
25750
25915
|
function getAppTileIcon(sourceApplication) {
|
|
25751
25916
|
var _storage$getLocalItem;
|
|
25752
25917
|
if (!sourceApplication) return null;
|
|
@@ -25757,44 +25922,45 @@ function getAppTileIcon(sourceApplication) {
|
|
|
25757
25922
|
});
|
|
25758
25923
|
return tile ? tile.faIconUrl || tile.iconUrl : null;
|
|
25759
25924
|
}
|
|
25925
|
+
function getNotificationStartTime(notification) {
|
|
25926
|
+
var startsAt = notification.startsAt,
|
|
25927
|
+
timeZoneType = notification.timeZoneType;
|
|
25928
|
+
if (timeZoneType === 'Recipient TimeZone' || timeZoneType === 'RPTZ') {
|
|
25929
|
+
return startsAt;
|
|
25930
|
+
}
|
|
25931
|
+
return moment.utc(startsAt).local().format('YYYY-MM-DD HH:mm:ss');
|
|
25932
|
+
}
|
|
25933
|
+
function getNotificationTimestamp(notification) {
|
|
25934
|
+
var startTime = getNotificationStartTime(notification);
|
|
25935
|
+
var startDate = moment(startTime);
|
|
25936
|
+
return startDate.isValid() ? startDate.valueOf() : 0;
|
|
25937
|
+
}
|
|
25760
25938
|
function groupNotificationsByApp(notifications) {
|
|
25761
|
-
var maxPerGroup = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : MAX_NOTIFICATIONS_PER_APP_GROUP;
|
|
25762
25939
|
var groupMap = new Map();
|
|
25763
|
-
var groupOrder = [];
|
|
25764
25940
|
notifications.forEach(function (notification) {
|
|
25765
25941
|
var appName = notification.sourceApplication || 'Other';
|
|
25766
25942
|
if (!groupMap.has(appName)) {
|
|
25767
25943
|
groupMap.set(appName, []);
|
|
25768
|
-
groupOrder.push(appName);
|
|
25769
25944
|
}
|
|
25770
25945
|
groupMap.get(appName).push(notification);
|
|
25771
25946
|
});
|
|
25772
|
-
|
|
25773
|
-
|
|
25774
|
-
|
|
25947
|
+
return Array.from(groupMap.entries()).map(function (_ref2) {
|
|
25948
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
25949
|
+
appName = _ref3[0],
|
|
25950
|
+
all = _ref3[1];
|
|
25951
|
+
var sorted = _toConsumableArray(all).sort(function (a, b) {
|
|
25952
|
+
return getNotificationTimestamp(b) - getNotificationTimestamp(a);
|
|
25775
25953
|
});
|
|
25776
|
-
});
|
|
25777
|
-
return groupOrder.map(function (appName) {
|
|
25778
|
-
var all = groupMap.get(appName);
|
|
25779
25954
|
return {
|
|
25780
25955
|
appName: appName,
|
|
25781
|
-
totalCount:
|
|
25782
|
-
notifications:
|
|
25783
|
-
|
|
25956
|
+
totalCount: sorted.length,
|
|
25957
|
+
notifications: sorted,
|
|
25958
|
+
latestTimestamp: sorted.length ? getNotificationTimestamp(sorted[0]) : 0
|
|
25784
25959
|
};
|
|
25960
|
+
}).sort(function (a, b) {
|
|
25961
|
+
return b.latestTimestamp - a.latestTimestamp;
|
|
25785
25962
|
});
|
|
25786
25963
|
}
|
|
25787
|
-
function getExpandedAppGroup(notifications, appName) {
|
|
25788
|
-
var appNotifications = notifications.filter(function (notification) {
|
|
25789
|
-
return (notification.sourceApplication || 'Other') === appName;
|
|
25790
|
-
});
|
|
25791
|
-
return {
|
|
25792
|
-
appName: appName,
|
|
25793
|
-
totalCount: appNotifications.length,
|
|
25794
|
-
notifications: appNotifications,
|
|
25795
|
-
hasMore: false
|
|
25796
|
-
};
|
|
25797
|
-
}
|
|
25798
25964
|
function sortNotifications(notifications) {
|
|
25799
25965
|
try {
|
|
25800
25966
|
return _toConsumableArray(notifications).map(function (n) {
|
|
@@ -25842,6 +26008,30 @@ var getTimeDiff = function getTimeDiff(startsAt) {
|
|
|
25842
26008
|
}
|
|
25843
26009
|
return '';
|
|
25844
26010
|
};
|
|
26011
|
+
var getSidebarTimeDiff = function getSidebarTimeDiff(startsAt) {
|
|
26012
|
+
var startDate = moment(startsAt);
|
|
26013
|
+
var todayDate = moment(new Date());
|
|
26014
|
+
var minsDiff = todayDate.diff(startDate, 'minutes');
|
|
26015
|
+
var hoursDiff = todayDate.diff(startDate, 'hours');
|
|
26016
|
+
var daysDiff = todayDate.diff(startDate, 'days');
|
|
26017
|
+
var monthsDiff = todayDate.diff(startDate, 'months');
|
|
26018
|
+
if (minsDiff < 1) {
|
|
26019
|
+
return '1m ago';
|
|
26020
|
+
}
|
|
26021
|
+
if (minsDiff < 60) {
|
|
26022
|
+
return "".concat(minsDiff, "m ago");
|
|
26023
|
+
}
|
|
26024
|
+
if (hoursDiff < 24) {
|
|
26025
|
+
return "".concat(hoursDiff, "h ago");
|
|
26026
|
+
}
|
|
26027
|
+
if (daysDiff <= 30) {
|
|
26028
|
+
return "".concat(daysDiff, "d ago");
|
|
26029
|
+
}
|
|
26030
|
+
if (monthsDiff <= 12) {
|
|
26031
|
+
return "".concat(monthsDiff, "mo ago");
|
|
26032
|
+
}
|
|
26033
|
+
return '';
|
|
26034
|
+
};
|
|
25845
26035
|
var SANITIZE_REGEX = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>|<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi;
|
|
25846
26036
|
var SanitizeNotificationContent = function SanitizeNotificationContent(str) {
|
|
25847
26037
|
SANITIZE_REGEX.lastIndex = 0;
|
|
@@ -25877,7 +26067,7 @@ var useWindowSize = function useWindowSize() {
|
|
|
25877
26067
|
return windowSize;
|
|
25878
26068
|
};
|
|
25879
26069
|
|
|
25880
|
-
var _excluded$
|
|
26070
|
+
var _excluded$3 = ["count", "current", "showNavButtons", "onLeftButtonClick", "onRightButtonClick", "saveActionComponentState", "ActionComponent", "notificationsTopContainerRef", "mobileNotificationsTopContainerRef", "setNotificationHeightFlag", "sidebarExpandedSecondary"];
|
|
25881
26071
|
var alertBackgroundColorMapping = {
|
|
25882
26072
|
alert: '#fab9b9',
|
|
25883
26073
|
warning: '#f5f5cb',
|
|
@@ -25946,13 +26136,13 @@ var Banner = function Banner(props) {
|
|
|
25946
26136
|
notificationsTopContainerRef = props.notificationsTopContainerRef,
|
|
25947
26137
|
mobileNotificationsTopContainerRef = props.mobileNotificationsTopContainerRef,
|
|
25948
26138
|
setNotificationHeightFlag = props.setNotificationHeightFlag,
|
|
25949
|
-
|
|
26139
|
+
sidebarExpandedSecondary = props.sidebarExpandedSecondary,
|
|
26140
|
+
notification = _objectWithoutProperties(props, _excluded$3);
|
|
25950
26141
|
var dismissibleFlag = notification.dismissibleFlag,
|
|
25951
26142
|
onDismiss = notification.onDismiss,
|
|
25952
26143
|
startsAt = notification.startsAt,
|
|
25953
26144
|
timeZoneType = notification.timeZoneType,
|
|
25954
26145
|
showSideBar = notification.showSideBar,
|
|
25955
|
-
isGroupedSideBar = notification.isGroupedSideBar,
|
|
25956
26146
|
action = notification.action,
|
|
25957
26147
|
content = notification.content,
|
|
25958
26148
|
sourceApplication = notification.sourceApplication,
|
|
@@ -25984,6 +26174,8 @@ var Banner = function Banner(props) {
|
|
|
25984
26174
|
}, [expanded]);
|
|
25985
26175
|
var startTime = timeZoneType === "Recipient TimeZone" || timeZoneType === "RPTZ" ? startsAt : moment.utc(startsAt).local().format("YYYY-MM-DD HH:mm:ss");
|
|
25986
26176
|
var timeDiff = getTimeDiff(startTime);
|
|
26177
|
+
var sidebarTimeDiff = sidebarExpandedSecondary ? getSidebarTimeDiff(startTime) : '';
|
|
26178
|
+
var isDismissible = dismissibleFlag === true || dismissibleFlag === "true";
|
|
25987
26179
|
var topNotificationBar = function topNotificationBar() {
|
|
25988
26180
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
25989
26181
|
className: "utilities_ops-announcements_Banner--notificationContainer",
|
|
@@ -26050,10 +26242,10 @@ var Banner = function Banner(props) {
|
|
|
26050
26242
|
onRightButtonClick: onRightButtonClick
|
|
26051
26243
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26052
26244
|
className: "utilities_ops-announcements_Banner--notificationBarBtn",
|
|
26053
|
-
style:
|
|
26245
|
+
style: isDismissible ? {
|
|
26054
26246
|
borderLeft: '2px solid rgb(204, 204, 204)'
|
|
26055
26247
|
} : {}
|
|
26056
|
-
},
|
|
26248
|
+
}, isDismissible && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26057
26249
|
onClick: onDismiss
|
|
26058
26250
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.Icon, {
|
|
26059
26251
|
style: {
|
|
@@ -26063,112 +26255,54 @@ var Banner = function Banner(props) {
|
|
|
26063
26255
|
variant: "material"
|
|
26064
26256
|
}))));
|
|
26065
26257
|
};
|
|
26066
|
-
var
|
|
26067
|
-
var categoryColor = alertInfoColorMapping[categoryKey];
|
|
26068
|
-
var categoryBackground = alertBackgroundColorMapping[categoryKey];
|
|
26069
|
-
var groupedSideNotificationRow = function groupedSideNotificationRow() {
|
|
26258
|
+
var sidebarExpandedSecondaryRow = function sidebarExpandedSecondaryRow() {
|
|
26070
26259
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26071
|
-
className: "utilities_ops-announcements_Banner--
|
|
26072
|
-
style: {
|
|
26073
|
-
backgroundColor: categoryBackground
|
|
26074
|
-
}
|
|
26260
|
+
className: "utilities_ops-announcements_Banner--sideNotificationSecondaryBody"
|
|
26075
26261
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26076
|
-
className: "utilities_ops-announcements_Banner--
|
|
26077
|
-
style: {
|
|
26078
|
-
backgroundColor: categoryColor
|
|
26079
|
-
}
|
|
26080
|
-
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
26081
|
-
name: alertToIconMapping[categoryKey],
|
|
26082
|
-
style: {
|
|
26083
|
-
fontSize: '11px'
|
|
26084
|
-
}
|
|
26085
|
-
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26086
|
-
className: "utilities_ops-announcements_Banner--sideNotificationRowContent"
|
|
26087
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26088
|
-
className: "utilities_ops-announcements_Banner--sideNotificationRowText",
|
|
26089
|
-
dangerouslySetInnerHTML: {
|
|
26090
|
-
__html: SanitizeNotificationContent(content)
|
|
26091
|
-
}
|
|
26092
|
-
}), action && ActionComponent && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26093
|
-
style: {
|
|
26094
|
-
marginTop: '4px'
|
|
26095
|
-
}
|
|
26096
|
-
}, /*#__PURE__*/React__default["default"].createElement(ActionComponent, {
|
|
26097
|
-
notification: notification,
|
|
26098
|
-
saveActionComponentState: saveActionComponentState
|
|
26099
|
-
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26100
|
-
className: "utilities_ops-announcements_Banner--sideNotificationRowMeta"
|
|
26101
|
-
}, (feedUrl || link) && /*#__PURE__*/React__default["default"].createElement("a", {
|
|
26102
|
-
href: feedUrl || link,
|
|
26103
|
-
target: "_blank",
|
|
26104
|
-
rel: "noopener noreferrer",
|
|
26105
|
-
className: "utilities_ops-announcements_Banner--sideNotificationRowLink"
|
|
26106
|
-
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.Icon, {
|
|
26107
|
-
name: "open_in_new",
|
|
26108
|
-
variant: "material"
|
|
26109
|
-
})), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
26110
|
-
className: "utilities_ops-announcements_Banner--sideNotificationRowTime"
|
|
26111
|
-
}, timeDiff)));
|
|
26112
|
-
};
|
|
26113
|
-
var sideNotificationBar = function sideNotificationBar() {
|
|
26114
|
-
return isGroupedSideBar ? groupedSideNotificationRow() : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26115
|
-
className: "utilities_ops-announcements_Banner--notificationContainer utilities_ops-announcements_Banner--sideBar",
|
|
26116
|
-
style: {
|
|
26117
|
-
backgroundColor: categoryBackground
|
|
26118
|
-
}
|
|
26119
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26120
|
-
className: "utilities_ops-announcements_Banner--appBarContentWrapper",
|
|
26121
|
-
style: {
|
|
26122
|
-
borderLeft: "2px solid ".concat(categoryColor)
|
|
26123
|
-
}
|
|
26262
|
+
className: "utilities_ops-announcements_Banner--sideNotificationExpandedRow"
|
|
26124
26263
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26125
|
-
className: "utilities_ops-announcements_Banner--
|
|
26126
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26127
|
-
className: "utilities_ops-announcements_Banner--sideNotificationInfoBox",
|
|
26128
|
-
style: {
|
|
26129
|
-
backgroundColor: categoryColor
|
|
26130
|
-
}
|
|
26131
|
-
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
26132
|
-
name: alertToIconMapping[categoryKey],
|
|
26133
|
-
style: {
|
|
26134
|
-
fontSize: '12px'
|
|
26135
|
-
}
|
|
26136
|
-
})), sourceApplication && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("b", null, sourceApplication), " -"), " ", timeDiff), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26137
|
-
className: "utilities_ops-announcements_Banner--appBarContentBox"
|
|
26264
|
+
className: "utilities_ops-announcements_Banner--sideNotificationExpandedRowMain"
|
|
26138
26265
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
26266
|
+
className: "utilities_ops-announcements_Banner--sideNotificationExpandedRowText",
|
|
26139
26267
|
dangerouslySetInnerHTML: {
|
|
26140
26268
|
__html: SanitizeNotificationContent(content)
|
|
26141
26269
|
}
|
|
26142
26270
|
}), (feedUrl || link) && /*#__PURE__*/React__default["default"].createElement("a", {
|
|
26143
26271
|
href: feedUrl || link,
|
|
26144
26272
|
target: "_blank",
|
|
26145
|
-
|
|
26273
|
+
rel: "noopener noreferrer",
|
|
26274
|
+
className: "utilities_ops-announcements_Banner--sideNotificationExpandedRowLink"
|
|
26146
26275
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.Icon, {
|
|
26147
26276
|
name: "open_in_new",
|
|
26148
26277
|
variant: "material"
|
|
26149
|
-
}))), action && ActionComponent && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26150
|
-
style: {
|
|
26151
|
-
marginBottom: '5px'
|
|
26152
|
-
}
|
|
26153
|
-
}, /*#__PURE__*/React__default["default"].createElement(ActionComponent, {
|
|
26154
|
-
notification: notification,
|
|
26155
|
-
saveActionComponentState: saveActionComponentState
|
|
26156
26278
|
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26157
|
-
className: "utilities_ops-announcements_Banner--
|
|
26158
|
-
|
|
26159
|
-
|
|
26160
|
-
|
|
26161
|
-
|
|
26162
|
-
|
|
26279
|
+
className: "utilities_ops-announcements_Banner--sideNotificationExpandedRowMeta"
|
|
26280
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
26281
|
+
className: "utilities_ops-announcements_Banner--sideNotificationExpandedRowTime"
|
|
26282
|
+
}, sidebarTimeDiff), isDismissible && /*#__PURE__*/React__default["default"].createElement("button", {
|
|
26283
|
+
type: "button",
|
|
26284
|
+
className: "utilities_ops-announcements_Banner--sideNotificationDismissBtn",
|
|
26285
|
+
onClick: onDismiss,
|
|
26286
|
+
"aria-label": "Dismiss notification"
|
|
26163
26287
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.Icon, {
|
|
26164
26288
|
style: {
|
|
26165
|
-
cursor: 'pointer'
|
|
26166
|
-
color: '#8A8886',
|
|
26167
|
-
fontSize: '20px'
|
|
26289
|
+
cursor: 'pointer'
|
|
26168
26290
|
},
|
|
26169
26291
|
name: "close",
|
|
26170
26292
|
variant: "material"
|
|
26171
|
-
}))))
|
|
26293
|
+
})))), action && ActionComponent && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26294
|
+
className: "utilities_ops-announcements_Banner--sideNotificationExpandedRowAction"
|
|
26295
|
+
}, /*#__PURE__*/React__default["default"].createElement(ActionComponent, {
|
|
26296
|
+
notification: notification,
|
|
26297
|
+
saveActionComponentState: saveActionComponentState,
|
|
26298
|
+
displayVariant: "sidebarV2"
|
|
26299
|
+
})));
|
|
26300
|
+
};
|
|
26301
|
+
var sideNotificationBar = function sideNotificationBar() {
|
|
26302
|
+
if (sidebarExpandedSecondary) {
|
|
26303
|
+
return sidebarExpandedSecondaryRow();
|
|
26304
|
+
}
|
|
26305
|
+
return null;
|
|
26172
26306
|
};
|
|
26173
26307
|
var mobileNotificationBar = function mobileNotificationBar() {
|
|
26174
26308
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -26280,111 +26414,253 @@ var _styleModuleImportMap$4 = {
|
|
|
26280
26414
|
"appBarContentWrapper": "utilities_ops-announcements_Banner--appBarContentWrapper",
|
|
26281
26415
|
"sideBarNotificationMeta": "utilities_ops-announcements_Banner--sideBarNotificationMeta",
|
|
26282
26416
|
"feedUrl": "utilities_ops-announcements_Banner--feedUrl",
|
|
26283
|
-
"
|
|
26284
|
-
"
|
|
26285
|
-
"
|
|
26286
|
-
"
|
|
26287
|
-
"
|
|
26417
|
+
"sideNotificationSidebarList": "utilities_ops-announcements_Banner--sideNotificationSidebarList",
|
|
26418
|
+
"sideNotificationCardWrapper": "utilities_ops-announcements_Banner--sideNotificationCardWrapper",
|
|
26419
|
+
"sideNotificationCardWrapperStacked": "utilities_ops-announcements_Banner--sideNotificationCardWrapperStacked",
|
|
26420
|
+
"sideNotificationCardWrapperExpanded": "utilities_ops-announcements_Banner--sideNotificationCardWrapperExpanded",
|
|
26421
|
+
"sideNotificationStackContainer": "utilities_ops-announcements_Banner--sideNotificationStackContainer",
|
|
26422
|
+
"sideNotificationExpandedGroup": "utilities_ops-announcements_Banner--sideNotificationExpandedGroup",
|
|
26423
|
+
"sideNotificationSecondaryBody": "utilities_ops-announcements_Banner--sideNotificationSecondaryBody",
|
|
26424
|
+
"sideNotificationAnimateCollapse": "utilities_ops-announcements_Banner--sideNotificationAnimateCollapse",
|
|
26425
|
+
"sideNotificationAnimateCollapseOpen": "utilities_ops-announcements_Banner--sideNotificationAnimateCollapseOpen",
|
|
26426
|
+
"sideNotificationCollapseBody": "utilities_ops-announcements_Banner--sideNotificationCollapseBody",
|
|
26427
|
+
"sideNotificationAnimateCollapseInner": "utilities_ops-announcements_Banner--sideNotificationAnimateCollapseInner",
|
|
26428
|
+
"sideNotificationCollapseBodyWrap": "utilities_ops-announcements_Banner--sideNotificationCollapseBodyWrap",
|
|
26429
|
+
"sideNotificationExpandedItemsWrap": "utilities_ops-announcements_Banner--sideNotificationExpandedItemsWrap",
|
|
26430
|
+
"sideNotificationExpandedItemsList": "utilities_ops-announcements_Banner--sideNotificationExpandedItemsList",
|
|
26431
|
+
"sideNotificationItemCard": "utilities_ops-announcements_Banner--sideNotificationItemCard",
|
|
26432
|
+
"sideNotificationStackContainerHidden": "utilities_ops-announcements_Banner--sideNotificationStackContainerHidden",
|
|
26433
|
+
"sideNotificationStackLayer": "utilities_ops-announcements_Banner--sideNotificationStackLayer",
|
|
26434
|
+
"sideNotificationStackLayer1": "utilities_ops-announcements_Banner--sideNotificationStackLayer1",
|
|
26435
|
+
"sideNotificationStackLayer2": "utilities_ops-announcements_Banner--sideNotificationStackLayer2",
|
|
26436
|
+
"sideNotificationCard": "utilities_ops-announcements_Banner--sideNotificationCard",
|
|
26437
|
+
"sideNotificationCardHeader": "utilities_ops-announcements_Banner--sideNotificationCardHeader",
|
|
26438
|
+
"sideNotificationCardHeaderLeft": "utilities_ops-announcements_Banner--sideNotificationCardHeaderLeft",
|
|
26439
|
+
"sideNotificationCardHeaderRight": "utilities_ops-announcements_Banner--sideNotificationCardHeaderRight",
|
|
26440
|
+
"sideNotificationCardHeaderTime": "utilities_ops-announcements_Banner--sideNotificationCardHeaderTime",
|
|
26441
|
+
"sideNotificationChevronBtn": "utilities_ops-announcements_Banner--sideNotificationChevronBtn",
|
|
26442
|
+
"sideNotificationChevronIcon": "utilities_ops-announcements_Banner--sideNotificationChevronIcon",
|
|
26443
|
+
"sideNotificationChevronIconExpanded": "utilities_ops-announcements_Banner--sideNotificationChevronIconExpanded",
|
|
26444
|
+
"sideNotificationCardPreview": "utilities_ops-announcements_Banner--sideNotificationCardPreview",
|
|
26445
|
+
"sideNotificationMoreBtn": "utilities_ops-announcements_Banner--sideNotificationMoreBtn",
|
|
26446
|
+
"sideNotificationLoadMoreSentinel": "utilities_ops-announcements_Banner--sideNotificationLoadMoreSentinel",
|
|
26447
|
+
"sideNotificationExpandedRowMain": "utilities_ops-announcements_Banner--sideNotificationExpandedRowMain",
|
|
26448
|
+
"sideNotificationExpandedRowText": "utilities_ops-announcements_Banner--sideNotificationExpandedRowText",
|
|
26449
|
+
"sideNotificationExpandedRowLink": "utilities_ops-announcements_Banner--sideNotificationExpandedRowLink",
|
|
26450
|
+
"sideNotificationExpandedRow": "utilities_ops-announcements_Banner--sideNotificationExpandedRow",
|
|
26451
|
+
"sideNotificationExpandedRowAction": "utilities_ops-announcements_Banner--sideNotificationExpandedRowAction",
|
|
26452
|
+
"sideNotificationExpandedRowMeta": "utilities_ops-announcements_Banner--sideNotificationExpandedRowMeta",
|
|
26453
|
+
"sideNotificationExpandedRowTime": "utilities_ops-announcements_Banner--sideNotificationExpandedRowTime",
|
|
26454
|
+
"sideNotificationDismissBtn": "utilities_ops-announcements_Banner--sideNotificationDismissBtn",
|
|
26455
|
+
"sideNotificationGroupAppIconWrap": "utilities_ops-announcements_Banner--sideNotificationGroupAppIconWrap",
|
|
26288
26456
|
"sideNotificationGroupAppIcon": "utilities_ops-announcements_Banner--sideNotificationGroupAppIcon",
|
|
26289
26457
|
"sideNotificationGroupAppIconPlaceholder": "utilities_ops-announcements_Banner--sideNotificationGroupAppIconPlaceholder",
|
|
26290
26458
|
"sideNotificationGroupAppName": "utilities_ops-announcements_Banner--sideNotificationGroupAppName",
|
|
26291
|
-
"
|
|
26292
|
-
"
|
|
26293
|
-
"
|
|
26294
|
-
"sideNotificationRowContent": "utilities_ops-announcements_Banner--sideNotificationRowContent",
|
|
26295
|
-
"sideNotificationRowText": "utilities_ops-announcements_Banner--sideNotificationRowText",
|
|
26296
|
-
"sideNotificationRowMeta": "utilities_ops-announcements_Banner--sideNotificationRowMeta",
|
|
26297
|
-
"sideNotificationRowLink": "utilities_ops-announcements_Banner--sideNotificationRowLink",
|
|
26298
|
-
"sideNotificationRowTime": "utilities_ops-announcements_Banner--sideNotificationRowTime",
|
|
26299
|
-
"sideNotificationViewAll": "utilities_ops-announcements_Banner--sideNotificationViewAll"
|
|
26459
|
+
"sideNotificationEmptyState": "utilities_ops-announcements_Banner--sideNotificationEmptyState",
|
|
26460
|
+
"sideNotificationEmptyIcon": "utilities_ops-announcements_Banner--sideNotificationEmptyIcon",
|
|
26461
|
+
"sideNotificationEmptyText": "utilities_ops-announcements_Banner--sideNotificationEmptyText"
|
|
26300
26462
|
}
|
|
26301
26463
|
};
|
|
26464
|
+
var EXPANDED_BATCH_SIZE = 15;
|
|
26302
26465
|
var SideNotificationGroup = function SideNotificationGroup(_ref) {
|
|
26303
26466
|
var appName = _ref.appName,
|
|
26304
26467
|
totalCount = _ref.totalCount,
|
|
26305
26468
|
notifications = _ref.notifications,
|
|
26306
|
-
|
|
26307
|
-
|
|
26308
|
-
onBack = _ref.onBack,
|
|
26309
|
-
onViewAll = _ref.onViewAll,
|
|
26469
|
+
isExpanded = _ref.isExpanded,
|
|
26470
|
+
onToggleExpand = _ref.onToggleExpand,
|
|
26310
26471
|
_onDismiss = _ref.onDismiss,
|
|
26472
|
+
scrollContainerRef = _ref.scrollContainerRef,
|
|
26311
26473
|
ActionComponent = _ref.ActionComponent,
|
|
26312
26474
|
saveActionComponentState = _ref.saveActionComponentState;
|
|
26313
26475
|
var appIconUrl = getAppTileIcon(appName);
|
|
26476
|
+
var topNotification = notifications[0];
|
|
26477
|
+
var moreCount = totalCount - 1;
|
|
26478
|
+
var stackLayers = Math.min(moreCount, 2);
|
|
26479
|
+
var topStartTime = topNotification ? getNotificationStartTime(topNotification) : null;
|
|
26480
|
+
var topTimeDiff = topStartTime ? getSidebarTimeDiff(topStartTime) : '';
|
|
26481
|
+
var _useState = React.useState(EXPANDED_BATCH_SIZE),
|
|
26482
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26483
|
+
visibleCount = _useState2[0],
|
|
26484
|
+
setVisibleCount = _useState2[1];
|
|
26485
|
+
var loadMoreRef = React.useRef(null);
|
|
26486
|
+
var totalCountRef = React.useRef(notifications.length);
|
|
26487
|
+
totalCountRef.current = notifications.length;
|
|
26488
|
+
React.useEffect(function () {
|
|
26489
|
+
setVisibleCount(EXPANDED_BATCH_SIZE);
|
|
26490
|
+
}, [isExpanded, notifications.length]);
|
|
26491
|
+
var loadMoreIfNeeded = React.useCallback(function () {
|
|
26492
|
+
var scrollRoot = scrollContainerRef === null || scrollContainerRef === void 0 ? void 0 : scrollContainerRef.current;
|
|
26493
|
+
var sentinel = loadMoreRef.current;
|
|
26494
|
+
if (!scrollRoot || !sentinel) {
|
|
26495
|
+
return;
|
|
26496
|
+
}
|
|
26497
|
+
setVisibleCount(function (prev) {
|
|
26498
|
+
if (prev >= totalCountRef.current) {
|
|
26499
|
+
return prev;
|
|
26500
|
+
}
|
|
26501
|
+
var rootRect = scrollRoot.getBoundingClientRect();
|
|
26502
|
+
var sentinelRect = sentinel.getBoundingClientRect();
|
|
26503
|
+
if (sentinelRect.top <= rootRect.bottom + 200) {
|
|
26504
|
+
return Math.min(prev + EXPANDED_BATCH_SIZE, totalCountRef.current);
|
|
26505
|
+
}
|
|
26506
|
+
return prev;
|
|
26507
|
+
});
|
|
26508
|
+
}, [scrollContainerRef]);
|
|
26509
|
+
React.useEffect(function () {
|
|
26510
|
+
if (!isExpanded || visibleCount >= notifications.length) {
|
|
26511
|
+
return undefined;
|
|
26512
|
+
}
|
|
26513
|
+
var scrollRoot = scrollContainerRef === null || scrollContainerRef === void 0 ? void 0 : scrollContainerRef.current;
|
|
26514
|
+
var sentinel = loadMoreRef.current;
|
|
26515
|
+
if (!scrollRoot || !sentinel) {
|
|
26516
|
+
return undefined;
|
|
26517
|
+
}
|
|
26518
|
+
var observer = new IntersectionObserver(function (entries) {
|
|
26519
|
+
var _entries$;
|
|
26520
|
+
if ((_entries$ = entries[0]) !== null && _entries$ !== void 0 && _entries$.isIntersecting) {
|
|
26521
|
+
loadMoreIfNeeded();
|
|
26522
|
+
}
|
|
26523
|
+
}, {
|
|
26524
|
+
root: scrollRoot,
|
|
26525
|
+
rootMargin: '200px',
|
|
26526
|
+
threshold: 0
|
|
26527
|
+
});
|
|
26528
|
+
observer.observe(sentinel);
|
|
26529
|
+
scrollRoot.addEventListener('scroll', loadMoreIfNeeded, {
|
|
26530
|
+
passive: true
|
|
26531
|
+
});
|
|
26532
|
+
loadMoreIfNeeded();
|
|
26533
|
+
return function () {
|
|
26534
|
+
observer.disconnect();
|
|
26535
|
+
scrollRoot.removeEventListener('scroll', loadMoreIfNeeded);
|
|
26536
|
+
};
|
|
26537
|
+
}, [isExpanded, notifications.length, visibleCount, scrollContainerRef, loadMoreIfNeeded]);
|
|
26538
|
+
React.useEffect(function () {
|
|
26539
|
+
if (!isExpanded || visibleCount >= notifications.length) {
|
|
26540
|
+
return undefined;
|
|
26541
|
+
}
|
|
26542
|
+
var frameId = requestAnimationFrame(loadMoreIfNeeded);
|
|
26543
|
+
return function () {
|
|
26544
|
+
return cancelAnimationFrame(frameId);
|
|
26545
|
+
};
|
|
26546
|
+
}, [isExpanded, visibleCount, notifications.length, loadMoreIfNeeded]);
|
|
26547
|
+
var handleExpandClick = function handleExpandClick(e) {
|
|
26548
|
+
e.stopPropagation();
|
|
26549
|
+
if (!isExpanded) {
|
|
26550
|
+
onToggleExpand();
|
|
26551
|
+
}
|
|
26552
|
+
};
|
|
26553
|
+
var handleChevronClick = function handleChevronClick(e) {
|
|
26554
|
+
e.stopPropagation();
|
|
26555
|
+
onToggleExpand();
|
|
26556
|
+
};
|
|
26557
|
+
var moreLabel = moreCount === 1 ? '1 more notification' : "".concat(moreCount, " more notifications");
|
|
26558
|
+
var visibleNotifications = notifications.slice(0, visibleCount);
|
|
26559
|
+
var hasMore = visibleCount < notifications.length;
|
|
26560
|
+
var renderHeader = function renderHeader() {
|
|
26561
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26562
|
+
className: "utilities_ops-announcements_Banner--sideNotificationCardHeader"
|
|
26563
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26564
|
+
className: "utilities_ops-announcements_Banner--sideNotificationCardHeaderLeft"
|
|
26565
|
+
}, appIconUrl ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26566
|
+
className: "utilities_ops-announcements_Banner--sideNotificationGroupAppIconWrap"
|
|
26567
|
+
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
26568
|
+
className: "utilities_ops-announcements_Banner--sideNotificationGroupAppIcon",
|
|
26569
|
+
src: appIconUrl,
|
|
26570
|
+
alt: ""
|
|
26571
|
+
})) : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26572
|
+
className: "utilities_ops-announcements_Banner--sideNotificationGroupAppIconPlaceholder"
|
|
26573
|
+
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
26574
|
+
className: "utilities_ops-announcements_Banner--sideNotificationGroupAppName"
|
|
26575
|
+
}, appName, " (", totalCount, ")")), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26576
|
+
className: "utilities_ops-announcements_Banner--sideNotificationCardHeaderRight"
|
|
26577
|
+
}, !isExpanded && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
26578
|
+
className: "utilities_ops-announcements_Banner--sideNotificationCardHeaderTime"
|
|
26579
|
+
}, topTimeDiff), /*#__PURE__*/React__default["default"].createElement("button", {
|
|
26580
|
+
type: "button",
|
|
26581
|
+
className: "utilities_ops-announcements_Banner--sideNotificationChevronBtn",
|
|
26582
|
+
onClick: handleChevronClick,
|
|
26583
|
+
"aria-label": isExpanded ? 'Collapse notifications' : 'Expand notifications',
|
|
26584
|
+
"aria-expanded": isExpanded
|
|
26585
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
26586
|
+
className: _getClassName("sideNotificationChevronIcon".concat(isExpanded ? ' sideNotificationChevronIconExpanded' : ''), _styleModuleImportMap$4, {
|
|
26587
|
+
"handleMissingStyleName": "warn"
|
|
26588
|
+
})
|
|
26589
|
+
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
26590
|
+
variant: "regular",
|
|
26591
|
+
name: "angle-down",
|
|
26592
|
+
style: {
|
|
26593
|
+
color: '#000'
|
|
26594
|
+
}
|
|
26595
|
+
})))));
|
|
26596
|
+
};
|
|
26314
26597
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26315
|
-
className: "
|
|
26316
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26317
|
-
className: _getClassName("sideNotificationGroupHeader".concat(showBackButton ? ' sideNotificationGroupHeaderWithBack' : ''), _styleModuleImportMap$4, {
|
|
26598
|
+
className: _getClassName("sideNotificationCardWrapper".concat(moreCount > 0 && !isExpanded ? ' sideNotificationCardWrapperStacked' : '').concat(isExpanded ? ' sideNotificationCardWrapperExpanded' : ''), _styleModuleImportMap$4, {
|
|
26318
26599
|
"handleMissingStyleName": "warn"
|
|
26319
26600
|
})
|
|
26320
|
-
},
|
|
26321
|
-
|
|
26322
|
-
className: "
|
|
26323
|
-
|
|
26324
|
-
|
|
26325
|
-
},
|
|
26326
|
-
|
|
26601
|
+
}, moreCount > 0 && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26602
|
+
onClick: handleExpandClick,
|
|
26603
|
+
className: _getClassName("sideNotificationStackContainer".concat(isExpanded ? ' sideNotificationStackContainerHidden' : ''), _styleModuleImportMap$4, {
|
|
26604
|
+
"handleMissingStyleName": "warn"
|
|
26605
|
+
})
|
|
26606
|
+
}, Array.from({
|
|
26607
|
+
length: stackLayers
|
|
26608
|
+
}, function (_, i) {
|
|
26609
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26610
|
+
key: i,
|
|
26611
|
+
className: _getClassName("sideNotificationStackLayer sideNotificationStackLayer".concat(stackLayers - i), _styleModuleImportMap$4, {
|
|
26612
|
+
"handleMissingStyleName": "warn"
|
|
26613
|
+
})
|
|
26614
|
+
});
|
|
26327
26615
|
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26328
|
-
className: "utilities_ops-announcements_Banner--
|
|
26329
|
-
},
|
|
26330
|
-
className: "
|
|
26331
|
-
|
|
26332
|
-
|
|
26333
|
-
}
|
|
26334
|
-
className: "utilities_ops-announcements_Banner--
|
|
26335
|
-
}
|
|
26336
|
-
className: "utilities_ops-announcements_Banner--
|
|
26337
|
-
},
|
|
26338
|
-
className: "utilities_ops-announcements_Banner--
|
|
26339
|
-
},
|
|
26340
|
-
|
|
26341
|
-
|
|
26342
|
-
}
|
|
26616
|
+
className: "utilities_ops-announcements_Banner--sideNotificationCard"
|
|
26617
|
+
}, renderHeader(), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26618
|
+
className: _getClassName("sideNotificationAnimateCollapse sideNotificationCollapseBodyWrap".concat(!isExpanded ? ' sideNotificationAnimateCollapseOpen' : ''), _styleModuleImportMap$4, {
|
|
26619
|
+
"handleMissingStyleName": "warn"
|
|
26620
|
+
})
|
|
26621
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26622
|
+
className: "utilities_ops-announcements_Banner--sideNotificationAnimateCollapseInner"
|
|
26623
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26624
|
+
className: "utilities_ops-announcements_Banner--sideNotificationCollapseBody"
|
|
26625
|
+
}, topNotification && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26626
|
+
className: "utilities_ops-announcements_Banner--sideNotificationCardPreview"
|
|
26627
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
26628
|
+
dangerouslySetInnerHTML: {
|
|
26629
|
+
__html: SanitizeNotificationContent(topNotification.content)
|
|
26630
|
+
}
|
|
26631
|
+
})), moreCount > 0 && /*#__PURE__*/React__default["default"].createElement("button", {
|
|
26632
|
+
type: "button",
|
|
26633
|
+
className: "utilities_ops-announcements_Banner--sideNotificationMoreBtn",
|
|
26634
|
+
onClick: handleExpandClick
|
|
26635
|
+
}, moreLabel)))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26636
|
+
className: _getClassName("sideNotificationAnimateCollapse sideNotificationExpandedItemsWrap".concat(isExpanded ? ' sideNotificationAnimateCollapseOpen' : ''), _styleModuleImportMap$4, {
|
|
26637
|
+
"handleMissingStyleName": "warn"
|
|
26638
|
+
})
|
|
26639
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26640
|
+
className: "utilities_ops-announcements_Banner--sideNotificationAnimateCollapseInner"
|
|
26641
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26642
|
+
className: "utilities_ops-announcements_Banner--sideNotificationExpandedItemsList"
|
|
26643
|
+
}, visibleNotifications.map(function (notification) {
|
|
26644
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26645
|
+
key: notification.notificationId,
|
|
26646
|
+
className: "utilities_ops-announcements_Banner--sideNotificationItemCard"
|
|
26647
|
+
}, /*#__PURE__*/React__default["default"].createElement(Banner, _extends$1({}, notification, {
|
|
26343
26648
|
showSideBar: true,
|
|
26344
26649
|
isGroupedSideBar: true,
|
|
26650
|
+
sidebarExpandedSecondary: true,
|
|
26345
26651
|
onDismiss: function onDismiss() {
|
|
26346
26652
|
return _onDismiss(notification);
|
|
26347
26653
|
},
|
|
26348
26654
|
ActionComponent: ActionComponent,
|
|
26349
26655
|
saveActionComponentState: saveActionComponentState
|
|
26350
|
-
}));
|
|
26351
|
-
})
|
|
26352
|
-
|
|
26353
|
-
className: "utilities_ops-announcements_Banner--
|
|
26354
|
-
|
|
26355
|
-
}
|
|
26356
|
-
|
|
26357
|
-
|
|
26358
|
-
}), /*#__PURE__*/React__default["default"].createElement("span", null, "View all")));
|
|
26359
|
-
};
|
|
26360
|
-
|
|
26361
|
-
var ESTIMATED_ITEM_HEIGHT = 80;
|
|
26362
|
-
var ESTIMATED_GROUP_HEIGHT = 320;
|
|
26363
|
-
var OVERSCAN = 3;
|
|
26364
|
-
function buildOffsets(count, itemHeights) {
|
|
26365
|
-
var defaultHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ESTIMATED_ITEM_HEIGHT;
|
|
26366
|
-
var offsets = new Array(count + 1);
|
|
26367
|
-
offsets[0] = 0;
|
|
26368
|
-
for (var i = 0; i < count; i++) {
|
|
26369
|
-
offsets[i + 1] = offsets[i] + (itemHeights[i] || defaultHeight) + 12;
|
|
26370
|
-
}
|
|
26371
|
-
return offsets;
|
|
26372
|
-
}
|
|
26373
|
-
|
|
26374
|
-
// Binary search: find the last index whose offset is <= scrollTop
|
|
26375
|
-
function findStartIndex(offsets, scrollTop) {
|
|
26376
|
-
var lo = 0;
|
|
26377
|
-
var hi = offsets.length - 2;
|
|
26378
|
-
while (lo < hi) {
|
|
26379
|
-
var mid = lo + hi + 1 >> 1;
|
|
26380
|
-
if (offsets[mid] <= scrollTop) {
|
|
26381
|
-
lo = mid;
|
|
26382
|
-
} else {
|
|
26383
|
-
hi = mid - 1;
|
|
26384
|
-
}
|
|
26385
|
-
}
|
|
26386
|
-
return lo;
|
|
26387
|
-
}
|
|
26656
|
+
})));
|
|
26657
|
+
}), isExpanded && hasMore && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26658
|
+
ref: loadMoreRef,
|
|
26659
|
+
className: "utilities_ops-announcements_Banner--sideNotificationLoadMoreSentinel",
|
|
26660
|
+
"aria-hidden": "true"
|
|
26661
|
+
}))))));
|
|
26662
|
+
};
|
|
26663
|
+
|
|
26388
26664
|
var Notifications = function Notifications(_ref) {
|
|
26389
26665
|
var notifications = _ref.notifications,
|
|
26390
26666
|
_onDismiss = _ref.onDismiss;
|
|
@@ -26404,16 +26680,12 @@ var Notifications = function Notifications(_ref) {
|
|
|
26404
26680
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
26405
26681
|
last = _useState4[0],
|
|
26406
26682
|
setLast = _useState4[1];
|
|
26407
|
-
var _useState5 = React.useState(
|
|
26683
|
+
var _useState5 = React.useState({}),
|
|
26408
26684
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
26409
|
-
|
|
26410
|
-
|
|
26685
|
+
expandedGroups = _useState6[0],
|
|
26686
|
+
setExpandedGroups = _useState6[1];
|
|
26411
26687
|
var scrollRef = React.useRef(null);
|
|
26412
|
-
var
|
|
26413
|
-
var _useState7 = React.useState(0),
|
|
26414
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
26415
|
-
scrollTop = _useState8[0],
|
|
26416
|
-
setScrollTop = _useState8[1];
|
|
26688
|
+
var notificationIdsRef = React.useRef('');
|
|
26417
26689
|
var onLeftButtonClick = function onLeftButtonClick() {
|
|
26418
26690
|
return i === 0 ? setI(last) : setI(i - 1);
|
|
26419
26691
|
};
|
|
@@ -26421,9 +26693,7 @@ var Notifications = function Notifications(_ref) {
|
|
|
26421
26693
|
return i === last ? setI(0) : setI(i + 1);
|
|
26422
26694
|
};
|
|
26423
26695
|
var resetSidebarView = React.useCallback(function () {
|
|
26424
|
-
|
|
26425
|
-
itemHeightsRef.current = {};
|
|
26426
|
-
setScrollTop(0);
|
|
26696
|
+
setExpandedGroups({});
|
|
26427
26697
|
if (scrollRef.current) {
|
|
26428
26698
|
scrollRef.current.scrollTop = 0;
|
|
26429
26699
|
}
|
|
@@ -26433,14 +26703,24 @@ var Notifications = function Notifications(_ref) {
|
|
|
26433
26703
|
setI(notifications.length - 1);
|
|
26434
26704
|
}
|
|
26435
26705
|
setLast(notifications.length - 1);
|
|
26436
|
-
|
|
26437
|
-
|
|
26438
|
-
|
|
26439
|
-
|
|
26706
|
+
var nextIds = notifications.map(function (n) {
|
|
26707
|
+
return n.notificationId;
|
|
26708
|
+
}).join('|');
|
|
26709
|
+
var structureChanged = nextIds !== notificationIdsRef.current;
|
|
26710
|
+
notificationIdsRef.current = nextIds;
|
|
26711
|
+
if (structureChanged) {
|
|
26712
|
+
setExpandedGroups(function (prev) {
|
|
26713
|
+
var next = {};
|
|
26714
|
+
var appNames = new Set(notifications.map(function (n) {
|
|
26715
|
+
return n.sourceApplication || 'Other';
|
|
26716
|
+
}));
|
|
26717
|
+
Object.keys(prev).forEach(function (appName) {
|
|
26718
|
+
if (prev[appName] && appNames.has(appName)) {
|
|
26719
|
+
next[appName] = true;
|
|
26720
|
+
}
|
|
26721
|
+
});
|
|
26722
|
+
return next;
|
|
26440
26723
|
});
|
|
26441
|
-
if (!stillHasApp) {
|
|
26442
|
-
setExpandedAppName(null);
|
|
26443
|
-
}
|
|
26444
26724
|
}
|
|
26445
26725
|
}, [notifications]);
|
|
26446
26726
|
React.useEffect(function () {
|
|
@@ -26448,87 +26728,13 @@ var Notifications = function Notifications(_ref) {
|
|
|
26448
26728
|
resetSidebarView();
|
|
26449
26729
|
}
|
|
26450
26730
|
}, [sidebarOpen, resetSidebarView]);
|
|
26451
|
-
|
|
26452
|
-
// Virtualizer state for the sidebar list
|
|
26453
|
-
var _useState9 = React.useState(600),
|
|
26454
|
-
_useState0 = _slicedToArray(_useState9, 2),
|
|
26455
|
-
viewportHeight = _useState0[0],
|
|
26456
|
-
setViewportHeight = _useState0[1];
|
|
26457
|
-
var rafPendingRef = React.useRef(false);
|
|
26458
|
-
var _useState1 = React.useState(0),
|
|
26459
|
-
_useState10 = _slicedToArray(_useState1, 2),
|
|
26460
|
-
forceUpdate = _useState10[1];
|
|
26461
|
-
React.useEffect(function () {
|
|
26462
|
-
var el = scrollRef.current;
|
|
26463
|
-
if (!el) return;
|
|
26464
|
-
var handleScroll = function handleScroll() {
|
|
26465
|
-
return setScrollTop(el.scrollTop);
|
|
26466
|
-
};
|
|
26467
|
-
var ro = new ResizeObserver(function (entries) {
|
|
26468
|
-
var _iterator = _createForOfIteratorHelper(entries),
|
|
26469
|
-
_step;
|
|
26470
|
-
try {
|
|
26471
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
26472
|
-
var entry = _step.value;
|
|
26473
|
-
setViewportHeight(entry.contentRect.height);
|
|
26474
|
-
}
|
|
26475
|
-
} catch (err) {
|
|
26476
|
-
_iterator.e(err);
|
|
26477
|
-
} finally {
|
|
26478
|
-
_iterator.f();
|
|
26479
|
-
}
|
|
26480
|
-
});
|
|
26481
|
-
el.addEventListener('scroll', handleScroll, {
|
|
26482
|
-
passive: true
|
|
26483
|
-
});
|
|
26484
|
-
ro.observe(el);
|
|
26485
|
-
return function () {
|
|
26486
|
-
el.removeEventListener('scroll', handleScroll);
|
|
26487
|
-
ro.disconnect();
|
|
26488
|
-
};
|
|
26489
|
-
}, [showSideBar]);
|
|
26490
|
-
|
|
26491
|
-
// Ref callback: measures rendered item height and triggers a rAF-batched re-render
|
|
26492
|
-
// when the measured height differs from the cached value.
|
|
26493
|
-
var measureItem = React.useCallback(function (index) {
|
|
26494
|
-
return function (node) {
|
|
26495
|
-
if (!node) return;
|
|
26496
|
-
var height = node.getBoundingClientRect().height;
|
|
26497
|
-
if (itemHeightsRef.current[index] === height) return;
|
|
26498
|
-
itemHeightsRef.current[index] = height;
|
|
26499
|
-
if (!rafPendingRef.current) {
|
|
26500
|
-
rafPendingRef.current = true;
|
|
26501
|
-
requestAnimationFrame(function () {
|
|
26502
|
-
rafPendingRef.current = false;
|
|
26503
|
-
forceUpdate(function (n) {
|
|
26504
|
-
return n + 1;
|
|
26505
|
-
});
|
|
26506
|
-
});
|
|
26507
|
-
}
|
|
26508
|
-
};
|
|
26509
|
-
}, []);
|
|
26510
26731
|
var count = notifications.length;
|
|
26511
|
-
var notificationGroups = showSideBar ?
|
|
26512
|
-
var
|
|
26513
|
-
|
|
26514
|
-
|
|
26515
|
-
|
|
26516
|
-
if (scrollRef.current) {
|
|
26517
|
-
scrollRef.current.scrollTop = 0;
|
|
26518
|
-
}
|
|
26519
|
-
};
|
|
26520
|
-
var handleBackToAllApps = function handleBackToAllApps() {
|
|
26521
|
-
resetSidebarView();
|
|
26732
|
+
var notificationGroups = showSideBar ? groupNotificationsByApp(notifications) : [];
|
|
26733
|
+
var toggleGroupExpand = function toggleGroupExpand(appName) {
|
|
26734
|
+
setExpandedGroups(function (prev) {
|
|
26735
|
+
return _objectSpread2(_objectSpread2({}, prev), {}, _defineProperty$2({}, appName, !prev[appName]));
|
|
26736
|
+
});
|
|
26522
26737
|
};
|
|
26523
|
-
var virtualListCount = showSideBar ? notificationGroups.length : count;
|
|
26524
|
-
var estimatedHeight = showSideBar ? ESTIMATED_GROUP_HEIGHT : ESTIMATED_ITEM_HEIGHT;
|
|
26525
|
-
var offsets = buildOffsets(virtualListCount, itemHeightsRef.current, estimatedHeight);
|
|
26526
|
-
var totalHeight = offsets[virtualListCount];
|
|
26527
|
-
var rawStart = findStartIndex(offsets, scrollTop);
|
|
26528
|
-
var startIdx = Math.max(0, rawStart - OVERSCAN);
|
|
26529
|
-
var endRaw = rawStart;
|
|
26530
|
-
while (endRaw < virtualListCount && offsets[endRaw] < scrollTop + viewportHeight) endRaw++;
|
|
26531
|
-
var endIdx = Math.min(virtualListCount - 1, endRaw + OVERSCAN);
|
|
26532
26738
|
var notification = notifications[i];
|
|
26533
26739
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !isNil$2(notification) && !showSideBar ? /*#__PURE__*/React__default["default"].createElement(Banner, _extends$1({
|
|
26534
26740
|
current: i + 1,
|
|
@@ -26546,7 +26752,19 @@ var Notifications = function Notifications(_ref) {
|
|
|
26546
26752
|
notificationsTopContainerRef: notificationsTopContainerRef,
|
|
26547
26753
|
mobileNotificationsTopContainerRef: mobileNotificationsTopContainerRef,
|
|
26548
26754
|
setNotificationHeightFlag: setNotificationHeightFlag
|
|
26549
|
-
})) : null,
|
|
26755
|
+
})) : null, showSideBar ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26756
|
+
style: {
|
|
26757
|
+
height: '100%'
|
|
26758
|
+
}
|
|
26759
|
+
}, count === 0 ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26760
|
+
className: "utilities_ops-announcements_Banner--sideNotificationEmptyState"
|
|
26761
|
+
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
26762
|
+
className: "utilities_ops-announcements_Banner--sideNotificationEmptyIcon",
|
|
26763
|
+
src: "/assets/icons/no_notification_sidebar.svg",
|
|
26764
|
+
alt: ""
|
|
26765
|
+
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
26766
|
+
className: "utilities_ops-announcements_Banner--sideNotificationEmptyText"
|
|
26767
|
+
}, "No pending notifications")) : null, count > 0 ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26550
26768
|
ref: scrollRef,
|
|
26551
26769
|
style: {
|
|
26552
26770
|
height: '100%',
|
|
@@ -26554,40 +26772,23 @@ var Notifications = function Notifications(_ref) {
|
|
|
26554
26772
|
overflowX: 'hidden'
|
|
26555
26773
|
}
|
|
26556
26774
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26557
|
-
|
|
26558
|
-
|
|
26559
|
-
|
|
26560
|
-
width: '100%'
|
|
26561
|
-
}
|
|
26562
|
-
}, Array.from({
|
|
26563
|
-
length: endIdx - startIdx + 1
|
|
26564
|
-
}, function (_, rel) {
|
|
26565
|
-
var index = startIdx + rel;
|
|
26566
|
-
var group = notificationGroups[index];
|
|
26567
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
26775
|
+
className: "utilities_ops-announcements_Banner--sideNotificationSidebarList"
|
|
26776
|
+
}, notificationGroups.map(function (group) {
|
|
26777
|
+
return /*#__PURE__*/React__default["default"].createElement(SideNotificationGroup, {
|
|
26568
26778
|
key: group.appName,
|
|
26569
|
-
ref: measureItem(index),
|
|
26570
|
-
style: {
|
|
26571
|
-
position: 'absolute',
|
|
26572
|
-
top: offsets[index],
|
|
26573
|
-
left: 0,
|
|
26574
|
-
width: '100%'
|
|
26575
|
-
}
|
|
26576
|
-
}, /*#__PURE__*/React__default["default"].createElement(SideNotificationGroup, {
|
|
26577
26779
|
appName: group.appName,
|
|
26578
26780
|
totalCount: group.totalCount,
|
|
26579
26781
|
notifications: group.notifications,
|
|
26580
|
-
|
|
26581
|
-
|
|
26582
|
-
|
|
26583
|
-
onViewAll: function onViewAll() {
|
|
26584
|
-
return handleViewAll(group.appName);
|
|
26782
|
+
isExpanded: Boolean(expandedGroups[group.appName]),
|
|
26783
|
+
onToggleExpand: function onToggleExpand() {
|
|
26784
|
+
return toggleGroupExpand(group.appName);
|
|
26585
26785
|
},
|
|
26586
26786
|
onDismiss: _onDismiss,
|
|
26787
|
+
scrollContainerRef: scrollRef,
|
|
26587
26788
|
ActionComponent: ActionComponent,
|
|
26588
26789
|
saveActionComponentState: saveActionComponentState
|
|
26589
|
-
})
|
|
26590
|
-
}))) : null);
|
|
26790
|
+
});
|
|
26791
|
+
}))) : null) : null);
|
|
26591
26792
|
};
|
|
26592
26793
|
|
|
26593
26794
|
var capitalizeAndReplaceUnderscores = function capitalizeAndReplaceUnderscores(role) {
|
|
@@ -26656,6 +26857,7 @@ var _styleModuleImportMap$3 = {
|
|
|
26656
26857
|
"sideBarWrapper": "utilities_ops-app-frame_AppBarComponent_AppBar--sideBarWrapper",
|
|
26657
26858
|
"innerNotificationDiv": "utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv",
|
|
26658
26859
|
"notificationsHeader": "utilities_ops-app-frame_AppBarComponent_AppBar--notificationsHeader",
|
|
26860
|
+
"notificationsHeaderCount": "utilities_ops-app-frame_AppBarComponent_AppBar--notificationsHeaderCount",
|
|
26659
26861
|
"notificationsWrapper": "utilities_ops-app-frame_AppBarComponent_AppBar--notificationsWrapper",
|
|
26660
26862
|
"notificationCount": "utilities_ops-app-frame_AppBarComponent_AppBar--notificationCount",
|
|
26661
26863
|
"twoChars": "utilities_ops-app-frame_AppBarComponent_AppBar--twoChars",
|
|
@@ -27139,7 +27341,7 @@ var notificationIconComp = function notificationIconComp(_ref3) {
|
|
|
27139
27341
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--flex-grid-items",
|
|
27140
27342
|
style: _objectSpread2({}, marginStyle),
|
|
27141
27343
|
onClick: function onClick() {
|
|
27142
|
-
return
|
|
27344
|
+
return handleIconClick(ICONS.NOTIFICATIONS);
|
|
27143
27345
|
}
|
|
27144
27346
|
}, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
|
|
27145
27347
|
name: "bell",
|
|
@@ -27152,7 +27354,7 @@ var notificationIconComp = function notificationIconComp(_ref3) {
|
|
|
27152
27354
|
style: {
|
|
27153
27355
|
fontSize: '10px'
|
|
27154
27356
|
}
|
|
27155
|
-
}, notifications.length)),
|
|
27357
|
+
}, notifications.length)), notificationsVisible && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27156
27358
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--arrowTipContainer"
|
|
27157
27359
|
}));
|
|
27158
27360
|
};
|
|
@@ -27221,6 +27423,8 @@ var AppBar$1 = function AppBar(props) {
|
|
|
27221
27423
|
props.title;
|
|
27222
27424
|
var getInnovationHubToken = props.getInnovationHubToken,
|
|
27223
27425
|
notifications = props.notifications,
|
|
27426
|
+
_props$bannerNotifica = props.bannerNotifications,
|
|
27427
|
+
bannerNotifications = _props$bannerNotifica === void 0 ? [] : _props$bannerNotifica,
|
|
27224
27428
|
onDismiss = props.onDismiss,
|
|
27225
27429
|
ActionComponent = props.ActionComponent,
|
|
27226
27430
|
saveActionComponentState = props.saveActionComponentState,
|
|
@@ -27237,6 +27441,7 @@ var AppBar$1 = function AppBar(props) {
|
|
|
27237
27441
|
availableStatuses = props.availableStatuses,
|
|
27238
27442
|
currentUserStatus = props.currentUserStatus,
|
|
27239
27443
|
onUserStatusUpdate = props.onUserStatusUpdate;
|
|
27444
|
+
var hasBannerNotifications = bannerNotifications.length > 0;
|
|
27240
27445
|
var _useWindowSize = useWindowSize(),
|
|
27241
27446
|
width = _useWindowSize.width;
|
|
27242
27447
|
_useWindowSize.height;
|
|
@@ -27452,6 +27657,14 @@ var AppBar$1 = function AppBar(props) {
|
|
|
27452
27657
|
// [mihelpRef, mihelpIconRef],
|
|
27453
27658
|
// )
|
|
27454
27659
|
|
|
27660
|
+
var closeAllPanels = function closeAllPanels() {
|
|
27661
|
+
setSettingsVisible(false);
|
|
27662
|
+
setNotificationsVisible(false);
|
|
27663
|
+
setMihelpVisible(false);
|
|
27664
|
+
setIdeaNoteVisible(false);
|
|
27665
|
+
setMobileMenuVisible(false);
|
|
27666
|
+
setShowSearchContainer(false);
|
|
27667
|
+
};
|
|
27455
27668
|
var closeSidebar = function closeSidebar(e) {
|
|
27456
27669
|
if (e.target.className.includes('sideBarWrapper')) {
|
|
27457
27670
|
setNotificationsVisible(false);
|
|
@@ -27512,7 +27725,8 @@ var AppBar$1 = function AppBar(props) {
|
|
|
27512
27725
|
fontSize: '16px'
|
|
27513
27726
|
}
|
|
27514
27727
|
})), /*#__PURE__*/React__default["default"].createElement(CopartLogo, {
|
|
27515
|
-
history: props.history
|
|
27728
|
+
history: props.history,
|
|
27729
|
+
onNavigate: closeAllPanels
|
|
27516
27730
|
}), !enableNewToolkitFeatures && !isAuthRoute ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27517
27731
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--moduleName"
|
|
27518
27732
|
}, moduleName) : null), /*#__PURE__*/React__default["default"].createElement(Breadcrumbs, {
|
|
@@ -27557,7 +27771,7 @@ var AppBar$1 = function AppBar(props) {
|
|
|
27557
27771
|
})), ideaNoteVisible && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27558
27772
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetContainer",
|
|
27559
27773
|
style: {
|
|
27560
|
-
top:
|
|
27774
|
+
top: hasBannerNotifications ? "".concat(sideBarTopValue, "px") : '48px'
|
|
27561
27775
|
}
|
|
27562
27776
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27563
27777
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--ideaWidgetHide",
|
|
@@ -27601,21 +27815,23 @@ var AppBar$1 = function AppBar(props) {
|
|
|
27601
27815
|
feedbackConfig: props.feedbackConfig,
|
|
27602
27816
|
showMihelpDot: showMihelpDot,
|
|
27603
27817
|
sideBarTopValue: sideBarTopValue,
|
|
27604
|
-
|
|
27818
|
+
bannerNotifications: bannerNotifications
|
|
27605
27819
|
}), notificationsVisible && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27606
27820
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--sideBarWrapper",
|
|
27607
27821
|
style: {
|
|
27608
|
-
top:
|
|
27822
|
+
top: hasBannerNotifications ? "".concat(sideBarTopValue, "px") : '48px'
|
|
27609
27823
|
},
|
|
27610
27824
|
onClick: closeSidebar
|
|
27611
27825
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27612
|
-
className: "utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv",
|
|
27826
|
+
className: "g2-notifications-sidebar-v2 utilities_ops-app-frame_AppBarComponent_AppBar--innerNotificationDiv",
|
|
27613
27827
|
style: {
|
|
27614
|
-
height: "calc(100dvh - ".concat(
|
|
27828
|
+
height: "calc(100dvh - ".concat(hasBannerNotifications ? sideBarTopValue : 48, "px)")
|
|
27615
27829
|
}
|
|
27616
27830
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27617
27831
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--notificationsHeader"
|
|
27618
|
-
}, /*#__PURE__*/React__default["default"].createElement("span", null, "Notifications")
|
|
27832
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", null, "Notifications"), (notifications === null || notifications === void 0 ? void 0 : notifications.length) > 0 && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
27833
|
+
className: "utilities_ops-app-frame_AppBarComponent_AppBar--notificationsHeaderCount"
|
|
27834
|
+
}, " (", notifications.length, ")")), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27619
27835
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--notificationsWrapper"
|
|
27620
27836
|
}, /*#__PURE__*/React__default["default"].createElement(Notifications, {
|
|
27621
27837
|
notifications: notifications || [],
|
|
@@ -27633,13 +27849,13 @@ var AppBar$1 = function AppBar(props) {
|
|
|
27633
27849
|
})), settingsVisible && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27634
27850
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebarWrapper",
|
|
27635
27851
|
style: {
|
|
27636
|
-
top:
|
|
27852
|
+
top: hasBannerNotifications ? "".concat(sideBarTopValue, "px") : '48px'
|
|
27637
27853
|
},
|
|
27638
27854
|
onClick: closeSidebar
|
|
27639
27855
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
27640
27856
|
className: "utilities_ops-app-frame_AppBarComponent_AppBar--settingsSidebar",
|
|
27641
27857
|
style: {
|
|
27642
|
-
height: "calc(100dvh - ".concat(
|
|
27858
|
+
height: "calc(100dvh - ".concat(hasBannerNotifications ? sideBarTopValue : 48, "px)")
|
|
27643
27859
|
}
|
|
27644
27860
|
}, !stack || stack === 'c' ? /*#__PURE__*/React__default["default"].createElement(SettingsView$2, {
|
|
27645
27861
|
onSave: onSave,
|
|
@@ -27666,7 +27882,7 @@ var AppBar$1 = function AppBar(props) {
|
|
|
27666
27882
|
closeSidebar: closeSidebar,
|
|
27667
27883
|
logout: onLogoutItemClicked,
|
|
27668
27884
|
items: mobileMenuItems,
|
|
27669
|
-
|
|
27885
|
+
bannerNotifications: bannerNotifications,
|
|
27670
27886
|
sideBarTopValue: sideBarTopValue,
|
|
27671
27887
|
availableStatuses: availableStatuses,
|
|
27672
27888
|
currentUserStatus: currentUserStatus,
|
|
@@ -29506,6 +29722,7 @@ function fetchG2Notifications(updateNotifications, updateAllNotificationsList) {
|
|
|
29506
29722
|
notification.dismissibleFlag = notification.dismissal_flag;
|
|
29507
29723
|
notification.feedUrl = notification.feed_url;
|
|
29508
29724
|
notification.notificationId = notification.notification_id;
|
|
29725
|
+
notification.displayLocation = notification.display_location;
|
|
29509
29726
|
notification.sourceApplication = notification.source_application;
|
|
29510
29727
|
notification.sourcePlatform = notification.source_platform;
|
|
29511
29728
|
notification.timeZoneType = notification.timezone_type;
|
|
@@ -29530,9 +29747,6 @@ function fetchG2Notifications(updateNotifications, updateAllNotificationsList) {
|
|
|
29530
29747
|
});
|
|
29531
29748
|
compose(updateNotifications, filterNotifications)(modifiedNotifications);
|
|
29532
29749
|
updateAllNotificationsList(modifiedNotifications, true);
|
|
29533
|
-
// Prune expired entries from viewedNotifications after the main logic
|
|
29534
|
-
// settles. Deferred so it never blocks the notifications render.
|
|
29535
|
-
setTimeout(pruneExpiredViewedNotifications, 0);
|
|
29536
29750
|
}).catch(function (e) {
|
|
29537
29751
|
console.log(e);
|
|
29538
29752
|
});
|
|
@@ -30995,48 +31209,67 @@ var AppBar = function AppBar(_ref) {
|
|
|
30995
31209
|
}
|
|
30996
31210
|
if (history.location.pathname !== '/logout' && history.location.pathname !== '/login' && localStorage.getItem('login') && tileConfigAccess) {
|
|
30997
31211
|
if (notificationsSource.includes('Nchan')) {
|
|
30998
|
-
|
|
30999
|
-
|
|
31000
|
-
|
|
31001
|
-
|
|
31002
|
-
|
|
31003
|
-
|
|
31004
|
-
|
|
31005
|
-
|
|
31006
|
-
|
|
31007
|
-
|
|
31008
|
-
|
|
31009
|
-
|
|
31010
|
-
|
|
31011
|
-
|
|
31012
|
-
|
|
31013
|
-
|
|
31014
|
-
|
|
31015
|
-
|
|
31016
|
-
|
|
31212
|
+
var startNchanNotifications = /*#__PURE__*/function () {
|
|
31213
|
+
var _ref6 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee5() {
|
|
31214
|
+
var client, pingIntervalInSec;
|
|
31215
|
+
return _regenerator().w(function (_context5) {
|
|
31216
|
+
while (1) switch (_context5.n) {
|
|
31217
|
+
case 0:
|
|
31218
|
+
_context5.n = 1;
|
|
31219
|
+
return initViewedNotifications();
|
|
31220
|
+
case 1:
|
|
31221
|
+
fetchG2Notifications(updateNotifications, updateAllNotificationsList);
|
|
31222
|
+
client = startWebSocketConnection(updateNotifications, updateAllNotificationsList, _reConnectSocket, updateUserStatusFromWebSocket, {
|
|
31223
|
+
onOpen: function onOpen() {
|
|
31224
|
+
reconnectingRef.current = false;
|
|
31225
|
+
},
|
|
31226
|
+
onClose: function onClose() {
|
|
31227
|
+
reconnectingRef.current = false;
|
|
31228
|
+
}
|
|
31229
|
+
});
|
|
31230
|
+
if (client) {
|
|
31231
|
+
socketClientRef.current = client;
|
|
31232
|
+
pingIntervalInSec = coreAppConfig.nchanPingIntervalInSec || 30;
|
|
31233
|
+
setPingInterval(setInterval(function () {
|
|
31234
|
+
if (client.readyState === WebSocket.OPEN) {
|
|
31235
|
+
client.send('_ping_');
|
|
31236
|
+
}
|
|
31237
|
+
}, pingIntervalInSec * 1000));
|
|
31238
|
+
setSocketClient(client);
|
|
31239
|
+
}
|
|
31240
|
+
case 2:
|
|
31241
|
+
return _context5.a(2);
|
|
31242
|
+
}
|
|
31243
|
+
}, _callee5);
|
|
31244
|
+
}));
|
|
31245
|
+
return function startNchanNotifications() {
|
|
31246
|
+
return _ref6.apply(this, arguments);
|
|
31247
|
+
};
|
|
31248
|
+
}();
|
|
31249
|
+
startNchanNotifications();
|
|
31017
31250
|
}
|
|
31018
31251
|
var loadUserStatus = /*#__PURE__*/function () {
|
|
31019
|
-
var
|
|
31252
|
+
var _ref7 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
31020
31253
|
var _userStatus$toLowerCa, statuses, userStatus, statusList, statusListLower, isSystemAssignedStatus, isValidStatus, finalStatus, offlineIndex, updatedStatus, _t6, _t7;
|
|
31021
|
-
return _regenerator().w(function (
|
|
31022
|
-
while (1) switch (
|
|
31254
|
+
return _regenerator().w(function (_context6) {
|
|
31255
|
+
while (1) switch (_context6.p = _context6.n) {
|
|
31023
31256
|
case 0:
|
|
31024
|
-
|
|
31025
|
-
|
|
31257
|
+
_context6.p = 0;
|
|
31258
|
+
_context6.n = 1;
|
|
31026
31259
|
return fetchAvailableStatuses();
|
|
31027
31260
|
case 1:
|
|
31028
|
-
statuses =
|
|
31261
|
+
statuses = _context6.v;
|
|
31029
31262
|
setAvailableStatuses(statuses);
|
|
31030
|
-
|
|
31263
|
+
_context6.n = 2;
|
|
31031
31264
|
return fetchUserStatus();
|
|
31032
31265
|
case 2:
|
|
31033
|
-
userStatus =
|
|
31266
|
+
userStatus = _context6.v;
|
|
31034
31267
|
if (!(userStatus === null)) {
|
|
31035
|
-
|
|
31268
|
+
_context6.n = 3;
|
|
31036
31269
|
break;
|
|
31037
31270
|
}
|
|
31038
31271
|
setAvailableStatuses([]);
|
|
31039
|
-
return
|
|
31272
|
+
return _context6.a(2);
|
|
31040
31273
|
case 3:
|
|
31041
31274
|
statusList = statuses.map(function (s) {
|
|
31042
31275
|
return s.status;
|
|
@@ -31048,7 +31281,7 @@ var AppBar = function AppBar(_ref) {
|
|
|
31048
31281
|
isValidStatus = userStatus && (statusListLower.includes(userStatus.toLowerCase()) || isSystemAssignedStatus);
|
|
31049
31282
|
finalStatus = userStatus;
|
|
31050
31283
|
if (isValidStatus) {
|
|
31051
|
-
|
|
31284
|
+
_context6.n = 8;
|
|
31052
31285
|
break;
|
|
31053
31286
|
}
|
|
31054
31287
|
offlineIndex = statusListLower.indexOf('offline');
|
|
@@ -31058,37 +31291,37 @@ var AppBar = function AppBar(_ref) {
|
|
|
31058
31291
|
finalStatus = statuses[0].status;
|
|
31059
31292
|
}
|
|
31060
31293
|
if (!finalStatus) {
|
|
31061
|
-
|
|
31294
|
+
_context6.n = 7;
|
|
31062
31295
|
break;
|
|
31063
31296
|
}
|
|
31064
31297
|
setCurrentUserStatus(finalStatus);
|
|
31065
31298
|
storage$2.setLocalItem('dashboard', finalStatus, 'userAvailability');
|
|
31066
|
-
|
|
31067
|
-
|
|
31299
|
+
_context6.p = 4;
|
|
31300
|
+
_context6.n = 5;
|
|
31068
31301
|
return updateUserStatus(finalStatus);
|
|
31069
31302
|
case 5:
|
|
31070
|
-
updatedStatus =
|
|
31303
|
+
updatedStatus = _context6.v;
|
|
31071
31304
|
setCurrentUserStatus(updatedStatus);
|
|
31072
31305
|
storage$2.setLocalItem('dashboard', updatedStatus, 'userAvailability');
|
|
31073
|
-
|
|
31306
|
+
_context6.n = 7;
|
|
31074
31307
|
break;
|
|
31075
31308
|
case 6:
|
|
31076
|
-
|
|
31077
|
-
_t6 =
|
|
31309
|
+
_context6.p = 6;
|
|
31310
|
+
_t6 = _context6.v;
|
|
31078
31311
|
console.error('Failed to update defaulted user status:', _t6);
|
|
31079
31312
|
showError('Failed to set default user status.');
|
|
31080
31313
|
case 7:
|
|
31081
|
-
|
|
31314
|
+
_context6.n = 9;
|
|
31082
31315
|
break;
|
|
31083
31316
|
case 8:
|
|
31084
31317
|
setCurrentUserStatus(finalStatus);
|
|
31085
31318
|
storage$2.setLocalItem('dashboard', finalStatus, 'userAvailability');
|
|
31086
31319
|
case 9:
|
|
31087
|
-
|
|
31320
|
+
_context6.n = 11;
|
|
31088
31321
|
break;
|
|
31089
31322
|
case 10:
|
|
31090
|
-
|
|
31091
|
-
_t7 =
|
|
31323
|
+
_context6.p = 10;
|
|
31324
|
+
_t7 = _context6.v;
|
|
31092
31325
|
console.error('Failed to load user status:', _t7);
|
|
31093
31326
|
// if (error.message && error.message.includes('available statuses')) {
|
|
31094
31327
|
// showError('Failed to fetch available statuses.')
|
|
@@ -31096,12 +31329,12 @@ var AppBar = function AppBar(_ref) {
|
|
|
31096
31329
|
// showError('Failed to fetch user status.')
|
|
31097
31330
|
// }
|
|
31098
31331
|
case 11:
|
|
31099
|
-
return
|
|
31332
|
+
return _context6.a(2);
|
|
31100
31333
|
}
|
|
31101
|
-
},
|
|
31334
|
+
}, _callee6, null, [[4, 6], [0, 10]]);
|
|
31102
31335
|
}));
|
|
31103
31336
|
return function loadUserStatus() {
|
|
31104
|
-
return
|
|
31337
|
+
return _ref7.apply(this, arguments);
|
|
31105
31338
|
};
|
|
31106
31339
|
}();
|
|
31107
31340
|
if (!isUserStatusHidden()) {
|
|
@@ -31196,8 +31429,10 @@ var AppBar = function AppBar(_ref) {
|
|
|
31196
31429
|
phoneStatus: '',
|
|
31197
31430
|
phoneStatusProcessing: false
|
|
31198
31431
|
} : _storage$chromePlugin;
|
|
31432
|
+
var bannerNotifications = filterBannerNotifications(notifications);
|
|
31433
|
+
var sidebarNotifications = filterSidebarNotifications(notifications);
|
|
31199
31434
|
return /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(Notifications, {
|
|
31200
|
-
notifications:
|
|
31435
|
+
notifications: bannerNotifications,
|
|
31201
31436
|
onDismiss: dismissNotification,
|
|
31202
31437
|
ActionComponent: ActionComponent,
|
|
31203
31438
|
saveActionComponentState: saveActionComponentState,
|
|
@@ -31234,7 +31469,8 @@ var AppBar = function AppBar(_ref) {
|
|
|
31234
31469
|
showTitle: showTitle,
|
|
31235
31470
|
title: title,
|
|
31236
31471
|
history: history,
|
|
31237
|
-
notifications:
|
|
31472
|
+
notifications: sidebarNotifications,
|
|
31473
|
+
bannerNotifications: bannerNotifications,
|
|
31238
31474
|
onDismiss: dismissNotification,
|
|
31239
31475
|
ActionComponent: ActionComponent,
|
|
31240
31476
|
saveActionComponentState: saveActionComponentState,
|
|
@@ -65210,7 +65446,7 @@ AppFrame.defaultProps = {
|
|
|
65210
65446
|
navItems: []
|
|
65211
65447
|
};
|
|
65212
65448
|
|
|
65213
|
-
var _excluded$
|
|
65449
|
+
var _excluded$2 = ["fromPhone", "toPhone", "appCode", "entityType", "lotAttributes"];
|
|
65214
65450
|
var logOutboundCalls = /*#__PURE__*/function () {
|
|
65215
65451
|
var _ref = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee(data) {
|
|
65216
65452
|
var _storage$getLocalItem;
|
|
@@ -65246,7 +65482,7 @@ var CallLogger = React__default["default"].memo(function (_ref2) {
|
|
|
65246
65482
|
entityType = _ref2$entityType === void 0 ? '' : _ref2$entityType,
|
|
65247
65483
|
_ref2$lotAttributes = _ref2.lotAttributes,
|
|
65248
65484
|
lotAttributes = _ref2$lotAttributes === void 0 ? {} : _ref2$lotAttributes,
|
|
65249
|
-
props = _objectWithoutProperties(_ref2, _excluded$
|
|
65485
|
+
props = _objectWithoutProperties(_ref2, _excluded$2);
|
|
65250
65486
|
var _useState = React.useState({
|
|
65251
65487
|
error: null,
|
|
65252
65488
|
success: null
|
|
@@ -68672,32 +68908,96 @@ function ContextualHelp(_ref) {
|
|
|
68672
68908
|
}
|
|
68673
68909
|
|
|
68674
68910
|
var IFRAME_EVENTS = {
|
|
68911
|
+
// app → shell
|
|
68675
68912
|
UPDATE_URI: 'UPDATE_URI',
|
|
68676
68913
|
UPDATE_CRUMBS: 'UPDATE_CRUMBS',
|
|
68677
|
-
SET_NAV_CONFIG: 'SET_NAV_CONFIG',
|
|
68678
68914
|
COUNTS_AVAILABLE: 'COUNTS_AVAILABLE',
|
|
68679
68915
|
UPDATE_NAV_COUNTS: 'UPDATE_NAV_COUNTS',
|
|
68680
|
-
REQUEST_NAV_COUNTS: 'REQUEST_NAV_COUNTS',
|
|
68681
68916
|
NAV_COUNTS_RESPONSE: 'NAV_COUNTS_RESPONSE',
|
|
68917
|
+
SET_NAV_CONFIG: 'SET_NAV_CONFIG',
|
|
68918
|
+
FETCH_REQUEST: 'FETCH_REQUEST',
|
|
68919
|
+
CANCEL_REQUEST: 'CANCEL_REQUEST',
|
|
68920
|
+
STORAGE_GET: 'STORAGE_GET',
|
|
68921
|
+
STORAGE_SET: 'STORAGE_SET',
|
|
68922
|
+
ACCESS_CHECK: 'ACCESS_CHECK',
|
|
68923
|
+
GET_INIT_DATA: 'GET_INIT_DATA',
|
|
68924
|
+
GET_IFRAME_DATA: 'GET_IFRAME_DATA',
|
|
68682
68925
|
SET_APP_ENV: 'SET_APP_ENV',
|
|
68926
|
+
HISTORY_GO: 'HISTORY_GO',
|
|
68927
|
+
SESSION_EXPIRED: 'SESSION_EXPIRED',
|
|
68928
|
+
// shell → app
|
|
68929
|
+
LOAD_URI: 'LOAD_URI',
|
|
68930
|
+
FETCH_RESPONSE: 'FETCH_RESPONSE',
|
|
68931
|
+
STORAGE_RESPONSE: 'STORAGE_RESPONSE',
|
|
68932
|
+
ACCESS_RESPONSE: 'ACCESS_RESPONSE',
|
|
68933
|
+
INIT_DATA: 'INIT_DATA',
|
|
68934
|
+
IFRAME_DATA: 'IFRAME_DATA',
|
|
68683
68935
|
STORAGE_CHANGED: 'STORAGE_CHANGED',
|
|
68684
|
-
|
|
68936
|
+
REQUEST_NAV_COUNTS: 'REQUEST_NAV_COUNTS',
|
|
68937
|
+
CRUMB_CLICKED: 'CRUMB_CLICKED'
|
|
68685
68938
|
};
|
|
68939
|
+
var ALLOWED_ORIGINS = ['.copart.com', '.copart.co.uk', '.copart.ca', '.copartmea.com', '.copart.ie'];
|
|
68940
|
+
function isAllowedOrigin(origin) {
|
|
68941
|
+
try {
|
|
68942
|
+
var hostname = new URL(origin).hostname;
|
|
68943
|
+
return ALLOWED_ORIGINS.some(function (domain) {
|
|
68944
|
+
return hostname === domain.slice(1) || hostname.endsWith(domain);
|
|
68945
|
+
});
|
|
68946
|
+
} catch (_) {
|
|
68947
|
+
return false;
|
|
68948
|
+
}
|
|
68949
|
+
}
|
|
68686
68950
|
|
|
68687
|
-
var _excluded = ["signal"];
|
|
68951
|
+
var _excluded$1 = ["signal"];
|
|
68688
68952
|
var pending = new Map();
|
|
68689
68953
|
var STORAGE_REQUEST_TIMEOUT_MS = 5000;
|
|
68690
68954
|
function requestId() {
|
|
68691
|
-
return
|
|
68955
|
+
return crypto.randomUUID();
|
|
68956
|
+
}
|
|
68957
|
+
|
|
68958
|
+
// The exact origin of the shell that framed us. Learned from the first inbound
|
|
68959
|
+
// message that passes validation (origin is copart + came from window.parent),
|
|
68960
|
+
// then pinned. Used as the targetOrigin for every outbound post() so app→shell
|
|
68961
|
+
// messages (incl. FETCH_REQUEST bodies) are never broadcast to '*'.
|
|
68962
|
+
//
|
|
68963
|
+
// If SHELL_ORIGIN is provided at build time we lock to it up front — there is
|
|
68964
|
+
// only one shell, so this is the tightest option and closes the "any
|
|
68965
|
+
// *.copart.com subdomain" residual entirely. Otherwise we capture-and-lock.
|
|
68966
|
+
var trustedParentOrigin = typeof process !== 'undefined' && process.env && process.env.SHELL_ORIGIN || null;
|
|
68967
|
+
|
|
68968
|
+
/**
|
|
68969
|
+
* Gate every inbound message. event.origin is set by the browser and cannot be
|
|
68970
|
+
* forged by the sender, so a non-copart parent (e.g. a malicious embedder) is
|
|
68971
|
+
* rejected here before it can lock the origin or be processed.
|
|
68972
|
+
* - must come from our direct parent window (single framer),
|
|
68973
|
+
* - must be a copart origin (or the pinned SHELL_ORIGIN if configured),
|
|
68974
|
+
* - once an origin is pinned, only that exact origin is accepted thereafter.
|
|
68975
|
+
*/
|
|
68976
|
+
function isTrustedMessage(event) {
|
|
68977
|
+
if (typeof window !== 'undefined' && event.source !== window.parent) return false;
|
|
68978
|
+
if (trustedParentOrigin) {
|
|
68979
|
+
// Already pinned (via SHELL_ORIGIN or a prior capture): exact match only.
|
|
68980
|
+
return event.origin === trustedParentOrigin;
|
|
68981
|
+
}
|
|
68982
|
+
if (!isAllowedOrigin(event.origin)) return false;
|
|
68983
|
+
// First valid message from a copart parent — pin it.
|
|
68984
|
+
trustedParentOrigin = event.origin;
|
|
68985
|
+
return true;
|
|
68692
68986
|
}
|
|
68693
68987
|
function post(eventType, eventProps) {
|
|
68694
68988
|
if (typeof window === 'undefined' || !window.parent) return;
|
|
68989
|
+
// Never fall back to '*': if we have not yet learned the shell origin, use the
|
|
68990
|
+
// '/' sentinel ("deliver only if same-origin as us") so nothing leaks to a
|
|
68991
|
+
// malicious framer. In practice an inbound message pins the origin before the
|
|
68992
|
+
// app sends anything.
|
|
68993
|
+
var targetOrigin = trustedParentOrigin || '/';
|
|
68695
68994
|
window.parent.postMessage({
|
|
68696
68995
|
eventType: eventType,
|
|
68697
68996
|
eventProps: eventProps || {}
|
|
68698
|
-
},
|
|
68997
|
+
}, targetOrigin);
|
|
68699
68998
|
}
|
|
68700
68999
|
function handleMessage(event) {
|
|
69000
|
+
if (!isTrustedMessage(event)) return;
|
|
68701
69001
|
var data = event.data;
|
|
68702
69002
|
if (!data || !data.eventType) return;
|
|
68703
69003
|
var _data$eventProps = data.eventProps,
|
|
@@ -68710,7 +69010,7 @@ function handleMessage(event) {
|
|
|
68710
69010
|
pendingResponseType = _pending$get.responseType;
|
|
68711
69011
|
pending.delete(id);
|
|
68712
69012
|
switch (data.eventType) {
|
|
68713
|
-
case
|
|
69013
|
+
case IFRAME_EVENTS.FETCH_RESPONSE:
|
|
68714
69014
|
if ('error' in eventProps) {
|
|
68715
69015
|
var _eventProps$error, _eventProps$error2, _eventProps$error3, _eventProps$error4, _eventProps$error5;
|
|
68716
69016
|
var err = new Error(((_eventProps$error = eventProps.error) === null || _eventProps$error === void 0 ? void 0 : _eventProps$error.message) || 'Fetch failed');
|
|
@@ -68724,12 +69024,7 @@ function handleMessage(event) {
|
|
|
68724
69024
|
var _eventProps$result;
|
|
68725
69025
|
var resultData = (_eventProps$result = eventProps.result) === null || _eventProps$result === void 0 ? void 0 : _eventProps$result.data;
|
|
68726
69026
|
if (pendingResponseType === 'arraybuffer') {
|
|
68727
|
-
if (resultData instanceof ArrayBuffer) {
|
|
68728
|
-
console.log('[iframe-bridge/transport] FETCH_RESPONSE binary OK', {
|
|
68729
|
-
requestId: id,
|
|
68730
|
-
byteLength: resultData.byteLength
|
|
68731
|
-
});
|
|
68732
|
-
} else {
|
|
69027
|
+
if (resultData instanceof ArrayBuffer) ; else {
|
|
68733
69028
|
// Shell returned non-binary for a request that expected arraybuffer.
|
|
68734
69029
|
// This means Step 2 (shell) has not been deployed yet, or the shell
|
|
68735
69030
|
// is not forwarding responseType to its own axios call.
|
|
@@ -68743,13 +69038,13 @@ function handleMessage(event) {
|
|
|
68743
69038
|
resolve(eventProps.result);
|
|
68744
69039
|
}
|
|
68745
69040
|
break;
|
|
68746
|
-
case
|
|
69041
|
+
case IFRAME_EVENTS.STORAGE_RESPONSE:
|
|
68747
69042
|
resolve(eventProps.result);
|
|
68748
69043
|
break;
|
|
68749
|
-
case
|
|
69044
|
+
case IFRAME_EVENTS.ACCESS_RESPONSE:
|
|
68750
69045
|
resolve(eventProps.result);
|
|
68751
69046
|
break;
|
|
68752
|
-
case
|
|
69047
|
+
case IFRAME_EVENTS.INIT_DATA:
|
|
68753
69048
|
resolve(eventProps.result);
|
|
68754
69049
|
break;
|
|
68755
69050
|
}
|
|
@@ -68759,13 +69054,10 @@ if (typeof window !== 'undefined') {
|
|
|
68759
69054
|
}
|
|
68760
69055
|
function sendFetchRequest(payload) {
|
|
68761
69056
|
var signal = payload.signal,
|
|
68762
|
-
restPayload = _objectWithoutProperties(payload, _excluded);
|
|
69057
|
+
restPayload = _objectWithoutProperties(payload, _excluded$1);
|
|
68763
69058
|
return new Promise(function (resolve, reject) {
|
|
68764
69059
|
// Reject immediately if the signal is already aborted before we even send
|
|
68765
69060
|
if (signal !== null && signal !== void 0 && signal.aborted) {
|
|
68766
|
-
console.log('[iframe-bridge/transport] FETCH_REQUEST aborted before send', {
|
|
68767
|
-
url: payload.url
|
|
68768
|
-
});
|
|
68769
69061
|
reject(new DOMException('Request aborted', 'AbortError'));
|
|
68770
69062
|
return;
|
|
68771
69063
|
}
|
|
@@ -68776,27 +69068,14 @@ function sendFetchRequest(payload) {
|
|
|
68776
69068
|
reject: reject,
|
|
68777
69069
|
responseType: payload.responseType
|
|
68778
69070
|
});
|
|
68779
|
-
if (payload.responseType || payload.timeout != null || payload.withCredentials != null) {
|
|
68780
|
-
console.log('[iframe-bridge/transport] sending FETCH_REQUEST with extended options', {
|
|
68781
|
-
requestId: id,
|
|
68782
|
-
url: payload.url,
|
|
68783
|
-
responseType: payload.responseType,
|
|
68784
|
-
timeout: payload.timeout,
|
|
68785
|
-
withCredentials: payload.withCredentials
|
|
68786
|
-
});
|
|
68787
|
-
}
|
|
68788
69071
|
|
|
68789
69072
|
// signal cannot be transferred through postMessage — handle abort locally
|
|
68790
69073
|
if (signal) {
|
|
68791
69074
|
var onAbort = function onAbort() {
|
|
68792
69075
|
if (pending.has(id)) {
|
|
68793
69076
|
pending.delete(id);
|
|
68794
|
-
console.log('[iframe-bridge/transport] FETCH_REQUEST aborted mid-flight', {
|
|
68795
|
-
requestId: id,
|
|
68796
|
-
url: payload.url
|
|
68797
|
-
});
|
|
68798
69077
|
// Notify the shell so it can cancel its own request if wired up
|
|
68799
|
-
post(
|
|
69078
|
+
post(IFRAME_EVENTS.CANCEL_REQUEST, {
|
|
68800
69079
|
requestId: id
|
|
68801
69080
|
});
|
|
68802
69081
|
reject(new DOMException('Request aborted', 'AbortError'));
|
|
@@ -68808,7 +69087,7 @@ function sendFetchRequest(payload) {
|
|
|
68808
69087
|
}
|
|
68809
69088
|
|
|
68810
69089
|
// signal is intentionally excluded from the message — it's a non-serialisable DOM object
|
|
68811
|
-
post(
|
|
69090
|
+
post(IFRAME_EVENTS.FETCH_REQUEST, _objectSpread2(_objectSpread2({}, restPayload), {}, {
|
|
68812
69091
|
requestId: id
|
|
68813
69092
|
}));
|
|
68814
69093
|
});
|
|
@@ -68838,7 +69117,7 @@ function sendStorageGet(payload) {
|
|
|
68838
69117
|
_resolve(undefined);
|
|
68839
69118
|
}
|
|
68840
69119
|
});
|
|
68841
|
-
post(
|
|
69120
|
+
post(IFRAME_EVENTS.STORAGE_GET, _objectSpread2(_objectSpread2({}, payload), {}, {
|
|
68842
69121
|
requestId: id
|
|
68843
69122
|
}));
|
|
68844
69123
|
});
|
|
@@ -68868,35 +69147,44 @@ function sendStorageSet(payload) {
|
|
|
68868
69147
|
_resolve2(undefined);
|
|
68869
69148
|
}
|
|
68870
69149
|
});
|
|
68871
|
-
post(
|
|
69150
|
+
post(IFRAME_EVENTS.STORAGE_SET, _objectSpread2(_objectSpread2({}, payload), {}, {
|
|
68872
69151
|
requestId: id
|
|
68873
69152
|
}));
|
|
68874
69153
|
});
|
|
68875
69154
|
}
|
|
68876
69155
|
function getInitData() {
|
|
68877
|
-
return new Promise(function (
|
|
69156
|
+
return new Promise(function (_resolve4) {
|
|
68878
69157
|
var id = requestId();
|
|
68879
69158
|
var timer = setTimeout(function () {
|
|
68880
69159
|
if (pending.has(id)) {
|
|
68881
69160
|
pending.delete(id);
|
|
68882
|
-
|
|
69161
|
+
_resolve4(null);
|
|
68883
69162
|
}
|
|
68884
69163
|
}, 5000);
|
|
68885
69164
|
pending.set(id, {
|
|
68886
69165
|
resolve: function resolve(result) {
|
|
68887
69166
|
clearTimeout(timer);
|
|
68888
|
-
|
|
69167
|
+
_resolve4(result);
|
|
68889
69168
|
},
|
|
68890
69169
|
reject: function reject() {
|
|
68891
69170
|
clearTimeout(timer);
|
|
68892
|
-
|
|
69171
|
+
_resolve4(null);
|
|
68893
69172
|
}
|
|
68894
69173
|
});
|
|
68895
|
-
post(
|
|
69174
|
+
post(IFRAME_EVENTS.GET_INIT_DATA, {
|
|
68896
69175
|
requestId: id
|
|
68897
69176
|
});
|
|
68898
69177
|
});
|
|
68899
69178
|
}
|
|
69179
|
+
|
|
69180
|
+
/**
|
|
69181
|
+
* The shell origin we are pinned to (learned from the handshake or SHELL_ORIGIN).
|
|
69182
|
+
* Null until the first valid inbound message arrives. Used to build absolute
|
|
69183
|
+
* shell URLs (e.g. AppLink opening a shell route in a new tab).
|
|
69184
|
+
*/
|
|
69185
|
+
function getShellOrigin() {
|
|
69186
|
+
return trustedParentOrigin;
|
|
69187
|
+
}
|
|
68900
69188
|
function postHistoryGo(delta) {
|
|
68901
69189
|
post(IFRAME_EVENTS.HISTORY_GO, {
|
|
68902
69190
|
delta: delta
|
|
@@ -68967,6 +69255,7 @@ function sendAppEnv(toolkitEnv) {
|
|
|
68967
69255
|
}
|
|
68968
69256
|
function addMessageListener(callback) {
|
|
68969
69257
|
var handler = function handler(event) {
|
|
69258
|
+
if (!isTrustedMessage(event)) return;
|
|
68970
69259
|
var data = event.data;
|
|
68971
69260
|
if (data && data.eventType) callback(data);
|
|
68972
69261
|
};
|
|
@@ -68989,7 +69278,8 @@ function getInitialUri() {
|
|
|
68989
69278
|
}
|
|
68990
69279
|
return new Promise(function (resolve) {
|
|
68991
69280
|
function onMessage(event) {
|
|
68992
|
-
if (event
|
|
69281
|
+
if (!isTrustedMessage(event)) return;
|
|
69282
|
+
if (event.data && event.data.eventType === IFRAME_EVENTS.LOAD_URI && event.data.eventProps) {
|
|
68993
69283
|
window.removeEventListener('message', onMessage);
|
|
68994
69284
|
clearTimeout(timer);
|
|
68995
69285
|
var _uri = event.data.eventProps.uri;
|
|
@@ -69013,9 +69303,13 @@ function setAppName(name) {
|
|
|
69013
69303
|
_appName = name;
|
|
69014
69304
|
}
|
|
69015
69305
|
function getAppName() {
|
|
69016
|
-
var _window$toolkitEnv;
|
|
69306
|
+
var _window$toolkitEnv, _process$env;
|
|
69017
69307
|
if (_appName) return _appName;
|
|
69018
|
-
|
|
69308
|
+
var envName = ((_window$toolkitEnv = window.toolkitEnv) === null || _window$toolkitEnv === void 0 ? void 0 : _window$toolkitEnv.APP_NAME) || typeof process !== 'undefined' && ((_process$env = process.env) === null || _process$env === void 0 ? void 0 : _process$env.APP_NAME) || '';
|
|
69309
|
+
if (!envName) {
|
|
69310
|
+
console.error('[iframe-bridge] APP_NAME is not configured. Storage namespacing and app resolution will not work correctly.');
|
|
69311
|
+
}
|
|
69312
|
+
return envName;
|
|
69019
69313
|
}
|
|
69020
69314
|
|
|
69021
69315
|
/**
|
|
@@ -69023,7 +69317,7 @@ function getAppName() {
|
|
|
69023
69317
|
* Matches standalone toolkit: permissions are stored as `${appAuthName}:permissions`.
|
|
69024
69318
|
*/
|
|
69025
69319
|
function resolveAppAuthName(appName, getLocalItemFn) {
|
|
69026
|
-
var _window$toolkitEnv2, _process$
|
|
69320
|
+
var _window$toolkitEnv2, _process$env2;
|
|
69027
69321
|
if (!appName) return null;
|
|
69028
69322
|
var portalConfig = typeof getLocalItemFn === 'function' ? getLocalItemFn('opsportal-core:config') : null;
|
|
69029
69323
|
var appTiles = portalConfig && portalConfig.tiles || [];
|
|
@@ -69032,11 +69326,14 @@ function resolveAppAuthName(appName, getLocalItemFn) {
|
|
|
69032
69326
|
});
|
|
69033
69327
|
if (appData !== null && appData !== void 0 && appData.appAuthName) return appData.appAuthName;
|
|
69034
69328
|
if ((_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.APP_AUTH_NAME) return window.toolkitEnv.APP_AUTH_NAME;
|
|
69035
|
-
if (typeof process !== 'undefined' && (_process$
|
|
69329
|
+
if (typeof process !== 'undefined' && (_process$env2 = process.env) !== null && _process$env2 !== void 0 && _process$env2.APP_AUTH_NAME) {
|
|
69036
69330
|
return process.env.APP_AUTH_NAME;
|
|
69037
69331
|
}
|
|
69038
69332
|
return null;
|
|
69039
69333
|
}
|
|
69334
|
+
function nullishCoalesce(primary, fallback) {
|
|
69335
|
+
return primary !== null && primary !== undefined ? primary : fallback;
|
|
69336
|
+
}
|
|
69040
69337
|
function getByPath(obj, path) {
|
|
69041
69338
|
if (obj == null) return undefined;
|
|
69042
69339
|
var parts = path.split('.');
|
|
@@ -69073,34 +69370,21 @@ function setInitCache(initData) {
|
|
|
69073
69370
|
// Shell sends config/coreAppPermissions under shorthand keys; map to canonical keys bridge getters expect
|
|
69074
69371
|
if (initData.config != null && initData['opsportal-core:config'] == null) {
|
|
69075
69372
|
cache.local['opsportal-core:config'] = initData.config;
|
|
69076
|
-
console.log('[iframe-bridge/storage] setInitCache mapped config -> opsportal-core:config');
|
|
69077
69373
|
}
|
|
69078
69374
|
if (initData.coreAppPermissions != null && initData['ops_portal:permissions'] == null) {
|
|
69079
69375
|
cache.local['ops_portal:permissions'] = initData.coreAppPermissions;
|
|
69080
|
-
console.log('[iframe-bridge/storage] setInitCache mapped coreAppPermissions -> ops_portal:permissions', {
|
|
69081
|
-
count: Array.isArray(initData.coreAppPermissions) ? initData.coreAppPermissions.length : 'not-array'
|
|
69082
|
-
});
|
|
69083
69376
|
}
|
|
69084
69377
|
var appPermKeys = Object.keys(initData).filter(function (k) {
|
|
69085
69378
|
return k.endsWith(':permissions') && k !== 'ops_portal:permissions';
|
|
69086
69379
|
});
|
|
69087
69380
|
appPermKeys.forEach(function (k) {
|
|
69088
69381
|
cache.local[k] = initData[k];
|
|
69089
|
-
console.log('[iframe-bridge/storage] setInitCache mapped app permissions', {
|
|
69090
|
-
key: k,
|
|
69091
|
-
count: Array.isArray(initData[k]) ? initData[k].length : 'not-array'
|
|
69092
|
-
});
|
|
69093
69382
|
});
|
|
69094
69383
|
var appConfigKeys = Object.keys(initData).filter(function (k) {
|
|
69095
69384
|
return k.endsWith(':config') && k !== 'opsportal-core:config';
|
|
69096
69385
|
});
|
|
69097
69386
|
appConfigKeys.forEach(function (k) {
|
|
69098
|
-
var _initData$k;
|
|
69099
69387
|
cache.local[k] = initData[k];
|
|
69100
|
-
console.log('[iframe-bridge/storage] setInitCache mapped app config', {
|
|
69101
|
-
key: k,
|
|
69102
|
-
hasRunConfig: Boolean((_initData$k = initData[k]) === null || _initData$k === void 0 ? void 0 : _initData$k.runConfig)
|
|
69103
|
-
});
|
|
69104
69388
|
});
|
|
69105
69389
|
}
|
|
69106
69390
|
function setExtraLocal(key, value) {
|
|
@@ -69110,7 +69394,7 @@ function getInitDataForBootstrap() {
|
|
|
69110
69394
|
return getInitData();
|
|
69111
69395
|
}
|
|
69112
69396
|
function getLocalItem(key, path) {
|
|
69113
|
-
var value = cache.local[key]
|
|
69397
|
+
var value = nullishCoalesce(cache.local[key], cache[key]);
|
|
69114
69398
|
var out = path ? getByPath(value, path) : value;
|
|
69115
69399
|
if (out !== undefined) return out;
|
|
69116
69400
|
if (key === 'login') return cache.login;
|
|
@@ -69125,7 +69409,7 @@ function setLocalItem(key, value, path) {
|
|
|
69125
69409
|
path: path
|
|
69126
69410
|
});
|
|
69127
69411
|
if (path) {
|
|
69128
|
-
var existing = cache.local[key]
|
|
69412
|
+
var existing = nullishCoalesce(cache.local[key], nullishCoalesce(cache[key], {}));
|
|
69129
69413
|
cache.local[key] = setByPath(_objectSpread2({}, existing), path, value);
|
|
69130
69414
|
} else {
|
|
69131
69415
|
cache.local[key] = value;
|
|
@@ -69134,7 +69418,7 @@ function setLocalItem(key, value, path) {
|
|
|
69134
69418
|
}
|
|
69135
69419
|
}
|
|
69136
69420
|
function getSessionItem(key, path) {
|
|
69137
|
-
var value = cache.session[key]
|
|
69421
|
+
var value = nullishCoalesce(cache.session[key], cache[key]);
|
|
69138
69422
|
var out = path ? getByPath(value, path) : value;
|
|
69139
69423
|
if (out !== undefined) return out;
|
|
69140
69424
|
if (key === 'dashboard') return cache.dashboard;
|
|
@@ -69148,7 +69432,7 @@ function setSessionItem(key, value, path) {
|
|
|
69148
69432
|
path: path
|
|
69149
69433
|
});
|
|
69150
69434
|
if (path) {
|
|
69151
|
-
var existing = cache.session[key]
|
|
69435
|
+
var existing = nullishCoalesce(cache.session[key], nullishCoalesce(cache[key], {}));
|
|
69152
69436
|
cache.session[key] = setByPath(_objectSpread2({}, existing), path, value);
|
|
69153
69437
|
} else {
|
|
69154
69438
|
cache.session[key] = value;
|
|
@@ -69190,14 +69474,14 @@ function applyStorageChanged() {
|
|
|
69190
69474
|
if (op === 'set' && key) {
|
|
69191
69475
|
if (scope === 'session') {
|
|
69192
69476
|
if (path) {
|
|
69193
|
-
var existing = cache.session[key]
|
|
69477
|
+
var existing = nullishCoalesce(cache.session[key], {});
|
|
69194
69478
|
cache.session[key] = setByPath(_objectSpread2({}, existing), path, value);
|
|
69195
69479
|
} else {
|
|
69196
69480
|
cache.session[key] = value;
|
|
69197
69481
|
if (key === 'dashboard') cache.dashboard = value;
|
|
69198
69482
|
}
|
|
69199
69483
|
} else if (path) {
|
|
69200
|
-
var _existing = cache.local[key]
|
|
69484
|
+
var _existing = nullishCoalesce(cache.local[key], {});
|
|
69201
69485
|
cache.local[key] = setByPath(_objectSpread2({}, _existing), path, value);
|
|
69202
69486
|
} else {
|
|
69203
69487
|
cache.local[key] = value;
|
|
@@ -69218,7 +69502,7 @@ function removeSessionItemFromCache(key) {
|
|
|
69218
69502
|
function getItem$1(key) {
|
|
69219
69503
|
var APP_NAME = getAppName();
|
|
69220
69504
|
var namespaced = "".concat(APP_NAME, ":").concat(key);
|
|
69221
|
-
return cache.local[namespaced]
|
|
69505
|
+
return nullishCoalesce(cache.local[namespaced], cache[key]);
|
|
69222
69506
|
}
|
|
69223
69507
|
function setItem(key, value) {
|
|
69224
69508
|
var APP_NAME = getAppName();
|
|
@@ -69253,7 +69537,7 @@ function setAppContext() {
|
|
|
69253
69537
|
if (!appAuthName) throw new Error('appAuthName not found');
|
|
69254
69538
|
setSessionItem("".concat(appAuthName, ":miHelpBotContext"), context);
|
|
69255
69539
|
} catch (e) {
|
|
69256
|
-
console.
|
|
69540
|
+
console.error('[iframe-bridge/storage] setAppContext error:', e);
|
|
69257
69541
|
}
|
|
69258
69542
|
}
|
|
69259
69543
|
function clearStorage() {
|
|
@@ -69286,7 +69570,7 @@ var storage$1 = {
|
|
|
69286
69570
|
var appAuthName = appData ? appData.appAuthName : (_window$toolkitEnv6 = window.toolkitEnv) !== null && _window$toolkitEnv6 !== void 0 && _window$toolkitEnv6.APP_AUTH_NAME ? window.toolkitEnv.APP_AUTH_NAME : process.env.APP_AUTH_NAME;
|
|
69287
69571
|
return appAuthName ? getSessionItem("".concat(appAuthName, ":miHelpBotContext")) : {};
|
|
69288
69572
|
} catch (e) {
|
|
69289
|
-
console.
|
|
69573
|
+
console.error('[iframe-bridge/storage] appContext getter error:', e);
|
|
69290
69574
|
return '';
|
|
69291
69575
|
}
|
|
69292
69576
|
},
|
|
@@ -69496,15 +69780,6 @@ function request(config) {
|
|
|
69496
69780
|
timeout = finalConfig.timeout,
|
|
69497
69781
|
withCredentials = finalConfig.withCredentials,
|
|
69498
69782
|
signal = finalConfig.signal;
|
|
69499
|
-
if (responseType || timeout != null || withCredentials != null || signal) {
|
|
69500
|
-
console.log('[iframe-bridge/fetcher] request with extended options', {
|
|
69501
|
-
url: url,
|
|
69502
|
-
responseType: responseType,
|
|
69503
|
-
timeout: timeout,
|
|
69504
|
-
withCredentials: withCredentials,
|
|
69505
|
-
hasSignal: Boolean(signal)
|
|
69506
|
-
});
|
|
69507
|
-
}
|
|
69508
69783
|
return sendFetchRequest({
|
|
69509
69784
|
method: (method || 'get').toLowerCase(),
|
|
69510
69785
|
url: url,
|
|
@@ -69517,13 +69792,6 @@ function request(config) {
|
|
|
69517
69792
|
signal: signal
|
|
69518
69793
|
});
|
|
69519
69794
|
}).then(function (result) {
|
|
69520
|
-
if (result.data instanceof ArrayBuffer) {
|
|
69521
|
-
console.log('[iframe-bridge/fetcher] binary response received', {
|
|
69522
|
-
url: config.url,
|
|
69523
|
-
byteLength: result.data.byteLength,
|
|
69524
|
-
type: 'ArrayBuffer'
|
|
69525
|
-
});
|
|
69526
|
-
}
|
|
69527
69795
|
return applyResponseInterceptors({
|
|
69528
69796
|
data: result.data,
|
|
69529
69797
|
status: result.status,
|
|
@@ -69687,14 +69955,10 @@ Object.assign(fetcher, {
|
|
|
69687
69955
|
return _regenerator().w(function (_context3) {
|
|
69688
69956
|
while (1) switch (_context3.p = _context3.n) {
|
|
69689
69957
|
case 0:
|
|
69690
|
-
|
|
69691
|
-
appName: appName,
|
|
69692
|
-
useAppScopes: useAppScopes
|
|
69693
|
-
});
|
|
69694
|
-
_context3.p = 1;
|
|
69958
|
+
_context3.p = 0;
|
|
69695
69959
|
permissions = [];
|
|
69696
69960
|
if (!useAppScopes) {
|
|
69697
|
-
_context3.n =
|
|
69961
|
+
_context3.n = 1;
|
|
69698
69962
|
break;
|
|
69699
69963
|
}
|
|
69700
69964
|
userAppScopes = Array.isArray(storage$1.userAppScopes) ? storage$1.userAppScopes : [];
|
|
@@ -69702,10 +69966,6 @@ Object.assign(fetcher, {
|
|
|
69702
69966
|
appEntry = Array.isArray(allAppScopesAndFunctions) ? allAppScopesAndFunctions.find(function (s) {
|
|
69703
69967
|
return s.appName === appName;
|
|
69704
69968
|
}) : null;
|
|
69705
|
-
console.log('[iframe-bridge/fetcher] getPermissions (useAppScopes)', {
|
|
69706
|
-
appEntryFound: Boolean(appEntry),
|
|
69707
|
-
userAppScopesCount: userAppScopes.length
|
|
69708
|
-
});
|
|
69709
69969
|
if (appEntry) {
|
|
69710
69970
|
appFunctionsMap = {};
|
|
69711
69971
|
(_appEntry$scopes = appEntry.scopes) === null || _appEntry$scopes === void 0 ? void 0 : _appEntry$scopes.forEach(function (scope) {
|
|
@@ -69727,25 +69987,21 @@ Object.assign(fetcher, {
|
|
|
69727
69987
|
});
|
|
69728
69988
|
permissions = Object.values(appFunctionsMap);
|
|
69729
69989
|
}
|
|
69730
|
-
_context3.n =
|
|
69990
|
+
_context3.n = 3;
|
|
69731
69991
|
break;
|
|
69732
|
-
case
|
|
69992
|
+
case 1:
|
|
69733
69993
|
config = storage$1.getLocalItem('opsportal-core:config') || storage$1.getLocalItem('config');
|
|
69734
69994
|
endpoint = config === null || config === void 0 ? void 0 : (_config$endpoints = config.endpoints) === null || _config$endpoints === void 0 ? void 0 : _config$endpoints.g2AppPermissions;
|
|
69735
69995
|
url = endpoint ? "".concat(endpoint).concat(appName) : "/api/permissions/".concat(appName);
|
|
69736
69996
|
country = storage$1.getSessionItem('dashboard', 'selectedCountryA3code');
|
|
69737
|
-
|
|
69738
|
-
url: url,
|
|
69739
|
-
country: country
|
|
69740
|
-
});
|
|
69741
|
-
_context3.n = 3;
|
|
69997
|
+
_context3.n = 2;
|
|
69742
69998
|
return fetcher.get(url, {
|
|
69743
69999
|
headers: {
|
|
69744
70000
|
country: country,
|
|
69745
70001
|
source: 'OPS_PORTAL'
|
|
69746
70002
|
}
|
|
69747
70003
|
});
|
|
69748
|
-
case
|
|
70004
|
+
case 2:
|
|
69749
70005
|
response = _context3.v;
|
|
69750
70006
|
appDetails = (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$applic = _response$data.applications) === null || _response$data$applic === void 0 ? void 0 : _response$data$applic.find(function (app) {
|
|
69751
70007
|
return app.name === appName;
|
|
@@ -69753,15 +70009,11 @@ Object.assign(fetcher, {
|
|
|
69753
70009
|
if (appDetails) {
|
|
69754
70010
|
permissions = appDetails.applicationFunctions;
|
|
69755
70011
|
}
|
|
69756
|
-
case
|
|
69757
|
-
console.log('[iframe-bridge/fetcher] getPermissions stored', {
|
|
69758
|
-
appName: appName,
|
|
69759
|
-
count: permissions.length
|
|
69760
|
-
});
|
|
70012
|
+
case 3:
|
|
69761
70013
|
storage$1.setLocalItem("".concat(appName, ":permissions"), permissions);
|
|
69762
70014
|
return _context3.a(2, permissions);
|
|
69763
|
-
case
|
|
69764
|
-
_context3.p =
|
|
70015
|
+
case 4:
|
|
70016
|
+
_context3.p = 4;
|
|
69765
70017
|
_t = _context3.v;
|
|
69766
70018
|
console.warn('[iframe-bridge/fetcher] getPermissions failed', {
|
|
69767
70019
|
appName: appName,
|
|
@@ -69769,7 +70021,7 @@ Object.assign(fetcher, {
|
|
|
69769
70021
|
});
|
|
69770
70022
|
return _context3.a(2, []);
|
|
69771
70023
|
}
|
|
69772
|
-
}, _callee3, null, [[
|
|
70024
|
+
}, _callee3, null, [[0, 4]]);
|
|
69773
70025
|
}));
|
|
69774
70026
|
function getPermissions(_x2, _x3) {
|
|
69775
70027
|
return _getPermissions.apply(this, arguments);
|
|
@@ -70191,7 +70443,7 @@ function CrumbProvider(_ref) {
|
|
|
70191
70443
|
React.useEffect(function () {
|
|
70192
70444
|
var remove = addMessageListener(function (data) {
|
|
70193
70445
|
var _data$eventProps;
|
|
70194
|
-
if (data.eventType ===
|
|
70446
|
+
if (data.eventType === IFRAME_EVENTS.CRUMB_CLICKED && ((_data$eventProps = data.eventProps) === null || _data$eventProps === void 0 ? void 0 : _data$eventProps.path) != null && navigateRef) {
|
|
70195
70447
|
navigateRef(data.eventProps.path);
|
|
70196
70448
|
}
|
|
70197
70449
|
});
|
|
@@ -70298,6 +70550,283 @@ function Crumb(_ref) {
|
|
|
70298
70550
|
return null;
|
|
70299
70551
|
}
|
|
70300
70552
|
|
|
70553
|
+
/**
|
|
70554
|
+
* Shared navigation classifier for embedded apps.
|
|
70555
|
+
*
|
|
70556
|
+
* Both AppLink (the opt-in component) and the global navigation guard (the
|
|
70557
|
+
* catch-all for raw <a>/window.open/forms) use this so they agree on what is
|
|
70558
|
+
* "internal" (a shell route), "external" (a foreign site), or something we
|
|
70559
|
+
* should leave to the browser.
|
|
70560
|
+
*/
|
|
70561
|
+
|
|
70562
|
+
// Schemes that are not frame navigations we manage — let the browser handle.
|
|
70563
|
+
var SPECIAL_SCHEME = /^(mailto:|tel:|sms:|callto:|blob:|data:|javascript:|about:)/i;
|
|
70564
|
+
|
|
70565
|
+
/**
|
|
70566
|
+
* @param {string} href
|
|
70567
|
+
* @returns {{kind:'internal'|'external'|'special'|'hash'|'ignore', shellPath?:string, absolute?:string, unresolved?:boolean}}
|
|
70568
|
+
* - internal: same origin as the shell → should be driven through the shell router
|
|
70569
|
+
* - external: a different origin → must open in a new tab, never in-frame
|
|
70570
|
+
* - special/hash/ignore: leave to native browser behavior
|
|
70571
|
+
*/
|
|
70572
|
+
function classifyHref(href) {
|
|
70573
|
+
if (href == null || href === '' || typeof href !== 'string') return {
|
|
70574
|
+
kind: 'ignore'
|
|
70575
|
+
};
|
|
70576
|
+
if (SPECIAL_SCHEME.test(href)) return {
|
|
70577
|
+
kind: 'special'
|
|
70578
|
+
};
|
|
70579
|
+
if (href.startsWith('#')) return {
|
|
70580
|
+
kind: 'hash'
|
|
70581
|
+
};
|
|
70582
|
+
var shellOrigin = getShellOrigin();
|
|
70583
|
+
var appOrigin = typeof window !== 'undefined' ? window.location.origin : undefined;
|
|
70584
|
+
var base = shellOrigin || appOrigin;
|
|
70585
|
+
var parsed;
|
|
70586
|
+
try {
|
|
70587
|
+
parsed = new URL(href, base);
|
|
70588
|
+
} catch (_) {
|
|
70589
|
+
return {
|
|
70590
|
+
kind: 'ignore'
|
|
70591
|
+
};
|
|
70592
|
+
}
|
|
70593
|
+
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
|
|
70594
|
+
return {
|
|
70595
|
+
kind: 'special'
|
|
70596
|
+
};
|
|
70597
|
+
}
|
|
70598
|
+
var shellPath = "".concat(parsed.pathname).concat(parsed.search).concat(parsed.hash);
|
|
70599
|
+
if (shellOrigin) {
|
|
70600
|
+
return parsed.origin === shellOrigin ? {
|
|
70601
|
+
kind: 'internal',
|
|
70602
|
+
shellPath: shellPath,
|
|
70603
|
+
absolute: shellOrigin + shellPath
|
|
70604
|
+
} : {
|
|
70605
|
+
kind: 'external',
|
|
70606
|
+
absolute: parsed.href
|
|
70607
|
+
};
|
|
70608
|
+
}
|
|
70609
|
+
|
|
70610
|
+
// Handshake not complete yet (shell origin unknown). Best effort: a URL on the
|
|
70611
|
+
// app's own origin (which is what a relative path resolves to) is treated as
|
|
70612
|
+
// internal-but-unresolved; the shell path is still correct to route.
|
|
70613
|
+
if (appOrigin && parsed.origin === appOrigin) {
|
|
70614
|
+
return {
|
|
70615
|
+
kind: 'internal',
|
|
70616
|
+
shellPath: shellPath,
|
|
70617
|
+
absolute: parsed.origin + shellPath,
|
|
70618
|
+
unresolved: true
|
|
70619
|
+
};
|
|
70620
|
+
}
|
|
70621
|
+
return {
|
|
70622
|
+
kind: 'external',
|
|
70623
|
+
absolute: parsed.href
|
|
70624
|
+
};
|
|
70625
|
+
}
|
|
70626
|
+
function isModifiedClick(event) {
|
|
70627
|
+
return event.metaKey || event.altKey || event.ctrlKey || event.shiftKey;
|
|
70628
|
+
}
|
|
70629
|
+
|
|
70630
|
+
var _excluded = ["href", "target", "rel", "children", "onClick"];
|
|
70631
|
+
|
|
70632
|
+
/**
|
|
70633
|
+
* AppLink — a drop-in replacement for a plain <a> inside an iframed app.
|
|
70634
|
+
*
|
|
70635
|
+
* Why it exists: an app is rendered inside the shell's iframe. A normal
|
|
70636
|
+
* <a href="..."> click navigates the *iframe itself*, which is wrong in two ways:
|
|
70637
|
+
* 1. Internal/shell links → the iframe full-reloads (and can even render the
|
|
70638
|
+
* shell nested inside the iframe — "shell-in-shell") and the shell URL bar
|
|
70639
|
+
* desyncs, breaking deep-linking and Back.
|
|
70640
|
+
* 2. External links → an arbitrary (possibly malicious) site gets framed
|
|
70641
|
+
* inside our portal chrome.
|
|
70642
|
+
*
|
|
70643
|
+
* AppLink is the opt-in "authored correctly" path; for raw <a>/window.open the
|
|
70644
|
+
* app did NOT convert, installNavigationGuard() is the global catch-all. Both
|
|
70645
|
+
* share classifyHref() so they behave identically.
|
|
70646
|
+
*
|
|
70647
|
+
* Behavior:
|
|
70648
|
+
* - Relative / same-shell-origin href → shell router navigation (no reload).
|
|
70649
|
+
* target="_blank" opens the absolute shell URL in a new tab.
|
|
70650
|
+
* - External href → target defaults to "_blank" + rel="noopener noreferrer".
|
|
70651
|
+
* - mailto:/tel:/hash/etc. and modified/middle clicks → native behavior.
|
|
70652
|
+
*
|
|
70653
|
+
* All other anchor props (className, style, aria-*, onClick, …) are forwarded.
|
|
70654
|
+
*/
|
|
70655
|
+
function AppLink(_ref) {
|
|
70656
|
+
var href = _ref.href,
|
|
70657
|
+
target = _ref.target,
|
|
70658
|
+
rel = _ref.rel,
|
|
70659
|
+
children = _ref.children,
|
|
70660
|
+
onClick = _ref.onClick,
|
|
70661
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
70662
|
+
var result = classifyHref(href);
|
|
70663
|
+
var isInternal = result.kind === 'internal';
|
|
70664
|
+
var isExternal = result.kind === 'external';
|
|
70665
|
+
var shellOrigin = getShellOrigin();
|
|
70666
|
+
var handleClick = function handleClick(event) {
|
|
70667
|
+
if (onClick) onClick(event);
|
|
70668
|
+
if (event.defaultPrevented) return;
|
|
70669
|
+
if (event.button !== 0) return;
|
|
70670
|
+
if (isModifiedClick(event)) return;
|
|
70671
|
+
if (isInternal) {
|
|
70672
|
+
event.preventDefault();
|
|
70673
|
+
if (target === '_blank') {
|
|
70674
|
+
window.open(result.absolute, '_blank', 'noopener,noreferrer');
|
|
70675
|
+
} else {
|
|
70676
|
+
postUpdateUri(result.shellPath, true);
|
|
70677
|
+
}
|
|
70678
|
+
return;
|
|
70679
|
+
}
|
|
70680
|
+
// External: let the resolved target/rel below force a new tab (never in-frame).
|
|
70681
|
+
};
|
|
70682
|
+
var resolvedTarget = isExternal ? target || '_blank' : target;
|
|
70683
|
+
var resolvedRel = resolvedTarget === '_blank' ? rel || 'noopener noreferrer' : rel;
|
|
70684
|
+
|
|
70685
|
+
// href shown on the anchor: absolute shell URL for internal (so hover/copy/
|
|
70686
|
+
// open-in-new-tab work), original href otherwise.
|
|
70687
|
+
var anchorHref = isInternal && shellOrigin ? result.absolute : href;
|
|
70688
|
+
return /*#__PURE__*/React__default["default"].createElement("a", _extends$1({
|
|
70689
|
+
href: anchorHref,
|
|
70690
|
+
target: resolvedTarget,
|
|
70691
|
+
rel: resolvedRel,
|
|
70692
|
+
onClick: handleClick
|
|
70693
|
+
}, rest), children);
|
|
70694
|
+
}
|
|
70695
|
+
|
|
70696
|
+
/**
|
|
70697
|
+
* installNavigationGuard — a global, app-agnostic catch-all that keeps an
|
|
70698
|
+
* embedded app's frame from navigating itself to the wrong place, regardless of
|
|
70699
|
+
* how the app wrote the navigation. AppLink is the opt-in, "authored correctly"
|
|
70700
|
+
* path; this guard covers the code the app did NOT write with AppLink:
|
|
70701
|
+
*
|
|
70702
|
+
* 1. Raw <a href> clicks (any anchor, added anytime) — capture-phase listener.
|
|
70703
|
+
* 2. window.open(url, '_self'/'_top'/'_parent') — wrapped.
|
|
70704
|
+
* 3. <form> submits with a navigating action — capture-phase submit listener.
|
|
70705
|
+
*
|
|
70706
|
+
* Policy (shared with AppLink via classifyHref):
|
|
70707
|
+
* - internal (same origin as shell) → drive the shell router (postUpdateUri),
|
|
70708
|
+
* no iframe reload, shell URL stays in sync. New-tab intents open the
|
|
70709
|
+
* absolute shell URL.
|
|
70710
|
+
* - external (foreign origin) → open in a new tab (noopener), never in-frame.
|
|
70711
|
+
* - special/hash → left to the browser.
|
|
70712
|
+
*
|
|
70713
|
+
* Call once, after bootstrap. Idempotent. Returns an uninstall function.
|
|
70714
|
+
*
|
|
70715
|
+
* NOTE: this is defense-in-depth, not a security boundary. See LIMITATIONS at
|
|
70716
|
+
* the bottom for the vectors it cannot cover (location.assign, meta-refresh,
|
|
70717
|
+
* server redirects), which must be handled by CSP + the shell heartbeat.
|
|
70718
|
+
*/
|
|
70719
|
+
|
|
70720
|
+
var installed = false;
|
|
70721
|
+
function installNavigationGuard() {
|
|
70722
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
70723
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') return function () {};
|
|
70724
|
+
if (installed) return function () {};
|
|
70725
|
+
installed = true;
|
|
70726
|
+
var onBlockedNavigation = options.onBlockedNavigation;
|
|
70727
|
+
var routeInternal = function routeInternal(shellPath, newTab) {
|
|
70728
|
+
if (newTab) {
|
|
70729
|
+
var shellOrigin = getShellOrigin();
|
|
70730
|
+
window.open((shellOrigin || '') + shellPath, '_blank', 'noopener,noreferrer');
|
|
70731
|
+
} else {
|
|
70732
|
+
postUpdateUri(shellPath, true);
|
|
70733
|
+
}
|
|
70734
|
+
if (onBlockedNavigation) onBlockedNavigation({
|
|
70735
|
+
type: 'internal',
|
|
70736
|
+
shellPath: shellPath,
|
|
70737
|
+
newTab: newTab
|
|
70738
|
+
});
|
|
70739
|
+
};
|
|
70740
|
+
var openExternal = function openExternal(absolute) {
|
|
70741
|
+
window.open(absolute, '_blank', 'noopener,noreferrer');
|
|
70742
|
+
if (onBlockedNavigation) onBlockedNavigation({
|
|
70743
|
+
type: 'external',
|
|
70744
|
+
absolute: absolute
|
|
70745
|
+
});
|
|
70746
|
+
};
|
|
70747
|
+
|
|
70748
|
+
// --- 1. Anchor clicks -----------------------------------------------------
|
|
70749
|
+
var onClick = function onClick(event) {
|
|
70750
|
+
if (event.defaultPrevented || event.button !== 0) return;
|
|
70751
|
+
var anchor = event.target && event.target.closest && event.target.closest('a[href]');
|
|
70752
|
+
if (!anchor) return;
|
|
70753
|
+
// Respect an explicit new-tab/native target the browser will handle safely.
|
|
70754
|
+
var target = anchor.getAttribute('target');
|
|
70755
|
+
var href = anchor.getAttribute('href');
|
|
70756
|
+
var result = classifyHref(href);
|
|
70757
|
+
if (result.kind === 'special' || result.kind === 'hash' || result.kind === 'ignore') return;
|
|
70758
|
+
|
|
70759
|
+
// Modifier / middle click on an internal link: let the browser open the real
|
|
70760
|
+
// URL (anchor href is already absolute-to-app; harmless). For external it's
|
|
70761
|
+
// fine too. We only take over the *plain* click.
|
|
70762
|
+
if (isModifiedClick(event)) return;
|
|
70763
|
+
if (result.kind === 'internal') {
|
|
70764
|
+
event.preventDefault();
|
|
70765
|
+
routeInternal(result.shellPath, target === '_blank');
|
|
70766
|
+
return;
|
|
70767
|
+
}
|
|
70768
|
+
if (result.kind === 'external') {
|
|
70769
|
+
// Force new tab even if the app omitted target — never load foreign in-frame.
|
|
70770
|
+
event.preventDefault();
|
|
70771
|
+
openExternal(result.absolute);
|
|
70772
|
+
}
|
|
70773
|
+
};
|
|
70774
|
+
document.addEventListener('click', onClick, true);
|
|
70775
|
+
|
|
70776
|
+
// --- 2. window.open('_self'/'_top'/'_parent') -----------------------------
|
|
70777
|
+
var nativeOpen = window.open;
|
|
70778
|
+
var wrappedOpen = function wrappedOpen(url, name, features) {
|
|
70779
|
+
// Named/new-window targets are real popups — allow natively.
|
|
70780
|
+
var selfNav = name === '_self' || name === '_top' || name === '_parent';
|
|
70781
|
+
if (url != null && selfNav) {
|
|
70782
|
+
var result = classifyHref(String(url));
|
|
70783
|
+
if (result.kind === 'internal') {
|
|
70784
|
+
routeInternal(result.shellPath, false);
|
|
70785
|
+
return null;
|
|
70786
|
+
}
|
|
70787
|
+
if (result.kind === 'external') {
|
|
70788
|
+
return nativeOpen.call(window, result.absolute, '_blank', 'noopener,noreferrer');
|
|
70789
|
+
}
|
|
70790
|
+
}
|
|
70791
|
+
return nativeOpen.call(window, url, name, features);
|
|
70792
|
+
};
|
|
70793
|
+
try {
|
|
70794
|
+
window.open = wrappedOpen;
|
|
70795
|
+
} catch (_) {/* some environments freeze window.open */}
|
|
70796
|
+
|
|
70797
|
+
// --- 3. Form submits ------------------------------------------------------
|
|
70798
|
+
var onSubmit = function onSubmit(event) {
|
|
70799
|
+
if (event.defaultPrevented) return;
|
|
70800
|
+
var form = event.target;
|
|
70801
|
+
if (!form || form.tagName !== 'FORM') return;
|
|
70802
|
+
var action = form.getAttribute('action');
|
|
70803
|
+
// No action → submits to current URL (in-app); let it be. GET/POST both
|
|
70804
|
+
// cause a frame navigation though, so classify the action when present.
|
|
70805
|
+
if (!action) return;
|
|
70806
|
+
var result = classifyHref(action);
|
|
70807
|
+
if (result.kind === 'external') {
|
|
70808
|
+
// Never let a form post navigate the frame to a foreign origin.
|
|
70809
|
+
event.preventDefault();
|
|
70810
|
+
if (onBlockedNavigation) onBlockedNavigation({
|
|
70811
|
+
type: 'external-form-blocked',
|
|
70812
|
+
action: result.absolute
|
|
70813
|
+
});
|
|
70814
|
+
// Intentionally do NOT auto-resubmit externally — a cross-origin form POST
|
|
70815
|
+
// to a new tab is not generally safe/possible. Surface via callback.
|
|
70816
|
+
}
|
|
70817
|
+
// internal form navigation is left to the app's own router/handling.
|
|
70818
|
+
};
|
|
70819
|
+
document.addEventListener('submit', onSubmit, true);
|
|
70820
|
+
return function uninstall() {
|
|
70821
|
+
document.removeEventListener('click', onClick, true);
|
|
70822
|
+
document.removeEventListener('submit', onSubmit, true);
|
|
70823
|
+
try {
|
|
70824
|
+
window.open = nativeOpen;
|
|
70825
|
+
} catch (_) {}
|
|
70826
|
+
installed = false;
|
|
70827
|
+
};
|
|
70828
|
+
}
|
|
70829
|
+
|
|
70301
70830
|
var iframeFacade = {
|
|
70302
70831
|
AppFrame: AppFrame,
|
|
70303
70832
|
CallLogger: CallLogger,
|
|
@@ -70309,6 +70838,8 @@ var iframeFacade = {
|
|
|
70309
70838
|
Crumb: Crumb,
|
|
70310
70839
|
CrumbProvider: CrumbProvider,
|
|
70311
70840
|
useCrumbContext: useCrumbContext,
|
|
70841
|
+
AppLink: AppLink,
|
|
70842
|
+
installNavigationGuard: installNavigationGuard,
|
|
70312
70843
|
bridge: {
|
|
70313
70844
|
postUpdateUri: postUpdateUri,
|
|
70314
70845
|
postUpdateCrumbs: postUpdateCrumbs,
|
|
@@ -70326,6 +70857,7 @@ var iframeFacade = {
|
|
|
70326
70857
|
resolveAppAuthName: resolveAppAuthName,
|
|
70327
70858
|
getInitDataForBootstrap: getInitDataForBootstrap,
|
|
70328
70859
|
sendStorageGet: sendStorageGet,
|
|
70860
|
+
getShellOrigin: getShellOrigin,
|
|
70329
70861
|
IFRAME_EVENTS: IFRAME_EVENTS
|
|
70330
70862
|
}
|
|
70331
70863
|
};
|
|
@@ -70340,7 +70872,8 @@ function registerEarlyLoadUriListener() {
|
|
|
70340
70872
|
window.__IFRAME_EARLY_LOAD_URI_LISTENER_REGISTERED = true;
|
|
70341
70873
|
window.__IFRAME_EARLY_LOAD_URI = null;
|
|
70342
70874
|
window.addEventListener('message', function (event) {
|
|
70343
|
-
if (event.
|
|
70875
|
+
if (!isAllowedOrigin(event.origin)) return;
|
|
70876
|
+
if (event.data && event.data.eventType === IFRAME_EVENTS.LOAD_URI && event.data.eventProps) {
|
|
70344
70877
|
window.__IFRAME_EARLY_LOAD_URI = event.data.eventProps.uri || '/';
|
|
70345
70878
|
}
|
|
70346
70879
|
});
|
|
@@ -70399,7 +70932,6 @@ function _hydrateAppConfig() {
|
|
|
70399
70932
|
_context.n = 4;
|
|
70400
70933
|
break;
|
|
70401
70934
|
}
|
|
70402
|
-
console.log('[Iframe] fetching app config from', configFallbackUri);
|
|
70403
70935
|
_context.n = 3;
|
|
70404
70936
|
return fetcher.getConfig(configFallbackUri);
|
|
70405
70937
|
case 3:
|
|
@@ -70493,12 +71025,12 @@ function bootstrapIframeApp(_x3) {
|
|
|
70493
71025
|
}
|
|
70494
71026
|
function _bootstrapIframeApp() {
|
|
70495
71027
|
_bootstrapIframeApp = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee4(options) {
|
|
70496
|
-
var _ref4, _ref4$appName, appName, permissionKeysOption, rootSelector, onInitCache, render, _ref4$standaloneError, standaloneErrorMessage, _ref4$fetchConfigFrom, fetchConfigFromShell, _ref4$configFallbackU, configFallbackUri, validateAppConfig, _ref4$permissionsOnly, permissionsOnlyIfArray, _ref4$autoSendAppEnv, autoSendAppEnv, toolkitEnv, _ref4$mihelpAgentProp, mihelpAgentProps, rootNode, bridge, fetcher, storage, getInitialUri, getInitData, setInitCache, setExtraLocal, sendStorageGet, setAppName, sendAppEnv, resolveAppAuthName, _yield$Promise$all, _yield$Promise$all2, initialUri, initData, getCachedLocalItem, appAuthName, permissionKeys, tasks, _t;
|
|
71028
|
+
var _ref4, _ref4$appName, appName, permissionKeysOption, rootSelector, onInitCache, render, _ref4$standaloneError, standaloneErrorMessage, _ref4$fetchConfigFrom, fetchConfigFromShell, _ref4$configFallbackU, configFallbackUri, validateAppConfig, _ref4$permissionsOnly, permissionsOnlyIfArray, _ref4$autoSendAppEnv, autoSendAppEnv, toolkitEnv, _ref4$mihelpAgentProp, mihelpAgentProps, _ref4$installNavGuard, installNavGuard, rootNode, bridge, fetcher, storage, getInitialUri, getInitData, setInitCache, setExtraLocal, sendStorageGet, setAppName, sendAppEnv, resolveAppAuthName, _yield$Promise$all, _yield$Promise$all2, initialUri, initData, getCachedLocalItem, appAuthName, permissionKeys, tasks, _t;
|
|
70497
71029
|
return _regenerator().w(function (_context4) {
|
|
70498
71030
|
while (1) switch (_context4.p = _context4.n) {
|
|
70499
71031
|
case 0:
|
|
70500
71032
|
registerEarlyLoadUriListener();
|
|
70501
|
-
_ref4 = options || {}, _ref4$appName = _ref4.appName, appName = _ref4$appName === void 0 ? process.env.APP_NAME : _ref4$appName, permissionKeysOption = _ref4.permissionKeys, rootSelector = _ref4.rootSelector, onInitCache = _ref4.onInitCache, render = _ref4.render, _ref4$standaloneError = _ref4.standaloneErrorMessage, standaloneErrorMessage = _ref4$standaloneError === void 0 ? 'This application must be opened from the parent portal.' : _ref4$standaloneError, _ref4$fetchConfigFrom = _ref4.fetchConfigFromShell, fetchConfigFromShell = _ref4$fetchConfigFrom === void 0 ? true : _ref4$fetchConfigFrom, _ref4$configFallbackU = _ref4.configFallbackUri, configFallbackUri = _ref4$configFallbackU === void 0 ? process.env.CONFIG_URI : _ref4$configFallbackU, validateAppConfig = _ref4.validateAppConfig, _ref4$permissionsOnly = _ref4.permissionsOnlyIfArray, permissionsOnlyIfArray = _ref4$permissionsOnly === void 0 ? true : _ref4$permissionsOnly, _ref4$autoSendAppEnv = _ref4.autoSendAppEnv, autoSendAppEnv = _ref4$autoSendAppEnv === void 0 ? true : _ref4$autoSendAppEnv, toolkitEnv = _ref4.toolkitEnv, _ref4$mihelpAgentProp = _ref4.mihelpAgentProps, mihelpAgentProps = _ref4$mihelpAgentProp === void 0 ? null : _ref4$mihelpAgentProp;
|
|
71033
|
+
_ref4 = options || {}, _ref4$appName = _ref4.appName, appName = _ref4$appName === void 0 ? process.env.APP_NAME : _ref4$appName, permissionKeysOption = _ref4.permissionKeys, rootSelector = _ref4.rootSelector, onInitCache = _ref4.onInitCache, render = _ref4.render, _ref4$standaloneError = _ref4.standaloneErrorMessage, standaloneErrorMessage = _ref4$standaloneError === void 0 ? 'This application must be opened from the parent portal.' : _ref4$standaloneError, _ref4$fetchConfigFrom = _ref4.fetchConfigFromShell, fetchConfigFromShell = _ref4$fetchConfigFrom === void 0 ? true : _ref4$fetchConfigFrom, _ref4$configFallbackU = _ref4.configFallbackUri, configFallbackUri = _ref4$configFallbackU === void 0 ? process.env.CONFIG_URI : _ref4$configFallbackU, validateAppConfig = _ref4.validateAppConfig, _ref4$permissionsOnly = _ref4.permissionsOnlyIfArray, permissionsOnlyIfArray = _ref4$permissionsOnly === void 0 ? true : _ref4$permissionsOnly, _ref4$autoSendAppEnv = _ref4.autoSendAppEnv, autoSendAppEnv = _ref4$autoSendAppEnv === void 0 ? true : _ref4$autoSendAppEnv, toolkitEnv = _ref4.toolkitEnv, _ref4$mihelpAgentProp = _ref4.mihelpAgentProps, mihelpAgentProps = _ref4$mihelpAgentProp === void 0 ? null : _ref4$mihelpAgentProp, _ref4$installNavGuard = _ref4.installNavGuard, installNavGuard = _ref4$installNavGuard === void 0 ? true : _ref4$installNavGuard;
|
|
70502
71034
|
if (!(typeof render !== 'function')) {
|
|
70503
71035
|
_context4.n = 1;
|
|
70504
71036
|
break;
|
|
@@ -70520,6 +71052,13 @@ function _bootstrapIframeApp() {
|
|
|
70520
71052
|
renderStandaloneError(rootNode, standaloneErrorMessage);
|
|
70521
71053
|
return _context4.a(2);
|
|
70522
71054
|
case 3:
|
|
71055
|
+
// Global catch-all so raw <a>/window.open('_self')/forms the app did not write
|
|
71056
|
+
// with AppLink still route through the shell (internal) or a new tab (external)
|
|
71057
|
+
// instead of navigating this iframe to the wrong place. Opt out with
|
|
71058
|
+
// installNavGuard: false.
|
|
71059
|
+
if (installNavGuard) {
|
|
71060
|
+
installNavigationGuard();
|
|
71061
|
+
}
|
|
70523
71062
|
bridge = iframeFacade.bridge, fetcher = iframeFacade.fetcher, storage = iframeFacade.storage;
|
|
70524
71063
|
getInitialUri = bridge.getInitialUri, getInitData = bridge.getInitData, setInitCache = bridge.setInitCache, setExtraLocal = bridge.setExtraLocal, sendStorageGet = bridge.sendStorageGet, setAppName = bridge.setAppName, sendAppEnv = bridge.sendAppEnv, resolveAppAuthName = bridge.resolveAppAuthName;
|
|
70525
71064
|
_context4.n = 4;
|
|
@@ -70533,22 +71072,29 @@ function _bootstrapIframeApp() {
|
|
|
70533
71072
|
if (autoSendAppEnv && typeof sendAppEnv === 'function') {
|
|
70534
71073
|
sendAppEnv(toolkitEnv, mihelpAgentProps);
|
|
70535
71074
|
}
|
|
70536
|
-
if (initData) {
|
|
70537
|
-
|
|
70538
|
-
|
|
70539
|
-
} else {
|
|
70540
|
-
console.warn('[Iframe] no initData from shell');
|
|
71075
|
+
if (!initData) {
|
|
71076
|
+
_context4.n = 5;
|
|
71077
|
+
break;
|
|
70541
71078
|
}
|
|
71079
|
+
setInitCache(initData);
|
|
71080
|
+
if (onInitCache) onInitCache(initData);
|
|
71081
|
+
_context4.n = 6;
|
|
71082
|
+
break;
|
|
71083
|
+
case 5:
|
|
71084
|
+
console.error('[Iframe] failed to get initData from shell (handshake timeout)');
|
|
71085
|
+
renderStandaloneError(rootNode, 'Failed to connect to the portal. Please refresh.');
|
|
71086
|
+
return _context4.a(2);
|
|
71087
|
+
case 6:
|
|
70542
71088
|
getCachedLocalItem = function getCachedLocalItem(key) {
|
|
70543
71089
|
return storage.getLocalItem(key);
|
|
70544
71090
|
};
|
|
70545
71091
|
appAuthName = typeof resolveAppAuthName === 'function' ? resolveAppAuthName(appName, getCachedLocalItem) : null;
|
|
70546
71092
|
permissionKeys = permissionKeysOption !== undefined ? permissionKeysOption : appAuthName ? "".concat(appAuthName, ":permissions") : null;
|
|
70547
71093
|
if (!(fetchConfigFromShell && appName)) {
|
|
70548
|
-
_context4.n =
|
|
71094
|
+
_context4.n = 10;
|
|
70549
71095
|
break;
|
|
70550
71096
|
}
|
|
70551
|
-
_context4.p =
|
|
71097
|
+
_context4.p = 7;
|
|
70552
71098
|
tasks = [hydrateAppConfig({
|
|
70553
71099
|
appName: appName,
|
|
70554
71100
|
getCachedLocalItem: getCachedLocalItem,
|
|
@@ -70567,21 +71113,21 @@ function _bootstrapIframeApp() {
|
|
|
70567
71113
|
permissionsOnlyIfArray: permissionsOnlyIfArray
|
|
70568
71114
|
}));
|
|
70569
71115
|
}
|
|
70570
|
-
_context4.n = 6;
|
|
70571
|
-
return Promise.all(tasks);
|
|
70572
|
-
case 6:
|
|
70573
71116
|
_context4.n = 8;
|
|
71117
|
+
return Promise.all(tasks);
|
|
71118
|
+
case 8:
|
|
71119
|
+
_context4.n = 10;
|
|
70574
71120
|
break;
|
|
70575
|
-
case
|
|
70576
|
-
_context4.p =
|
|
71121
|
+
case 9:
|
|
71122
|
+
_context4.p = 9;
|
|
70577
71123
|
_t = _context4.v;
|
|
70578
71124
|
console.warn('[Iframe] failed to fetch app config/permissions from shell:', _t);
|
|
70579
|
-
case
|
|
71125
|
+
case 10:
|
|
70580
71126
|
render(initialUri, rootNode);
|
|
70581
|
-
case
|
|
71127
|
+
case 11:
|
|
70582
71128
|
return _context4.a(2);
|
|
70583
71129
|
}
|
|
70584
|
-
}, _callee4, null, [[
|
|
71130
|
+
}, _callee4, null, [[7, 9]]);
|
|
70585
71131
|
}));
|
|
70586
71132
|
return _bootstrapIframeApp.apply(this, arguments);
|
|
70587
71133
|
}
|
|
@@ -70855,8 +71401,8 @@ function IframeAppShell(_ref) {
|
|
|
70855
71401
|
var appAuthName = resolveAppAuthName(getAppName(), function (key) {
|
|
70856
71402
|
return storage$1.getLocalItem(key);
|
|
70857
71403
|
});
|
|
70858
|
-
var key = permissionKey || (appAuthName ? "".concat(appAuthName, ":permissions") :
|
|
70859
|
-
var ready = Array.isArray(storage$1.getLocalItem(key));
|
|
71404
|
+
var key = permissionKey || (appAuthName ? "".concat(appAuthName, ":permissions") : null);
|
|
71405
|
+
var ready = !key || Array.isArray(storage$1.getLocalItem(key));
|
|
70860
71406
|
React.useEffect(function () {
|
|
70861
71407
|
if (ready && onPermissionsReady) onPermissionsReady();
|
|
70862
71408
|
}, [ready, onPermissionsReady]);
|
|
@@ -82452,6 +82998,7 @@ var index_es = /*#__PURE__*/Object.freeze({
|
|
|
82452
82998
|
});
|
|
82453
82999
|
|
|
82454
83000
|
exports.AppFrame = AppFrame;
|
|
83001
|
+
exports.AppLink = AppLink;
|
|
82455
83002
|
exports.AutoRefresh = AutoRefresh;
|
|
82456
83003
|
exports.CallLogger = CallLogger;
|
|
82457
83004
|
exports.ContextualHelp = ContextualHelp;
|
|
@@ -82463,6 +83010,7 @@ exports.bootstrapIframeApp = bootstrapIframeApp;
|
|
|
82463
83010
|
exports.buildNavCountEntry = buildNavCountEntry;
|
|
82464
83011
|
exports.fetcher = fetcher$1;
|
|
82465
83012
|
exports.iframeFacade = iframeFacade;
|
|
83013
|
+
exports.installNavigationGuard = installNavigationGuard;
|
|
82466
83014
|
exports.normalizeIframePath = normalizeIframePath;
|
|
82467
83015
|
exports.postHistoryGo = postHistoryGo;
|
|
82468
83016
|
exports.storage = storage$2;
|