@capillarytech/blaze-ui 2.8.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5123,6 +5123,79 @@ var _default = exports["default"] = DisabledContext;
5123
5123
 
5124
5124
  /***/ }),
5125
5125
 
5126
+ /***/ 959:
5127
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5128
+
5129
+ "use strict";
5130
+
5131
+
5132
+ exports.__esModule = true;
5133
+ exports["default"] = void 0;
5134
+ var _utilities = __webpack_require__(6636);
5135
+ var _react = _interopRequireWildcard(__webpack_require__(9206));
5136
+ var _reactIntl = __webpack_require__(6407);
5137
+ var _CapSkeleton = _interopRequireDefault(__webpack_require__(5798));
5138
+ var _CapSomethingWentWrong = _interopRequireDefault(__webpack_require__(9214));
5139
+ var _messages = _interopRequireDefault(__webpack_require__(7873));
5140
+ var _styles = _interopRequireDefault(__webpack_require__(9873));
5141
+ var _jsxRuntime = __webpack_require__(4848);
5142
+ const _excluded = ["system", "loadingFallback"];
5143
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
5144
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
5145
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
5146
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5147
+ const CapImportMFEComponent = _ref => {
5148
+ let {
5149
+ system,
5150
+ loadingFallback
5151
+ } = _ref,
5152
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
5153
+ const {
5154
+ url,
5155
+ scope,
5156
+ module
5157
+ } = system || {};
5158
+ const Component = (0, _react.useMemo)(() => {
5159
+ if (!url || !scope || !module) {
5160
+ return null;
5161
+ }
5162
+ return /*#__PURE__*/_react.default.lazy(() => (0, _utilities.importRemote)({
5163
+ url,
5164
+ scope,
5165
+ module
5166
+ }));
5167
+ }, [url, scope, module]);
5168
+ if (!Component) {
5169
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
5170
+ className: _styles.default['loading-div'],
5171
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSomethingWentWrong.default, {
5172
+ title: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, _extends({}, _messages.default.incorrectSystem)),
5173
+ description: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, _extends({}, _messages.default.incorrectSystemDesc))
5174
+ })
5175
+ });
5176
+ }
5177
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Suspense, {
5178
+ fallback: loadingFallback ? loadingFallback : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
5179
+ className: _styles.default['loading-div'],
5180
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
5181
+ className: _styles.default['loading-title'],
5182
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, _extends({}, _messages.default.loadingFallbackMsg))
5183
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CapSkeleton.default, {
5184
+ active: true,
5185
+ title: true,
5186
+ paragraph: {
5187
+ rows: 4,
5188
+ width: '38.5rem'
5189
+ }
5190
+ })]
5191
+ }),
5192
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, _extends({}, rest))
5193
+ });
5194
+ };
5195
+ var _default = exports["default"] = CapImportMFEComponent;
5196
+
5197
+ /***/ }),
5198
+
5126
5199
  /***/ 1020:
5127
5200
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5128
5201
 
@@ -7783,6 +7856,7 @@ var _exportNames = {
7783
7856
  CapFormItem: true,
7784
7857
  CapIcon: true,
7785
7858
  CapImage: true,
7859
+ CapImportMFEComponent: true,
7786
7860
  CapInput: true,
7787
7861
  CapLabel: true,
7788
7862
  CapMenu: true,
@@ -7806,7 +7880,7 @@ var _exportNames = {
7806
7880
  getCapUIFontLinks: true,
7807
7881
  styledVars: true
7808
7882
  };
7809
- exports.styledVars = exports.loadCapUIFonts = exports.loadCapUI = exports.getCapUIFontLinks = exports.getCapThemeConfig = exports.LocaleHoc = exports.CapUnifiedSelect = exports.CapTooltipWithInfo = exports.CapTooltip = exports.CapTable = exports.CapTab = exports.CapSwitch = exports.CapSpin = exports.CapSomethingWentWrong = exports.CapSlideBox = exports.CapSkeleton = exports.CapSelectFilter = exports.CapRow = exports.CapRadio = exports.CapMenu = exports.CapLabel = exports.CapInput = exports.CapImage = exports.CapIcon = exports.CapFormItem = exports.CapForm = exports.CapError = exports.CapDropdown = exports.CapDivider = exports.CapColumn = exports.CapCheckbox = exports.CapCard = exports.CapButton = exports.CapAppNotEnabled = exports.CapAlert = void 0;
7883
+ exports.styledVars = exports.loadCapUIFonts = exports.loadCapUI = exports.getCapUIFontLinks = exports.getCapThemeConfig = exports.LocaleHoc = exports.CapUnifiedSelect = exports.CapTooltipWithInfo = exports.CapTooltip = exports.CapTable = exports.CapTab = exports.CapSwitch = exports.CapSpin = exports.CapSomethingWentWrong = exports.CapSlideBox = exports.CapSkeleton = exports.CapSelectFilter = exports.CapRow = exports.CapRadio = exports.CapMenu = exports.CapLabel = exports.CapInput = exports.CapImportMFEComponent = exports.CapImage = exports.CapIcon = exports.CapFormItem = exports.CapForm = exports.CapError = exports.CapDropdown = exports.CapDivider = exports.CapColumn = exports.CapCheckbox = exports.CapCard = exports.CapButton = exports.CapAppNotEnabled = exports.CapAlert = void 0;
7810
7884
  var _CapAlert = _interopRequireDefault(__webpack_require__(8501));
7811
7885
  exports.CapAlert = _CapAlert.default;
7812
7886
  var _CapAppNotEnabled = _interopRequireDefault(__webpack_require__(8290));
@@ -7833,6 +7907,8 @@ var _CapIcon = _interopRequireDefault(__webpack_require__(8244));
7833
7907
  exports.CapIcon = _CapIcon.default;
7834
7908
  var _CapImage = _interopRequireDefault(__webpack_require__(5842));
7835
7909
  exports.CapImage = _CapImage.default;
7910
+ var _CapImportMFEComponent = _interopRequireDefault(__webpack_require__(4609));
7911
+ exports.CapImportMFEComponent = _CapImportMFEComponent.default;
7836
7912
  var _CapInput = _interopRequireDefault(__webpack_require__(3991));
7837
7913
  exports.CapInput = _CapInput.default;
7838
7914
  var _CapLabel = _interopRequireDefault(__webpack_require__(3737));
@@ -26802,6 +26878,25 @@ var _CapUnifiedSelect = _interopRequireDefault(__webpack_require__(5353));
26802
26878
  exports["default"] = _CapUnifiedSelect.default;
26803
26879
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
26804
26880
 
26881
+ /***/ }),
26882
+
26883
+ /***/ 3232:
26884
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
26885
+
26886
+ // Imports
26887
+ var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ = __webpack_require__(1601);
26888
+ var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(6314);
26889
+ var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);
26890
+ // Module
26891
+ ___CSS_LOADER_EXPORT___.push([module.id, `.blaze-ui-loading-div{max-width:84rem;margin:0 auto;padding:1.428rem}.blaze-ui-loading-title{margin-bottom:.857rem}`, ""]);
26892
+ // Exports
26893
+ ___CSS_LOADER_EXPORT___.locals = {
26894
+ "loading-div": `blaze-ui-loading-div`,
26895
+ "loading-title": `blaze-ui-loading-title`
26896
+ };
26897
+ module.exports = ___CSS_LOADER_EXPORT___;
26898
+
26899
+
26805
26900
  /***/ }),
26806
26901
 
26807
26902
  /***/ 3262:
@@ -34250,6 +34345,20 @@ function updateCSS(css, key, originOption = {}) {
34250
34345
 
34251
34346
  /***/ }),
34252
34347
 
34348
+ /***/ 4609:
34349
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
34350
+
34351
+ "use strict";
34352
+
34353
+
34354
+ exports.__esModule = true;
34355
+ exports["default"] = void 0;
34356
+ var _CapImportMFEComponent = _interopRequireDefault(__webpack_require__(959));
34357
+ exports["default"] = _CapImportMFEComponent.default;
34358
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
34359
+
34360
+ /***/ }),
34361
+
34253
34362
  /***/ 4627:
34254
34363
  /***/ ((module) => {
34255
34364
 
@@ -49419,6 +49528,571 @@ var _CapRadio = _interopRequireDefault(__webpack_require__(7043));
49419
49528
  exports["default"] = _CapRadio.default;
49420
49529
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
49421
49530
 
49531
+ /***/ }),
49532
+
49533
+ /***/ 6636:
49534
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
49535
+
49536
+ "use strict";
49537
+ __webpack_require__.r(__webpack_exports__);
49538
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
49539
+ /* harmony export */ Logger: () => (/* binding */ Logger),
49540
+ /* harmony export */ createRuntimeVariables: () => (/* binding */ createRuntimeVariables),
49541
+ /* harmony export */ extractUrlAndGlobal: () => (/* binding */ extractUrlAndGlobal),
49542
+ /* harmony export */ getContainer: () => (/* binding */ getContainer),
49543
+ /* harmony export */ getModule: () => (/* binding */ getModule),
49544
+ /* harmony export */ getRuntimeRemotes: () => (/* binding */ getRuntimeRemotes),
49545
+ /* harmony export */ importDelegatedModule: () => (/* binding */ importDelegatedModule),
49546
+ /* harmony export */ importRemote: () => (/* binding */ importRemote),
49547
+ /* harmony export */ injectScript: () => (/* binding */ injectScript),
49548
+ /* harmony export */ isObjectEmpty: () => (/* binding */ isObjectEmpty),
49549
+ /* harmony export */ loadScript: () => (/* binding */ loadScript)
49550
+ /* harmony export */ });
49551
+ /******************************************************************************
49552
+ Copyright (c) Microsoft Corporation.
49553
+
49554
+ Permission to use, copy, modify, and/or distribute this software for any
49555
+ purpose with or without fee is hereby granted.
49556
+
49557
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
49558
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
49559
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
49560
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
49561
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
49562
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
49563
+ PERFORMANCE OF THIS SOFTWARE.
49564
+ ***************************************************************************** */
49565
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
49566
+
49567
+
49568
+ function __awaiter(thisArg, _arguments, P, generator) {
49569
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
49570
+ return new (P || (P = Promise))(function (resolve, reject) {
49571
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
49572
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
49573
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
49574
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
49575
+ });
49576
+ }
49577
+
49578
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
49579
+ var e = new Error(message);
49580
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
49581
+ };
49582
+
49583
+ const pure = typeof process !== 'undefined' ? process.env['REMOTES'] || {} : {};
49584
+ const remoteVars = pure;
49585
+ const extractUrlAndGlobal = (urlAndGlobal) => {
49586
+ const index = urlAndGlobal.indexOf('@');
49587
+ if (index <= 0 || index === urlAndGlobal.length - 1) {
49588
+ throw new Error(`Invalid request "${urlAndGlobal}"`);
49589
+ }
49590
+ return [urlAndGlobal.substring(index + 1), urlAndGlobal.substring(0, index)];
49591
+ };
49592
+ const loadScript = (keyOrRuntimeRemoteItem) => {
49593
+ const runtimeRemotes = getRuntimeRemotes$1();
49594
+ // 1) Load remote container if needed
49595
+ let asyncContainer;
49596
+ const reference = typeof keyOrRuntimeRemoteItem === 'string'
49597
+ ? runtimeRemotes[keyOrRuntimeRemoteItem]
49598
+ : keyOrRuntimeRemoteItem;
49599
+ if (reference.asyncContainer) {
49600
+ asyncContainer =
49601
+ typeof reference.asyncContainer.then === 'function'
49602
+ ? reference.asyncContainer
49603
+ : // @ts-ignore
49604
+ reference.asyncContainer();
49605
+ }
49606
+ else {
49607
+ // This casting is just to satisfy typescript,
49608
+ // In reality remoteGlobal will always be a string;
49609
+ const remoteGlobal = reference.global;
49610
+ // Check if theres an override for container key if not use remote global
49611
+ const containerKey = reference.uniqueKey
49612
+ ? reference.uniqueKey
49613
+ : remoteGlobal;
49614
+ const __webpack_error__ = new Error();
49615
+ // @ts-ignore
49616
+ const globalScope =
49617
+ // @ts-ignore
49618
+ typeof window !== 'undefined' ? window : globalThis.__remote_scope__;
49619
+ if (typeof window === 'undefined') {
49620
+ //@ts-ignore
49621
+ globalScope['_config'][containerKey] = reference.url;
49622
+ }
49623
+ else {
49624
+ // to match promise template system, can be removed once promise template is gone
49625
+ //@ts-ignore
49626
+ if (!globalScope['remoteLoading']) {
49627
+ //@ts-ignore
49628
+ globalScope['remoteLoading'] = {};
49629
+ }
49630
+ //@ts-ignore
49631
+ if (globalScope['remoteLoading'][containerKey]) {
49632
+ //@ts-ignore
49633
+ return globalScope['remoteLoading'][containerKey];
49634
+ }
49635
+ }
49636
+ // @ts-ignore
49637
+ asyncContainer = new Promise(function (resolve, reject) {
49638
+ function resolveRemoteGlobal() {
49639
+ //@ts-ignore
49640
+ const asyncContainer = globalScope[remoteGlobal];
49641
+ return resolve(asyncContainer);
49642
+ }
49643
+ //@ts-ignore
49644
+ if (typeof globalScope[remoteGlobal] !== 'undefined') {
49645
+ return resolveRemoteGlobal();
49646
+ }
49647
+ __webpack_require__.l(reference.url, function (event) {
49648
+ //@ts-ignore
49649
+ if (typeof globalScope[remoteGlobal] !== 'undefined') {
49650
+ return resolveRemoteGlobal();
49651
+ }
49652
+ const errorType = event && (event.type === 'load' ? 'missing' : event.type);
49653
+ const realSrc = event && event.target && event.target.src;
49654
+ __webpack_error__.message =
49655
+ 'Loading script failed.\n(' +
49656
+ errorType +
49657
+ ': ' +
49658
+ realSrc +
49659
+ ' or global var ' +
49660
+ remoteGlobal +
49661
+ ')';
49662
+ __webpack_error__.name = 'ScriptExternalLoadError';
49663
+ __webpack_error__.type = errorType;
49664
+ __webpack_error__.request = realSrc;
49665
+ reject(__webpack_error__);
49666
+ }, containerKey);
49667
+ }).catch(function (err) {
49668
+ console.error('container is offline, returning fake remote');
49669
+ console.error(err);
49670
+ return {
49671
+ fake: true,
49672
+ // @ts-ignore
49673
+ get: (arg) => {
49674
+ console.warn('faking', arg, 'module on, its offline');
49675
+ return Promise.resolve(() => {
49676
+ return {
49677
+ __esModule: true,
49678
+ default: () => {
49679
+ return null;
49680
+ },
49681
+ };
49682
+ });
49683
+ },
49684
+ //eslint-disable-next-line
49685
+ init: () => { },
49686
+ };
49687
+ });
49688
+ if (typeof window !== 'undefined') {
49689
+ //@ts-ignore
49690
+ globalScope['remoteLoading'][containerKey] = asyncContainer;
49691
+ }
49692
+ }
49693
+ return asyncContainer;
49694
+ };
49695
+ const getRuntimeRemotes$1 = () => {
49696
+ return Object.entries(remoteVars).reduce((acc, [key, value]) => {
49697
+ if (typeof value === 'object' && typeof value.then === 'function') {
49698
+ acc[key] = { asyncContainer: value };
49699
+ }
49700
+ else if (typeof value === 'function') {
49701
+ acc[key] = { asyncContainer: Promise.resolve(value()) };
49702
+ }
49703
+ else if (typeof value === 'string') {
49704
+ if (value.startsWith('internal ')) {
49705
+ const [request, query] = value.replace('internal ', '').split('?');
49706
+ if (query) {
49707
+ const remoteSyntax = new URLSearchParams(query).get('remote');
49708
+ if (remoteSyntax) {
49709
+ const [url, global] = extractUrlAndGlobal(remoteSyntax);
49710
+ acc[key] = { global, url };
49711
+ }
49712
+ }
49713
+ }
49714
+ else {
49715
+ const [url, global] = extractUrlAndGlobal(value);
49716
+ acc[key] = { global, url };
49717
+ }
49718
+ }
49719
+ else {
49720
+ console.warn('remotes process', process.env['REMOTES']);
49721
+ throw new Error(`[mf] Invalid value received for runtime_remote "${key}"`);
49722
+ }
49723
+ return acc;
49724
+ }, {});
49725
+ };
49726
+
49727
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
49728
+ const createContainerSharingScope = (asyncContainer) => {
49729
+ // @ts-ignore
49730
+ return asyncContainer
49731
+ .then(function (container) {
49732
+ if (!__webpack_require__.S['default']) {
49733
+ // not always a promise, so we wrap it in a resolve
49734
+ return Promise.resolve(__webpack_require__.I('default')).then(function () {
49735
+ return container;
49736
+ });
49737
+ }
49738
+ else {
49739
+ return container;
49740
+ }
49741
+ })
49742
+ .then(function (container) {
49743
+ try {
49744
+ // WARNING: here might be a potential BUG.
49745
+ // `container.init` does not return a Promise, and here we do not call `then` on it.
49746
+ // But according to [docs](https://webpack.js.org/concepts/module-federation/#dynamic-remote-containers)
49747
+ // it must be async.
49748
+ // The problem may be in Proxy in NextFederationPlugin.js.
49749
+ // or maybe a bug in the webpack itself - instead of returning rejected promise it just throws an error.
49750
+ // But now everything works properly and we keep this code as is.
49751
+ container.init(__webpack_require__.S['default']);
49752
+ }
49753
+ catch (e) {
49754
+ // maybe container already initialized so nothing to throw
49755
+ }
49756
+ return container;
49757
+ });
49758
+ };
49759
+ /**
49760
+ * Return initialized remote container by remote's key or its runtime remote item data.
49761
+ *
49762
+ * `runtimeRemoteItem` might be
49763
+ * { global, url } - values obtained from webpack remotes option `global@url`
49764
+ * or
49765
+ * { asyncContainer } - async container is a promise that resolves to the remote container
49766
+ */
49767
+ const injectScript = (keyOrRuntimeRemoteItem) => __awaiter(void 0, void 0, void 0, function* () {
49768
+ const asyncContainer = loadScript(keyOrRuntimeRemoteItem);
49769
+ return createContainerSharingScope(asyncContainer);
49770
+ });
49771
+ /**
49772
+ * Creates runtime variables from the provided remotes.
49773
+ * If the value of a remote starts with 'promise ' or 'external ', it is transformed into a function that returns the promise call.
49774
+ * Otherwise, the value is stringified.
49775
+ * @param {Remotes} remotes - The remotes to create runtime variables from.
49776
+ * @returns {Record<string, string>} - The created runtime variables.
49777
+ */
49778
+ const createRuntimeVariables = (remotes) => {
49779
+ if (!remotes) {
49780
+ return {};
49781
+ }
49782
+ return Object.entries(remotes).reduce((acc, [key, value]) => {
49783
+ if (value.startsWith('promise ') || value.startsWith('external ')) {
49784
+ const promiseCall = value.split(' ')[1];
49785
+ acc[key] = `function() {
49786
+ return ${promiseCall}
49787
+ }`;
49788
+ }
49789
+ else {
49790
+ acc[key] = JSON.stringify(value);
49791
+ }
49792
+ return acc;
49793
+ }, {});
49794
+ };
49795
+ /**
49796
+ * Returns initialized webpack RemoteContainer.
49797
+ * If its' script does not loaded - then load & init it firstly.
49798
+ */
49799
+ const getContainer = (remoteContainer) => __awaiter(void 0, void 0, void 0, function* () {
49800
+ if (!remoteContainer) {
49801
+ throw Error(`Remote container options is empty`);
49802
+ }
49803
+ const containerScope = typeof window !== 'undefined'
49804
+ ? window
49805
+ : globalThis.__remote_scope__;
49806
+ let containerKey;
49807
+ if (typeof remoteContainer === 'string') {
49808
+ containerKey = remoteContainer;
49809
+ }
49810
+ else {
49811
+ containerKey = remoteContainer.uniqueKey;
49812
+ if (!containerScope[containerKey]) {
49813
+ const container = yield injectScript({
49814
+ global: remoteContainer.global,
49815
+ url: remoteContainer.url,
49816
+ });
49817
+ if (!container) {
49818
+ throw Error(`Remote container ${remoteContainer.url} is empty`);
49819
+ }
49820
+ }
49821
+ }
49822
+ return containerScope[containerKey];
49823
+ });
49824
+ /**
49825
+ * Return remote module from container.
49826
+ * If you provide `exportName` it automatically return exact property value from module.
49827
+ *
49828
+ * @example
49829
+ * remote.getModule('./pages/index', 'default')
49830
+ */
49831
+ const getModule = (_a) => __awaiter(void 0, [_a], void 0, function* ({ remoteContainer, modulePath, exportName, }) {
49832
+ const container = yield getContainer(remoteContainer);
49833
+ try {
49834
+ const modFactory = yield (container === null || container === void 0 ? void 0 : container.get(modulePath));
49835
+ if (!modFactory) {
49836
+ return undefined;
49837
+ }
49838
+ const mod = modFactory();
49839
+ if (exportName) {
49840
+ return mod && typeof mod === 'object' ? mod[exportName] : undefined;
49841
+ }
49842
+ else {
49843
+ return mod;
49844
+ }
49845
+ }
49846
+ catch (error) {
49847
+ console.error(error);
49848
+ return undefined;
49849
+ }
49850
+ });
49851
+
49852
+ const isObjectEmpty = (obj) => {
49853
+ for (const x in obj) {
49854
+ return false;
49855
+ }
49856
+ return true;
49857
+ };
49858
+
49859
+ /**
49860
+ * Constant for remote entry file
49861
+ * @constant {string}
49862
+ */
49863
+ const REMOTE_ENTRY_FILE = 'remoteEntry.js';
49864
+ /**
49865
+ * Function to load remote
49866
+ * @function
49867
+ * @param {ImportRemoteOptions['url']} url - The url of the remote module
49868
+ * @param {ImportRemoteOptions['scope']} scope - The scope of the remote module
49869
+ * @param {ImportRemoteOptions['bustRemoteEntryCache']} bustRemoteEntryCache - Flag to bust the remote entry cache
49870
+ * @returns {Promise<void>} A promise that resolves when the remote is loaded
49871
+ */
49872
+ const loadRemote = (url, scope, bustRemoteEntryCache) => new Promise((resolve, reject) => {
49873
+ const timestamp = bustRemoteEntryCache ? `?t=${new Date().getTime()}` : '';
49874
+ const webpackRequire = __webpack_require__;
49875
+ webpackRequire.l(`${url}${timestamp}`, (event) => {
49876
+ var _a;
49877
+ if ((event === null || event === void 0 ? void 0 : event.type) === 'load') {
49878
+ // Script loaded successfully:
49879
+ return resolve();
49880
+ }
49881
+ const realSrc = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.src;
49882
+ const error = new Error();
49883
+ error.message = 'Loading script failed.\n(missing: ' + realSrc + ')';
49884
+ error.name = 'ScriptExternalLoadError';
49885
+ reject(error);
49886
+ }, scope);
49887
+ });
49888
+ const loadEsmRemote = (url, scope) => __awaiter(void 0, void 0, void 0, function* () {
49889
+ const module = yield import(/* webpackIgnore: true */ url);
49890
+ if (!module) {
49891
+ throw new Error(`Unable to load requested remote from ${url} with scope ${scope}`);
49892
+ }
49893
+ window[scope] = Object.assign(Object.assign({}, module), { __initializing: false, __initialized: false });
49894
+ });
49895
+ /**
49896
+ * Function to initialize sharing
49897
+ * @async
49898
+ * @function
49899
+ */
49900
+ const initSharing = () => __awaiter(void 0, void 0, void 0, function* () {
49901
+ const webpackShareScopes = __webpack_require__.S;
49902
+ if (!(webpackShareScopes === null || webpackShareScopes === void 0 ? void 0 : webpackShareScopes.default)) {
49903
+ yield __webpack_require__.I('default');
49904
+ }
49905
+ });
49906
+ /**
49907
+ * Function to initialize container
49908
+ * @async
49909
+ * @function
49910
+ * @param {WebpackRemoteContainer} containerScope - The container scope
49911
+ */
49912
+ const initContainer = (containerScope) => __awaiter(void 0, void 0, void 0, function* () {
49913
+ try {
49914
+ const webpackShareScopes = __webpack_require__.S;
49915
+ if (!containerScope.__initialized && !containerScope.__initializing) {
49916
+ containerScope.__initializing = true;
49917
+ yield containerScope.init(webpackShareScopes.default);
49918
+ containerScope.__initialized = true;
49919
+ delete containerScope.__initializing;
49920
+ }
49921
+ }
49922
+ catch (error) {
49923
+ console.error(error);
49924
+ }
49925
+ });
49926
+ /**
49927
+ * Function to import remote
49928
+ * @async
49929
+ * @function
49930
+ * @param {ImportRemoteOptions} options - The options for importing the remote
49931
+ * @returns {Promise<T>} A promise that resolves with the imported module
49932
+ */
49933
+ const importRemote = (_a) => __awaiter(void 0, [_a], void 0, function* ({ url, scope, module, remoteEntryFileName = REMOTE_ENTRY_FILE, bustRemoteEntryCache = true, esm = false, }) {
49934
+ const remoteScope = scope;
49935
+ if (!window[remoteScope]) {
49936
+ let remoteUrl = '';
49937
+ if (typeof url === 'string') {
49938
+ remoteUrl = url;
49939
+ }
49940
+ else {
49941
+ remoteUrl = yield url();
49942
+ }
49943
+ const remoteUrlWithEntryFile = `${remoteUrl}/${remoteEntryFileName}`;
49944
+ const asyncContainer = !esm
49945
+ ? loadRemote(remoteUrlWithEntryFile, scope, bustRemoteEntryCache)
49946
+ : loadEsmRemote(remoteUrlWithEntryFile, scope);
49947
+ // Load the remote and initialize the share scope if it's empty
49948
+ yield Promise.all([asyncContainer, initSharing()]);
49949
+ if (!window[remoteScope]) {
49950
+ throw new Error(`Remote loaded successfully but ${scope} could not be found! Verify that the name is correct in the Webpack configuration!`);
49951
+ }
49952
+ // Initialize the container to get shared modules and get the module factory:
49953
+ const [, moduleFactory] = yield Promise.all([
49954
+ initContainer(window[remoteScope]),
49955
+ window[remoteScope].get(module === '.' || module.startsWith('./') ? module : `./${module}`),
49956
+ ]);
49957
+ return moduleFactory();
49958
+ }
49959
+ else {
49960
+ const moduleFactory = yield window[remoteScope].get(module === '.' || module.startsWith('./') ? module : `./${module}`);
49961
+ return moduleFactory();
49962
+ }
49963
+ });
49964
+
49965
+ class Logger {
49966
+ static getLogger() {
49967
+ return this.loggerInstance;
49968
+ }
49969
+ static setLogger(logger) {
49970
+ this.loggerInstance = logger || console;
49971
+ return logger;
49972
+ }
49973
+ }
49974
+ Logger.loggerInstance = console;
49975
+
49976
+ const getRuntimeRemotes = () => {
49977
+ try {
49978
+ return Object.entries(remoteVars).reduce(function (acc, item) {
49979
+ const [key, value] = item;
49980
+ // if its an object with a thenable (eagerly executing function)
49981
+ if (typeof value === 'object' && typeof value.then === 'function') {
49982
+ acc[key] = { asyncContainer: value };
49983
+ }
49984
+ // if its a function that must be called (lazily executing function)
49985
+ else if (typeof value === 'function') {
49986
+ // @ts-ignore
49987
+ acc[key] = { asyncContainer: value };
49988
+ }
49989
+ // if its a delegate module, skip it
49990
+ else if (typeof value === 'string' && value.startsWith('internal ')) {
49991
+ const [request, query] = value.replace('internal ', '').split('?');
49992
+ if (query) {
49993
+ const remoteSyntax = new URLSearchParams(query).get('remote');
49994
+ if (remoteSyntax) {
49995
+ const [url, global] = extractUrlAndGlobal(remoteSyntax);
49996
+ acc[key] = { global, url };
49997
+ }
49998
+ }
49999
+ }
50000
+ // if its just a string (global@url)
50001
+ else if (typeof value === 'string') {
50002
+ const [url, global] = extractUrlAndGlobal(value);
50003
+ acc[key] = { global, url };
50004
+ }
50005
+ // we dont know or currently support this type
50006
+ else {
50007
+ //@ts-ignore
50008
+ console.warn('remotes process', process.env.REMOTES);
50009
+ throw new Error(`[mf] Invalid value received for runtime_remote "${key}"`);
50010
+ }
50011
+ return acc;
50012
+ }, {});
50013
+ }
50014
+ catch (err) {
50015
+ console.warn('Unable to retrieve runtime remotes: ', err);
50016
+ }
50017
+ return {};
50018
+ };
50019
+
50020
+ const importDelegatedModule = (keyOrRuntimeRemoteItem) => __awaiter(void 0, void 0, void 0, function* () {
50021
+ // @ts-ignore
50022
+ return loadScript(keyOrRuntimeRemoteItem)
50023
+ .then((asyncContainer) => {
50024
+ return asyncContainer;
50025
+ })
50026
+ .then((asyncContainer) => {
50027
+ // most of this is only needed because of legacy promise based implementation
50028
+ // can remove proxies once we remove promise based implementations
50029
+ if (typeof window === 'undefined') {
50030
+ if (!Object.hasOwnProperty.call(keyOrRuntimeRemoteItem, 'globalThis')) {
50031
+ return asyncContainer;
50032
+ }
50033
+ // return asyncContainer;
50034
+ //TODO: need to solve chunk flushing with delegated modules
50035
+ return {
50036
+ get: function (arg) {
50037
+ //@ts-ignore
50038
+ return asyncContainer.get(arg).then((f) => {
50039
+ const m = f();
50040
+ const result = {
50041
+ __esModule: m.__esModule,
50042
+ };
50043
+ for (const prop in m) {
50044
+ if (typeof m[prop] === 'function') {
50045
+ Object.defineProperty(result, prop, {
50046
+ get: function () {
50047
+ return function () {
50048
+ //@ts-ignore
50049
+ if (globalThis.usedChunks) {
50050
+ //@ts-ignore
50051
+ globalThis.usedChunks.add(
50052
+ //@ts-ignore
50053
+ `${keyOrRuntimeRemoteItem.global}->${arg}`);
50054
+ }
50055
+ //eslint-disable-next-line prefer-rest-params
50056
+ return m[prop](...arguments);
50057
+ };
50058
+ },
50059
+ enumerable: true,
50060
+ });
50061
+ }
50062
+ else {
50063
+ Object.defineProperty(result, prop, {
50064
+ get: () => {
50065
+ //@ts-ignore
50066
+ if (globalThis.usedChunks) {
50067
+ //@ts-ignore
50068
+ globalThis.usedChunks.add(
50069
+ //@ts-ignore
50070
+ `${keyOrRuntimeRemoteItem.global}->${arg}`);
50071
+ }
50072
+ return m[prop];
50073
+ },
50074
+ enumerable: true,
50075
+ });
50076
+ }
50077
+ }
50078
+ if (m.then) {
50079
+ return Promise.resolve(() => result);
50080
+ }
50081
+ return () => result;
50082
+ });
50083
+ },
50084
+ init: asyncContainer.init,
50085
+ };
50086
+ }
50087
+ else {
50088
+ return asyncContainer;
50089
+ }
50090
+ });
50091
+ });
50092
+
50093
+
50094
+
50095
+
49422
50096
  /***/ }),
49423
50097
 
49424
50098
  /***/ 6655:
@@ -51852,6 +52526,33 @@ function cloneElement(element, props) {
51852
52526
 
51853
52527
  /***/ }),
51854
52528
 
52529
+ /***/ 7873:
52530
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
52531
+
52532
+ "use strict";
52533
+
52534
+
52535
+ exports.__esModule = true;
52536
+ exports["default"] = void 0;
52537
+ var _reactIntl = __webpack_require__(6407);
52538
+ const scope = 'blaze.components.CapImportMFEComponent';
52539
+ var _default = exports["default"] = (0, _reactIntl.defineMessages)({
52540
+ loadingFallbackMsg: {
52541
+ id: scope + ".loadingFallbackMsg",
52542
+ defaultMessage: 'Loading...'
52543
+ },
52544
+ incorrectSystem: {
52545
+ id: scope + ".incorrectSystem",
52546
+ defaultMessage: 'Incorrect remote system configuration!'
52547
+ },
52548
+ incorrectSystemDesc: {
52549
+ id: scope + ".incorrectSystemDesc",
52550
+ defaultMessage: 'URL, scope or module not specified properly for remote system to be imported. Please re-check the configuration.'
52551
+ }
52552
+ });
52553
+
52554
+ /***/ }),
52555
+
51855
52556
  /***/ 7880:
51856
52557
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
51857
52558
 
@@ -58940,6 +59641,58 @@ function _interopRequireWildcard(e, t) {
58940
59641
  }
58941
59642
 
58942
59643
 
59644
+ /***/ }),
59645
+
59646
+ /***/ 9873:
59647
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
59648
+
59649
+ "use strict";
59650
+ __webpack_require__.r(__webpack_exports__);
59651
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
59652
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
59653
+ /* harmony export */ });
59654
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5072);
59655
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
59656
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_singletonStyleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4284);
59657
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_singletonStyleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_singletonStyleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
59658
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7659);
59659
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
59660
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5056);
59661
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
59662
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(540);
59663
+ /* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
59664
+ /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3232);
59665
+ /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5__);
59666
+ /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
59667
+ /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5__[__WEBPACK_IMPORT_KEY__]
59668
+ /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
59669
+
59670
+
59671
+
59672
+
59673
+
59674
+
59675
+
59676
+
59677
+
59678
+
59679
+
59680
+ var options = {};
59681
+
59682
+ ;
59683
+ options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
59684
+ options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
59685
+ options.domAPI = (_node_modules_style_loader_dist_runtime_singletonStyleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
59686
+ options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
59687
+
59688
+ var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()((_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5___default()), options);
59689
+
59690
+
59691
+
59692
+
59693
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5___default()) && (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5___default().locals) ? (_node_modules_css_loader_dist_cjs_js_ruleSet_1_rules_1_use_1_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_1_use_2_styles_scss__WEBPACK_IMPORTED_MODULE_5___default().locals) : undefined);
59694
+
59695
+
58943
59696
  /***/ }),
58944
59697
 
58945
59698
  /***/ 9879:
@@ -59378,6 +60131,52 @@ var _default = exports["default"] = genRadius;
59378
60131
  /******/ };
59379
60132
  /******/ })();
59380
60133
  /******/
60134
+ /******/ /* webpack/runtime/sharing */
60135
+ /******/ (() => {
60136
+ /******/ __webpack_require__.S = {};
60137
+ /******/ var initPromises = {};
60138
+ /******/ var initTokens = {};
60139
+ /******/ __webpack_require__.I = (name, initScope) => {
60140
+ /******/ if(!initScope) initScope = [];
60141
+ /******/ // handling circular init calls
60142
+ /******/ var initToken = initTokens[name];
60143
+ /******/ if(!initToken) initToken = initTokens[name] = {};
60144
+ /******/ if(initScope.indexOf(initToken) >= 0) return;
60145
+ /******/ initScope.push(initToken);
60146
+ /******/ // only runs once
60147
+ /******/ if(initPromises[name]) return initPromises[name];
60148
+ /******/ // creates a new share scope if needed
60149
+ /******/ if(!__webpack_require__.o(__webpack_require__.S, name)) __webpack_require__.S[name] = {};
60150
+ /******/ // runs all init snippets from all modules reachable
60151
+ /******/ var scope = __webpack_require__.S[name];
60152
+ /******/ var warn = (msg) => {
60153
+ /******/ if (typeof console !== "undefined" && console.warn) console.warn(msg);
60154
+ /******/ };
60155
+ /******/ var uniqueName = "@capillarytech/blaze-ui";
60156
+ /******/ var register = (name, version, factory, eager) => {
60157
+ /******/ var versions = scope[name] = scope[name] || {};
60158
+ /******/ var activeVersion = versions[version];
60159
+ /******/ if(!activeVersion || (!activeVersion.loaded && (!eager != !activeVersion.eager ? eager : uniqueName > activeVersion.from))) versions[version] = { get: factory, from: uniqueName, eager: !!eager };
60160
+ /******/ };
60161
+ /******/ var initExternal = (id) => {
60162
+ /******/ var handleError = (err) => (warn("Initialization of sharing external failed: " + err));
60163
+ /******/ try {
60164
+ /******/ var module = __webpack_require__(id);
60165
+ /******/ if(!module) return;
60166
+ /******/ var initFn = (module) => (module && module.init && module.init(__webpack_require__.S[name], initScope))
60167
+ /******/ if(module.then) return promises.push(module.then(initFn, handleError));
60168
+ /******/ var initResult = initFn(module);
60169
+ /******/ if(initResult && initResult.then) return promises.push(initResult['catch'](handleError));
60170
+ /******/ } catch(err) { handleError(err); }
60171
+ /******/ }
60172
+ /******/ var promises = [];
60173
+ /******/ switch(name) {
60174
+ /******/ }
60175
+ /******/ if(!promises.length) return initPromises[name] = 1;
60176
+ /******/ return initPromises[name] = Promise.all(promises).then(() => (initPromises[name] = 1));
60177
+ /******/ };
60178
+ /******/ })();
60179
+ /******/
59381
60180
  /******/ /* webpack/runtime/publicPath */
59382
60181
  /******/ (() => {
59383
60182
  /******/ __webpack_require__.p = "";