@trops/dash-core 0.1.443 → 0.1.445

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
@@ -50,8 +50,8 @@ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
50
50
  var jsxRuntime__namespace = /*#__PURE__*/_interopNamespaceDefault(jsxRuntime);
51
51
  var ReactDOM__namespace = /*#__PURE__*/_interopNamespaceDefault(ReactDOM);
52
52
 
53
- function ownKeys$$(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
54
- function _objectSpread$$(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$$(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$$(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
53
+ function ownKeys$Z(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
54
+ function _objectSpread$Z(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$Z(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$Z(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
55
55
  var event = {
56
56
  list: new Map(),
57
57
  // Map(1) { '<widget-UUID>' => { 'CustomSearchbar[10].searchQueryChanged': [] } }
@@ -113,7 +113,7 @@ var event = {
113
113
  uuid: subscriber["uuid"]
114
114
  };
115
115
  if ("action" in subscriber && subscriber.action !== undefined) {
116
- subscriber["action"](_objectSpread$$({}, objectToSend));
116
+ subscriber["action"](_objectSpread$Z({}, objectToSend));
117
117
  }
118
118
  });
119
119
  }
@@ -2891,8 +2891,8 @@ var DashboardWrapper = function DashboardWrapper(_ref) {
2891
2891
  });
2892
2892
  };
2893
2893
 
2894
- function ownKeys$_(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2895
- function _objectSpread$_(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$_(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$_(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2894
+ function ownKeys$Y(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2895
+ function _objectSpread$Y(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$Y(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$Y(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2896
2896
  function ThemeBroadcast(_ref) {
2897
2897
  var ctx = _ref.ctx;
2898
2898
  React.useEffect(function () {
@@ -2925,7 +2925,7 @@ var DashboardThemeProvider = function DashboardThemeProvider(_ref2) {
2925
2925
  var dashboardTheme = themes[themeKey];
2926
2926
  var themeValue = dashboardTheme ? dashboardTheme[themeVariant] || null : null;
2927
2927
  if (!themeValue) return null;
2928
- return _objectSpread$_(_objectSpread$_({}, parentContext), {}, {
2928
+ return _objectSpread$Y(_objectSpread$Y({}, parentContext), {}, {
2929
2929
  currentTheme: themeValue,
2930
2930
  currentThemeKey: themeKey,
2931
2931
  theme: themeValue,
@@ -2952,8 +2952,8 @@ var DashboardThemeProvider = function DashboardThemeProvider(_ref2) {
2952
2952
  });
2953
2953
  };
2954
2954
 
2955
- function ownKeys$Z(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2956
- function _objectSpread$Z(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$Z(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$Z(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2955
+ function ownKeys$X(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2956
+ function _objectSpread$X(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$X(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$X(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2957
2957
  var AppThemeScope = function AppThemeScope(_ref) {
2958
2958
  var children = _ref.children;
2959
2959
  var ctx = React.useContext(DashReact.ThemeContext);
@@ -2961,7 +2961,7 @@ var AppThemeScope = function AppThemeScope(_ref) {
2961
2961
  children: children
2962
2962
  });
2963
2963
  return /*#__PURE__*/jsxRuntime.jsx(DashReact.ThemeContext.Provider, {
2964
- value: _objectSpread$Z(_objectSpread$Z({}, ctx), {}, {
2964
+ value: _objectSpread$X(_objectSpread$X({}, ctx), {}, {
2965
2965
  currentTheme: ctx.appTheme,
2966
2966
  currentThemeKey: ctx.appThemeKey,
2967
2967
  theme: ctx.appTheme,
@@ -3073,11 +3073,11 @@ var LayoutContainer = function LayoutContainer(_ref) {
3073
3073
  });
3074
3074
  };
3075
3075
 
3076
- function ownKeys$Y(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3077
- function _objectSpread$Y(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$Y(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$Y(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3078
- function _createForOfIteratorHelper$w(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$w(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
3079
- function _unsupportedIterableToArray$w(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$w(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$w(r, a) : void 0; } }
3080
- function _arrayLikeToArray$w(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
3076
+ function ownKeys$W(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3077
+ function _objectSpread$W(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$W(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$W(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3078
+ function _createForOfIteratorHelper$x(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$x(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
3079
+ function _unsupportedIterableToArray$x(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$x(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$x(r, a) : void 0; } }
3080
+ function _arrayLikeToArray$x(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
3081
3081
  /**
3082
3082
  * Layout template definitions for the dashboard template picker.
3083
3083
  *
@@ -3351,12 +3351,12 @@ function createLayoutFromTemplate(template) {
3351
3351
  cols: template.cols,
3352
3352
  gap: "gap-2"
3353
3353
  };
3354
- var _iterator = _createForOfIteratorHelper$w(template.cells),
3354
+ var _iterator = _createForOfIteratorHelper$x(template.cells),
3355
3355
  _step;
3356
3356
  try {
3357
3357
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
3358
3358
  var cell = _step.value;
3359
- grid[cell.key] = _objectSpread$Y({
3359
+ grid[cell.key] = _objectSpread$W({
3360
3360
  component: null,
3361
3361
  hide: cell.hide || false
3362
3362
  }, cell.span ? {
@@ -4282,11 +4282,261 @@ var RegistryAuthModal = function RegistryAuthModal(_ref) {
4282
4282
  });
4283
4283
  };
4284
4284
 
4285
- function _createForOfIteratorHelper$v(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$v(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
4286
- function _unsupportedIterableToArray$v(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$v(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$v(r, a) : void 0; } }
4287
- function _arrayLikeToArray$v(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
4288
- function ownKeys$X(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4289
- function _objectSpread$X(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$X(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$X(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4285
+ var DashboardInstallOptionsModal = function DashboardInstallOptionsModal(_ref) {
4286
+ var _menuItems$;
4287
+ var isOpen = _ref.isOpen,
4288
+ setIsOpen = _ref.setIsOpen,
4289
+ pkg = _ref.pkg,
4290
+ _ref$menuItems = _ref.menuItems,
4291
+ menuItems = _ref$menuItems === void 0 ? [] : _ref$menuItems,
4292
+ onCreateFolder = _ref.onCreateFolder,
4293
+ onConfirm = _ref.onConfirm;
4294
+ var _useContext = React.useContext(DashReact.ThemeContext),
4295
+ currentTheme = _useContext.currentTheme;
4296
+ var panelStyles = DashReact.getStylesForItem(DashReact.themeObjects.PANEL, currentTheme, {
4297
+ grow: false
4298
+ });
4299
+ var defaultName = (pkg === null || pkg === void 0 ? void 0 : pkg.displayName) || (pkg === null || pkg === void 0 ? void 0 : pkg.name) || "";
4300
+ var _useState = React.useState(defaultName),
4301
+ _useState2 = _slicedToArray(_useState, 2),
4302
+ name = _useState2[0],
4303
+ setName = _useState2[1];
4304
+ var _useState3 = React.useState(((_menuItems$ = menuItems[0]) === null || _menuItems$ === void 0 ? void 0 : _menuItems$.id) != null ? String(menuItems[0].id) : ""),
4305
+ _useState4 = _slicedToArray(_useState3, 2),
4306
+ selectedMenuId = _useState4[0],
4307
+ setSelectedMenuId = _useState4[1];
4308
+ var _useState5 = React.useState(false),
4309
+ _useState6 = _slicedToArray(_useState5, 2),
4310
+ newFolderMode = _useState6[0],
4311
+ setNewFolderMode = _useState6[1];
4312
+ var _useState7 = React.useState(""),
4313
+ _useState8 = _slicedToArray(_useState7, 2),
4314
+ newFolderName = _useState8[0],
4315
+ setNewFolderName = _useState8[1];
4316
+ var _useState9 = React.useState(false),
4317
+ _useState0 = _slicedToArray(_useState9, 2),
4318
+ creating = _useState0[0],
4319
+ setCreating = _useState0[1];
4320
+ var _useState1 = React.useState(null),
4321
+ _useState10 = _slicedToArray(_useState1, 2),
4322
+ error = _useState10[0],
4323
+ setError = _useState10[1];
4324
+
4325
+ // Reset state every time the modal opens with a new package.
4326
+ React.useEffect(function () {
4327
+ var _menuItems$2;
4328
+ if (!isOpen) return;
4329
+ setName(defaultName);
4330
+ setSelectedMenuId(((_menuItems$2 = menuItems[0]) === null || _menuItems$2 === void 0 ? void 0 : _menuItems$2.id) != null ? String(menuItems[0].id) : "");
4331
+ setNewFolderMode(false);
4332
+ setNewFolderName("");
4333
+ setError(null);
4334
+ // eslint-disable-next-line react-hooks/exhaustive-deps
4335
+ }, [isOpen, pkg === null || pkg === void 0 ? void 0 : pkg.name]);
4336
+ var sortedFolders = React.useMemo(function () {
4337
+ return _toConsumableArray(menuItems || []).filter(function (m) {
4338
+ return m && m.id != null;
4339
+ }).sort(function (a, b) {
4340
+ return String(a.name || "").localeCompare(String(b.name || ""));
4341
+ });
4342
+ }, [menuItems]);
4343
+ function handleConfirm() {
4344
+ return _handleConfirm.apply(this, arguments);
4345
+ }
4346
+ function _handleConfirm() {
4347
+ _handleConfirm = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
4348
+ var menuId, trimmed, newId, created, _t;
4349
+ return _regeneratorRuntime.wrap(function (_context) {
4350
+ while (1) switch (_context.prev = _context.next) {
4351
+ case 0:
4352
+ setError(null);
4353
+ menuId = selectedMenuId ? selectedMenuId : null;
4354
+ if (!newFolderMode) {
4355
+ _context.next = 7;
4356
+ break;
4357
+ }
4358
+ trimmed = (newFolderName || "").trim();
4359
+ if (trimmed) {
4360
+ _context.next = 1;
4361
+ break;
4362
+ }
4363
+ setError("New folder name is required.");
4364
+ return _context.abrupt("return");
4365
+ case 1:
4366
+ if (!(typeof onCreateFolder !== "function")) {
4367
+ _context.next = 2;
4368
+ break;
4369
+ }
4370
+ setError("Folder creation is unavailable.");
4371
+ return _context.abrupt("return");
4372
+ case 2:
4373
+ _context.prev = 2;
4374
+ setCreating(true);
4375
+ newId = Date.now();
4376
+ _context.next = 3;
4377
+ return onCreateFolder({
4378
+ id: newId,
4379
+ name: trimmed,
4380
+ icon: "folder"
4381
+ });
4382
+ case 3:
4383
+ created = _context.sent;
4384
+ if (!(created !== null && created !== void 0 && created.error || (created === null || created === void 0 ? void 0 : created.success) === false)) {
4385
+ _context.next = 4;
4386
+ break;
4387
+ }
4388
+ setError((created === null || created === void 0 ? void 0 : created.message) || "Could not create folder.");
4389
+ return _context.abrupt("return");
4390
+ case 4:
4391
+ menuId = newId;
4392
+ _context.next = 6;
4393
+ break;
4394
+ case 5:
4395
+ _context.prev = 5;
4396
+ _t = _context["catch"](2);
4397
+ setError((_t === null || _t === void 0 ? void 0 : _t.message) || "Could not create folder.");
4398
+ return _context.abrupt("return");
4399
+ case 6:
4400
+ _context.prev = 6;
4401
+ setCreating(false);
4402
+ return _context.finish(6);
4403
+ case 7:
4404
+ onConfirm({
4405
+ name: (name || "").trim() || defaultName,
4406
+ menuId: menuId
4407
+ });
4408
+ case 8:
4409
+ case "end":
4410
+ return _context.stop();
4411
+ }
4412
+ }, _callee, null, [[2, 5, 6, 7]]);
4413
+ }));
4414
+ return _handleConfirm.apply(this, arguments);
4415
+ }
4416
+ if (!isOpen) return null;
4417
+ return /*#__PURE__*/jsxRuntime.jsx(DashReact.Modal, {
4418
+ isOpen: isOpen,
4419
+ setIsOpen: setIsOpen,
4420
+ width: "w-full max-w-md",
4421
+ height: "h-auto",
4422
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
4423
+ className: "flex flex-col rounded-lg overflow-hidden border ".concat(panelStyles.backgroundColor || "", " ").concat(panelStyles.borderColor || "", " ").concat(panelStyles.textColor || ""),
4424
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
4425
+ className: "flex flex-row items-center justify-between p-4 border-b border-white/10",
4426
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
4427
+ className: "flex items-center gap-3",
4428
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
4429
+ icon: "download",
4430
+ className: "h-4 w-4 opacity-70"
4431
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
4432
+ className: "text-lg font-semibold",
4433
+ children: "Install dashboard"
4434
+ })]
4435
+ }), /*#__PURE__*/jsxRuntime.jsx("button", {
4436
+ type: "button",
4437
+ onClick: function onClick() {
4438
+ return setIsOpen(false);
4439
+ },
4440
+ className: "opacity-50 hover:opacity-100 transition-opacity cursor-pointer",
4441
+ "aria-label": "Close",
4442
+ children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
4443
+ icon: "xmark",
4444
+ className: "h-5 w-5"
4445
+ })
4446
+ })]
4447
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
4448
+ className: "flex flex-col gap-4 p-4",
4449
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
4450
+ className: "flex flex-col gap-1",
4451
+ children: [/*#__PURE__*/jsxRuntime.jsx("label", {
4452
+ className: "text-sm font-medium",
4453
+ children: "Name"
4454
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
4455
+ value: name,
4456
+ onChange: function onChange(v) {
4457
+ return setName(v);
4458
+ },
4459
+ placeholder: defaultName
4460
+ }), /*#__PURE__*/jsxRuntime.jsx("span", {
4461
+ className: "text-[10px] opacity-50",
4462
+ children: "The local display name only. Doesn't change the published scope or package id."
4463
+ })]
4464
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
4465
+ className: "flex flex-col gap-1",
4466
+ children: [/*#__PURE__*/jsxRuntime.jsx("label", {
4467
+ className: "text-sm font-medium",
4468
+ children: "Folder"
4469
+ }), !newFolderMode ? /*#__PURE__*/jsxRuntime.jsxs("div", {
4470
+ className: "flex flex-row gap-2 items-center",
4471
+ children: [/*#__PURE__*/jsxRuntime.jsxs("select", {
4472
+ value: selectedMenuId,
4473
+ onChange: function onChange(e) {
4474
+ return setSelectedMenuId(e.target.value);
4475
+ },
4476
+ className: "flex-1 px-3 py-2 bg-gray-900 border border-white/10 rounded text-sm text-gray-200",
4477
+ children: [sortedFolders.length === 0 && /*#__PURE__*/jsxRuntime.jsx("option", {
4478
+ value: "",
4479
+ children: "\u2014 No folders yet \u2014"
4480
+ }), sortedFolders.map(function (m) {
4481
+ return /*#__PURE__*/jsxRuntime.jsx("option", {
4482
+ value: String(m.id),
4483
+ children: m.name
4484
+ }, m.id);
4485
+ })]
4486
+ }), /*#__PURE__*/jsxRuntime.jsx("button", {
4487
+ type: "button",
4488
+ onClick: function onClick() {
4489
+ return setNewFolderMode(true);
4490
+ },
4491
+ className: "px-3 py-2 text-xs bg-indigo-600 hover:bg-indigo-500 text-white rounded transition-colors",
4492
+ children: "+ New"
4493
+ })]
4494
+ }) : /*#__PURE__*/jsxRuntime.jsxs("div", {
4495
+ className: "flex flex-row gap-2 items-center",
4496
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
4497
+ value: newFolderName,
4498
+ onChange: function onChange(v) {
4499
+ return setNewFolderName(v);
4500
+ },
4501
+ placeholder: "New folder name",
4502
+ autoFocus: true
4503
+ }), /*#__PURE__*/jsxRuntime.jsx("button", {
4504
+ type: "button",
4505
+ onClick: function onClick() {
4506
+ setNewFolderMode(false);
4507
+ setNewFolderName("");
4508
+ setError(null);
4509
+ },
4510
+ className: "px-3 py-2 text-xs bg-gray-700 hover:bg-gray-600 text-gray-100 rounded transition-colors",
4511
+ children: "Cancel"
4512
+ })]
4513
+ })]
4514
+ }), error && /*#__PURE__*/jsxRuntime.jsx("div", {
4515
+ className: "text-xs text-red-300 bg-red-900/30 border border-red-700/40 rounded px-3 py-2",
4516
+ children: error
4517
+ })]
4518
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
4519
+ className: "flex flex-row justify-end gap-2 p-4 border-t border-white/10",
4520
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
4521
+ title: "Cancel",
4522
+ onClick: function onClick() {
4523
+ return setIsOpen(false);
4524
+ }
4525
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button2, {
4526
+ title: creating ? "Creating folder…" : "Install",
4527
+ onClick: handleConfirm,
4528
+ disabled: creating || !name.trim()
4529
+ })]
4530
+ })]
4531
+ })
4532
+ });
4533
+ };
4534
+
4535
+ function _createForOfIteratorHelper$w(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$w(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
4536
+ function _unsupportedIterableToArray$w(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$w(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$w(r, a) : void 0; } }
4537
+ function _arrayLikeToArray$w(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
4538
+ function ownKeys$V(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4539
+ function _objectSpread$V(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$V(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$V(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4290
4540
  var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
4291
4541
  var dashboardPackage = _ref.dashboardPackage,
4292
4542
  appId = _ref.appId,
@@ -4326,6 +4576,18 @@ var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
4326
4576
  setProgressComplete = _useState12[1];
4327
4577
  var progressResultRef = React.useRef(null);
4328
4578
  var cleanupProgressRef = React.useRef(null);
4579
+
4580
+ // Pre-install options modal: choose folder + rename. Lets the user
4581
+ // override the publisher's menuId (which would otherwise collide
4582
+ // with their local folder ids) and pick a friendlier display name.
4583
+ var _useState13 = React.useState(false),
4584
+ _useState14 = _slicedToArray(_useState13, 2),
4585
+ showOptionsModal = _useState14[0],
4586
+ setShowOptionsModal = _useState14[1];
4587
+ var _useState15 = React.useState([]),
4588
+ _useState16 = _slicedToArray(_useState15, 2),
4589
+ menuItems = _useState16[0],
4590
+ setMenuItems = _useState16[1];
4329
4591
  var pkg = dashboardPackage;
4330
4592
  if (!pkg) return null;
4331
4593
 
@@ -4356,12 +4618,16 @@ var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
4356
4618
  cancelled = true;
4357
4619
  };
4358
4620
  }, [pkg.name]);
4359
- function handleInstall() {
4360
- return _handleInstall.apply(this, arguments);
4361
- } // eslint-disable-next-line react-hooks/rules-of-hooks
4362
- function _handleInstall() {
4363
- _handleInstall = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
4364
- var deps, items, _window$mainApi2, _window$mainApi2$onIn, result, _result$workspace2, _t;
4621
+
4622
+ // Click handler on the "Install" button: load the user's existing
4623
+ // folders + open the options modal. The actual install fires from
4624
+ // the modal's onConfirm so we have the user's name/menuId choice.
4625
+ function handleInstallClick() {
4626
+ return _handleInstallClick.apply(this, arguments);
4627
+ }
4628
+ function _handleInstallClick() {
4629
+ _handleInstallClick = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
4630
+ var _window$mainApi2, _window$mainApi2$list, result, list;
4365
4631
  return _regeneratorRuntime.wrap(function (_context) {
4366
4632
  while (1) switch (_context.prev = _context.next) {
4367
4633
  case 0:
@@ -4370,6 +4636,107 @@ var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
4370
4636
  break;
4371
4637
  }
4372
4638
  return _context.abrupt("return");
4639
+ case 1:
4640
+ setInstallResult(null);
4641
+ _context.prev = 2;
4642
+ _context.next = 3;
4643
+ return (_window$mainApi2 = window.mainApi) === null || _window$mainApi2 === void 0 || (_window$mainApi2 = _window$mainApi2.menuItems) === null || _window$mainApi2 === void 0 || (_window$mainApi2$list = _window$mainApi2.listMenuItems) === null || _window$mainApi2$list === void 0 ? void 0 : _window$mainApi2$list.call(_window$mainApi2, appId);
4644
+ case 3:
4645
+ result = _context.sent;
4646
+ list = ((result === null || result === void 0 ? void 0 : result.menuItems) || []).filter(function (m) {
4647
+ return m && m.id != null;
4648
+ });
4649
+ setMenuItems(list);
4650
+ _context.next = 5;
4651
+ break;
4652
+ case 4:
4653
+ _context.prev = 4;
4654
+ _context["catch"](2);
4655
+ setMenuItems([]);
4656
+ case 5:
4657
+ setShowOptionsModal(true);
4658
+ case 6:
4659
+ case "end":
4660
+ return _context.stop();
4661
+ }
4662
+ }, _callee, null, [[2, 4]]);
4663
+ }));
4664
+ return _handleInstallClick.apply(this, arguments);
4665
+ }
4666
+ function handleCreateFolder(_x) {
4667
+ return _handleCreateFolder.apply(this, arguments);
4668
+ }
4669
+ function _handleCreateFolder() {
4670
+ _handleCreateFolder = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(menuItem) {
4671
+ var _window$mainApi3, _window$mainApi3$save;
4672
+ return _regeneratorRuntime.wrap(function (_context2) {
4673
+ while (1) switch (_context2.prev = _context2.next) {
4674
+ case 0:
4675
+ if (appId) {
4676
+ _context2.next = 1;
4677
+ break;
4678
+ }
4679
+ return _context2.abrupt("return", {
4680
+ success: false,
4681
+ message: "No appId"
4682
+ });
4683
+ case 1:
4684
+ return _context2.abrupt("return", (_window$mainApi3 = window.mainApi) === null || _window$mainApi3 === void 0 || (_window$mainApi3 = _window$mainApi3.menuItems) === null || _window$mainApi3 === void 0 || (_window$mainApi3$save = _window$mainApi3.saveMenuItem) === null || _window$mainApi3$save === void 0 ? void 0 : _window$mainApi3$save.call(_window$mainApi3, appId, menuItem));
4685
+ case 2:
4686
+ case "end":
4687
+ return _context2.stop();
4688
+ }
4689
+ }, _callee2);
4690
+ }));
4691
+ return _handleCreateFolder.apply(this, arguments);
4692
+ }
4693
+ function handleOptionsConfirm(_x2) {
4694
+ return _handleOptionsConfirm.apply(this, arguments);
4695
+ }
4696
+ function _handleOptionsConfirm() {
4697
+ _handleOptionsConfirm = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
4698
+ var name, menuId;
4699
+ return _regeneratorRuntime.wrap(function (_context3) {
4700
+ while (1) switch (_context3.prev = _context3.next) {
4701
+ case 0:
4702
+ name = _ref2.name, menuId = _ref2.menuId;
4703
+ setShowOptionsModal(false);
4704
+ _context3.next = 1;
4705
+ return runInstall({
4706
+ name: name,
4707
+ menuId: menuId
4708
+ });
4709
+ case 1:
4710
+ case "end":
4711
+ return _context3.stop();
4712
+ }
4713
+ }, _callee3);
4714
+ }));
4715
+ return _handleOptionsConfirm.apply(this, arguments);
4716
+ }
4717
+ function runInstall() {
4718
+ return _runInstall.apply(this, arguments);
4719
+ } // eslint-disable-next-line react-hooks/rules-of-hooks
4720
+ function _runInstall() {
4721
+ _runInstall = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
4722
+ var installOptions,
4723
+ deps,
4724
+ items,
4725
+ _window$mainApi4,
4726
+ _window$mainApi4$onIn,
4727
+ result,
4728
+ _result$workspace2,
4729
+ _args4 = arguments,
4730
+ _t2;
4731
+ return _regeneratorRuntime.wrap(function (_context4) {
4732
+ while (1) switch (_context4.prev = _context4.next) {
4733
+ case 0:
4734
+ installOptions = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
4735
+ if (!(!appId || !pkg.name)) {
4736
+ _context4.next = 1;
4737
+ break;
4738
+ }
4739
+ return _context4.abrupt("return");
4373
4740
  case 1:
4374
4741
  setIsInstalling(true);
4375
4742
  setInstallResult(null);
@@ -4398,11 +4765,11 @@ var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
4398
4765
 
4399
4766
  // Register progress listener
4400
4767
  if (cleanupProgressRef.current) cleanupProgressRef.current();
4401
- cleanupProgressRef.current = (_window$mainApi2 = window.mainApi) === null || _window$mainApi2 === void 0 || (_window$mainApi2 = _window$mainApi2.dashboardConfig) === null || _window$mainApi2 === void 0 || (_window$mainApi2$onIn = _window$mainApi2.onInstallProgress) === null || _window$mainApi2$onIn === void 0 ? void 0 : _window$mainApi2$onIn.call(_window$mainApi2, function (data) {
4768
+ cleanupProgressRef.current = (_window$mainApi4 = window.mainApi) === null || _window$mainApi4 === void 0 || (_window$mainApi4 = _window$mainApi4.dashboardConfig) === null || _window$mainApi4 === void 0 || (_window$mainApi4$onIn = _window$mainApi4.onInstallProgress) === null || _window$mainApi4$onIn === void 0 ? void 0 : _window$mainApi4$onIn.call(_window$mainApi4, function (data) {
4402
4769
  setProgressWidgets(function (prev) {
4403
4770
  var next = _toConsumableArray(prev);
4404
4771
  if (data.index >= 0 && data.index < next.length) {
4405
- next[data.index] = _objectSpread$X(_objectSpread$X({}, next[data.index]), {}, {
4772
+ next[data.index] = _objectSpread$V(_objectSpread$V({}, next[data.index]), {}, {
4406
4773
  status: data.status,
4407
4774
  error: data.error || null
4408
4775
  });
@@ -4411,13 +4778,13 @@ var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
4411
4778
  });
4412
4779
  });
4413
4780
  }
4414
- _context.prev = 2;
4415
- _context.next = 3;
4416
- return window.mainApi.dashboardConfig.installDashboardFromRegistry(appId, pkg.name);
4781
+ _context4.prev = 2;
4782
+ _context4.next = 3;
4783
+ return window.mainApi.dashboardConfig.installDashboardFromRegistry(appId, pkg.name, installOptions);
4417
4784
  case 3:
4418
- result = _context.sent;
4785
+ result = _context4.sent;
4419
4786
  if (!(result !== null && result !== void 0 && result.authRequired)) {
4420
- _context.next = 4;
4787
+ _context4.next = 4;
4421
4788
  break;
4422
4789
  }
4423
4790
  // Auth needed — close progress modal, show inline auth prompt
@@ -4431,7 +4798,7 @@ var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
4431
4798
  cleanupProgressRef.current();
4432
4799
  cleanupProgressRef.current = null;
4433
4800
  }
4434
- return _context.abrupt("return");
4801
+ return _context4.abrupt("return");
4435
4802
  case 4:
4436
4803
  // Store result for use when modal closes
4437
4804
  progressResultRef.current = result;
@@ -4447,33 +4814,33 @@ var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
4447
4814
  onInstallComplete(result);
4448
4815
  }
4449
4816
  }
4450
- _context.next = 6;
4817
+ _context4.next = 6;
4451
4818
  break;
4452
4819
  case 5:
4453
- _context.prev = 5;
4454
- _t = _context["catch"](2);
4820
+ _context4.prev = 5;
4821
+ _t2 = _context4["catch"](2);
4455
4822
  setProgressComplete(true);
4456
4823
  if (items.length === 0) {
4457
4824
  setInstallResult({
4458
4825
  status: "error",
4459
- message: _t.message || "Failed to install dashboard."
4826
+ message: _t2.message || "Failed to install dashboard."
4460
4827
  });
4461
4828
  }
4462
4829
  case 6:
4463
- _context.prev = 6;
4830
+ _context4.prev = 6;
4464
4831
  setIsInstalling(false);
4465
4832
  if (cleanupProgressRef.current) {
4466
4833
  cleanupProgressRef.current();
4467
4834
  cleanupProgressRef.current = null;
4468
4835
  }
4469
- return _context.finish(6);
4836
+ return _context4.finish(6);
4470
4837
  case 7:
4471
4838
  case "end":
4472
- return _context.stop();
4839
+ return _context4.stop();
4473
4840
  }
4474
- }, _callee, null, [[2, 5, 6, 7]]);
4841
+ }, _callee4, null, [[2, 5, 6, 7]]);
4475
4842
  }));
4476
- return _handleInstall.apply(this, arguments);
4843
+ return _runInstall.apply(this, arguments);
4477
4844
  }
4478
4845
  var handleProgressDone = React.useCallback(function () {
4479
4846
  setShowProgressModal(false);
@@ -4498,7 +4865,7 @@ var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
4498
4865
  var raw = preview === null || preview === void 0 ? void 0 : preview.compatibility;
4499
4866
  if (!raw) return raw;
4500
4867
  var cMap = ComponentManager.componentMap();
4501
- var augWidgets = _objectSpread$X({}, raw.widgets);
4868
+ var augWidgets = _objectSpread$V({}, raw.widgets);
4502
4869
  var fixedCount = 0;
4503
4870
  var _loop = function _loop() {
4504
4871
  var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
@@ -4525,7 +4892,7 @@ var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
4525
4892
  toInstall = 0,
4526
4893
  unavailable = 0,
4527
4894
  hasUnavailableRequired = false;
4528
- var _iterator = _createForOfIteratorHelper$v(widgetDeps),
4895
+ var _iterator = _createForOfIteratorHelper$w(widgetDeps),
4529
4896
  _step;
4530
4897
  try {
4531
4898
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -4741,9 +5108,16 @@ var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
4741
5108
  hoverBackgroundColor: isInstalling ? "" : "hover:bg-blue-700",
4742
5109
  textSize: "text-sm",
4743
5110
  padding: "py-1.5 px-4",
4744
- onClick: handleInstall,
5111
+ onClick: handleInstallClick,
4745
5112
  disabled: isInstalling
4746
5113
  })
5114
+ }), /*#__PURE__*/jsxRuntime.jsx(DashboardInstallOptionsModal, {
5115
+ isOpen: showOptionsModal,
5116
+ setIsOpen: setShowOptionsModal,
5117
+ pkg: pkg,
5118
+ menuItems: menuItems,
5119
+ onCreateFolder: handleCreateFolder,
5120
+ onConfirm: handleOptionsConfirm
4747
5121
  }), /*#__PURE__*/jsxRuntime.jsx(InstallProgressModal, {
4748
5122
  isOpen: showProgressModal,
4749
5123
  setIsOpen: setShowProgressModal,
@@ -4757,7 +5131,10 @@ var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
4757
5131
  },
4758
5132
  onAuthenticated: function onAuthenticated() {
4759
5133
  setInstallResult(null);
4760
- handleInstall();
5134
+ // Re-open the options modal so the user can confirm again
5135
+ // post-auth (cheaper than caching their first selection
5136
+ // through the auth round-trip).
5137
+ handleInstallClick();
4761
5138
  },
4762
5139
  onCancel: function onCancel() {
4763
5140
  return setInstallResult(null);
@@ -5081,8 +5458,6 @@ var DiscoverDashboardsDetail = function DiscoverDashboardsDetail(_ref) {
5081
5458
  });
5082
5459
  };
5083
5460
 
5084
- function ownKeys$W(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5085
- function _objectSpread$W(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$W(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$W(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5086
5461
  var LayoutManagerModal = function LayoutManagerModal(_ref) {
5087
5462
  var open = _ref.open,
5088
5463
  setIsOpen = _ref.setIsOpen,
@@ -5130,31 +5505,25 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
5130
5505
  localMenuItems = _useState12[0],
5131
5506
  setLocalMenuItems = _useState12[1];
5132
5507
 
5133
- // Post-install workspace for registry stepper customization
5508
+ // Pre-import file selection (file preview, not yet saved)
5134
5509
  var _useState13 = React.useState(null),
5135
5510
  _useState14 = _slicedToArray(_useState13, 2),
5136
- importedWorkspace = _useState14[0],
5137
- setImportedWorkspace = _useState14[1];
5138
-
5139
- // Pre-import file selection (file preview, not yet saved)
5140
- var _useState15 = React.useState(null),
5141
- _useState16 = _slicedToArray(_useState15, 2),
5142
- selectedFile = _useState16[0],
5143
- setSelectedFile = _useState16[1];
5511
+ selectedFile = _useState14[0],
5512
+ setSelectedFile = _useState14[1];
5144
5513
 
5145
5514
  // Inline new-folder form state
5146
- var _useState17 = React.useState(false),
5515
+ var _useState15 = React.useState(false),
5516
+ _useState16 = _slicedToArray(_useState15, 2),
5517
+ isCreatingFolder = _useState16[0],
5518
+ setIsCreatingFolder = _useState16[1];
5519
+ var _useState17 = React.useState(""),
5147
5520
  _useState18 = _slicedToArray(_useState17, 2),
5148
- isCreatingFolder = _useState18[0],
5149
- setIsCreatingFolder = _useState18[1];
5150
- var _useState19 = React.useState(""),
5521
+ newFolderName = _useState18[0],
5522
+ setNewFolderName = _useState18[1];
5523
+ var _useState19 = React.useState(null),
5151
5524
  _useState20 = _slicedToArray(_useState19, 2),
5152
- newFolderName = _useState20[0],
5153
- setNewFolderName = _useState20[1];
5154
- var _useState21 = React.useState(null),
5155
- _useState22 = _slicedToArray(_useState21, 2),
5156
- newFolderIcon = _useState22[0],
5157
- setNewFolderIcon = _useState22[1];
5525
+ newFolderIcon = _useState20[0],
5526
+ setNewFolderIcon = _useState20[1];
5158
5527
 
5159
5528
  // Reset state when modal opens
5160
5529
  React.useEffect(function () {
@@ -5174,7 +5543,6 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
5174
5543
  return (a.name || "").localeCompare(b.name || "");
5175
5544
  })[0]) === null || _Object$entries$sort$ === void 0 ? void 0 : _Object$entries$sort$[0]) || null : null;
5176
5545
  setSelectedThemeKey(appThemeKey || fallback);
5177
- setImportedWorkspace(null);
5178
5546
  setSelectedFile(null);
5179
5547
  setIsCreatingFolder(false);
5180
5548
  setNewFolderName("");
@@ -5261,22 +5629,34 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
5261
5629
  return _handleImportFromFile.apply(this, arguments);
5262
5630
  }
5263
5631
  function handleRegistryInstallComplete(result) {
5264
- var _result$workspace, _result$workspace2, _result$workspace3;
5265
- setImportedWorkspace(result.workspace);
5266
- setDashboardName(((_result$workspace = result.workspace) === null || _result$workspace === void 0 ? void 0 : _result$workspace.name) || "");
5267
- setSelectedMenuId(((_result$workspace2 = result.workspace) === null || _result$workspace2 === void 0 ? void 0 : _result$workspace2.menuId) || (menuItems.length > 0 ? menuItems[0].id : 1));
5268
- setSelectedThemeKey(((_result$workspace3 = result.workspace) === null || _result$workspace3 === void 0 ? void 0 : _result$workspace3.themeKey) || null);
5269
- setActiveStep(0);
5270
- }
5271
- function handleImportRegistryConfirm() {
5272
- return _handleImportRegistryConfirm.apply(this, arguments);
5273
- }
5274
- function _handleImportRegistryConfirm() {
5275
- _handleImportRegistryConfirm = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
5276
- var menuId, newItem, result, updatedWorkspace;
5632
+ // The pre-install DashboardInstallOptionsModal already collected
5633
+ // the user's name + folder choice and the install IPC applied
5634
+ // them, so the workspace on disk is final. Skip the legacy
5635
+ // post-install Name/Organize/Theme stepper (it would just ask
5636
+ // for the same fields again) close out and open the new
5637
+ // dashboard.
5638
+ if (onReloadWorkspaces) onReloadWorkspaces();
5639
+ loadThemes();
5640
+ if (onOpenWorkspace && result !== null && result !== void 0 && result.workspace) {
5641
+ onOpenWorkspace(result.workspace);
5642
+ }
5643
+ handleClose();
5644
+ }
5645
+ function handleImportConfirm() {
5646
+ return _handleImportConfirm.apply(this, arguments);
5647
+ }
5648
+ function _handleImportConfirm() {
5649
+ _handleImportConfirm = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
5650
+ var menuId, newItem, result;
5277
5651
  return _regeneratorRuntime.wrap(function (_context2) {
5278
5652
  while (1) switch (_context2.prev = _context2.next) {
5279
5653
  case 0:
5654
+ if (selectedFile) {
5655
+ _context2.next = 1;
5656
+ break;
5657
+ }
5658
+ return _context2.abrupt("return");
5659
+ case 1:
5280
5660
  menuId = selectedMenuId;
5281
5661
  if (isCreatingFolder && newFolderName.trim() && newFolderIcon) {
5282
5662
  newItem = {
@@ -5289,21 +5669,15 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
5289
5669
  onSaveMenuItem(newItem);
5290
5670
  }
5291
5671
  }
5292
-
5293
- // Import flow: file not yet saved, call importDashboardConfig with overrides
5294
- if (!(creationMethod === "import" && selectedFile)) {
5295
- _context2.next = 5;
5296
- break;
5297
- }
5298
- _context2.prev = 1;
5299
- _context2.next = 2;
5672
+ _context2.prev = 2;
5673
+ _context2.next = 3;
5300
5674
  return window.mainApi.dashboardConfig.importDashboardConfig(appId, {
5301
5675
  filePath: selectedFile.filePath,
5302
5676
  name: dashboardName.trim(),
5303
5677
  menuId: menuId,
5304
5678
  themeKey: selectedThemeKey
5305
5679
  });
5306
- case 2:
5680
+ case 3:
5307
5681
  result = _context2.sent;
5308
5682
  if (result && result.success) {
5309
5683
  onReloadWorkspaces && onReloadWorkspaces();
@@ -5313,47 +5687,18 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
5313
5687
  }
5314
5688
  handleClose();
5315
5689
  }
5316
- _context2.next = 4;
5690
+ _context2.next = 5;
5317
5691
  break;
5318
- case 3:
5319
- _context2.prev = 3;
5320
- _context2["catch"](1);
5321
5692
  case 4:
5322
- return _context2.abrupt("return");
5693
+ _context2.prev = 4;
5694
+ _context2["catch"](2);
5323
5695
  case 5:
5324
- if (importedWorkspace) {
5325
- _context2.next = 6;
5326
- break;
5327
- }
5328
- return _context2.abrupt("return");
5329
- case 6:
5330
- updatedWorkspace = _objectSpread$W(_objectSpread$W({}, importedWorkspace), {}, {
5331
- name: dashboardName.trim(),
5332
- menuId: menuId,
5333
- themeKey: selectedThemeKey
5334
- });
5335
- _context2.prev = 7;
5336
- _context2.next = 8;
5337
- return window.mainApi.workspace.saveWorkspaceForApplication(appId, updatedWorkspace);
5338
- case 8:
5339
- onReloadWorkspaces && onReloadWorkspaces();
5340
- loadThemes();
5341
- if (onOpenWorkspace) {
5342
- onOpenWorkspace(updatedWorkspace);
5343
- }
5344
- handleClose();
5345
- _context2.next = 10;
5346
- break;
5347
- case 9:
5348
- _context2.prev = 9;
5349
- _context2["catch"](7);
5350
- case 10:
5351
5696
  case "end":
5352
5697
  return _context2.stop();
5353
5698
  }
5354
- }, _callee2, null, [[1, 3], [7, 9]]);
5699
+ }, _callee2, null, [[2, 4]]);
5355
5700
  }));
5356
- return _handleImportRegistryConfirm.apply(this, arguments);
5701
+ return _handleImportConfirm.apply(this, arguments);
5357
5702
  }
5358
5703
  var selectedFolder = localMenuItems.find(function (item) {
5359
5704
  return item.id === selectedMenuId;
@@ -5641,8 +5986,10 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
5641
5986
  });
5642
5987
  }
5643
5988
 
5644
- // Registry browser: show until install completes
5645
- if (creationMethod === "registry" && !importedWorkspace) {
5989
+ // Registry browser: install completes inside DiscoverDashboardsDetail
5990
+ // (via the DashboardInstallOptionsModal) and the onInstallComplete
5991
+ // handler closes this modal directly — no post-install stepper.
5992
+ if (creationMethod === "registry") {
5646
5993
  return /*#__PURE__*/jsxRuntime.jsx(DashReact.Panel, {
5647
5994
  backgroundColor: "bg-slate-800",
5648
5995
  padding: false,
@@ -5695,37 +6042,6 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
5695
6042
  });
5696
6043
  }
5697
6044
 
5698
- // Registry stepper: 3 steps (Name, Folder, Theme)
5699
- if (creationMethod === "registry" && importedWorkspace) {
5700
- return /*#__PURE__*/jsxRuntime.jsx(DashReact.Panel, {
5701
- backgroundColor: "bg-slate-800",
5702
- padding: false,
5703
- children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Panel.Body, {
5704
- scrollable: false,
5705
- className: "h-full",
5706
- children: /*#__PURE__*/jsxRuntime.jsxs(DashReact.Stepper, {
5707
- activeStep: activeStep,
5708
- onStepChange: setActiveStep,
5709
- showNavigation: false,
5710
- className: "h-full p-6 pb-0",
5711
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
5712
- label: "Name",
5713
- description: "Name your dashboard",
5714
- children: renderNameStep()
5715
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
5716
- label: "Organize",
5717
- description: "Choose a folder",
5718
- children: renderFolderStep()
5719
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
5720
- label: "Choose Theme",
5721
- description: "Dashboard theme",
5722
- children: renderThemeStep()
5723
- })]
5724
- })
5725
- })
5726
- });
5727
- }
5728
-
5729
6045
  // creationMethod === "template" — existing 4-step wizard
5730
6046
  return /*#__PURE__*/jsxRuntime.jsx(DashReact.Panel, {
5731
6047
  backgroundColor: "bg-slate-800",
@@ -5786,7 +6102,7 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
5786
6102
  }
5787
6103
 
5788
6104
  // Registry browser: Cancel only (DiscoverDashboardsDetail has its own inline back button)
5789
- if (creationMethod === "registry" && !importedWorkspace) {
6105
+ if (creationMethod === "registry") {
5790
6106
  return /*#__PURE__*/jsxRuntime.jsx(DashReact.Modal.Footer, {
5791
6107
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
5792
6108
  className: "flex flex-row space-x-2",
@@ -5826,97 +6142,18 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
5826
6142
  title: "Next",
5827
6143
  textSize: "text-base xl:text-lg",
5828
6144
  padding: "py-2 px-4",
5829
- backgroundColor: "bg-blue-600",
5830
- textColor: "text-white",
5831
- hoverTextColor: "hover:text-white",
5832
- hoverBackgroundColor: "hover:bg-blue-500",
5833
- disabled: !selectedFile
5834
- })]
5835
- }), activeStep === 1 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
5836
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
5837
- onClick: function onClick() {
5838
- return setActiveStep(0);
5839
- },
5840
- title: "Back",
5841
- textSize: "text-base xl:text-lg",
5842
- padding: "py-2 px-4",
5843
- backgroundColor: "bg-gray-700",
5844
- textColor: "text-gray-300",
5845
- hoverTextColor: "hover:text-gray-100",
5846
- hoverBackgroundColor: "hover:bg-gray-600"
5847
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
5848
- onClick: function onClick() {
5849
- return setActiveStep(2);
5850
- },
5851
- title: "Next",
5852
- textSize: "text-base xl:text-lg",
5853
- padding: "py-2 px-4",
5854
- backgroundColor: "bg-blue-600",
5855
- textColor: "text-white",
5856
- hoverTextColor: "hover:text-white",
5857
- hoverBackgroundColor: "hover:bg-blue-500",
5858
- disabled: !dashboardName.trim()
5859
- })]
5860
- }), activeStep === 2 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
5861
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
5862
- onClick: function onClick() {
5863
- return setActiveStep(1);
5864
- },
5865
- title: "Back",
5866
- textSize: "text-base xl:text-lg",
5867
- padding: "py-2 px-4",
5868
- backgroundColor: "bg-gray-700",
5869
- textColor: "text-gray-300",
5870
- hoverTextColor: "hover:text-gray-100",
5871
- hoverBackgroundColor: "hover:bg-gray-600"
5872
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
5873
- onClick: function onClick() {
5874
- return setActiveStep(3);
5875
- },
5876
- title: "Next",
5877
- textSize: "text-base xl:text-lg",
5878
- padding: "py-2 px-4",
5879
- backgroundColor: "bg-blue-600",
5880
- textColor: "text-white",
5881
- hoverTextColor: "hover:text-white",
5882
- hoverBackgroundColor: "hover:bg-blue-500"
5883
- })]
5884
- }), activeStep === 3 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
5885
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
5886
- onClick: function onClick() {
5887
- return setActiveStep(2);
5888
- },
5889
- title: "Back",
5890
- textSize: "text-base xl:text-lg",
5891
- padding: "py-2 px-4",
5892
- backgroundColor: "bg-gray-700",
5893
- textColor: "text-gray-300",
5894
- hoverTextColor: "hover:text-gray-100",
5895
- hoverBackgroundColor: "hover:bg-gray-600"
5896
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
5897
- onClick: handleImportRegistryConfirm,
5898
- title: "Save",
5899
- textSize: "text-base xl:text-lg",
5900
- padding: "py-2 px-4",
5901
- backgroundColor: "bg-blue-600",
5902
- textColor: "text-white",
5903
- hoverTextColor: "hover:text-white",
5904
- hoverBackgroundColor: "hover:bg-blue-500"
5905
- })]
5906
- })]
5907
- })
5908
- });
5909
- }
5910
-
5911
- // Registry stepper footer: 3 steps (Name, Organize, Theme)
5912
- if (creationMethod === "registry" && importedWorkspace) {
5913
- return /*#__PURE__*/jsxRuntime.jsx(DashReact.Modal.Footer, {
5914
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
5915
- className: "flex flex-row space-x-2",
5916
- children: [activeStep === 0 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
6145
+ backgroundColor: "bg-blue-600",
6146
+ textColor: "text-white",
6147
+ hoverTextColor: "hover:text-white",
6148
+ hoverBackgroundColor: "hover:bg-blue-500",
6149
+ disabled: !selectedFile
6150
+ })]
6151
+ }), activeStep === 1 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
5917
6152
  children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
5918
- onClick: handleClose,
5919
- title: "Cancel",
6153
+ onClick: function onClick() {
6154
+ return setActiveStep(0);
6155
+ },
6156
+ title: "Back",
5920
6157
  textSize: "text-base xl:text-lg",
5921
6158
  padding: "py-2 px-4",
5922
6159
  backgroundColor: "bg-gray-700",
@@ -5925,7 +6162,7 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
5925
6162
  hoverBackgroundColor: "hover:bg-gray-600"
5926
6163
  }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
5927
6164
  onClick: function onClick() {
5928
- return setActiveStep(1);
6165
+ return setActiveStep(2);
5929
6166
  },
5930
6167
  title: "Next",
5931
6168
  textSize: "text-base xl:text-lg",
@@ -5936,10 +6173,10 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
5936
6173
  hoverBackgroundColor: "hover:bg-blue-500",
5937
6174
  disabled: !dashboardName.trim()
5938
6175
  })]
5939
- }), activeStep === 1 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
6176
+ }), activeStep === 2 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
5940
6177
  children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
5941
6178
  onClick: function onClick() {
5942
- return setActiveStep(0);
6179
+ return setActiveStep(1);
5943
6180
  },
5944
6181
  title: "Back",
5945
6182
  textSize: "text-base xl:text-lg",
@@ -5950,7 +6187,7 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
5950
6187
  hoverBackgroundColor: "hover:bg-gray-600"
5951
6188
  }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
5952
6189
  onClick: function onClick() {
5953
- return setActiveStep(2);
6190
+ return setActiveStep(3);
5954
6191
  },
5955
6192
  title: "Next",
5956
6193
  textSize: "text-base xl:text-lg",
@@ -5960,10 +6197,10 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
5960
6197
  hoverTextColor: "hover:text-white",
5961
6198
  hoverBackgroundColor: "hover:bg-blue-500"
5962
6199
  })]
5963
- }), activeStep === 2 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
6200
+ }), activeStep === 3 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
5964
6201
  children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
5965
6202
  onClick: function onClick() {
5966
- return setActiveStep(1);
6203
+ return setActiveStep(2);
5967
6204
  },
5968
6205
  title: "Back",
5969
6206
  textSize: "text-base xl:text-lg",
@@ -5973,7 +6210,7 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
5973
6210
  hoverTextColor: "hover:text-gray-100",
5974
6211
  hoverBackgroundColor: "hover:bg-gray-600"
5975
6212
  }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
5976
- onClick: handleImportRegistryConfirm,
6213
+ onClick: handleImportConfirm,
5977
6214
  title: "Save",
5978
6215
  textSize: "text-base xl:text-lg",
5979
6216
  padding: "py-2 px-4",
@@ -6300,9 +6537,9 @@ function cleanIpcError(message) {
6300
6537
  return match ? match[1] : message;
6301
6538
  }
6302
6539
 
6303
- function _createForOfIteratorHelper$u(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$u(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
6304
- function _unsupportedIterableToArray$u(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$u(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$u(r, a) : void 0; } }
6305
- function _arrayLikeToArray$u(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
6540
+ function _createForOfIteratorHelper$v(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$v(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
6541
+ function _unsupportedIterableToArray$v(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$v(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$v(r, a) : void 0; } }
6542
+ function _arrayLikeToArray$v(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
6306
6543
 
6307
6544
  /**
6308
6545
  * useRegistrySearch — shared hook for browsing and installing registry packages.
@@ -6416,13 +6653,13 @@ var useRegistrySearch = function useRegistrySearch() {
6416
6653
  return c.toLowerCase();
6417
6654
  }));
6418
6655
  widgets = [];
6419
- _iterator = _createForOfIteratorHelper$u(pkgs);
6656
+ _iterator = _createForOfIteratorHelper$v(pkgs);
6420
6657
  try {
6421
6658
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
6422
6659
  pkg = _step.value;
6423
6660
  // Compute missing APIs for the entire package
6424
6661
  allApiProviders = [];
6425
- _iterator2 = _createForOfIteratorHelper$u(pkg.providers || []);
6662
+ _iterator2 = _createForOfIteratorHelper$v(pkg.providers || []);
6426
6663
  try {
6427
6664
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
6428
6665
  p = _step2.value;
@@ -6435,11 +6672,11 @@ var useRegistrySearch = function useRegistrySearch() {
6435
6672
  } finally {
6436
6673
  _iterator2.f();
6437
6674
  }
6438
- _iterator3 = _createForOfIteratorHelper$u(pkg.widgets || []);
6675
+ _iterator3 = _createForOfIteratorHelper$v(pkg.widgets || []);
6439
6676
  try {
6440
6677
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
6441
6678
  w = _step3.value;
6442
- _iterator5 = _createForOfIteratorHelper$u(w.providers || []);
6679
+ _iterator5 = _createForOfIteratorHelper$v(w.providers || []);
6443
6680
  try {
6444
6681
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
6445
6682
  _p = _step5.value;
@@ -6461,7 +6698,7 @@ var useRegistrySearch = function useRegistrySearch() {
6461
6698
  missingApis = _toConsumableArray(new Set(allApiProviders)).filter(function (api) {
6462
6699
  return !capSet.has(api.toLowerCase());
6463
6700
  });
6464
- _iterator4 = _createForOfIteratorHelper$u(pkg.widgets || []);
6701
+ _iterator4 = _createForOfIteratorHelper$v(pkg.widgets || []);
6465
6702
  try {
6466
6703
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
6467
6704
  widget = _step4.value;
@@ -7082,11 +7319,9 @@ function applyFilters(items, filters, mode) {
7082
7319
  });
7083
7320
  }
7084
7321
 
7085
- function _createForOfIteratorHelper$t(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$t(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
7086
- function _unsupportedIterableToArray$t(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$t(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$t(r, a) : void 0; } }
7087
- function _arrayLikeToArray$t(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
7088
- function ownKeys$V(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7089
- function _objectSpread$V(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$V(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$V(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7322
+ function _createForOfIteratorHelper$u(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$u(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
7323
+ function _unsupportedIterableToArray$u(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$u(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$u(r, a) : void 0; } }
7324
+ function _arrayLikeToArray$u(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
7090
7325
  var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
7091
7326
  var _state$selectedDashbo, _state$selectedDashbo2;
7092
7327
  var state = _ref.state,
@@ -7206,7 +7441,7 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
7206
7441
 
7207
7442
  // --- Create logic (DASH-191: moved above useEffect so ref captures actual function) ---
7208
7443
  var handleCreate = React.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
7209
- var _state$customization, name, menuId, theme, result, _window$mainApi, installResult, updatedWorkspace, _window$mainApi2, _window$mainApi3, template, installedList, installedNames, _iterator, _step, widget, scopedId, resolvedUrl, layoutObj, widgetOrder, cells, widgetItems, nextId, _loop, i, fullLayout, workspace, _t, _t2, _t3;
7444
+ var _state$customization, name, menuId, theme, result, _window$mainApi, installResult, _window$mainApi2, _window$mainApi3, template, installedList, installedNames, _iterator, _step, widget, scopedId, resolvedUrl, layoutObj, widgetOrder, cells, widgetItems, nextId, _loop, i, fullLayout, workspace, _t, _t2, _t3;
7210
7445
  return _regeneratorRuntime.wrap(function (_context2) {
7211
7446
  while (1) switch (_context2.prev = _context2.next) {
7212
7447
  case 0:
@@ -7216,7 +7451,7 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
7216
7451
  _context2.prev = 1;
7217
7452
  _state$customization = state.customization, name = _state$customization.name, menuId = _state$customization.menuId, theme = _state$customization.theme;
7218
7453
  if (!(isPrebuilt && state.selectedDashboard)) {
7219
- _context2.next = 9;
7454
+ _context2.next = 8;
7220
7455
  break;
7221
7456
  }
7222
7457
  if (!onInstallDashboard) {
@@ -7233,15 +7468,19 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
7233
7468
  });
7234
7469
  case 2:
7235
7470
  result = _context2.sent;
7236
- _context2.next = 8;
7471
+ _context2.next = 7;
7237
7472
  break;
7238
7473
  case 3:
7239
7474
  if (!((_window$mainApi = window.mainApi) !== null && _window$mainApi !== void 0 && (_window$mainApi = _window$mainApi.dashboardConfig) !== null && _window$mainApi !== void 0 && _window$mainApi.installDashboardFromRegistry)) {
7240
- _context2.next = 8;
7475
+ _context2.next = 7;
7241
7476
  break;
7242
7477
  }
7243
7478
  _context2.next = 4;
7244
- return window.mainApi.dashboardConfig.installDashboardFromRegistry(appId, state.selectedDashboard.name || state.selectedDashboard.key);
7479
+ return window.mainApi.dashboardConfig.installDashboardFromRegistry(appId, state.selectedDashboard.name || state.selectedDashboard.key, {
7480
+ name: name.trim(),
7481
+ menuId: menuId || 1,
7482
+ themeKey: theme
7483
+ });
7245
7484
  case 4:
7246
7485
  installResult = _context2.sent;
7247
7486
  if (!(installResult !== null && installResult !== void 0 && installResult.authRequired)) {
@@ -7253,103 +7492,95 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
7253
7492
  return _context2.abrupt("return");
7254
7493
  case 5:
7255
7494
  if (!(installResult !== null && installResult !== void 0 && installResult.workspace)) {
7256
- _context2.next = 7;
7495
+ _context2.next = 6;
7257
7496
  break;
7258
7497
  }
7259
- updatedWorkspace = _objectSpread$V(_objectSpread$V({}, installResult.workspace), {}, {
7260
- name: name.trim(),
7261
- menuId: menuId || 1,
7262
- themeKey: theme
7263
- });
7264
- _context2.next = 6;
7265
- return window.mainApi.workspace.saveWorkspaceForApplication(appId, updatedWorkspace);
7266
- case 6:
7267
7498
  result = {
7268
7499
  success: true,
7269
- workspace: updatedWorkspace
7500
+ workspace: installResult.workspace
7270
7501
  };
7271
- _context2.next = 8;
7502
+ _context2.next = 7;
7272
7503
  break;
7273
- case 7:
7504
+ case 6:
7274
7505
  if (!(installResult !== null && installResult !== void 0 && installResult.error)) {
7275
- _context2.next = 8;
7506
+ _context2.next = 7;
7276
7507
  break;
7277
7508
  }
7278
7509
  throw new Error(installResult.error);
7279
- case 8:
7280
- _context2.next = 27;
7510
+ case 7:
7511
+ _context2.next = 26;
7281
7512
  break;
7282
- case 9:
7513
+ case 8:
7283
7514
  // Build-your-own path: create layout from template + place widgets
7284
7515
  template = layoutTemplates.find(function (t) {
7285
7516
  return t.id === state.layout.templateKey;
7286
7517
  });
7287
7518
  if (template) {
7288
- _context2.next = 10;
7519
+ _context2.next = 9;
7289
7520
  break;
7290
7521
  }
7291
7522
  throw new Error("No layout template selected.");
7292
- case 10:
7523
+ case 9:
7293
7524
  if (!((_window$mainApi2 = window.mainApi) !== null && _window$mainApi2 !== void 0 && _window$mainApi2.widgets)) {
7294
- _context2.next = 20;
7525
+ _context2.next = 19;
7295
7526
  break;
7296
7527
  }
7297
- _context2.next = 11;
7528
+ _context2.next = 10;
7298
7529
  return window.mainApi.widgets.list();
7299
- case 11:
7530
+ case 10:
7300
7531
  _t = _context2.sent;
7301
7532
  if (_t) {
7302
- _context2.next = 12;
7533
+ _context2.next = 11;
7303
7534
  break;
7304
7535
  }
7305
7536
  _t = [];
7306
- case 12:
7537
+ case 11:
7307
7538
  installedList = _t;
7308
7539
  installedNames = new Set(installedList.map(function (w) {
7309
7540
  return w.name;
7310
7541
  }));
7311
- _iterator = _createForOfIteratorHelper$t(state.selectedWidgets);
7312
- _context2.prev = 13;
7542
+ _iterator = _createForOfIteratorHelper$u(state.selectedWidgets);
7543
+ _context2.prev = 12;
7313
7544
  _iterator.s();
7314
- case 14:
7545
+ case 13:
7315
7546
  if ((_step = _iterator.n()).done) {
7316
- _context2.next = 17;
7547
+ _context2.next = 16;
7317
7548
  break;
7318
7549
  }
7319
7550
  widget = _step.value;
7320
7551
  if (widget.isRegistry) {
7321
- _context2.next = 15;
7552
+ _context2.next = 14;
7322
7553
  break;
7323
7554
  }
7324
- return _context2.abrupt("continue", 16);
7325
- case 15:
7555
+ return _context2.abrupt("continue", 15);
7556
+ case 14:
7326
7557
  scopedId = widget.packageScope ? "@".concat(widget.packageScope.replace(/^@/, ""), "/").concat(widget.packageName) : widget.packageName;
7327
7558
  if (!(!installedNames.has(scopedId) && !installedNames.has(widget.packageName))) {
7328
- _context2.next = 16;
7559
+ _context2.next = 15;
7329
7560
  break;
7330
7561
  }
7331
7562
  resolvedUrl = (widget.downloadUrl || "").replace(/\{version\}/g, widget.packageVersion || "").replace(/\{name\}/g, widget.packageName || "");
7332
7563
  if (!resolvedUrl) {
7333
- _context2.next = 16;
7564
+ _context2.next = 15;
7334
7565
  break;
7335
7566
  }
7336
- _context2.next = 16;
7567
+ _context2.next = 15;
7337
7568
  return window.mainApi.widgets.install(scopedId, resolvedUrl);
7569
+ case 15:
7570
+ _context2.next = 13;
7571
+ break;
7338
7572
  case 16:
7339
- _context2.next = 14;
7573
+ _context2.next = 18;
7340
7574
  break;
7341
7575
  case 17:
7342
- _context2.next = 19;
7343
- break;
7576
+ _context2.prev = 17;
7577
+ _t2 = _context2["catch"](12);
7578
+ _iterator.e(_t2);
7344
7579
  case 18:
7345
7580
  _context2.prev = 18;
7346
- _t2 = _context2["catch"](13);
7347
- _iterator.e(_t2);
7348
- case 19:
7349
- _context2.prev = 19;
7350
7581
  _iterator.f();
7351
- return _context2.finish(19);
7352
- case 20:
7582
+ return _context2.finish(18);
7583
+ case 19:
7353
7584
  layoutObj = createLayoutFromTemplate(template, menuId || 1); // Place widgets into grid cells as proper layout items
7354
7585
  widgetOrder = state.layout.widgetOrder || [];
7355
7586
  cells = template.cells.filter(function (c) {
@@ -7386,31 +7617,31 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
7386
7617
  }, _loop);
7387
7618
  });
7388
7619
  i = 0;
7389
- case 21:
7620
+ case 20:
7390
7621
  if (!(i < widgetOrder.length && i < cells.length)) {
7391
- _context2.next = 23;
7622
+ _context2.next = 22;
7392
7623
  break;
7393
7624
  }
7394
- return _context2.delegateYield(_loop(i), "t0", 22);
7395
- case 22:
7625
+ return _context2.delegateYield(_loop(i), "t0", 21);
7626
+ case 21:
7396
7627
  i++;
7397
- _context2.next = 21;
7628
+ _context2.next = 20;
7398
7629
  break;
7399
- case 23:
7630
+ case 22:
7400
7631
  fullLayout = [layoutObj].concat(widgetItems);
7401
7632
  if (!onCreateWorkspace) {
7402
- _context2.next = 25;
7633
+ _context2.next = 24;
7403
7634
  break;
7404
7635
  }
7405
- _context2.next = 24;
7636
+ _context2.next = 23;
7406
7637
  return onCreateWorkspace(fullLayout, theme, name.trim());
7407
- case 24:
7638
+ case 23:
7408
7639
  result = _context2.sent;
7409
- _context2.next = 27;
7640
+ _context2.next = 26;
7410
7641
  break;
7411
- case 25:
7642
+ case 24:
7412
7643
  if (!((_window$mainApi3 = window.mainApi) !== null && _window$mainApi3 !== void 0 && (_window$mainApi3 = _window$mainApi3.workspace) !== null && _window$mainApi3 !== void 0 && _window$mainApi3.saveWorkspaceForApplication)) {
7413
- _context2.next = 27;
7644
+ _context2.next = 26;
7414
7645
  break;
7415
7646
  }
7416
7647
  workspace = {
@@ -7419,43 +7650,48 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
7419
7650
  themeKey: theme,
7420
7651
  layout: fullLayout
7421
7652
  };
7422
- _context2.next = 26;
7653
+ _context2.next = 25;
7423
7654
  return window.mainApi.workspace.saveWorkspaceForApplication(appId, workspace);
7424
- case 26:
7655
+ case 25:
7425
7656
  result = {
7426
7657
  success: true,
7427
7658
  workspace: workspace
7428
7659
  };
7429
- case 27:
7660
+ case 26:
7430
7661
  if (result) {
7431
7662
  setCreatedDashboard(result.workspace || result);
7432
7663
  }
7433
- _context2.next = 29;
7664
+ _context2.next = 28;
7434
7665
  break;
7435
- case 28:
7436
- _context2.prev = 28;
7666
+ case 27:
7667
+ _context2.prev = 27;
7437
7668
  _t3 = _context2["catch"](1);
7438
7669
  setError(_t3.message || "Failed to create dashboard.");
7439
- case 29:
7440
- _context2.prev = 29;
7670
+ case 28:
7671
+ _context2.prev = 28;
7441
7672
  setCreating(false);
7442
- return _context2.finish(29);
7443
- case 30:
7673
+ return _context2.finish(28);
7674
+ case 29:
7444
7675
  case "end":
7445
7676
  return _context2.stop();
7446
7677
  }
7447
- }, _callee, null, [[1, 28, 29, 30], [13, 18, 19, 20]]);
7678
+ }, _callee, null, [[1, 27, 28, 29], [12, 17, 18, 19]]);
7448
7679
  })), [state, isPrebuilt, onInstallDashboard, onCreateWorkspace, appId]);
7449
7680
 
7450
- // Expose handleCreate and creating state to parent via ref (DASH-183)
7681
+ // Expose handleCreate, creating, and createdDashboard state to parent
7682
+ // via ref (DASH-183). The parent uses `createdDashboard` to swap the
7683
+ // footer "Create Dashboard" button out once the success state is
7684
+ // rendered — otherwise the user could accidentally re-fire the
7685
+ // install.
7451
7686
  React.useEffect(function () {
7452
7687
  if (createHandlerRef) {
7453
7688
  createHandlerRef.current = {
7454
7689
  handleCreate: handleCreate,
7455
- creating: creating
7690
+ creating: creating,
7691
+ createdDashboard: createdDashboard
7456
7692
  };
7457
7693
  }
7458
- }, [createHandlerRef, handleCreate, creating]);
7694
+ }, [createHandlerRef, handleCreate, creating, createdDashboard]);
7459
7695
  var handleNameChange = React.useCallback(function (val) {
7460
7696
  dispatch({
7461
7697
  type: "SET_CUSTOMIZATION",
@@ -8220,7 +8456,7 @@ var STEP_LABELS = [{
8220
8456
  * Resets wizard state cleanly on close.
8221
8457
  */
8222
8458
  var DashboardWizardModal = function DashboardWizardModal(_ref) {
8223
- var _createHandlerRef$cur, _createHandlerRef$cur2;
8459
+ var _createHandlerRef$cur, _createHandlerRef$cur2, _createHandlerRef$cur3;
8224
8460
  var open = _ref.open,
8225
8461
  setIsOpen = _ref.setIsOpen,
8226
8462
  _ref$menuItems = _ref.menuItems,
@@ -8267,6 +8503,7 @@ var DashboardWizardModal = function DashboardWizardModal(_ref) {
8267
8503
  }, [canProceed, nextStep]);
8268
8504
  var isLastStep = state.step === 1;
8269
8505
  var isCreating = (_createHandlerRef$cur = (_createHandlerRef$cur2 = createHandlerRef.current) === null || _createHandlerRef$cur2 === void 0 ? void 0 : _createHandlerRef$cur2.creating) !== null && _createHandlerRef$cur !== void 0 ? _createHandlerRef$cur : false;
8506
+ var isCreated = !!((_createHandlerRef$cur3 = createHandlerRef.current) !== null && _createHandlerRef$cur3 !== void 0 && _createHandlerRef$cur3.createdDashboard);
8270
8507
  var canCreate = canProceed && !isCreating;
8271
8508
  return /*#__PURE__*/jsxRuntime.jsx(DashReact.Modal, {
8272
8509
  isOpen: open,
@@ -8336,7 +8573,7 @@ var DashboardWizardModal = function DashboardWizardModal(_ref) {
8336
8573
  })
8337
8574
  })
8338
8575
  })]
8339
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
8576
+ }), !isCreated && /*#__PURE__*/jsxRuntime.jsxs("div", {
8340
8577
  className: "flex flex-row justify-between items-center pt-4 mt-4 border-t border-gray-700/50",
8341
8578
  children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
8342
8579
  onClick: state.step === 0 ? handleClose : prevStep,
@@ -8352,8 +8589,8 @@ var DashboardWizardModal = function DashboardWizardModal(_ref) {
8352
8589
  children: ["Step ", state.step + 1, " of ", STEP_LABELS.length]
8353
8590
  }), isLastStep ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
8354
8591
  onClick: function onClick() {
8355
- var _createHandlerRef$cur3, _createHandlerRef$cur4;
8356
- return (_createHandlerRef$cur3 = createHandlerRef.current) === null || _createHandlerRef$cur3 === void 0 || (_createHandlerRef$cur4 = _createHandlerRef$cur3.handleCreate) === null || _createHandlerRef$cur4 === void 0 ? void 0 : _createHandlerRef$cur4.call(_createHandlerRef$cur3);
8592
+ var _createHandlerRef$cur4, _createHandlerRef$cur5;
8593
+ return (_createHandlerRef$cur4 = createHandlerRef.current) === null || _createHandlerRef$cur4 === void 0 || (_createHandlerRef$cur5 = _createHandlerRef$cur4.handleCreate) === null || _createHandlerRef$cur5 === void 0 ? void 0 : _createHandlerRef$cur5.call(_createHandlerRef$cur4);
8357
8594
  },
8358
8595
  title: isCreating ? "Creating..." : "Create Dashboard",
8359
8596
  textSize: "text-sm",
@@ -12996,9 +13233,9 @@ var PanelEditItem = function PanelEditItem(_ref) {
12996
13233
  };
12997
13234
 
12998
13235
  var _excluded$6 = ["rows", "cols"];
12999
- function _createForOfIteratorHelper$s(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$s(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
13000
- function _unsupportedIterableToArray$s(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$s(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$s(r, a) : void 0; } }
13001
- function _arrayLikeToArray$s(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13236
+ function _createForOfIteratorHelper$t(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$t(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
13237
+ function _unsupportedIterableToArray$t(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$t(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$t(r, a) : void 0; } }
13238
+ function _arrayLikeToArray$t(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13002
13239
  function ownKeys$T(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13003
13240
  function _objectSpread$T(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$T(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$T(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13004
13241
  var defaultGrid = {
@@ -13151,7 +13388,7 @@ function GridEditor(_ref) {
13151
13388
  function sortObjectByKeys(obj) {
13152
13389
  var sortedKeys = Object.keys(obj).sort();
13153
13390
  var sortedObj = {};
13154
- var _iterator = _createForOfIteratorHelper$s(sortedKeys),
13391
+ var _iterator = _createForOfIteratorHelper$t(sortedKeys),
13155
13392
  _step;
13156
13393
  try {
13157
13394
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -13624,9 +13861,9 @@ var PanelEditItemNotifications = function PanelEditItemNotifications(_ref) {
13624
13861
  });
13625
13862
  };
13626
13863
 
13627
- function _createForOfIteratorHelper$r(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$r(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
13628
- function _unsupportedIterableToArray$r(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$r(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$r(r, a) : void 0; } }
13629
- function _arrayLikeToArray$r(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13864
+ function _createForOfIteratorHelper$s(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$s(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
13865
+ function _unsupportedIterableToArray$s(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$s(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$s(r, a) : void 0; } }
13866
+ function _arrayLikeToArray$s(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13630
13867
  function ownKeys$R(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13631
13868
  function _objectSpread$R(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$R(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$R(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13632
13869
  var DAYS = [{
@@ -13955,7 +14192,7 @@ var PanelEditItemSchedule = function PanelEditItemSchedule(_ref2) {
13955
14192
  setIsLoading(true);
13956
14193
  window.mainApi.scheduler.getTasks(widgetUuid).then(function (tasks) {
13957
14194
  var stateMap = {};
13958
- var _iterator = _createForOfIteratorHelper$r(tasks || []),
14195
+ var _iterator = _createForOfIteratorHelper$s(tasks || []),
13959
14196
  _step;
13960
14197
  try {
13961
14198
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -14189,7 +14426,7 @@ function belongsToWorkspace(item, workspace) {
14189
14426
  if (itemDashId === undefined || itemDashId === null) return false;
14190
14427
  return String(itemDashId) === String(wsId);
14191
14428
  }
14192
- var FRAMEWORK_CONTAINER_COMPONENTS = new Set(["LayoutGridContainer", "Container", "LayoutContainer"]);
14429
+ var FRAMEWORK_CONTAINER_COMPONENTS$1 = new Set(["LayoutGridContainer", "Container", "LayoutContainer"]);
14193
14430
 
14194
14431
  /**
14195
14432
  * Is this layout item a USER widget (i.e. something the user added
@@ -14210,13 +14447,13 @@ var FRAMEWORK_CONTAINER_COMPONENTS = new Set(["LayoutGridContainer", "Container"
14210
14447
  */
14211
14448
  function isUserWidget(item) {
14212
14449
  if (!item || _typeof(item) !== "object" || !item.component) return false;
14213
- if (FRAMEWORK_CONTAINER_COMPONENTS.has(item.component)) return false;
14450
+ if (FRAMEWORK_CONTAINER_COMPONENTS$1.has(item.component)) return false;
14214
14451
  return true;
14215
14452
  }
14216
14453
 
14217
- function _createForOfIteratorHelper$q(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$q(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
14218
- function _unsupportedIterableToArray$q(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$q(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$q(r, a) : void 0; } }
14219
- function _arrayLikeToArray$q(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14454
+ function _createForOfIteratorHelper$r(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$r(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
14455
+ function _unsupportedIterableToArray$r(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$r(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$r(r, a) : void 0; } }
14456
+ function _arrayLikeToArray$r(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14220
14457
 
14221
14458
  /**
14222
14459
  * Resolve which provider name a given widget instance would bind to for
@@ -14248,7 +14485,7 @@ function resolveProviderName(_ref) {
14248
14485
  // array. Support both because different callers shape it either way.
14249
14486
  if (appProviders) {
14250
14487
  if (Array.isArray(appProviders)) {
14251
- var _iterator = _createForOfIteratorHelper$q(appProviders),
14488
+ var _iterator = _createForOfIteratorHelper$r(appProviders),
14252
14489
  _step;
14253
14490
  try {
14254
14491
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -14308,7 +14545,7 @@ function forEachWidget(workspace, visit) {
14308
14545
  };
14309
14546
  var _walk = function walk(items) {
14310
14547
  if (!Array.isArray(items)) return;
14311
- var _iterator2 = _createForOfIteratorHelper$q(items),
14548
+ var _iterator2 = _createForOfIteratorHelper$r(items),
14312
14549
  _step2;
14313
14550
  try {
14314
14551
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -14338,7 +14575,7 @@ function forEachWidget(workspace, visit) {
14338
14575
  };
14339
14576
  _walk(workspace.layout);
14340
14577
  if (Array.isArray(workspace.pages)) {
14341
- var _iterator3 = _createForOfIteratorHelper$q(workspace.pages),
14578
+ var _iterator3 = _createForOfIteratorHelper$r(workspace.pages),
14342
14579
  _step3;
14343
14580
  try {
14344
14581
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -14382,7 +14619,7 @@ function getUnresolvedProviders(_ref2) {
14382
14619
  var requirements = getWidgetRequirements(item.component) || [];
14383
14620
  if (!Array.isArray(requirements) || requirements.length === 0) return;
14384
14621
  var widgetId = item.uuidString || item.uuid || item.id || null;
14385
- var _iterator4 = _createForOfIteratorHelper$q(requirements),
14622
+ var _iterator4 = _createForOfIteratorHelper$r(requirements),
14386
14623
  _step4;
14387
14624
  try {
14388
14625
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
@@ -14423,7 +14660,7 @@ function getUnresolvedProviders(_ref2) {
14423
14660
  */
14424
14661
  function groupByProviderType(unresolved) {
14425
14662
  var byType = new Map();
14426
- var _iterator5 = _createForOfIteratorHelper$q(unresolved || []),
14663
+ var _iterator5 = _createForOfIteratorHelper$r(unresolved || []),
14427
14664
  _step5;
14428
14665
  try {
14429
14666
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
@@ -14459,7 +14696,7 @@ function getAllProviderBindings(_ref3) {
14459
14696
  var requirements = getWidgetRequirements(item.component) || [];
14460
14697
  if (!Array.isArray(requirements) || requirements.length === 0) return;
14461
14698
  var widgetId = item.uuidString || item.uuid || item.id || null;
14462
- var _iterator6 = _createForOfIteratorHelper$q(requirements),
14699
+ var _iterator6 = _createForOfIteratorHelper$r(requirements),
14463
14700
  _step6;
14464
14701
  try {
14465
14702
  for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
@@ -14499,9 +14736,9 @@ function getAllProviderBindings(_ref3) {
14499
14736
 
14500
14737
  function ownKeys$P(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14501
14738
  function _objectSpread$P(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$P(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$P(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14502
- function _createForOfIteratorHelper$p(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$p(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
14503
- function _unsupportedIterableToArray$p(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$p(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$p(r, a) : void 0; } }
14504
- function _arrayLikeToArray$p(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14739
+ function _createForOfIteratorHelper$q(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$q(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
14740
+ function _unsupportedIterableToArray$q(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$q(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$q(r, a) : void 0; } }
14741
+ function _arrayLikeToArray$q(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14505
14742
  var EVENT_STRING_RE = /^([^[]+)\[([^\]]+)\]\.(.+)$/;
14506
14743
 
14507
14744
  /** Parse "Component[itemId].event" → { component, itemId, event }. */
@@ -14671,7 +14908,7 @@ function getCurrentWiring(workspace) {
14671
14908
  // Live format is array; defensive guard for legacy object
14672
14909
  // form (a single source widget keyed under the handler).
14673
14910
  var events = Array.isArray(eventList) ? eventList : typeof eventList === "string" ? [eventList] : [];
14674
- var _iterator = _createForOfIteratorHelper$p(events),
14911
+ var _iterator = _createForOfIteratorHelper$q(events),
14675
14912
  _step;
14676
14913
  try {
14677
14914
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -14734,7 +14971,7 @@ function getOrphanedListeners(workspace, getWidgetConfig) {
14734
14971
  if (!byItemId.has(id)) byItemId.set(id, meta);
14735
14972
  });
14736
14973
  var orphans = [];
14737
- var _iterator2 = _createForOfIteratorHelper$p(wiring),
14974
+ var _iterator2 = _createForOfIteratorHelper$q(wiring),
14738
14975
  _step2;
14739
14976
  try {
14740
14977
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -14800,7 +15037,7 @@ function pruneDeadListenerReferences(workspace) {
14800
15037
  var liveKeys = new Set();
14801
15038
  var _walkForLive = function walkForLive(items) {
14802
15039
  if (!Array.isArray(items)) return;
14803
- var _iterator3 = _createForOfIteratorHelper$p(items),
15040
+ var _iterator3 = _createForOfIteratorHelper$q(items),
14804
15041
  _step3;
14805
15042
  try {
14806
15043
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -14821,7 +15058,7 @@ function pruneDeadListenerReferences(workspace) {
14821
15058
  };
14822
15059
  _walkForLive(workspace.layout);
14823
15060
  if (Array.isArray(workspace.pages)) {
14824
- var _iterator4 = _createForOfIteratorHelper$p(workspace.pages),
15061
+ var _iterator4 = _createForOfIteratorHelper$q(workspace.pages),
14825
15062
  _step4;
14826
15063
  try {
14827
15064
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
@@ -14838,7 +15075,7 @@ function pruneDeadListenerReferences(workspace) {
14838
15075
  var removed = 0;
14839
15076
  var _pruneListeners = function pruneListeners(items) {
14840
15077
  if (!Array.isArray(items)) return;
14841
- var _iterator5 = _createForOfIteratorHelper$p(items),
15078
+ var _iterator5 = _createForOfIteratorHelper$q(items),
14842
15079
  _step5;
14843
15080
  try {
14844
15081
  for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
@@ -14850,7 +15087,7 @@ function pruneDeadListenerReferences(workspace) {
14850
15087
  var events = item.listeners[handler];
14851
15088
  if (!Array.isArray(events)) continue;
14852
15089
  var kept = [];
14853
- var _iterator6 = _createForOfIteratorHelper$p(events),
15090
+ var _iterator6 = _createForOfIteratorHelper$q(events),
14854
15091
  _step6;
14855
15092
  try {
14856
15093
  for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
@@ -14885,7 +15122,7 @@ function pruneDeadListenerReferences(workspace) {
14885
15122
  };
14886
15123
  _pruneListeners(workspace.layout);
14887
15124
  if (Array.isArray(workspace.pages)) {
14888
- var _iterator7 = _createForOfIteratorHelper$p(workspace.pages),
15125
+ var _iterator7 = _createForOfIteratorHelper$q(workspace.pages),
14889
15126
  _step7;
14890
15127
  try {
14891
15128
  for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
@@ -14929,7 +15166,7 @@ function applyWiringChanges(workspace, _ref) {
14929
15166
  });
14930
15167
  return byReceiver.get(id);
14931
15168
  };
14932
- var _iterator8 = _createForOfIteratorHelper$p(adds),
15169
+ var _iterator8 = _createForOfIteratorHelper$q(adds),
14933
15170
  _step8;
14934
15171
  try {
14935
15172
  for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
@@ -14942,7 +15179,7 @@ function applyWiringChanges(workspace, _ref) {
14942
15179
  } finally {
14943
15180
  _iterator8.f();
14944
15181
  }
14945
- var _iterator9 = _createForOfIteratorHelper$p(removes),
15182
+ var _iterator9 = _createForOfIteratorHelper$q(removes),
14946
15183
  _step9;
14947
15184
  try {
14948
15185
  for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
@@ -15016,7 +15253,7 @@ function applyToItem(listeners, _ref2) {
15016
15253
  }
15017
15254
 
15018
15255
  // Removes first so a re-add (rare) lands.
15019
- var _iterator0 = _createForOfIteratorHelper$p(removes),
15256
+ var _iterator0 = _createForOfIteratorHelper$q(removes),
15020
15257
  _step0;
15021
15258
  try {
15022
15259
  var _loop = function _loop() {
@@ -15045,7 +15282,7 @@ function applyToItem(listeners, _ref2) {
15045
15282
  } finally {
15046
15283
  _iterator0.f();
15047
15284
  }
15048
- var _iterator1 = _createForOfIteratorHelper$p(adds),
15285
+ var _iterator1 = _createForOfIteratorHelper$q(adds),
15049
15286
  _step1;
15050
15287
  try {
15051
15288
  for (_iterator1.s(); !(_step1 = _iterator1.n()).done;) {
@@ -17992,9 +18229,9 @@ function mcpJsonToFormState(jsonString, nextRowId) {
17992
18229
  return result;
17993
18230
  }
17994
18231
 
17995
- function _createForOfIteratorHelper$o(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$o(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
17996
- function _unsupportedIterableToArray$o(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$o(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$o(r, a) : void 0; } }
17997
- function _arrayLikeToArray$o(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
18232
+ function _createForOfIteratorHelper$p(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$p(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
18233
+ function _unsupportedIterableToArray$p(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$p(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$p(r, a) : void 0; } }
18234
+ function _arrayLikeToArray$p(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
17998
18235
  function ownKeys$L(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17999
18236
  function _objectSpread$L(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$L(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$L(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18000
18237
  var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
@@ -18279,11 +18516,11 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
18279
18516
 
18280
18517
  // Flatten all widgets from all packages for the widget list
18281
18518
  flatWidgets = [];
18282
- _iterator = _createForOfIteratorHelper$o(result.packages || []);
18519
+ _iterator = _createForOfIteratorHelper$p(result.packages || []);
18283
18520
  try {
18284
18521
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
18285
18522
  pkg = _step.value;
18286
- _iterator2 = _createForOfIteratorHelper$o(pkg.widgets || []);
18523
+ _iterator2 = _createForOfIteratorHelper$p(pkg.widgets || []);
18287
18524
  try {
18288
18525
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
18289
18526
  widget = _step2.value;
@@ -20177,9 +20414,9 @@ var useWidgetSchedulerStatus = function useWidgetSchedulerStatus(widgetId) {
20177
20414
  };
20178
20415
  };
20179
20416
 
20180
- function _createForOfIteratorHelper$n(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$n(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
20181
- function _unsupportedIterableToArray$n(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$n(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$n(r, a) : void 0; } }
20182
- function _arrayLikeToArray$n(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
20417
+ function _createForOfIteratorHelper$o(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$o(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
20418
+ function _unsupportedIterableToArray$o(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$o(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$o(r, a) : void 0; } }
20419
+ function _arrayLikeToArray$o(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
20183
20420
  function formatCountdown(ms) {
20184
20421
  if (ms == null || ms < 0) return "--";
20185
20422
  if (ms < 1000) return "< 1s";
@@ -20296,7 +20533,7 @@ var WidgetCardStatusBar = function WidgetCardStatusBar(_ref) {
20296
20533
 
20297
20534
  // Find soonest countdown among enabled tasks
20298
20535
  var soonestMs = null;
20299
- var _iterator = _createForOfIteratorHelper$n(enabledTasks),
20536
+ var _iterator = _createForOfIteratorHelper$o(enabledTasks),
20300
20537
  _step;
20301
20538
  try {
20302
20539
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -25553,9 +25790,9 @@ var ExternalWidget = function ExternalWidget(_ref) {
25553
25790
  var GRID_CELL_WIDGET_TYPE = "grid-cell-widget";
25554
25791
  var SIDEBAR_WIDGET_TYPE = "sidebar-widget";
25555
25792
 
25556
- function _createForOfIteratorHelper$m(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$m(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
25557
- function _unsupportedIterableToArray$m(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$m(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$m(r, a) : void 0; } }
25558
- function _arrayLikeToArray$m(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
25793
+ function _createForOfIteratorHelper$n(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$n(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
25794
+ function _unsupportedIterableToArray$n(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$n(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$n(r, a) : void 0; } }
25795
+ function _arrayLikeToArray$n(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
25559
25796
  function ownKeys$E(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25560
25797
  function _objectSpread$E(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$E(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$E(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
25561
25798
 
@@ -26178,7 +26415,7 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
26178
26415
  return selectable["delete"](cn);
26179
26416
  });
26180
26417
  var resolved = new Set();
26181
- var _iterator = _createForOfIteratorHelper$m(selectable),
26418
+ var _iterator = _createForOfIteratorHelper$n(selectable),
26182
26419
  _step;
26183
26420
  try {
26184
26421
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -28587,9 +28824,9 @@ function migrateBareComponentName(componentMap, component) {
28587
28824
 
28588
28825
  function ownKeys$C(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
28589
28826
  function _objectSpread$C(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$C(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$C(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
28590
- function _createForOfIteratorHelper$l(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$l(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
28591
- function _unsupportedIterableToArray$l(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$l(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$l(r, a) : void 0; } }
28592
- function _arrayLikeToArray$l(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
28827
+ function _createForOfIteratorHelper$m(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$m(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
28828
+ function _unsupportedIterableToArray$m(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$m(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$m(r, a) : void 0; } }
28829
+ function _arrayLikeToArray$m(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
28593
28830
  /**
28594
28831
  * The model for all layout components used primarily in the renderLayout method
28595
28832
  * @param {Object} layoutItem an object containing various attributes of the layout item
@@ -28601,7 +28838,7 @@ function _arrayLikeToArray$l(r, a) { (null == a || a > r.length) && (a = r.lengt
28601
28838
  function sortObjectByKeys(obj) {
28602
28839
  var sortedKeys = Object.keys(obj).sort();
28603
28840
  var sortedObj = {};
28604
- var _iterator = _createForOfIteratorHelper$l(sortedKeys),
28841
+ var _iterator = _createForOfIteratorHelper$m(sortedKeys),
28605
28842
  _step;
28606
28843
  try {
28607
28844
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -28684,16 +28921,34 @@ var LayoutModel = function LayoutModel(layoutItem, workspaceLayout, dashboardId)
28684
28921
  /**
28685
28922
  * @param {Boolean} canHaveChildren if the layout item can have children (if widget - cannot!)
28686
28923
  */
28687
- layout.canHaveChildren = "canHaveChildren" in obj ? obj.canHaveChildren !== undefined ? obj.canHaveChildren : obj.type !== "widget" : true;
28924
+ // Containers can have children; widgets cannot. Defaults derived
28925
+ // from component name so a pre-v0.1.444 layout item without an
28926
+ // explicit `canHaveChildren` field still classifies correctly.
28927
+ var isContainerComponent = obj.component === "LayoutGridContainer" || obj.component === "Container" || obj.component === "LayoutContainer";
28928
+ layout.canHaveChildren = "canHaveChildren" in obj ? obj.canHaveChildren !== undefined ? obj.canHaveChildren : isContainerComponent : isContainerComponent;
28688
28929
  layout.width = "width" in obj ? obj.width : "w-full";
28689
28930
  layout.height = "height" in obj ? obj.height : "h-full";
28690
28931
  layout.parent = "parent" in obj ? obj.parent : 0;
28691
28932
 
28692
28933
  /**
28693
28934
  * @param {String} type The type of the component (widget|grid|workspace|layout)
28694
- * Note: "grid" is the new primary container type, "layout"/"workspace" are deprecated
28935
+ *
28936
+ * Default is "widget" because users only ever ADD widgets via the
28937
+ * sidebar / drag-drop. Framework chrome (LayoutGridContainer,
28938
+ * Container, etc.) is created by the framework itself and ALWAYS
28939
+ * sets `type` explicitly. Defaulting to "widget" means user data
28940
+ * persisted without an explicit type is correctly typed as a widget
28941
+ * by every consumer (widgets list, listener filter, validation).
28942
+ *
28943
+ * Pre-v0.1.444 the default was "layout", which silently mistyped
28944
+ * thousands of widget instances and broke the WidgetsTab list
28945
+ * filter. The bare-component fallback of `obj.type ||
28946
+ * (FRAMEWORK_CONTAINERS.has(obj.component) ? "layout" : "widget")`
28947
+ * is a defensive snap-back: if a framework container was
28948
+ * persisted without a type, force the right one rather than
28949
+ * trust the new default.
28695
28950
  */
28696
- layout.type = "type" in obj ? obj.type : "layout";
28951
+ layout.type = "type" in obj ? obj.type : obj.component === "LayoutGridContainer" ? "grid" : obj.component === "Container" || obj.component === "LayoutContainer" ? "layout" : "widget";
28697
28952
 
28698
28953
  /**
28699
28954
  * @param {String} workspace The name of the Workspace the component belongs to (can exist in as a child)
@@ -28895,9 +29150,9 @@ var SettingsModel = function SettingsModel() {
28895
29150
  return obj;
28896
29151
  };
28897
29152
 
28898
- function _createForOfIteratorHelper$k(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$k(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
28899
- function _unsupportedIterableToArray$k(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$k(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$k(r, a) : void 0; } }
28900
- function _arrayLikeToArray$k(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
29153
+ function _createForOfIteratorHelper$l(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$l(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
29154
+ function _unsupportedIterableToArray$l(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$l(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$l(r, a) : void 0; } }
29155
+ function _arrayLikeToArray$l(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
28901
29156
 
28902
29157
  /**
28903
29158
  * Workspace-level pre-pass that migrates legacy bare component
@@ -28972,7 +29227,7 @@ function migrateScopedIdsInWorkspace(workspace, componentMap) {
28972
29227
  };
28973
29228
  var _walk = function walk(items) {
28974
29229
  if (!Array.isArray(items)) return;
28975
- var _iterator = _createForOfIteratorHelper$k(items),
29230
+ var _iterator = _createForOfIteratorHelper$l(items),
28976
29231
  _step;
28977
29232
  try {
28978
29233
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -28994,7 +29249,7 @@ function migrateScopedIdsInWorkspace(workspace, componentMap) {
28994
29249
  };
28995
29250
  _walk(workspace.layout);
28996
29251
  if (Array.isArray(workspace.pages)) {
28997
- var _iterator2 = _createForOfIteratorHelper$k(workspace.pages),
29252
+ var _iterator2 = _createForOfIteratorHelper$l(workspace.pages),
28998
29253
  _step2;
28999
29254
  try {
29000
29255
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -29011,9 +29266,9 @@ function migrateScopedIdsInWorkspace(workspace, componentMap) {
29011
29266
  return counts;
29012
29267
  }
29013
29268
 
29014
- function _createForOfIteratorHelper$j(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$j(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
29015
- function _unsupportedIterableToArray$j(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$j(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$j(r, a) : void 0; } }
29016
- function _arrayLikeToArray$j(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
29269
+ function _createForOfIteratorHelper$k(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$k(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
29270
+ function _unsupportedIterableToArray$k(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$k(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$k(r, a) : void 0; } }
29271
+ function _arrayLikeToArray$k(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
29017
29272
  /**
29018
29273
  * cleanForeignWidgetsFromWorkspace.js
29019
29274
  *
@@ -29054,7 +29309,7 @@ function cleanForeignWidgetsFromWorkspace(workspace) {
29054
29309
  var _cleanList = function cleanList(items) {
29055
29310
  if (!Array.isArray(items)) return items;
29056
29311
  var kept = [];
29057
- var _iterator = _createForOfIteratorHelper$j(items),
29312
+ var _iterator = _createForOfIteratorHelper$k(items),
29058
29313
  _step;
29059
29314
  try {
29060
29315
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -29091,7 +29346,7 @@ function cleanForeignWidgetsFromWorkspace(workspace) {
29091
29346
  workspace.sidebarLayout = _cleanList(workspace.sidebarLayout);
29092
29347
  }
29093
29348
  if (Array.isArray(workspace.pages)) {
29094
- var _iterator2 = _createForOfIteratorHelper$j(workspace.pages),
29349
+ var _iterator2 = _createForOfIteratorHelper$k(workspace.pages),
29095
29350
  _step2;
29096
29351
  try {
29097
29352
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -29109,6 +29364,105 @@ function cleanForeignWidgetsFromWorkspace(workspace) {
29109
29364
  return summary;
29110
29365
  }
29111
29366
 
29367
+ function _createForOfIteratorHelper$j(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$j(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
29368
+ function _unsupportedIterableToArray$j(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$j(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$j(r, a) : void 0; } }
29369
+ function _arrayLikeToArray$j(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
29370
+ /**
29371
+ * migrateLayoutItemTypes.js
29372
+ *
29373
+ * One-shot data migration that runs at workspace load time. Fixes
29374
+ * legacy `item.type` values where user widgets were persisted with
29375
+ * the old `LayoutModel` default (`type: "layout"`) — that default
29376
+ * silently mis-classified every widget as a container, which broke
29377
+ * any downstream code that filtered "is this a user widget?" by
29378
+ * type field.
29379
+ *
29380
+ * Post-v0.1.444 LayoutModel defaults `type` based on component
29381
+ * name. This migration applies the same logic to ALREADY-PERSISTED
29382
+ * items so old workspaces.json data heals on next save.
29383
+ *
29384
+ * Rules:
29385
+ * - `component === "LayoutGridContainer"` → `type: "grid"`
29386
+ * - `component === "Container"` / `"LayoutContainer"` → `type: "layout"`
29387
+ * - Anything else → `type: "widget"`
29388
+ *
29389
+ * Mutates in place. Idempotent — running on a clean workspace is
29390
+ * a no-op. Returns a count of items whose type was corrected.
29391
+ *
29392
+ * @param {Object} workspace
29393
+ * @returns {{ corrected: number }}
29394
+ */
29395
+
29396
+ var FRAMEWORK_CONTAINER_COMPONENTS = new Set(["LayoutGridContainer", "Container", "LayoutContainer"]);
29397
+ function expectedType(component) {
29398
+ if (component === "LayoutGridContainer") return "grid";
29399
+ if (component === "Container" || component === "LayoutContainer") {
29400
+ return "layout";
29401
+ }
29402
+ return "widget";
29403
+ }
29404
+ function migrateLayoutItemTypes(workspace) {
29405
+ var summary = {
29406
+ corrected: 0
29407
+ };
29408
+ if (!workspace) return summary;
29409
+ var fixItem = function fixItem(item) {
29410
+ if (!item || _typeof(item) !== "object" || !item.component) return;
29411
+ var want = expectedType(item.component);
29412
+ // Only correct OBVIOUS misclassifications. If the persisted type
29413
+ // is `widget` but the component is a known container — fix it.
29414
+ // If a user widget is typed `layout` (the old default) — fix it.
29415
+ // Don't disturb items that were intentionally typed something
29416
+ // unusual (e.g. `workspace`) on a non-container component.
29417
+ var current = item.type;
29418
+ var isContainer = FRAMEWORK_CONTAINER_COMPONENTS.has(item.component);
29419
+ if (isContainer && current !== want) {
29420
+ item.type = want;
29421
+ summary.corrected += 1;
29422
+ return;
29423
+ }
29424
+ if (!isContainer && (current === "layout" || current === undefined)) {
29425
+ item.type = "widget";
29426
+ summary.corrected += 1;
29427
+ }
29428
+ };
29429
+ var _walk = function walk(items) {
29430
+ if (!Array.isArray(items)) return;
29431
+ var _iterator = _createForOfIteratorHelper$j(items),
29432
+ _step;
29433
+ try {
29434
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
29435
+ var item = _step.value;
29436
+ if (!item || _typeof(item) !== "object") continue;
29437
+ fixItem(item);
29438
+ if (Array.isArray(item.items)) _walk(item.items);
29439
+ if (Array.isArray(item.layout)) _walk(item.layout);
29440
+ }
29441
+ } catch (err) {
29442
+ _iterator.e(err);
29443
+ } finally {
29444
+ _iterator.f();
29445
+ }
29446
+ };
29447
+ _walk(workspace.layout);
29448
+ if (Array.isArray(workspace.pages)) {
29449
+ var _iterator2 = _createForOfIteratorHelper$j(workspace.pages),
29450
+ _step2;
29451
+ try {
29452
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
29453
+ var page = _step2.value;
29454
+ _walk(page === null || page === void 0 ? void 0 : page.layout);
29455
+ }
29456
+ } catch (err) {
29457
+ _iterator2.e(err);
29458
+ } finally {
29459
+ _iterator2.f();
29460
+ }
29461
+ }
29462
+ _walk(workspace.sidebarLayout);
29463
+ return summary;
29464
+ }
29465
+
29112
29466
  /**
29113
29467
  * Default layout for a brand-new workspace: a single 1x1 grid container
29114
29468
  * with one empty cell. Mirrors DashboardModel._initializeLayout().
@@ -29261,6 +29615,14 @@ var WorkspaceModel = function WorkspaceModel(workspaceItem) {
29261
29615
  // wiring on first load post-v0.1.435.
29262
29616
  migrateScopedIdsInWorkspace(workspace, ComponentManager.componentMap());
29263
29617
 
29618
+ // Pre-v0.1.444 LayoutModel defaulted `item.type` to "layout" — every
29619
+ // widget instance persisted without an explicit type was silently
29620
+ // typed as a container, breaking any UI that filtered by type.
29621
+ // The new default infers from component name; this migration applies
29622
+ // the same inference to legacy on-disk data so existing
29623
+ // workspaces.json heals on the next save.
29624
+ migrateLayoutItemTypes(workspace);
29625
+
29264
29626
  // Strip any listener bindings whose source widget is no longer in
29265
29627
  // the tree. These "orphan" bindings are dead — they don't match any
29266
29628
  // live publisher and never fire — so they're safe to remove at load