@crystaldesign/diva-backoffice 26.13.0-beta.34 → 26.13.0-beta.35

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.
@@ -81331,6 +81331,96 @@ var ENRICHER_EDITOR_VIEWS = [{
81331
81331
  }
81332
81332
  }];
81333
81333
 
81334
+ /**
81335
+ * The longest a reloadPage call of the in-app chat waits for its turn to be saved before the page reloads anyway (the
81336
+ * save failed, or the host never reported it).
81337
+ */
81338
+ var CHAT_TURN_RELOAD_FALLBACK_MS = 10000;
81339
+ /** A call over the MCP bridge: the bridge posts its result at once, so the reload keeps its short delay. */
81340
+ var BRIDGE_RELOAD_DELAY_MS = 2000;
81341
+
81342
+ /**
81343
+ * Where a pending reloadPage call came from: the in-app chat's own turn, or the MCP bridge (no chat turn). Read off
81344
+ * whether a chat turn is live — a bridge call during a live in-app turn counts as 'chatTurn' and reloads by the fallback.
81345
+ */
81346
+
81347
+ /** A reloadPage call waiting for its reload: where it came from and, for a chat turn, that turn's answer message. */
81348
+
81349
+ /** Set while a reloadPage call waits for its reload. */
81350
+ var pendingPageReload = observable.box(undefined);
81351
+
81352
+ /** The in-app chat's turn state — registered by the agent panel, no live turn without one. */
81353
+ var chatTurnState = function chatTurnState() {
81354
+ return {
81355
+ isStreaming: false
81356
+ };
81357
+ };
81358
+
81359
+ /** The agent panel reports its chat's turn state; returns the unregister. */
81360
+ function setChatTurnProbe(probe) {
81361
+ chatTurnState = probe;
81362
+ return function () {
81363
+ if (chatTurnState === probe) chatTurnState = function chatTurnState() {
81364
+ return {
81365
+ isStreaming: false
81366
+ };
81367
+ };
81368
+ };
81369
+ }
81370
+
81371
+ /** The fallback timer of the pending call — a newer call replaces it, so an older, shorter one cannot reload early. */
81372
+ var reloadTimer;
81373
+
81374
+ /** Set for good once this document reloads: `location.reload()` does not stop the script, the page still runs a moment. */
81375
+ var pageReloadStarted = false;
81376
+
81377
+ /** Whether this document is reloading for a reloadPage call — it keeps running until it unloads. */
81378
+ function isPageReloading() {
81379
+ return pageReloadStarted;
81380
+ }
81381
+
81382
+ /** Reloads the page for a pending reloadPage call — once, whoever comes first: the agent panel or the fallback timer. */
81383
+ function reloadPendingPage() {
81384
+ if (!pendingPageReload.get()) return;
81385
+ pendingPageReload.set(undefined);
81386
+ pageReloadStarted = true;
81387
+ window.location.reload();
81388
+ }
81389
+
81390
+ /**
81391
+ * Arms the reload of a reloadPage call. A call from the in-app chat's turn reloads once the agent panel sees that turn
81392
+ * SAVED (pageReloadDue): reloading earlier leaves the turn's record 'streaming', the reloaded chat settles it as
81393
+ * interrupted, and the automatic 'Continue.' never comes. The timer is the fallback for both sources.
81394
+ */
81395
+ function requestPageReload() {
81396
+ var _chat$lastMessage;
81397
+ var chat = chatTurnState();
81398
+ var turnMessage = chat.isStreaming && ((_chat$lastMessage = chat.lastMessage) === null || _chat$lastMessage === void 0 ? void 0 : _chat$lastMessage.kind) === 'assistant' ? chat.lastMessage.id : undefined;
81399
+ var source = chat.isStreaming ? 'chatTurn' : 'bridge';
81400
+ pendingPageReload.set(turnMessage ? {
81401
+ source: source,
81402
+ messageId: turnMessage
81403
+ } : {
81404
+ source: source
81405
+ });
81406
+ clearTimeout(reloadTimer);
81407
+ reloadTimer = setTimeout(reloadPendingPage, source === 'chatTurn' ? CHAT_TURN_RELOAD_FALLBACK_MS : BRIDGE_RELOAD_DELAY_MS);
81408
+ return source;
81409
+ }
81410
+
81411
+ /** The in-app chat as the agent panel sees it: a turn is live, and the last message of the open conversation. */
81412
+
81413
+ /**
81414
+ * Whether the page may reload now for a reloadPage call of the chat's own turn: no turn is live and the last message is
81415
+ * that turn's answer, saved ('ready' is set only after the server stored it) and ended by reloadPage. An older answer
81416
+ * ended by reloadPage — the user opened another conversation meanwhile — is not that turn's. A bridge call never waits
81417
+ * for the chat.
81418
+ */
81419
+ function pageReloadDue(pending, chat) {
81420
+ var last = chat.lastMessage;
81421
+ return (pending === null || pending === void 0 ? void 0 : pending.source) === 'chatTurn' && !chat.isStreaming && (last === null || last === void 0 ? void 0 : last.kind) === 'assistant' && (!pending.messageId || last.id === pending.messageId) && last.status === 'ready' && last.endedByTool === 'reloadPage';
81422
+ }
81423
+
81334
81424
  /**
81335
81425
  * Where the editors lived in the backoffice (`/backoffice/catalogs/idmeditor/…`). The Data Engine mounts them at its
81336
81426
  * root instead; old links under this prefix are redirected to the same page there.
@@ -81476,6 +81566,29 @@ function currentEditorIds(root, ctx) {
81476
81566
  };
81477
81567
  }
81478
81568
 
81569
+ /** The catalog editor's record of the open catalog, as far as the facts read it. */
81570
+
81571
+ /**
81572
+ * The open catalog's name and IDM format major (3 or 4) for the per-turn facts — read only from the editor's record of
81573
+ * THIS catalog: the context can still hold the bare id from the route, or the record of the catalog opened before.
81574
+ */
81575
+ function openCatalogFacts(catalogId, openCatalog) {
81576
+ if (!catalogId || (openCatalog === null || openCatalog === void 0 ? void 0 : openCatalog._id) !== catalogId) return {};
81577
+ return {
81578
+ catalogName: openCatalog.name || undefined,
81579
+ catalogMajor: typeof openCatalog.major === 'number' ? openCatalog.major : undefined
81580
+ };
81581
+ }
81582
+
81583
+ /** The IDM format major of the catalog open in the editor, when the editor's record holds it — else undefined. */
81584
+ function openCatalogMajor(root) {
81585
+ var _root$contextStore;
81586
+ // Guarded: the media tools also run where neither a route nor a catalog context exists.
81587
+ var catalogId = root.navigationState ? currentEditorIds(root).catalogId : undefined;
81588
+ var openCatalog = (_root$contextStore = root.contextStore) === null || _root$contextStore === void 0 || (_root$contextStore = _root$contextStore.peekContext('catalog')) === null || _root$contextStore === void 0 ? void 0 : _root$contextStore.selectedCatalog;
81589
+ return openCatalogFacts(catalogId, openCatalog).catalogMajor;
81590
+ }
81591
+
81479
81592
  /** Navigable views: permission-filtered menu + the current editors' sub-views (from mount context or live path). */
81480
81593
  function allViews(root, ctx) {
81481
81594
  var views = flattenViews(root, root.contentStore.resolvedMenu, '');
@@ -82448,7 +82561,7 @@ function bulkLocateRows(_x9, _x10, _x11, _x12) {
82448
82561
  return _bulkLocateRows.apply(this, arguments);
82449
82562
  }
82450
82563
 
82451
- /** The record ids of rows that share a key, for a refusal that tells the caller which rowIds to pick from. */
82564
+ /** How many new items the stageTableEdits receipt names as missing their base price group — a payload can add thousands. */
82452
82565
  function _bulkLocateRows() {
82453
82566
  _bulkLocateRows = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee20(api, column, values, deadline) {
82454
82567
  var _options$chunkSize;
@@ -82545,7 +82658,7 @@ function _bulkLocateRows() {
82545
82658
  /** Hands the hits judged since the last call to `onChunk`; false = the caller wants no further lookups. */
82546
82659
  handedOver = 0;
82547
82660
  handOver = /*#__PURE__*/function () {
82548
- var _ref62 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee19(afterServerLookup) {
82661
+ var _ref63 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee19(afterServerLookup) {
82549
82662
  var fresh;
82550
82663
  return _regeneratorRuntime.wrap(function _callee19$(_context27) {
82551
82664
  while (1) switch (_context27.prev = _context27.next) {
@@ -82570,7 +82683,7 @@ function _bulkLocateRows() {
82570
82683
  }, _callee19);
82571
82684
  }));
82572
82685
  return function handOver(_x64) {
82573
- return _ref62.apply(this, arguments);
82686
+ return _ref63.apply(this, arguments);
82574
82687
  };
82575
82688
  }(); // A number and a text condition cannot share one column filter — numeric-looking values go in chunks of their own.
82576
82689
  groups = [pending.filter(numeric), pending.filter(function (value) {
@@ -82601,7 +82714,7 @@ function _bulkLocateRows() {
82601
82714
  isNumber = numeric(queue[0]);
82602
82715
  _loop11 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop11() {
82603
82716
  var _api$getFilterModel4;
82604
- var _result$notReached2, chunk, model, listed, _result$missing, kept, wait, _ref63, overflow, _iterator45, _step45, _value6, _result$notReached3;
82717
+ var _result$notReached2, chunk, model, listed, _result$missing, kept, wait, _ref64, overflow, _iterator45, _step45, _value6, _result$notReached3;
82605
82718
  return _regeneratorRuntime.wrap(function _loop11$(_context28) {
82606
82719
  while (1) switch (_context28.prev = _context28.next) {
82607
82720
  case 0:
@@ -82664,7 +82777,7 @@ function _bulkLocateRows() {
82664
82777
  break;
82665
82778
  }
82666
82779
  // A wait the deadline cut short says nothing about the server — only the full wait does.
82667
- (_ref63 = wait < LOOKUP_WAIT_MS ? result.notReached : result.unverified).push.apply(_ref63, _toConsumableArray(chunk));
82780
+ (_ref64 = wait < LOOKUP_WAIT_MS ? result.notReached : result.unverified).push.apply(_ref64, _toConsumableArray(chunk));
82668
82781
  _context28.next = 30;
82669
82782
  break;
82670
82783
  case 27:
@@ -82746,13 +82859,35 @@ function _bulkLocateRows() {
82746
82859
  }));
82747
82860
  return _bulkLocateRows.apply(this, arguments);
82748
82861
  }
82749
- var recordIdsOf = function recordIdsOf(nodes) {
82862
+ var NAMED_NEW_ITEMS_LIMIT = 20;
82863
+
82864
+ /** The first `limit` names, comma-separated, plus how many more there are. */
82865
+ var namedWithRest = function namedWithRest(names, limit) {
82866
+ return names.length > limit ? "".concat(names.slice(0, limit).join(', '), " and ").concat(names.length - limit, " more") : names.join(', ');
82867
+ };
82868
+
82869
+ /** The featureNos of a row of an options table, where one key is usually one row per feature; none on other tables. */
82870
+ var featureNosOf = function featureNosOf(data) {
82871
+ return Array.isArray(data === null || data === void 0 ? void 0 : data.featureNos) && data.featureNos.length ? data.featureNos : undefined;
82872
+ };
82873
+
82874
+ /** The rows that carry one key, by _id — each with the features it serves where the rows carry featureNos. */
82875
+ var carrierIdsOf = function carrierIdsOf(nodes) {
82750
82876
  return nodes.map(function (node) {
82751
82877
  var _node$data$_id, _node$data;
82752
- return String((_node$data$_id = (_node$data = node.data) === null || _node$data === void 0 ? void 0 : _node$data._id) !== null && _node$data$_id !== void 0 ? _node$data$_id : node.id);
82878
+ var id = String((_node$data$_id = (_node$data = node.data) === null || _node$data === void 0 ? void 0 : _node$data._id) !== null && _node$data$_id !== void 0 ? _node$data$_id : node.id);
82879
+ var featureNos = featureNosOf(node.data);
82880
+ return featureNos ? "".concat(id, " (featureNos ").concat(featureNos.join(', '), ")") : id;
82753
82881
  }).join(', ');
82754
82882
  };
82755
82883
 
82884
+ /** Rows of one key that serve different features: the feature is what the user means, so the agent asks instead of picking. */
82885
+ var askWhichFeature = function askWhichFeature(nodes) {
82886
+ return nodes.some(function (node) {
82887
+ return featureNosOf(node.data);
82888
+ }) ? ' ASK the user which feature unless the request names it — do not pick the first.' : '';
82889
+ };
82890
+
82756
82891
  /**
82757
82892
  * Proves for each value that exactly ONE row of the column carries it, the way a bulk locate does (one combined equals
82758
82893
  * filter per 50 values), and puts the filter model it found back. Answers a refusal per value that is not proven unique.
@@ -82771,7 +82906,7 @@ function _confirmUniqueKeys() {
82771
82906
  refusals = new Map();
82772
82907
  filterBefore = api.getFilterModel();
82773
82908
  restoreFilter = /*#__PURE__*/function () {
82774
- var _ref64 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
82909
+ var _ref65 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
82775
82910
  var _api$getFilterModel5;
82776
82911
  return _regeneratorRuntime.wrap(function _callee21$(_context30) {
82777
82912
  while (1) switch (_context30.prev = _context30.next) {
@@ -82792,7 +82927,7 @@ function _confirmUniqueKeys() {
82792
82927
  }, _callee21);
82793
82928
  }));
82794
82929
  return function restoreFilter() {
82795
- return _ref64.apply(this, arguments);
82930
+ return _ref65.apply(this, arguments);
82796
82931
  };
82797
82932
  }();
82798
82933
  _context31.prev = 3;
@@ -82826,7 +82961,7 @@ function _confirmUniqueKeys() {
82826
82961
  try {
82827
82962
  for (_iterator47.s(); !(_step47 = _iterator47.n()).done;) {
82828
82963
  _step47$value = _step47.value, _value8 = _step47$value.value, matches = _step47$value.matches, nodes = _step47$value.nodes;
82829
- refusals.set(_value8, "".concat(column, " = '").concat(_value8, "' is carried by ").concat(matches, " rows (_id ").concat(recordIdsOf(nodes)).concat(matches > nodes.length ? ', …' : '', ") \u2014 not a UNIQUE key: address the one you mean by rowId = its _id."));
82964
+ refusals.set(_value8, "".concat(column, " = '").concat(_value8, "' is carried by ").concat(matches, " rows (_id ").concat(carrierIdsOf(nodes)).concat(matches > nodes.length ? ', …' : '', ") \u2014 not a UNIQUE key: address the one you mean by rowId = its _id.").concat(askWhichFeature(nodes)));
82830
82965
  }
82831
82966
  } catch (err) {
82832
82967
  _iterator47.e(err);
@@ -83230,7 +83365,7 @@ function createNavigationToolset(ctx) {
83230
83365
  isNumber = matchesNumerically(parent.api.getColumnDef(parentNode.column), value);
83231
83366
  carriers = exactRowsOf(parent.api, parentNode.column, value, isNumber, NOT_UNIQUE_ROW_LIMIT);
83232
83367
  return _context2.abrupt("return", {
83233
- error: "parentRow: ".concat(column, " = '").concat(value, "' is carried by ").concat(carrierCount, " rows in '").concat(parent.entry.label, "' (_id ").concat(recordIdsOf(carriers)).concat(carrierCount > carriers.length ? ', …' : '', ") \u2014 address the parent row by column '_id' with the one you mean.")
83368
+ error: "parentRow: ".concat(column, " = '").concat(value, "' is carried by ").concat(carrierCount, " rows in '").concat(parent.entry.label, "' (_id ").concat(carrierIdsOf(carriers)).concat(carrierCount > carriers.length ? ', …' : '', ") \u2014 address the parent row by column '_id' with the one you mean.").concat(askWhichFeature(carriers))
83234
83369
  });
83235
83370
  case 30:
83236
83371
  _context2.next = 32;
@@ -83400,9 +83535,9 @@ function createNavigationToolset(ctx) {
83400
83535
  };
83401
83536
  // Peek, never seed: the catalog editor owns that context. Its record may still be the bare id from the route.
83402
83537
  var openCatalog = (_root$contextStore$pe2 = root.contextStore.peekContext('catalog')) === null || _root$contextStore$pe2 === void 0 ? void 0 : _root$contextStore$pe2.selectedCatalog;
83403
- return {
83404
- catalogId: catalogId,
83405
- catalogName: catalogId && (openCatalog === null || openCatalog === void 0 ? void 0 : openCatalog._id) === catalogId ? openCatalog.name || undefined : undefined,
83538
+ return _objectSpread$C(_objectSpread$C({
83539
+ catalogId: catalogId
83540
+ }, openCatalogFacts(catalogId, openCatalog)), {}, {
83406
83541
  // A reload or a cross-catalog navigateTo can switch the organization silently — name it with every answer.
83407
83542
  organizationId: (_root$dataStore = root.dataStore) === null || _root$dataStore === void 0 ? void 0 : _root$dataStore.selectedOrganizationId,
83408
83543
  currentPath: root.navigationState.path,
@@ -83463,11 +83598,11 @@ function createNavigationToolset(ctx) {
83463
83598
  idmCatalog: editorFact(idm, catalogId ? "catalogs/".concat(catalogId) : undefined),
83464
83599
  enricherPackage: editorFact(enricher, packageId ? "packages/".concat(packageId) : undefined)
83465
83600
  }
83466
- };
83601
+ });
83467
83602
  },
83468
83603
  dispatch: function () {
83469
83604
  var _dispatch = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(name, input, signal, onProgress) {
83470
- var awaitingApproval, args, _allViews2, views, editorSubviews, _args$path, _root$navigationState2, _allViews3, _views, _editorSubviews, requested, dynamic, known, editorView, _permittedEditorViews4, idm, enricher, subViews, catalogIdIn, fromCatalog, toCatalog, only, entries, compactWanted, fullWanted, _args$value, _resolveGrid, entry, api, error, multiValues, _entry$getHandle$getD, _entry$getHandle2, filterBeforeBulk, deadline, bulk, _api$getFilterModel, requestedColumns, fields, rows, _notUnique, returnedData, returnedRoots, fieldsOmitted, unknownColumns, _bulk, missing, unverified, notReached, filterBeforeLocate, _located, _args$value2, matchedRows, carrierCount, notUnique, _cellValueOf2, matchedValue, gridsOnScreen, subtableHint, trimmedFirstRow, revealNote, revealed, _args$id, openError, _entry$getHandle$getD3, _entry$getHandle4, _lastNode$data, _entry$getHandle$hasP, _entry$getHandle5, _api$getFilterModel2, prelude, _resolveGrid2, _entry, _api, _error, waitedForRowsMs, previewCell, divaDefs, leafFields, _requested, columns, _unknownColumns, limit, _rows, displayed, unsavedRowCount, i, _api$getDisplayedRowA, context, _i2, node, values, truncatedColumns, _iterator8, _step8, column, raw, labelled, columnMeta, lastNode, gridContext, hasCreatorRow, creatorRowLoaded, totalRowCount, dirty, filterModel, filteredBy, _ref31, _ref32, _staged$0$rowId, _staged$, _addedRows$, _outcome$committed, _root$navigationState3, _outcome$failed, _outcome$declined2, _outcome$skipped, callStartedAt, KNOWN_KEYS, ALIASES, unknownKeys, hints, edits, EDIT_KEYS, EDIT_ALIASES, editFaults, addRows, addRowsTsv, listedAddRowCount, tsvHeaderLine, tsvRowLines, lines, header, duplicate, faults, removeRowIds, removeRows, editedRows, removedRows, intendedRowCount, _prelude, _resolveGrid3, _entry2, _api2, _error2, handle, explicitParentRow, mountedAfterFirst, isSubtable, parentBinding, boundParentRow, parentBindingNote, idColumnPresent, isUnloadedRecordId, reroutedRecordIds, _iterator9, _step9, _edit2, _i3, _arr2, rowId, serieScope, fmt, _divaDefs, checkCellInput, parserRefusal, parseRefusalOf, newRowEditability, newRowEditRefusal, typedValueOf, computedRefusalOf, writeCell, isLookupColumn, lookupWrite, staged, storedWrite, expectedValueOf, stagingNotes, failed, unchanged, removed, removedRecordIds, filterBeforeStaging, keyFilterApplied, restoreUserFilter, keyFilterChanged, keyCache, keyRefusals, resolveByKey, resolveTarget, applyEditToNode, columnDefFor, requiredFields, failures, editabilityUnverified, failedRows, problems, needsServerLookup, lookupKeyOf, lookupKeys, _iterator11, _step11, _edit3, _keyColumn6, _keyValue6, _iterator12, _step12, _removal, _keyColumn7, _keyValue7, _iterator13, _step13, edit, keyColumn, keyValue, _iterator14, _step14, removal, _keyColumn, _keyValue, keysByColumn, _i6, _arr3, _keysByColumn$get, address, _keyColumn2, _iterator15, _step15, _step15$value, _keyColumn3, keyValues, _deadline, refusals, _iterator16, _step16, _step16$value, _keyValue2, refusal, mergedOutcome, mergeCommitOutcome, preApproved, notProcessedKeys, chunkFailure, chunkCommitThrew, intendedCount, _approved, passDeadline, serverChunks, roomForAnotherChunk, blockSize, _keysByColumn, _iterator17, _step17, _keysByColumn$get2, _step17$value, _keyColumn4, _keyValue3, handledKeys, settledKeys, chunkError, _located2, settleVerdicts, stageChunk, _iterator25, _step25, _step25$value, _keyColumn5, _keyValues, _iterator26, _step26, _keyValue4, _bulk2, lookupDeadline, reason, _iterator27, _step27, _keyValue5, key, _iterator28, _step28, _key, _iterator29, _step29, value, filterWasChanged, remainingEdits, remainingRemovals, _iterator30, _step30, _removal2, _target, _target$error, id, _iterator31, _step31, _edit4$column, _edit4, _column2, _target2, _target2$error, _node2, _rowId2, targets, _iterator32, _step32, _api2$getRowNode2, _rowId, addedRows, providedAddColumns, conditionedPosDefaults, lookupWriteCache, addRowsStopAt, _loop4, _ret3, _i7, unsentListedRows, unsentTsvLines, keyRemainingCount, addRemainingCount, remainingCount, remainingPart, addSchemaHint, validationErrors, alreadySent, _iterator33, _step33, _api2$getRowNode12, _rowId3, rowErrors, focusNode, totalStaged, survivingOperations, cleaningLabel, approved, survived, survivedCount, withdrawn, decision, trimEcho, storedOf, finalOutcome, outcome, serverErrors, reported, isSessionRowId, sentValuesOf, lengthLimitNote, addError, _iterator34, _step34, failure, _iterator35, _step35, _rowId4, _iterator36, _step36, _rowId5, _iterator37, _step37, _api2$getRowNode13, _rowId6, _rowErrors, _i9, _addedRows, _api2$getRowNode5, a, outcomeIsEmpty, survivedAfterCommit, autoCommitted, autoCommittedOps, committedIds, failedIds, editTargets, addTargets, removalTargets, hasIdColumn, verifyDeadline, verifyDeadlineHit, filterBeforeVerify, verifyFilterApplied, probeServerRow, restoreVerifyFilter, verifiedChanges, verifiedAdds, verifiedRemovals, _iterator38, _step38, _loop5, _iterator39, _step39, _loop6, _iterator40, _step40, target, probe, appliedCount, livePath, editorPathFor, echoValues, withServerIds, addedRowsWithoutId, landedInSeries, foreignSeries, committedOps, confirmedCount, notCommittedRowIds, isEmptyCell, silentlyDropped, storedDiffers, _root$navigationState4, _ctx$getSelection, dirtyGrids, _root$navigationState5, _livePath$match, _livePath$match2, _ref55, _ref56, _livePath, packageBase, catalogBase, baseId, isPack, _root$webplannerInsta, destroyed, reloadTriggered, knownKeys, source, _action, _input, _entry3$getActions, _entry3$getActions2, _resolveGrid4, _entry3, _error3, _handle, actionName, actionInput, _addTargets, removeTargets, viewActions, available, approve, declined, autoNote, authorizedFetch, refreshAndSettle, unsettledNote, viewAction, mutating, cloneSettled, _catalogId, _handle$getApplicatio7, _handle$getApplicatio8, catalogId, importSettled, _handle$getApplicatio9, _handle$getApplicatio10, _params2$scope, _pricelistNode, app, serieNo, _params2, scope, _key4, parent, parentHandle, pricelistNode, patch, label, factors, pricelistRowId, factorOutcome, rejected, _handle$getApplicatio11, _handle$getApplicatio12, _app, pricesSettled, removeTargetIn, _target3, _header, live, saved, gone, attempt, rowsNote, _target4, markAdded, keys, resolved, _iterator43, _step43, _loop9, _ret5, added, newColumns, _loop10, _i15, _resolved, decisionSubtableNote, partialNote, _column8, _search, _entry4$getActions, _entry4$getActions2, _enumDef$customParams, _optionsRow$data, _plainWords$sort$, _resolveGrid5, _entry4, _api3, _error4, _handle2, _column7, search, _limit, wantsExact, needle, equals, optionAction, _yield$optionAction$o, options, note, enumDef, enumData, _enumDef$customParams2, computedDef, savedRowsOnly, _fields2, _enumDef$cellDataType, optionsRowId, optionsRow, rowData, patternChars, plainWords, remoteSearch, matchLocally, fetchLimit, fetched, text, _options, fetchCapped, _handle2$getApplicati, _handle2$getApplicati2, appScope, deps, hint, _resolveGrid6, _api4, _error5, _resolveGrid7, _entry5, _error6, _handle3, _label, _autoNote;
83605
+ var awaitingApproval, args, _allViews2, views, editorSubviews, _args$path, _root$navigationState2, _allViews3, _views, _editorSubviews, requested, dynamic, known, editorView, _permittedEditorViews4, idm, enricher, subViews, catalogIdIn, fromCatalog, toCatalog, only, entries, compactWanted, fullWanted, _args$value, _resolveGrid, entry, api, error, multiValues, _entry$getHandle$getD, _entry$getHandle2, filterBeforeBulk, deadline, bulk, _api$getFilterModel, requestedColumns, notUniqueNodes, featureColumn, fields, rows, _notUnique, returnedData, returnedRoots, fieldsOmitted, unknownColumns, _bulk, missing, unverified, notReached, filterBeforeLocate, _located, _args$value2, matchedRows, carrierCount, carriers, notUnique, _cellValueOf2, matchedValue, gridsOnScreen, subtableHint, trimmedFirstRow, revealNote, revealed, _args$id, openError, _entry$getHandle$getD3, _entry$getHandle4, _lastNode$data, _entry$getHandle$hasP, _entry$getHandle5, _api$getFilterModel2, prelude, _resolveGrid2, _entry, _api, _error, waitedForRowsMs, previewCell, divaDefs, leafFields, _requested, columns, _unknownColumns, limit, _rows, displayed, unsavedRowCount, i, _api$getDisplayedRowA, context, _i2, node, values, truncatedColumns, _iterator8, _step8, column, raw, labelled, columnMeta, lastNode, gridContext, hasCreatorRow, creatorRowLoaded, totalRowCount, dirty, filterModel, filteredBy, _ref32, _ref33, _staged$0$rowId, _staged$, _addedRows$, _outcome$committed, _root$navigationState3, _entry2$readUrl, _outcome$failed, _outcome$declined2, _outcome$skipped, callStartedAt, KNOWN_KEYS, ALIASES, unknownKeys, hints, edits, EDIT_KEYS, EDIT_ALIASES, editFaults, addRows, addRowsTsv, listedAddRowCount, tsvHeaderLine, tsvRowLines, lines, header, duplicate, faults, removeRowIds, removeRows, editedRows, removedRows, intendedRowCount, _prelude, _resolveGrid3, _entry2, _api2, _error2, handle, explicitParentRow, mountedAfterFirst, isSubtable, parentBinding, boundParentRow, parentBindingNote, idColumnPresent, isUnloadedRecordId, reroutedRecordIds, _iterator9, _step9, _edit2, _i3, _arr2, rowId, serieScope, fmt, _divaDefs, checkCellInput, parserRefusal, parseRefusalOf, newRowEditability, newRowEditRefusal, typedValueOf, computedRefusalOf, writeCell, isLookupColumn, lookupWrite, staged, storedWrite, expectedValueOf, stagingNotes, failed, unchanged, removed, removedRecordIds, filterBeforeStaging, keyFilterApplied, restoreUserFilter, keyFilterChanged, keyCache, keyRefusals, resolveByKey, resolveTarget, applyEditToNode, columnDefFor, requiredFields, failures, editabilityUnverified, failedRows, problems, needsServerLookup, lookupKeyOf, lookupKeys, _iterator11, _step11, _edit3, _keyColumn6, _keyValue6, _iterator12, _step12, _removal, _keyColumn7, _keyValue7, _iterator13, _step13, edit, keyColumn, keyValue, _iterator14, _step14, removal, _keyColumn, _keyValue, keysByColumn, _i6, _arr3, _keysByColumn$get, address, _keyColumn2, _iterator15, _step15, _step15$value, _keyColumn3, keyValues, _deadline, refusals, _iterator16, _step16, _step16$value, _keyValue2, refusal, mergedOutcome, mergeCommitOutcome, preApproved, notProcessedKeys, chunkFailure, chunkCommitThrew, intendedCount, _approved, passDeadline, serverChunks, roomForAnotherChunk, blockSize, _keysByColumn, _iterator17, _step17, _keysByColumn$get2, _step17$value, _keyColumn4, _keyValue3, handledKeys, settledKeys, chunkError, _located2, settleVerdicts, stageChunk, _iterator25, _step25, _step25$value, _keyColumn5, _keyValues, _iterator26, _step26, _keyValue4, _bulk2, lookupDeadline, reason, _iterator27, _step27, _keyValue5, key, _iterator28, _step28, _key, _iterator29, _step29, value, filterWasChanged, remainingEdits, remainingRemovals, _iterator30, _step30, _removal2, _target, _target$error, id, _iterator31, _step31, _edit4$column, _edit4, _column2, _target2, _target2$error, _node2, _rowId2, targets, _iterator32, _step32, _api2$getRowNode2, _rowId, addedRows, providedAddColumns, conditionedPosDefaults, lookupWriteCache, addRowsStopAt, _loop4, _ret3, _i7, unsentListedRows, unsentTsvLines, keyRemainingCount, addRemainingCount, remainingCount, remainingPart, addSchemaHint, validationErrors, alreadySent, _iterator33, _step33, _api2$getRowNode13, _rowId3, rowErrors, focusNode, totalStaged, survivingOperations, cleaningLabel, approved, survived, survivedCount, withdrawn, decision, trimEcho, storedOf, finalOutcome, outcome, serverErrors, reported, isSessionRowId, sentValuesOf, lengthLimitNote, addError, _iterator34, _step34, failure, _iterator35, _step35, _rowId4, _iterator36, _step36, _rowId5, _iterator37, _step37, _api2$getRowNode14, _rowId6, _rowErrors, _i9, _addedRows, _api2$getRowNode5, a, outcomeIsEmpty, survivedAfterCommit, autoCommitted, autoCommittedOps, committedIds, failedIds, editTargets, addTargets, removalTargets, hasIdColumn, verifyDeadline, verifyDeadlineHit, filterBeforeVerify, verifyFilterApplied, probeServerRow, restoreVerifyFilter, verifiedChanges, verifiedAdds, verifiedRemovals, _iterator38, _step38, _loop5, _iterator39, _step39, _loop6, _iterator40, _step40, target, probe, appliedCount, livePath, editorPathFor, echoValues, withServerIds, addedRowsWithoutId, landedInSeries, foreignSeries, committedOps, confirmedCount, notCommittedRowIds, isEmptyCell, silentlyDropped, storedDiffers, unpricedNewItems, _root$navigationState4, _ctx$getSelection, dirtyGrids, _root$navigationState5, _livePath$match, _livePath$match2, _ref56, _ref57, _livePath, packageBase, catalogBase, baseId, isPack, _root$webplannerInsta, destroyed, reloadTriggered, knownKeys, source, _action, _input, _entry3$getActions, _entry3$getActions2, _resolveGrid4, _entry3, _error3, _handle, actionName, actionInput, _addTargets, removeTargets, viewActions, available, approve, declined, autoNote, authorizedFetch, refreshAndSettle, unsettledNote, viewAction, mutating, cloneSettled, _catalogId, _handle$getApplicatio7, _handle$getApplicatio8, catalogId, importSettled, _handle$getApplicatio9, _handle$getApplicatio10, _params2$scope, _pricelistNode, app, serieNo, _params2, scope, _key4, parent, parentHandle, pricelistNode, patch, label, factors, pricelistRowId, factorOutcome, rejected, _handle$getApplicatio11, _handle$getApplicatio12, _app, pricesSettled, removeTargetIn, _target3, _header, live, saved, gone, attempt, rowsNote, _target4, markAdded, keys, resolved, _iterator43, _step43, _loop9, _ret5, added, newColumns, _loop10, _i15, _resolved, decisionSubtableNote, partialNote, _column8, _search, _entry4$getActions, _entry4$getActions2, _enumDef$customParams, _optionsRow$data, _plainWords$sort$, _resolveGrid5, _entry4, _api3, _error4, _handle2, _column7, search, _limit, wantsExact, needle, equals, optionAction, _yield$optionAction$o, options, note, enumDef, enumData, _enumDef$customParams2, computedDef, savedRowsOnly, _fields2, _enumDef$cellDataType, optionsRowId, optionsRow, rowData, patternChars, plainWords, remoteSearch, matchLocally, fetchLimit, fetched, text, _options, fetchCapped, _handle2$getApplicati, _handle2$getApplicati2, appScope, deps, hint, _resolveGrid6, _api4, _error5, _resolveGrid7, _entry5, _error6, _handle3, _label, _autoNote;
83471
83606
  return _regeneratorRuntime.wrap(function _callee13$(_context21) {
83472
83607
  while (1) switch (_context21.prev = _context21.next) {
83473
83608
  case 0:
@@ -83476,7 +83611,7 @@ function createNavigationToolset(ctx) {
83476
83611
  };
83477
83612
  args = input !== null && input !== void 0 ? input : {};
83478
83613
  _context21.t0 = name;
83479
- _context21.next = _context21.t0 === 'listViews' ? 5 : _context21.t0 === 'navigateTo' ? 7 : _context21.t0 === 'listGrids' ? 28 : _context21.t0 === 'locateRow' ? 35 : _context21.t0 === 'openToolbarTool' ? 99 : _context21.t0 === 'readGridRows' ? 107 : _context21.t0 === 'stageTableEdits' ? 176 : _context21.t0 === 'reloadPage' ? 702 : _context21.t0 === 'reloadPlanner' ? 708 : _context21.t0 === 'runTableAction' ? 722 : _context21.t0 === 'readColumnOptions' ? 975 : _context21.t0 === 'clearGridFilter' ? 1044 : _context21.t0 === 'discardStagedChanges' ? 1049 : 1070;
83614
+ _context21.next = _context21.t0 === 'listViews' ? 5 : _context21.t0 === 'navigateTo' ? 7 : _context21.t0 === 'listGrids' ? 28 : _context21.t0 === 'locateRow' ? 35 : _context21.t0 === 'openToolbarTool' ? 102 : _context21.t0 === 'readGridRows' ? 110 : _context21.t0 === 'stageTableEdits' ? 179 : _context21.t0 === 'reloadPage' ? 706 : _context21.t0 === 'reloadPlanner' ? 712 : _context21.t0 === 'runTableAction' ? 726 : _context21.t0 === 'readColumnOptions' ? 979 : _context21.t0 === 'clearGridFilter' ? 1048 : _context21.t0 === 'discardStagedChanges' ? 1053 : 1074;
83480
83615
  break;
83481
83616
  case 5:
83482
83617
  _allViews2 = allViews(root, ctx), views = _allViews2.views, editorSubviews = _allViews2.editorSubviews;
@@ -83638,7 +83773,7 @@ function createNavigationToolset(ctx) {
83638
83773
  // BULK READ: one call instead of a locateRow chain. Read-only — the pre-bulk filter model is restored before returning.
83639
83774
  multiValues = Array.isArray(input === null || input === void 0 ? void 0 : input.values) ? input.values.map(String) : undefined;
83640
83775
  if (!(multiValues !== null && multiValues !== void 0 && multiValues.length)) {
83641
- _context21.next = 66;
83776
+ _context21.next = 68;
83642
83777
  break;
83643
83778
  }
83644
83779
  filterBeforeBulk = api.getFilterModel(); // Time budget: running past the call timeout leaves this handler blocking the serialized call queue.
@@ -83662,19 +83797,26 @@ function createNavigationToolset(ctx) {
83662
83797
  case 52:
83663
83798
  // Row previews BEFORE the filter goes back — the grid recycles its nodes on a refilter.
83664
83799
  requestedColumns = Array.isArray(input === null || input === void 0 ? void 0 : input.columns) ? input.columns.map(String) : [];
83665
- fields = _toConsumableArray(new Set([].concat(_toConsumableArray(bulkRowFields((_entry$getHandle$getD = (_entry$getHandle2 = entry.getHandle()) === null || _entry$getHandle2 === void 0 ? void 0 : _entry$getHandle2.getDivaColumnDefs()) !== null && _entry$getHandle$getD !== void 0 ? _entry$getHandle$getD : [], bulk.column)), _toConsumableArray(requestedColumns))));
83666
- rows = bulk.hits.map(function (_ref18) {
83667
- var value = _ref18.value,
83668
- node = _ref18.node;
83800
+ notUniqueNodes = bulk.notUnique.flatMap(function (_ref18) {
83801
+ var nodes = _ref18.nodes;
83802
+ return nodes;
83803
+ }); // Rows of one optionKey differ only in their features — without featureNos they cannot be told apart.
83804
+ featureColumn = notUniqueNodes.some(function (node) {
83805
+ return featureNosOf(node.data);
83806
+ }) ? ['featureNos'] : [];
83807
+ fields = _toConsumableArray(new Set([].concat(_toConsumableArray(bulkRowFields((_entry$getHandle$getD = (_entry$getHandle2 = entry.getHandle()) === null || _entry$getHandle2 === void 0 ? void 0 : _entry$getHandle2.getDivaColumnDefs()) !== null && _entry$getHandle$getD !== void 0 ? _entry$getHandle$getD : [], bulk.column)), featureColumn, _toConsumableArray(requestedColumns))));
83808
+ rows = bulk.hits.map(function (_ref19) {
83809
+ var value = _ref19.value,
83810
+ node = _ref19.node;
83669
83811
  return {
83670
83812
  value: value,
83671
83813
  firstRow: pickRowFields(node.data, fields)
83672
83814
  };
83673
83815
  });
83674
- _notUnique = bulk.notUnique.map(function (_ref19) {
83675
- var value = _ref19.value,
83676
- matches = _ref19.matches,
83677
- nodes = _ref19.nodes;
83816
+ _notUnique = bulk.notUnique.map(function (_ref20) {
83817
+ var value = _ref20.value,
83818
+ matches = _ref20.matches,
83819
+ nodes = _ref20.nodes;
83678
83820
  return {
83679
83821
  value: value,
83680
83822
  matches: matches,
@@ -83683,11 +83825,11 @@ function createNavigationToolset(ctx) {
83683
83825
  })
83684
83826
  };
83685
83827
  });
83686
- returnedData = [].concat(_toConsumableArray(bulk.hits.map(function (_ref20) {
83687
- var node = _ref20.node;
83828
+ returnedData = [].concat(_toConsumableArray(bulk.hits.map(function (_ref21) {
83829
+ var node = _ref21.node;
83688
83830
  return node.data;
83689
- })), _toConsumableArray(bulk.notUnique.flatMap(function (_ref21) {
83690
- var nodes = _ref21.nodes;
83831
+ })), _toConsumableArray(bulk.notUnique.flatMap(function (_ref22) {
83832
+ var nodes = _ref22.nodes;
83691
83833
  return nodes.map(function (node) {
83692
83834
  return node.data;
83693
83835
  });
@@ -83706,14 +83848,14 @@ function createNavigationToolset(ctx) {
83706
83848
  });
83707
83849
  }) : []; // A pure read must not leave lookup filters behind — restore what was active before.
83708
83850
  if (!bulk.filterApplied) {
83709
- _context21.next = 64;
83851
+ _context21.next = 66;
83710
83852
  break;
83711
83853
  }
83712
83854
  api.setFilterModel(Object.keys(filterBeforeBulk !== null && filterBeforeBulk !== void 0 ? filterBeforeBulk : {}).length ? filterBeforeBulk : null);
83713
83855
  // The settle wait lives inside the budget too — the model is restored either way.
83714
- _context21.next = 64;
83856
+ _context21.next = 66;
83715
83857
  return waitForRows(api, Math.max(0, deadline - Date.now()));
83716
- case 64:
83858
+ case 66:
83717
83859
  _bulk = bulk, missing = _bulk.missing, unverified = _bulk.unverified, notReached = _bulk.notReached;
83718
83860
  return _context21.abrupt("return", _objectSpread$C(_objectSpread$C(_objectSpread$C(_objectSpread$C(_objectSpread$C(_objectSpread$C(_objectSpread$C({
83719
83861
  rows: rows
@@ -83730,35 +83872,35 @@ function createNavigationToolset(ctx) {
83730
83872
  } : {}), unknownColumns.length ? {
83731
83873
  unknownColumns: unknownColumns
83732
83874
  } : {}), {}, {
83733
- note: "".concat(rows.length, "/").concat(multiValues.length, " located") + (bulk.serverLookups ? " in ".concat(bulk.serverLookups, " server lookup(s) of up to ").concat(BULK_LOOKUP_CHUNK, " values each.") : ' from the loaded rows, no server lookup needed.') + (returnedData.length ? " Each row carries _id, the located column and the table's required and lookup columns (translated ones in their first language)" + (fieldsOmitted.length ? ' — fieldsOmitted names the other record fields, pass the ones you need in `columns`.' : '.') : '') + (unknownColumns.length ? ' unknownColumns: no returned row carries these fields.' : '') + (missing.length ? " Missing values did NOT match — check them for typos before concluding they don't exist." : '') + (unverified.length ? " UNVERIFIED values have NO verdict \u2014 that is not a miss: their server lookup did not answer within ".concat(LOOKUP_WAIT_MS / 1000, " s, or the batch matched more rows than the table loads at once. Look them up again (smaller batches, once the tab is idle), never conclude they do not exist.") : '') + (_notUnique.length ? " notUnique values match SEVERAL rows \u2014 their rows are listed (at most ".concat(NOT_UNIQUE_ROW_LIMIT, "; matches = how many carry the exact value). Never use such a value as a reference id; address the record you mean by its _id.") : '') + (notReached.length ? " TIME BUDGET HIT: ".concat(notReached.length, " value(s) were NOT looked up \u2014 call again with just those.") : ' No filter was left behind.')
83875
+ note: "".concat(rows.length, "/").concat(multiValues.length, " located") + (bulk.serverLookups ? " in ".concat(bulk.serverLookups, " server lookup(s) of up to ").concat(BULK_LOOKUP_CHUNK, " values each.") : ' from the loaded rows, no server lookup needed.') + (returnedData.length ? " Each row carries _id, the located column and the table's required and lookup columns (translated ones in their first language)" + (fieldsOmitted.length ? ' — fieldsOmitted names the other record fields, pass the ones you need in `columns`.' : '.') : '') + (unknownColumns.length ? ' unknownColumns: no returned row carries these fields.' : '') + (missing.length ? " Missing values did NOT match — check them for typos before concluding they don't exist." : '') + (unverified.length ? " UNVERIFIED values have NO verdict \u2014 that is not a miss: their server lookup did not answer within ".concat(LOOKUP_WAIT_MS / 1000, " s, or the batch matched more rows than the table loads at once. Look them up again (smaller batches, once the tab is idle), never conclude they do not exist.") : '') + (_notUnique.length ? " notUnique values match SEVERAL rows \u2014 their rows are listed (at most ".concat(NOT_UNIQUE_ROW_LIMIT, "; matches = how many carry the exact value). Never use such a value as a reference id; address the record you mean by its _id.").concat(askWhichFeature(notUniqueNodes)) : '') + (notReached.length ? " TIME BUDGET HIT: ".concat(notReached.length, " value(s) were NOT looked up \u2014 call again with just those.") : ' No filter was left behind.')
83734
83876
  }));
83735
- case 66:
83877
+ case 68:
83736
83878
  if (!(((_args$value = args.value) !== null && _args$value !== void 0 ? _args$value : '') === '')) {
83737
- _context21.next = 68;
83879
+ _context21.next = 70;
83738
83880
  break;
83739
83881
  }
83740
83882
  return _context21.abrupt("return", {
83741
83883
  error: "Provide 'value' (one row) or 'values' (bulk read)."
83742
83884
  });
83743
- case 68:
83885
+ case 70:
83744
83886
  // Captured before the lookup: a rejected loose hit must hand the user's OWN filter back, not an empty one.
83745
83887
  filterBeforeLocate = api.getFilterModel();
83746
- _context21.prev = 69;
83747
- _context21.next = 72;
83888
+ _context21.prev = 71;
83889
+ _context21.next = 74;
83748
83890
  return locateRowCore(api, args.column, String((_args$value2 = args.value) !== null && _args$value2 !== void 0 ? _args$value2 : ''), args.select !== false);
83749
- case 72:
83891
+ case 74:
83750
83892
  _located = _context21.sent;
83751
- _context21.next = 78;
83893
+ _context21.next = 80;
83752
83894
  break;
83753
- case 75:
83754
- _context21.prev = 75;
83755
- _context21.t2 = _context21["catch"](69);
83895
+ case 77:
83896
+ _context21.prev = 77;
83897
+ _context21.t2 = _context21["catch"](71);
83756
83898
  return _context21.abrupt("return", {
83757
83899
  error: _context21.t2 instanceof Error ? _context21.t2.message : String(_context21.t2)
83758
83900
  });
83759
- case 78:
83901
+ case 80:
83760
83902
  if (_located.node) {
83761
- _context21.next = 80;
83903
+ _context21.next = 82;
83762
83904
  break;
83763
83905
  }
83764
83906
  return _context21.abrupt("return", _objectSpread$C(_objectSpread$C({
@@ -83768,43 +83910,44 @@ function createNavigationToolset(ctx) {
83768
83910
  } : {}), {}, {
83769
83911
  note: _located.lookupTimedOut ? "The server filter for ".concat(args.column, " = '").concat(args.value, "' did NOT answer within ").concat(LOOKUP_WAIT_MS / 1000, " s \u2014 this is NOT proof that the row is missing (a busy or stuck grid). Retry once the tab is idle; the lookup filter is already removed.") : "No row matched ".concat(args.column, " ~ '").concat(args.value, "'. The lookup filter is already removed \u2014 do NOT call clearGridFilter, it would drop a filter the user set.")
83770
83912
  }));
83771
- case 80:
83913
+ case 82:
83772
83914
  matchedRows = _located.filterApplied ? countDisplayedRealRows(api) : _located.loadedMatches;
83773
83915
  carrierCount = _located.exact ? countExactRows(api, _located.column, String(args.value)) : 0;
83916
+ carriers = carrierCount > 1 ? exactRowsOf(api, _located.column, String(args.value), matchesNumerically(api.getColumnDef(_located.column), String(args.value)), NOT_UNIQUE_ROW_LIMIT) : [];
83774
83917
  notUnique = carrierCount > 1 ? {
83775
83918
  value: String(args.value),
83776
83919
  matches: carrierCount,
83777
- rows: exactRowsOf(api, _located.column, String(args.value), matchesNumerically(api.getColumnDef(_located.column), String(args.value)), NOT_UNIQUE_ROW_LIMIT).map(function (node) {
83920
+ rows: carriers.map(function (node) {
83778
83921
  var _entry$getHandle$getD2, _entry$getHandle3;
83779
83922
  return pickRowFields(node.data, bulkRowFields((_entry$getHandle$getD2 = (_entry$getHandle3 = entry.getHandle()) === null || _entry$getHandle3 === void 0 ? void 0 : _entry$getHandle3.getDivaColumnDefs()) !== null && _entry$getHandle$getD2 !== void 0 ? _entry$getHandle$getD2 : [], _located.column));
83780
83923
  })
83781
83924
  } : undefined; // `exact:true` requires a genuine hit — a loose (contains/prefix) one is reported as NOT FOUND rather
83782
83925
  // than handed back disguised as the requested value (serieNo '9' resolving to '99').
83783
83926
  if (!(args.exact && !_located.exact)) {
83784
- _context21.next = 90;
83927
+ _context21.next = 93;
83785
83928
  break;
83786
83929
  }
83787
83930
  matchedValue = String((_cellValueOf2 = cellValueOf(api, _located.node, _located.column)) !== null && _cellValueOf2 !== void 0 ? _cellValueOf2 : '');
83788
83931
  if (!_located.filterApplied) {
83789
- _context21.next = 89;
83932
+ _context21.next = 92;
83790
83933
  break;
83791
83934
  }
83792
83935
  api.setFilterModel(Object.keys(filterBeforeLocate !== null && filterBeforeLocate !== void 0 ? filterBeforeLocate : {}).length ? filterBeforeLocate : null);
83793
- _context21.next = 89;
83936
+ _context21.next = 92;
83794
83937
  return waitForRows(api);
83795
- case 89:
83938
+ case 92:
83796
83939
  return _context21.abrupt("return", {
83797
83940
  matchedRows: 0,
83798
83941
  note: "No EXACT match for ".concat(args.column, " = '").concat(args.value, "' \u2014 the closest candidate was '").concat(matchedValue, "' (").concat(matchedRows, " loose candidate(s) total, none exact). Nothing was selected.")
83799
83942
  });
83800
- case 90:
83943
+ case 93:
83801
83944
  if (!(args.select !== false)) {
83802
- _context21.next = 93;
83945
+ _context21.next = 96;
83803
83946
  break;
83804
83947
  }
83805
- _context21.next = 93;
83948
+ _context21.next = 96;
83806
83949
  return sleep(400);
83807
- case 93:
83950
+ case 96:
83808
83951
  // A subtable already on screen re-renders in place, so only openToolbarTool for one NOT yet listed.
83809
83952
  gridsOnScreen = root.gridRegistry.entries.map(function (e) {
83810
83953
  return e.label;
@@ -83835,61 +83978,61 @@ function createNavigationToolset(ctx) {
83835
83978
  selected: args.select !== false,
83836
83979
  toolbarTools: listToolbarTools(),
83837
83980
  gridsOnScreen: gridsOnScreen,
83838
- note: (notUnique ? "NOT UNIQUE: ".concat(notUnique.matches, " rows carry ").concat(args.column, " = '").concat(args.value, "' \u2014 firstRow is only the first of them, notUnique.rows lists them. Never use this value as a reference id; address the record you mean by its _id. ") : '') + (_located.exact ? '' : "NOT AN EXACT MATCH: ".concat(args.column, " = '").concat(args.value, "' was requested but this row's value is different (see firstRow) \u2014 ") + "it only matched loosely. Do not treat this as proof that '".concat(args.value, "' exists; pass exact:true to require a genuine hit instead of the closest candidate. ")) + (_located.filterApplied ? 'VERIFY via firstRow that this is really the requested entity. LEAVE the filter active — it is what shows the user the match; clearGridFilter only when the user is done with this row or before locating something else.' : 'The row was already loaded — scrolled to and highlighted WITHOUT filtering; the table is fully loaded (or the value is an _id), so matchedRows is complete. No filter to clear.') + subtableHint + revealNote
83981
+ note: (notUnique ? "NOT UNIQUE: ".concat(notUnique.matches, " rows carry ").concat(args.column, " = '").concat(args.value, "' (_id ").concat(carrierIdsOf(carriers)).concat(notUnique.matches > carriers.length ? ', …' : '', ") \u2014 firstRow is only the first of them, notUnique.rows lists them. Never use this value as a reference id; address the record you mean by its _id.").concat(askWhichFeature(carriers), " ") : '') + (_located.exact ? '' : "NOT AN EXACT MATCH: ".concat(args.column, " = '").concat(args.value, "' was requested but this row's value is different (see firstRow) \u2014 ") + "it only matched loosely. Do not treat this as proof that '".concat(args.value, "' exists; pass exact:true to require a genuine hit instead of the closest candidate. ")) + (_located.filterApplied ? 'VERIFY via firstRow that this is really the requested entity. LEAVE the filter active — it is what shows the user the match; clearGridFilter only when the user is done with this row or before locating something else.' : 'The row was already loaded — scrolled to and highlighted WITHOUT filtering; the table is fully loaded (or the value is an _id), so matchedRows is complete. No filter to clear.') + subtableHint + revealNote
83839
83982
  }));
83840
- case 99:
83841
- _context21.next = 101;
83983
+ case 102:
83984
+ _context21.next = 104;
83842
83985
  return openToolbarToolById(String((_args$id = args.id) !== null && _args$id !== void 0 ? _args$id : ''));
83843
- case 101:
83986
+ case 104:
83844
83987
  openError = _context21.sent;
83845
83988
  if (!openError) {
83846
- _context21.next = 104;
83989
+ _context21.next = 107;
83847
83990
  break;
83848
83991
  }
83849
83992
  throw new Error(openError);
83850
- case 104:
83851
- _context21.next = 106;
83993
+ case 107:
83994
+ _context21.next = 109;
83852
83995
  return sleep(400);
83853
- case 106:
83996
+ case 109:
83854
83997
  return _context21.abrupt("return", {
83855
83998
  ok: true,
83856
83999
  gridsNowOnScreen: root.gridRegistry.entries.map(function (entry) {
83857
84000
  return entry.label;
83858
84001
  })
83859
84002
  });
83860
- case 107:
83861
- _context21.next = 109;
84003
+ case 110:
84004
+ _context21.next = 112;
83862
84005
  return applyParentRowPrelude(input, args);
83863
- case 109:
84006
+ case 112:
83864
84007
  prelude = _context21.sent;
83865
84008
  if (!prelude) {
83866
- _context21.next = 112;
84009
+ _context21.next = 115;
83867
84010
  break;
83868
84011
  }
83869
84012
  return _context21.abrupt("return", prelude);
83870
- case 112:
84013
+ case 115:
83871
84014
  _resolveGrid2 = resolveGrid(args.grid), _entry = _resolveGrid2.entry, _api = _resolveGrid2.api, _error = _resolveGrid2.error;
83872
84015
  if (!(_error || !_api || !_entry)) {
83873
- _context21.next = 115;
84016
+ _context21.next = 118;
83874
84017
  break;
83875
84018
  }
83876
84019
  return _context21.abrupt("return", {
83877
84020
  error: _error
83878
84021
  });
83879
- case 115:
84022
+ case 118:
83880
84023
  if (!isRealRow(_api.getDisplayedRowAtIndex(0))) {
83881
- _context21.next = 119;
84024
+ _context21.next = 122;
83882
84025
  break;
83883
84026
  }
83884
84027
  _context21.t3 = 0;
83885
- _context21.next = 122;
84028
+ _context21.next = 125;
83886
84029
  break;
83887
- case 119:
83888
- _context21.next = 121;
84030
+ case 122:
84031
+ _context21.next = 124;
83889
84032
  return waitForRows(_api);
83890
- case 121:
84033
+ case 124:
83891
84034
  _context21.t3 = _context21.sent;
83892
- case 122:
84035
+ case 125:
83893
84036
  waitedForRowsMs = _context21.t3;
83894
84037
  previewCell = function previewCell(column, v, truncatedColumns) {
83895
84038
  if (v == null || _typeof(v) !== 'object') return v;
@@ -83929,66 +84072,66 @@ function createNavigationToolset(ctx) {
83929
84072
  if (context !== null && context !== void 0 && context.isNew && !context.isEmpty) unsavedRowCount += 1;
83930
84073
  }
83931
84074
  _i2 = 0;
83932
- case 135:
84075
+ case 138:
83933
84076
  if (!(_i2 < displayed && _rows.length < limit)) {
83934
- _context21.next = 166;
84077
+ _context21.next = 169;
83935
84078
  break;
83936
84079
  }
83937
84080
  node = _api.getDisplayedRowAtIndex(_i2);
83938
84081
  if (!(!isRealRow(node) || !node.id)) {
83939
- _context21.next = 139;
84082
+ _context21.next = 142;
83940
84083
  break;
83941
84084
  }
83942
- return _context21.abrupt("continue", 163);
83943
- case 139:
84085
+ return _context21.abrupt("continue", 166);
84086
+ case 142:
83944
84087
  values = {};
83945
84088
  truncatedColumns = [];
83946
84089
  _iterator8 = _createForOfIteratorHelper$i(columns);
83947
- _context21.prev = 142;
84090
+ _context21.prev = 145;
83948
84091
  _iterator8.s();
83949
- case 144:
84092
+ case 147:
83950
84093
  if ((_step8 = _iterator8.n()).done) {
83951
- _context21.next = 154;
84094
+ _context21.next = 157;
83952
84095
  break;
83953
84096
  }
83954
84097
  column = _step8.value;
83955
84098
  raw = cellValueOf(_api, node, column);
83956
84099
  labelled = labelledLookupValues(divaDefOf(divaDefs, column), raw, node.data);
83957
84100
  if (!labelled) {
83958
- _context21.next = 151;
84101
+ _context21.next = 154;
83959
84102
  break;
83960
84103
  }
83961
84104
  values[column] = labelled;
83962
- return _context21.abrupt("continue", 152);
83963
- case 151:
84105
+ return _context21.abrupt("continue", 155);
84106
+ case 154:
83964
84107
  // The stored SET_POS_COUNT_VALUE:n form reads like a decision action; the number is what gets written back.
83965
84108
  values[column] = isPosCountActionsColumn(divaDefOf(divaDefs, column)) ? posCountOf(raw) : previewCell(column, raw, truncatedColumns);
83966
- case 152:
83967
- _context21.next = 144;
84109
+ case 155:
84110
+ _context21.next = 147;
83968
84111
  break;
83969
- case 154:
83970
- _context21.next = 159;
84112
+ case 157:
84113
+ _context21.next = 162;
83971
84114
  break;
83972
- case 156:
83973
- _context21.prev = 156;
83974
- _context21.t4 = _context21["catch"](142);
83975
- _iterator8.e(_context21.t4);
83976
84115
  case 159:
83977
84116
  _context21.prev = 159;
83978
- _iterator8.f();
83979
- return _context21.finish(159);
84117
+ _context21.t4 = _context21["catch"](145);
84118
+ _iterator8.e(_context21.t4);
83980
84119
  case 162:
84120
+ _context21.prev = 162;
84121
+ _iterator8.f();
84122
+ return _context21.finish(162);
84123
+ case 165:
83981
84124
  _rows.push(_objectSpread$C({
83982
84125
  rowId: node.id,
83983
84126
  values: values
83984
84127
  }, truncatedColumns.length ? {
83985
84128
  truncatedColumns: truncatedColumns
83986
84129
  } : {}));
83987
- case 163:
84130
+ case 166:
83988
84131
  _i2++;
83989
- _context21.next = 135;
84132
+ _context21.next = 138;
83990
84133
  break;
83991
- case 166:
84134
+ case 169:
83992
84135
  columnMeta = columns.map(function (field) {
83993
84136
  return _objectSpread$C({
83994
84137
  column: field
@@ -84032,7 +84175,7 @@ function createNavigationToolset(ctx) {
84032
84175
  countNote: dirty ? 'This table has UNCOMMITTED staged rows, so totalRowCount is inflated by them — do not report it as the row count; enumerate, or reload the page first.' : undefined,
84033
84176
  note: _rows.length === 0 ? "The table has 0 loaded rows after polling ".concat(waitedForRowsMs, " ms for its first block \u2014 its prefilter (serie/catalog selection) yields no data here. This is not a loading race any more: treat it as empty; re-read only if you changed the selection/filter or navigated since.") : "Returned ".concat(_rows.length, " of ").concat(totalRowCount, " rows").concat(_rows.length < totalRowCount ? _rows.length === limit ? " \u2014 the `limit` (".concat(limit, ") cut the slice: re-call with a higher limit (max 500) for more. For COUNTS always report totalRowCount, never the returned slice") : ' — the rest is not loaded client-side (server-side lazy table; scrolling or a filter loads more). For COUNTS always report totalRowCount, never the returned slice' : '', ". For stageTableEdits you can address rows directly by keyColumn/keyValue (unique value) \u2014 rowId is the fallback for rows without a unique key.")
84034
84177
  }));
84035
- case 176:
84178
+ case 179:
84036
84179
  callStartedAt = Date.now(); // A misspelled top-level key would be dropped in silence and `grid` would default to the wrong table.
84037
84180
  KNOWN_KEYS = ['grid', 'edits', 'addRows', 'removeRowIds', 'removeRows', 'cleanReferences', 'parentRow', 'addRowsTsv', 'source', 'mapping', 'dryRun'];
84038
84181
  ALIASES = {
@@ -84043,18 +84186,18 @@ function createNavigationToolset(ctx) {
84043
84186
  }; // Over the MCP bridge a `source` and its `mapping` are replaced by the payload's rows before the call ever
84044
84187
  // reaches here. Arriving unexpanded means this is the in-app agent, which has no payload store of its own.
84045
84188
  if (!(input !== null && input !== void 0 && input.source || input !== null && input !== void 0 && input.mapping)) {
84046
- _context21.next = 181;
84189
+ _context21.next = 184;
84047
84190
  break;
84048
84191
  }
84049
84192
  return _context21.abrupt("return", {
84050
84193
  error: "A payload `source` (and its `mapping`) only works over the MCP bridge, where the service resolves it into rows. In this chat, pass the rows as addRows or addRowsTsv, with the table's own column ids. Nothing was staged."
84051
84194
  });
84052
- case 181:
84195
+ case 184:
84053
84196
  unknownKeys = Object.keys(input !== null && input !== void 0 ? input : {}).filter(function (key) {
84054
84197
  return !KNOWN_KEYS.includes(key);
84055
84198
  });
84056
84199
  if (!unknownKeys.length) {
84057
- _context21.next = 185;
84200
+ _context21.next = 188;
84058
84201
  break;
84059
84202
  }
84060
84203
  hints = unknownKeys.map(function (key) {
@@ -84063,7 +84206,7 @@ function createNavigationToolset(ctx) {
84063
84206
  return _context21.abrupt("return", {
84064
84207
  error: "Unknown parameter(s) ".concat(hints.join(', '), ". stageTableEdits takes: ").concat(KNOWN_KEYS.join(', '), ". Nothing was staged.")
84065
84208
  });
84066
- case 185:
84209
+ case 188:
84067
84210
  edits = Array.isArray(input === null || input === void 0 ? void 0 : input.edits) ? input.edits : []; // A missing `newValue` would coerce to '' — the documented "clear the cell" — and wipe the cell in silence.
84068
84211
  EDIT_KEYS = ['rowId', 'keyColumn', 'keyValue', 'column', 'newValue'];
84069
84212
  EDIT_ALIASES = {
@@ -84086,13 +84229,13 @@ function createNavigationToolset(ctx) {
84086
84229
  return ["edits[".concat(index, "] ").concat(faults.filter(Boolean).join(' and '))];
84087
84230
  });
84088
84231
  if (!editFaults.length) {
84089
- _context21.next = 191;
84232
+ _context21.next = 194;
84090
84233
  break;
84091
84234
  }
84092
84235
  return _context21.abrupt("return", {
84093
84236
  error: "".concat(editFaults.join('; '), ". Each edit takes: ").concat(EDIT_KEYS.join(', '), " \u2014 newValue is required (an empty string clears the cell). Nothing was staged.")
84094
84237
  });
84095
- case 191:
84238
+ case 194:
84096
84239
  // Entries without the `values` wrapper are unambiguous — treat the entry AS the values.
84097
84240
  addRows = (Array.isArray(input === null || input === void 0 ? void 0 : input.addRows) ? input.addRows : []).map(function (row) {
84098
84241
  return row && _typeof(row) === 'object' && !('values' in row) && Object.keys(row).length ? {
@@ -84108,7 +84251,7 @@ function createNavigationToolset(ctx) {
84108
84251
  tsvHeaderLine = '';
84109
84252
  tsvRowLines = [];
84110
84253
  if (!(addRowsTsv !== undefined)) {
84111
- _context21.next = 211;
84254
+ _context21.next = 214;
84112
84255
  break;
84113
84256
  }
84114
84257
  lines = addRowsTsv.split('\n').map(function (line) {
@@ -84119,13 +84262,13 @@ function createNavigationToolset(ctx) {
84119
84262
  // Exactly one empty tail is the final newline; a second one is a blank row the caller wrote and gets its fault.
84120
84263
  if (lines.length && lines[lines.length - 1] === '') lines.pop();
84121
84264
  if (!(lines.length < 2)) {
84122
- _context21.next = 201;
84265
+ _context21.next = 204;
84123
84266
  break;
84124
84267
  }
84125
84268
  return _context21.abrupt("return", {
84126
84269
  error: "addRowsTsv needs a HEADER line of column field ids and at least one row line, tab-separated (e.g. 'typeNo\\tsequenceNo' then 'ART_001\\t10'). Nothing was staged."
84127
84270
  });
84128
- case 201:
84271
+ case 204:
84129
84272
  tsvHeaderLine = lines[0];
84130
84273
  tsvRowLines = lines.slice(1);
84131
84274
  header = lines[0].split('\t').map(function (cell) {
@@ -84135,13 +84278,13 @@ function createNavigationToolset(ctx) {
84135
84278
  return cell && header.indexOf(cell) !== index;
84136
84279
  });
84137
84280
  if (!(!header.every(Boolean) || duplicate)) {
84138
- _context21.next = 207;
84281
+ _context21.next = 210;
84139
84282
  break;
84140
84283
  }
84141
84284
  return _context21.abrupt("return", {
84142
84285
  error: duplicate ? "addRowsTsv names the column '".concat(duplicate, "' twice in its header line. Nothing was staged.") : 'addRowsTsv has an empty column name in its header line. Nothing was staged.'
84143
84286
  });
84144
- case 207:
84287
+ case 210:
84145
84288
  faults = [];
84146
84289
  lines.slice(1).forEach(function (line, index) {
84147
84290
  if (!line.trim()) {
@@ -84155,9 +84298,9 @@ function createNavigationToolset(ctx) {
84155
84298
  }
84156
84299
  var values = Object.fromEntries(header.map(function (column, position) {
84157
84300
  return [column, cells[position].trim()];
84158
- }).filter(function (_ref22) {
84159
- var _ref23 = _slicedToArray(_ref22, 2),
84160
- value = _ref23[1];
84301
+ }).filter(function (_ref23) {
84302
+ var _ref24 = _slicedToArray(_ref23, 2),
84303
+ value = _ref24[1];
84161
84304
  return value !== '';
84162
84305
  }));
84163
84306
  if (!Object.keys(values).length) {
@@ -84169,19 +84312,19 @@ function createNavigationToolset(ctx) {
84169
84312
  });
84170
84313
  });
84171
84314
  if (!faults.length) {
84172
- _context21.next = 211;
84315
+ _context21.next = 214;
84173
84316
  break;
84174
84317
  }
84175
84318
  return _context21.abrupt("return", {
84176
84319
  error: "addRowsTsv: ".concat(faults.slice(0, 5).join('; ')).concat(faults.length > 5 ? "; and ".concat(faults.length - 5, " more") : '', ". Every row line needs exactly one cell per header column (an empty cell leaves that column unset). Nothing was staged.")
84177
84320
  });
84178
- case 211:
84321
+ case 214:
84179
84322
  removeRowIds = _toConsumableArray(new Set((Array.isArray(input === null || input === void 0 ? void 0 : input.removeRowIds) ? input.removeRowIds : []).map(String)));
84180
84323
  removeRows = Array.isArray(input === null || input === void 0 ? void 0 : input.removeRows) ? input.removeRows : []; // A dry run must NEVER reach the staging path below. It only knows how to check NEW rows: entered on
84181
84324
  // `dryRun && addRows.length`, a dry run carrying only edits or removals used to fall through and was staged,
84182
84325
  // approved and committed for real. A mixed call would check the rows and write the rest — refused as well.
84183
84326
  if (!(input !== null && input !== void 0 && input.dryRun && (!addRows.length || edits.length || removeRowIds.length || removeRows.length))) {
84184
- _context21.next = 215;
84327
+ _context21.next = 218;
84185
84328
  break;
84186
84329
  }
84187
84330
  return _context21.abrupt("return", {
@@ -84189,7 +84332,7 @@ function createNavigationToolset(ctx) {
84189
84332
  dryRun: true,
84190
84333
  error: 'A dry run checks NEW rows only (addRows, addRowsTsv or a payload `source`)' + (addRows.length ? ', and this call also carries edits or removals, which it would not check. ' : ', and this call carries none. ') + 'Nothing was staged. Re-send without dryRun to apply edits or removals, or send only the rows to check.'
84191
84334
  });
84192
- case 215:
84335
+ case 218:
84193
84336
  // The cap counts ROWS on screen: two edits on one row are one live grid row, so each row counts once however
84194
84337
  // many of its cells change.
84195
84338
  editedRows = new Set(edits.map(function (edit) {
@@ -84203,7 +84346,7 @@ function createNavigationToolset(ctx) {
84203
84346
  intendedRowCount = editedRows.size + addRows.length + removeRowIds.length + removedRows.size; // A dry run stages nothing, so the browser limit does not apply to it — checking a big payload in one go is
84204
84347
  // exactly how an agent finds out it has to split, and what to fix before it does.
84205
84348
  if (!(intendedRowCount > WRITE_ROW_LIMIT && !(input !== null && input !== void 0 && input.dryRun))) {
84206
- _context21.next = 220;
84349
+ _context21.next = 223;
84207
84350
  break;
84208
84351
  }
84209
84352
  return _context21.abrupt("return", {
@@ -84211,54 +84354,54 @@ function createNavigationToolset(ctx) {
84211
84354
  intendedRowCount: intendedRowCount,
84212
84355
  limit: WRITE_ROW_LIMIT
84213
84356
  });
84214
- case 220:
84357
+ case 223:
84215
84358
  if (!(!edits.length && !addRows.length && !removeRowIds.length && !removeRows.length)) {
84216
- _context21.next = 222;
84359
+ _context21.next = 225;
84217
84360
  break;
84218
84361
  }
84219
84362
  throw new Error('Provide edits: [{rowId | keyColumn+keyValue, column, newValue}], addRows: [{values}], removeRowIds and/or removeRows: [{keyColumn, keyValue}] — key addressing locates the row for you (unique value of any column), rowIds come from readGridRows.');
84220
- case 222:
84221
- _context21.next = 224;
84363
+ case 225:
84364
+ _context21.next = 227;
84222
84365
  return applyParentRowPrelude(input, args);
84223
- case 224:
84366
+ case 227:
84224
84367
  _prelude = _context21.sent;
84225
84368
  if (!_prelude) {
84226
- _context21.next = 227;
84369
+ _context21.next = 230;
84227
84370
  break;
84228
84371
  }
84229
84372
  return _context21.abrupt("return", _prelude);
84230
- case 227:
84373
+ case 230:
84231
84374
  _resolveGrid3 = resolveGrid(args.grid), _entry2 = _resolveGrid3.entry, _api2 = _resolveGrid3.api, _error2 = _resolveGrid3.error;
84232
84375
  if (!(_error2 || !_api2 || !_entry2)) {
84233
- _context21.next = 230;
84376
+ _context21.next = 233;
84234
84377
  break;
84235
84378
  }
84236
84379
  return _context21.abrupt("return", {
84237
84380
  error: _error2
84238
84381
  });
84239
- case 230:
84382
+ case 233:
84240
84383
  handle = _entry2.getHandle();
84241
84384
  if (handle) {
84242
- _context21.next = 233;
84385
+ _context21.next = 236;
84243
84386
  break;
84244
84387
  }
84245
84388
  return _context21.abrupt("return", {
84246
84389
  error: "Table '".concat(_entry2.label, "' is not ready.")
84247
84390
  });
84248
- case 233:
84391
+ case 236:
84249
84392
  if (!handle.hasPendingChanges()) {
84250
- _context21.next = 235;
84393
+ _context21.next = 238;
84251
84394
  break;
84252
84395
  }
84253
84396
  throw new Error('This table already has uncommitted (staged) changes — wait for the pending decision or ask the user to save/discard their manual edits first.');
84254
- case 235:
84397
+ case 238:
84255
84398
  if (!(_api2.getDisplayedRowCount() === 1 && !isRealRow(_api2.getDisplayedRowAtIndex(0)))) {
84256
- _context21.next = 238;
84399
+ _context21.next = 241;
84257
84400
  break;
84258
84401
  }
84259
- _context21.next = 238;
84402
+ _context21.next = 241;
84260
84403
  return waitForRows(_api2);
84261
- case 238:
84404
+ case 241:
84262
84405
  // Without parentRow the write lands under the parent the subtable is bound to — the one an earlier call left
84263
84406
  // selected. Only the subtable's own declaration names it; without one the write is refused, never guessed.
84264
84407
  explicitParentRow = !!(input !== null && input !== void 0 && input.parentRow); // Mount order is the fallback for a subtable whose module declares no parent (media refs, the assortment item
@@ -84269,13 +84412,13 @@ function createNavigationToolset(ctx) {
84269
84412
  isSubtable = explicitParentRow || !!_entry2.getBoundParent || mountedAfterFirst;
84270
84413
  parentBinding = explicitParentRow ? undefined : declaredParentBinding(_entry2);
84271
84414
  if (!(parentBinding !== null && parentBinding !== void 0 && parentBinding.refusal)) {
84272
- _context21.next = 244;
84415
+ _context21.next = 247;
84273
84416
  break;
84274
84417
  }
84275
84418
  return _context21.abrupt("return", {
84276
84419
  error: parentBinding.refusal
84277
84420
  });
84278
- case 244:
84421
+ case 247:
84279
84422
  boundParentRow = parentBinding === null || parentBinding === void 0 ? void 0 : parentBinding.parent;
84280
84423
  parentBindingNote = boundParentRow ? " SUBTABLE WRITE WITHOUT parentRow: bound to the parent row this subtable is showing \u2014 '".concat(boundParentRow.grid, "' ").concat(boundParentRow.column, " = '").concat(boundParentRow.value, "' (boundParentRow). Verify that is the intended parent; pass parentRow to bind explicitly.") : mountedAfterFirst && !explicitParentRow && !_entry2.getBoundParent ? ' SUBTABLE WRITE WITHOUT parentRow: this table declares no parent binding, so the parent row it landed under cannot be named here — verify it in the table before building on the write.' : ''; // A record _id offered as rowId — partlistpos hands the _id out AS the rowId, and locateRow.firstRow._id is the
84281
84424
  // same value — is a valid address once its node is loaded. When it is not (the subtable re-rendered, a filter
@@ -84303,40 +84446,40 @@ function createNavigationToolset(ctx) {
84303
84446
  _iterator9.f();
84304
84447
  }
84305
84448
  _i3 = 0, _arr2 = _toConsumableArray(removeRowIds);
84306
- case 252:
84449
+ case 255:
84307
84450
  if (!(_i3 < _arr2.length)) {
84308
- _context21.next = 262;
84451
+ _context21.next = 265;
84309
84452
  break;
84310
84453
  }
84311
84454
  rowId = _arr2[_i3];
84312
84455
  if (isUnloadedRecordId(rowId)) {
84313
- _context21.next = 256;
84456
+ _context21.next = 259;
84314
84457
  break;
84315
84458
  }
84316
- return _context21.abrupt("continue", 259);
84317
- case 256:
84459
+ return _context21.abrupt("continue", 262);
84460
+ case 259:
84318
84461
  removeRowIds.splice(removeRowIds.indexOf(rowId), 1);
84319
84462
  removeRows.push({
84320
84463
  keyColumn: '_id',
84321
84464
  keyValue: rowId
84322
84465
  });
84323
84466
  reroutedRecordIds += 1;
84324
- case 259:
84467
+ case 262:
84325
84468
  _i3++;
84326
- _context21.next = 252;
84469
+ _context21.next = 255;
84327
84470
  break;
84328
- case 262:
84471
+ case 265:
84329
84472
  // Hard stop for CREATES when the serie scope is unresolved — the row would be filed wherever the endpoint defaults to.
84330
84473
  serieScope = serieScopeOf(_entry2, handle);
84331
84474
  if (!(addRows.length && serieScope && !serieScope.serieId)) {
84332
- _context21.next = 265;
84475
+ _context21.next = 268;
84333
84476
  break;
84334
84477
  }
84335
84478
  return _context21.abrupt("return", {
84336
84479
  error: "'".concat(_entry2.label, "' belongs to ONE serie (its endpoint is /series/<id>/\u2026) and NO serie is selected, so a new row would be filed wherever the view defaults to \u2014 usually the FIRST serie (serie 0, the components serie). Nothing was staged."),
84337
84480
  fix: 'selectSerie(<serieNo>) first — listSeries shows the numbers and the current selection — then re-send this call unchanged.'
84338
84481
  });
84339
- case 265:
84482
+ case 268:
84340
84483
  fmt = function fmt(v) {
84341
84484
  return v == null ? undefined : _typeof(v) === 'object' ? JSON.stringify(v).slice(0, 80) : v;
84342
84485
  }; // The AG col def loses the DIVA custom props (editable/required/customParams) — check the DIVA def too.
@@ -84420,12 +84563,12 @@ function createNavigationToolset(ctx) {
84420
84563
  };
84421
84564
  var multi = !!(divaDef !== null && divaDef !== void 0 && (_divaDef$customParams7 = divaDef.customParams) !== null && _divaDef$customParams7 !== void 0 && _divaDef$customParams7.multiple);
84422
84565
  var resolve = function resolve(token) {
84423
- var _ref24, _enumData$find;
84424
- return (_ref24 = (_enumData$find = enumData.find(function (e) {
84566
+ var _ref25, _enumData$find;
84567
+ return (_ref25 = (_enumData$find = enumData.find(function (e) {
84425
84568
  return String(e === null || e === void 0 ? void 0 : e.value) === token;
84426
84569
  })) !== null && _enumData$find !== void 0 ? _enumData$find : enumData.find(function (e) {
84427
84570
  return String(e === null || e === void 0 ? void 0 : e.value).toLowerCase() === token.toLowerCase();
84428
- })) !== null && _ref24 !== void 0 ? _ref24 : enumData.find(function (e) {
84571
+ })) !== null && _ref25 !== void 0 ? _ref25 : enumData.find(function (e) {
84429
84572
  return String(e === null || e === void 0 ? void 0 : e.name).toLowerCase() === token.toLowerCase();
84430
84573
  });
84431
84574
  };
@@ -84656,7 +84799,7 @@ function createNavigationToolset(ctx) {
84656
84799
  };
84657
84800
  /** The table's own write path; a refusal comes back as the message the agent reports. */
84658
84801
  writeCell = /*#__PURE__*/function () {
84659
- var _ref25 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(rowId, column, text) {
84802
+ var _ref26 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(rowId, column, text) {
84660
84803
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
84661
84804
  while (1) switch (_context3.prev = _context3.next) {
84662
84805
  case 0:
@@ -84693,7 +84836,7 @@ function createNavigationToolset(ctx) {
84693
84836
  }, _callee3, null, [[0, 7]]);
84694
84837
  }));
84695
84838
  return function writeCell(_x24, _x25, _x26) {
84696
- return _ref25.apply(this, arguments);
84839
+ return _ref26.apply(this, arguments);
84697
84840
  };
84698
84841
  }();
84699
84842
  isLookupColumn = function isLookupColumn(column) {
@@ -84701,7 +84844,7 @@ function createNavigationToolset(ctx) {
84701
84844
  return ((_divaDefOf2 = divaDefOf(_divaDefs, column)) === null || _divaDefOf2 === void 0 ? void 0 : _divaDefOf2.cellDataType) === 'lookup';
84702
84845
  };
84703
84846
  lookupWrite = /*#__PURE__*/function () {
84704
- var _ref26 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(column, raw, rowData) {
84847
+ var _ref27 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(column, raw, rowData) {
84705
84848
  var _divaDefs$find2, _lookupParams$levels, _lookupParams$lookupV;
84706
84849
  var lookupParams, multiple, levelNames, toToken, normalizedRaw, parsed, keys, _yield$handle$resolve, data, resolved, _missing, candidates, valueForLabel, corrected, _yield$handle$resolve2, separatorHint, candidateList, candidateHint;
84707
84850
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
@@ -84826,7 +84969,7 @@ function createNavigationToolset(ctx) {
84826
84969
  }, _callee4, null, [[9, 38]]);
84827
84970
  }));
84828
84971
  return function lookupWrite(_x27, _x28, _x29) {
84829
- return _ref26.apply(this, arguments);
84972
+ return _ref27.apply(this, arguments);
84830
84973
  };
84831
84974
  }();
84832
84975
  staged = [];
@@ -84858,8 +85001,8 @@ function createNavigationToolset(ctx) {
84858
85001
  /** Keys confirmUniqueKeys did not prove unique, by `${keyColumn}\0${keyValue}` — their refusal replaces any lookup. */
84859
85002
  keyRefusals = new Map();
84860
85003
  resolveByKey = /*#__PURE__*/function () {
84861
- var _ref27 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(keyColumn, keyValue) {
84862
- var label, cacheKey, refusal, cached, located, matches, carriers, exact;
85004
+ var _ref28 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(keyColumn, keyValue) {
85005
+ var label, cacheKey, refusal, cached, located, matches, _carriers, exact;
84863
85006
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
84864
85007
  while (1) switch (_context5.prev = _context5.next) {
84865
85008
  case 0:
@@ -84931,10 +85074,10 @@ function createNavigationToolset(ctx) {
84931
85074
  break;
84932
85075
  }
84933
85076
  keyCache.set(cacheKey, null);
84934
- carriers = exactRowsOf(_api2, located.column, keyValue, matchesNumerically(_api2.getColumnDef(located.column), keyValue), NOT_UNIQUE_ROW_LIMIT);
85077
+ _carriers = exactRowsOf(_api2, located.column, keyValue, matchesNumerically(_api2.getColumnDef(located.column), keyValue), NOT_UNIQUE_ROW_LIMIT);
84935
85078
  return _context5.abrupt("return", {
84936
85079
  label: label,
84937
- error: "".concat(keyColumn, " = '").concat(keyValue, "' matches ").concat(matches, " rows (_id ").concat(recordIdsOf(carriers)).concat(matches > carriers.length ? ', …' : '', ") \u2014 not a UNIQUE key: address the one you mean by rowId = its _id.")
85080
+ error: "".concat(keyColumn, " = '").concat(keyValue, "' matches ").concat(matches, " rows (_id ").concat(carrierIdsOf(_carriers)).concat(matches > _carriers.length ? ', …' : '', ") \u2014 not a UNIQUE key: address the one you mean by rowId = its _id.").concat(askWhichFeature(_carriers))
84938
85081
  });
84939
85082
  case 29:
84940
85083
  exact = cellValueOf(_api2, located.node, located.column);
@@ -84960,11 +85103,11 @@ function createNavigationToolset(ctx) {
84960
85103
  }, _callee5, null, [[8, 14]]);
84961
85104
  }));
84962
85105
  return function resolveByKey(_x30, _x31) {
84963
- return _ref27.apply(this, arguments);
85106
+ return _ref28.apply(this, arguments);
84964
85107
  };
84965
85108
  }();
84966
85109
  resolveTarget = /*#__PURE__*/function () {
84967
- var _ref28 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(address) {
85110
+ var _ref29 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(address) {
84968
85111
  var rowId, _node, keyColumn, keyValue;
84969
85112
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
84970
85113
  while (1) switch (_context6.prev = _context6.next) {
@@ -85017,12 +85160,12 @@ function createNavigationToolset(ctx) {
85017
85160
  }, _callee6);
85018
85161
  }));
85019
85162
  return function resolveTarget(_x32) {
85020
- return _ref28.apply(this, arguments);
85163
+ return _ref29.apply(this, arguments);
85021
85164
  };
85022
85165
  }();
85023
85166
  /** Apply one column edit to an already-resolved row — shared by the direct loop and the sequential lookup path below. */
85024
85167
  applyEditToNode = /*#__PURE__*/function () {
85025
- var _ref29 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(node, rowId, column, rawNewValue) {
85168
+ var _ref30 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(node, rowId, column, rawNewValue) {
85026
85169
  var _node$data3, _api2$getRowNode;
85027
85170
  var from, _node$data2, _res$data$column, res, _ok, check, ok;
85028
85171
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
@@ -85122,7 +85265,7 @@ function createNavigationToolset(ctx) {
85122
85265
  }, _callee7);
85123
85266
  }));
85124
85267
  return function applyEditToNode(_x33, _x34, _x35, _x36) {
85125
- return _ref29.apply(this, arguments);
85268
+ return _ref30.apply(this, arguments);
85126
85269
  };
85127
85270
  }(); // --- Multiple EXISTING rows addressed by keyColumn/keyValue, none of them already loaded on screen
85128
85271
  // (the prices grid, and generally any table bigger than its initial window): each such lookup goes
@@ -85149,7 +85292,7 @@ function createNavigationToolset(ctx) {
85149
85292
  // for rows that came from a payload: the agent never read them, so this is its only way to check them — and
85150
85293
  // the answer stays small, counts plus the failing rows, however many rows there are.
85151
85294
  if (!(input !== null && input !== void 0 && input.dryRun && addRows.length)) {
85152
- _context21.next = 304;
85295
+ _context21.next = 307;
85153
85296
  break;
85154
85297
  }
85155
85298
  requiredFields = _divaDefs.filter(function (definition) {
@@ -85290,7 +85433,7 @@ function createNavigationToolset(ctx) {
85290
85433
  return "'".concat(column, "'");
85291
85434
  }).join(', '), " (editabilityUnverified) \u2014 its rule needs grid context a dry run does not have, so the real call may still refuse it. ") : '. ') + "Row numbers count the addRows list (a payload's rows follow the rows listed in the call), then the addRowsTsv lines. " + 'Re-send without dryRun to stage and commit.' + (addRows.length > WRITE_ROW_LIMIT ? " NOTE: ".concat(addRows.length, " rows exceed the ").concat(WRITE_ROW_LIMIT, "-row limit of ONE write \u2014 split them across calls.") : '')
85292
85435
  }));
85293
- case 304:
85436
+ case 307:
85294
85437
  /** Mirrors locateRowCore's own loaded-rows check (read-only) — never mutates the filter itself. */
85295
85438
  needsServerLookup = function needsServerLookup(keyColumn, keyValue) {
85296
85439
  var colDef = columnDefFor(keyColumn);
@@ -85381,51 +85524,51 @@ function createNavigationToolset(ctx) {
85381
85524
  }
85382
85525
  // The chunked pass judges uniqueness with its own lookups — this pre-check only serves the direct path.
85383
85526
  if (!(!lookupKeys.size && hasUnloadedDisplayedRows(_api2))) {
85384
- _context21.next = 347;
85527
+ _context21.next = 350;
85385
85528
  break;
85386
85529
  }
85387
85530
  keysByColumn = new Map();
85388
85531
  _i6 = 0, _arr3 = [].concat(_toConsumableArray(edits.filter(function (edit) {
85389
85532
  return (edit === null || edit === void 0 ? void 0 : edit.rowId) == null;
85390
85533
  })), _toConsumableArray(removeRows));
85391
- case 315:
85534
+ case 318:
85392
85535
  if (!(_i6 < _arr3.length)) {
85393
- _context21.next = 326;
85536
+ _context21.next = 329;
85394
85537
  break;
85395
85538
  }
85396
85539
  address = _arr3[_i6];
85397
85540
  if (!((address === null || address === void 0 ? void 0 : address.keyColumn) == null || (address === null || address === void 0 ? void 0 : address.keyValue) == null)) {
85398
- _context21.next = 319;
85541
+ _context21.next = 322;
85399
85542
  break;
85400
85543
  }
85401
- return _context21.abrupt("continue", 323);
85402
- case 319:
85544
+ return _context21.abrupt("continue", 326);
85545
+ case 322:
85403
85546
  _keyColumn2 = String(address.keyColumn);
85404
85547
  if (!(_keyColumn2 === '_id' || !columnDefFor(_keyColumn2))) {
85405
- _context21.next = 322;
85548
+ _context21.next = 325;
85406
85549
  break;
85407
85550
  }
85408
- return _context21.abrupt("continue", 323);
85409
- case 322:
85551
+ return _context21.abrupt("continue", 326);
85552
+ case 325:
85410
85553
  keysByColumn.set(_keyColumn2, ((_keysByColumn$get = keysByColumn.get(_keyColumn2)) !== null && _keysByColumn$get !== void 0 ? _keysByColumn$get : new Set()).add(String(address.keyValue)));
85411
- case 323:
85554
+ case 326:
85412
85555
  _i6++;
85413
- _context21.next = 315;
85556
+ _context21.next = 318;
85414
85557
  break;
85415
- case 326:
85558
+ case 329:
85416
85559
  _iterator15 = _createForOfIteratorHelper$i(keysByColumn);
85417
- _context21.prev = 327;
85560
+ _context21.prev = 330;
85418
85561
  _iterator15.s();
85419
- case 329:
85562
+ case 332:
85420
85563
  if ((_step15 = _iterator15.n()).done) {
85421
- _context21.next = 339;
85564
+ _context21.next = 342;
85422
85565
  break;
85423
85566
  }
85424
85567
  _step15$value = _slicedToArray(_step15.value, 2), _keyColumn3 = _step15$value[0], keyValues = _step15$value[1];
85425
85568
  _deadline = Date.now() + 14000 * Math.ceil(keyValues.size / BULK_LOOKUP_CHUNK);
85426
- _context21.next = 334;
85569
+ _context21.next = 337;
85427
85570
  return confirmUniqueKeys(_api2, _keyColumn3, _toConsumableArray(keyValues), _deadline);
85428
- case 334:
85571
+ case 337:
85429
85572
  refusals = _context21.sent;
85430
85573
  _iterator16 = _createForOfIteratorHelper$i(refusals);
85431
85574
  try {
@@ -85438,21 +85581,21 @@ function createNavigationToolset(ctx) {
85438
85581
  } finally {
85439
85582
  _iterator16.f();
85440
85583
  }
85441
- case 337:
85442
- _context21.next = 329;
85584
+ case 340:
85585
+ _context21.next = 332;
85443
85586
  break;
85444
- case 339:
85445
- _context21.next = 344;
85587
+ case 342:
85588
+ _context21.next = 347;
85446
85589
  break;
85447
- case 341:
85448
- _context21.prev = 341;
85449
- _context21.t5 = _context21["catch"](327);
85450
- _iterator15.e(_context21.t5);
85451
85590
  case 344:
85452
85591
  _context21.prev = 344;
85453
- _iterator15.f();
85454
- return _context21.finish(344);
85592
+ _context21.t5 = _context21["catch"](330);
85593
+ _iterator15.e(_context21.t5);
85455
85594
  case 347:
85595
+ _context21.prev = 347;
85596
+ _iterator15.f();
85597
+ return _context21.finish(347);
85598
+ case 350:
85456
85599
  mergedOutcome = {
85457
85600
  committed: [],
85458
85601
  failed: [],
@@ -85474,30 +85617,30 @@ function createNavigationToolset(ctx) {
85474
85617
  /** The failed chunk threw inside its commit — whether any of its rows reached the server is unknown. */
85475
85618
  chunkCommitThrew = false;
85476
85619
  if (!(lookupKeys.size > 0)) {
85477
- _context21.next = 434;
85620
+ _context21.next = 437;
85478
85621
  break;
85479
85622
  }
85480
85623
  intendedCount = edits.length + addRows.length + removeRowIds.length + removeRows.length;
85481
85624
  if (!ctx.autoApprove) awaitingApproval();
85482
85625
  _context21.t6 = ctx.autoApprove;
85483
85626
  if (_context21.t6) {
85484
- _context21.next = 360;
85627
+ _context21.next = 363;
85485
85628
  break;
85486
85629
  }
85487
- _context21.next = 359;
85630
+ _context21.next = 362;
85488
85631
  return _entry2.requestAgentApproval(intendedCount, "".concat(intendedCount, " change(s) \u2014 ").concat(lookupKeys.size, " row(s) must be located first"), signal);
85489
- case 359:
85632
+ case 362:
85490
85633
  _context21.t6 = _context21.sent;
85491
- case 360:
85634
+ case 363:
85492
85635
  _approved = _context21.t6;
85493
85636
  if (_approved) {
85494
- _context21.next = 366;
85637
+ _context21.next = 369;
85495
85638
  break;
85496
85639
  }
85497
85640
  restoreUserFilter();
85498
85641
  // As at the later bar: an aborted call (the client stopped waiting) withdraws it — no decision of the user.
85499
85642
  if (!((signal === null || signal === void 0 ? void 0 : signal.aborted) === true)) {
85500
- _context21.next = 365;
85643
+ _context21.next = 368;
85501
85644
  break;
85502
85645
  }
85503
85646
  return _context21.abrupt("return", {
@@ -85506,14 +85649,14 @@ function createNavigationToolset(ctx) {
85506
85649
  stagedCount: 0,
85507
85650
  note: 'The approval bar was WITHDRAWN because the call was cancelled (the client stopped waiting) — the user did NOT decide and nothing was staged or saved. Send the same changes again and tell the user the bar is waiting for them.'
85508
85651
  });
85509
- case 365:
85652
+ case 368:
85510
85653
  return _context21.abrupt("return", {
85511
85654
  applied: false,
85512
85655
  outcome: 'DISCARDED',
85513
85656
  stagedCount: 0,
85514
85657
  note: 'The user DECLINED the change — nothing was staged or saved. Do not retry; ask what to do instead.'
85515
85658
  });
85516
- case 366:
85659
+ case 369:
85517
85660
  preApproved = true;
85518
85661
  passDeadline = callStartedAt + KEY_PASS_BUDGET_MS;
85519
85662
  serverChunks = 0;
@@ -85554,7 +85697,7 @@ function createNavigationToolset(ctx) {
85554
85697
  value = _step18$value.value,
85555
85698
  matches = _step18$value.matches,
85556
85699
  nodes = _step18$value.nodes;
85557
- settle(value, "".concat(keyColumn, " = '").concat(value, "' matches ").concat(matches, " rows (_id ").concat(recordIdsOf(nodes)).concat(matches > nodes.length ? ', …' : '', ") \u2014 not a UNIQUE key: address the one you mean by rowId = its _id."));
85700
+ settle(value, "".concat(keyColumn, " = '").concat(value, "' matches ").concat(matches, " rows (_id ").concat(carrierIdsOf(nodes)).concat(matches > nodes.length ? ', …' : '', ") \u2014 not a UNIQUE key: address the one you mean by rowId = its _id.").concat(askWhichFeature(nodes)));
85558
85701
  }
85559
85702
  } catch (err) {
85560
85703
  _iterator18.e(err);
@@ -85589,7 +85732,7 @@ function createNavigationToolset(ctx) {
85589
85732
  /** Stages every edit/removal of the rows one lookup surfaced and commits them together, before the next filter. */
85590
85733
  stageChunk = function stageChunk(keyColumn) {
85591
85734
  return /*#__PURE__*/function () {
85592
- var _ref30 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(hits, afterServerLookup, result) {
85735
+ var _ref31 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(hits, afterServerLookup, result) {
85593
85736
  var _iterator21, _step21, value, stagedStart, removedStart, commitStarted, stagedBefore, _iterator22, _step22, _loop3, _iterator23, _step23, _value3;
85594
85737
  return _regeneratorRuntime.wrap(function _callee8$(_context9) {
85595
85738
  while (1) switch (_context9.prev = _context9.next) {
@@ -85760,21 +85903,21 @@ function createNavigationToolset(ctx) {
85760
85903
  }, _callee8, null, [[9, 41], [12, 23, 26, 29]]);
85761
85904
  }));
85762
85905
  return function (_x37, _x38, _x39) {
85763
- return _ref30.apply(this, arguments);
85906
+ return _ref31.apply(this, arguments);
85764
85907
  };
85765
85908
  }();
85766
85909
  };
85767
85910
  _iterator25 = _createForOfIteratorHelper$i(_keysByColumn);
85768
- _context21.prev = 379;
85911
+ _context21.prev = 382;
85769
85912
  _iterator25.s();
85770
- case 381:
85913
+ case 384:
85771
85914
  if ((_step25 = _iterator25.n()).done) {
85772
- _context21.next = 420;
85915
+ _context21.next = 423;
85773
85916
  break;
85774
85917
  }
85775
85918
  _step25$value = _slicedToArray(_step25.value, 2), _keyColumn5 = _step25$value[0], _keyValues = _step25$value[1];
85776
85919
  if (!(signal !== null && signal !== void 0 && signal.aborted || !roomForAnotherChunk())) {
85777
- _context21.next = 387;
85920
+ _context21.next = 390;
85778
85921
  break;
85779
85922
  }
85780
85923
  _iterator26 = _createForOfIteratorHelper$i(_keyValues);
@@ -85788,25 +85931,25 @@ function createNavigationToolset(ctx) {
85788
85931
  } finally {
85789
85932
  _iterator26.f();
85790
85933
  }
85791
- return _context21.abrupt("continue", 418);
85792
- case 387:
85934
+ return _context21.abrupt("continue", 421);
85935
+ case 390:
85793
85936
  _bulk2 = void 0;
85794
85937
  _located2 = undefined;
85795
- _context21.prev = 389;
85938
+ _context21.prev = 392;
85796
85939
  // The first chunk runs even when the approval used the budget up: a call must never answer after waiting alone.
85797
85940
  lookupDeadline = Math.max(passDeadline, Date.now() + CHUNK_RESERVE_MS);
85798
- _context21.next = 393;
85941
+ _context21.next = 396;
85799
85942
  return bulkLocateRows(_api2, _keyColumn5, _keyValues, lookupDeadline, {
85800
85943
  chunkSize: blockSize,
85801
85944
  onChunk: stageChunk(_keyColumn5)
85802
85945
  });
85803
- case 393:
85946
+ case 396:
85804
85947
  _bulk2 = _context21.sent;
85805
- _context21.next = 403;
85948
+ _context21.next = 406;
85806
85949
  break;
85807
- case 396:
85808
- _context21.prev = 396;
85809
- _context21.t7 = _context21["catch"](389);
85950
+ case 399:
85951
+ _context21.prev = 399;
85952
+ _context21.t7 = _context21["catch"](392);
85810
85953
  // A column the table cannot filter on fails before its first lookup; rows staged before that are committed.
85811
85954
  reason = _context21.t7 instanceof Error ? _context21.t7.message : String(_context21.t7);
85812
85955
  if (_located2) settleVerdicts(_keyColumn5, _located2);
@@ -85825,28 +85968,28 @@ function createNavigationToolset(ctx) {
85825
85968
  } finally {
85826
85969
  _iterator27.f();
85827
85970
  }
85828
- return _context21.abrupt("continue", 418);
85829
- case 403:
85971
+ return _context21.abrupt("continue", 421);
85972
+ case 406:
85830
85973
  settleVerdicts(_keyColumn5, _bulk2);
85831
85974
  if (!chunkError) {
85832
- _context21.next = 416;
85975
+ _context21.next = 419;
85833
85976
  break;
85834
85977
  }
85835
85978
  if (!handle.hasPendingChanges()) {
85836
- _context21.next = 408;
85979
+ _context21.next = 411;
85837
85980
  break;
85838
85981
  }
85839
- _context21.next = 408;
85982
+ _context21.next = 411;
85840
85983
  return handle.rollback();
85841
- case 408:
85984
+ case 411:
85842
85985
  if (mergedOutcome.committed.length) {
85843
- _context21.next = 412;
85986
+ _context21.next = 415;
85844
85987
  break;
85845
85988
  }
85846
85989
  if (keyFilterChanged()) keyFilterApplied = true;
85847
85990
  restoreUserFilter();
85848
85991
  throw chunkError;
85849
- case 412:
85992
+ case 415:
85850
85993
  chunkFailure = chunkError instanceof Error ? chunkError.message : String(chunkError);
85851
85994
  _iterator28 = _createForOfIteratorHelper$i(lookupKeys.keys());
85852
85995
  try {
@@ -85859,8 +86002,8 @@ function createNavigationToolset(ctx) {
85859
86002
  } finally {
85860
86003
  _iterator28.f();
85861
86004
  }
85862
- return _context21.abrupt("break", 420);
85863
- case 416:
86005
+ return _context21.abrupt("break", 423);
86006
+ case 419:
85864
86007
  _iterator29 = _createForOfIteratorHelper$i(_bulk2.notReached);
85865
86008
  try {
85866
86009
  for (_iterator29.s(); !(_step29 = _iterator29.n()).done;) {
@@ -85872,21 +86015,21 @@ function createNavigationToolset(ctx) {
85872
86015
  } finally {
85873
86016
  _iterator29.f();
85874
86017
  }
85875
- case 418:
85876
- _context21.next = 381;
86018
+ case 421:
86019
+ _context21.next = 384;
85877
86020
  break;
85878
- case 420:
85879
- _context21.next = 425;
86021
+ case 423:
86022
+ _context21.next = 428;
85880
86023
  break;
85881
- case 422:
85882
- _context21.prev = 422;
85883
- _context21.t8 = _context21["catch"](379);
85884
- _iterator25.e(_context21.t8);
85885
86024
  case 425:
85886
86025
  _context21.prev = 425;
85887
- _iterator25.f();
85888
- return _context21.finish(425);
86026
+ _context21.t8 = _context21["catch"](382);
86027
+ _iterator25.e(_context21.t8);
85889
86028
  case 428:
86029
+ _context21.prev = 428;
86030
+ _iterator25.f();
86031
+ return _context21.finish(428);
86032
+ case 431:
85890
86033
  // Bring the loaded window back to what the caller had before more edits (possibly rowId-addressed,
85891
86034
  // always assumed already-loaded) rely on it — restoreUserFilter only mutates when a lookup above
85892
86035
  // actually changed something, and the grid needs a moment to settle after a filter change.
@@ -85894,12 +86037,12 @@ function createNavigationToolset(ctx) {
85894
86037
  filterWasChanged = keyFilterApplied;
85895
86038
  restoreUserFilter();
85896
86039
  if (!filterWasChanged) {
85897
- _context21.next = 434;
86040
+ _context21.next = 437;
85898
86041
  break;
85899
86042
  }
85900
- _context21.next = 434;
86043
+ _context21.next = 437;
85901
86044
  return waitForRows(_api2);
85902
- case 434:
86045
+ case 437:
85903
86046
  remainingEdits = edits.filter(function (edit) {
85904
86047
  return (edit === null || edit === void 0 ? void 0 : edit.rowId) == null && (edit === null || edit === void 0 ? void 0 : edit.keyColumn) != null && (edit === null || edit === void 0 ? void 0 : edit.keyValue) != null && notProcessedKeys.has(lookupKeyOf(String(edit.keyColumn), String(edit.keyValue)));
85905
86048
  });
@@ -85908,73 +86051,73 @@ function createNavigationToolset(ctx) {
85908
86051
  }); // Key-addressed removals resolve to rowIds before the edit loop (conflicts are checked against the final id list).
85909
86052
  // Rows already resolved+staged+committed by the sequential lookup pass above are skipped here.
85910
86053
  _iterator30 = _createForOfIteratorHelper$i(removeRows);
85911
- _context21.prev = 437;
86054
+ _context21.prev = 440;
85912
86055
  _iterator30.s();
85913
- case 439:
86056
+ case 442:
85914
86057
  if ((_step30 = _iterator30.n()).done) {
85915
- _context21.next = 453;
86058
+ _context21.next = 456;
85916
86059
  break;
85917
86060
  }
85918
86061
  _removal2 = _step30.value;
85919
86062
  if (!((_removal2 === null || _removal2 === void 0 ? void 0 : _removal2.keyColumn) != null && (_removal2 === null || _removal2 === void 0 ? void 0 : _removal2.keyValue) != null && lookupKeys.has(lookupKeyOf(String(_removal2.keyColumn), String(_removal2.keyValue))))) {
85920
- _context21.next = 443;
86063
+ _context21.next = 446;
85921
86064
  break;
85922
86065
  }
85923
- return _context21.abrupt("continue", 451);
85924
- case 443:
85925
- _context21.next = 445;
86066
+ return _context21.abrupt("continue", 454);
86067
+ case 446:
86068
+ _context21.next = 448;
85926
86069
  return resolveTarget(_removal2);
85927
- case 445:
86070
+ case 448:
85928
86071
  _target = _context21.sent;
85929
86072
  if (!(_target.error || !_target.node)) {
85930
- _context21.next = 449;
86073
+ _context21.next = 452;
85931
86074
  break;
85932
86075
  }
85933
86076
  failed.push({
85934
86077
  rowId: _target.label,
85935
86078
  error: (_target$error = _target.error) !== null && _target$error !== void 0 ? _target$error : 'Row not found.'
85936
86079
  });
85937
- return _context21.abrupt("continue", 451);
85938
- case 449:
86080
+ return _context21.abrupt("continue", 454);
86081
+ case 452:
85939
86082
  id = String(_target.node.id);
85940
86083
  if (!removeRowIds.includes(id)) removeRowIds.push(id);
85941
- case 451:
85942
- _context21.next = 439;
86084
+ case 454:
86085
+ _context21.next = 442;
85943
86086
  break;
85944
- case 453:
85945
- _context21.next = 458;
86087
+ case 456:
86088
+ _context21.next = 461;
85946
86089
  break;
85947
- case 455:
85948
- _context21.prev = 455;
85949
- _context21.t9 = _context21["catch"](437);
85950
- _iterator30.e(_context21.t9);
85951
86090
  case 458:
85952
86091
  _context21.prev = 458;
85953
- _iterator30.f();
85954
- return _context21.finish(458);
86092
+ _context21.t9 = _context21["catch"](440);
86093
+ _iterator30.e(_context21.t9);
85955
86094
  case 461:
86095
+ _context21.prev = 461;
86096
+ _iterator30.f();
86097
+ return _context21.finish(461);
86098
+ case 464:
85956
86099
  _iterator31 = _createForOfIteratorHelper$i(edits);
85957
- _context21.prev = 462;
86100
+ _context21.prev = 465;
85958
86101
  _iterator31.s();
85959
- case 464:
86102
+ case 467:
85960
86103
  if ((_step31 = _iterator31.n()).done) {
85961
- _context21.next = 484;
86104
+ _context21.next = 487;
85962
86105
  break;
85963
86106
  }
85964
86107
  _edit4 = _step31.value;
85965
86108
  if (!((_edit4 === null || _edit4 === void 0 ? void 0 : _edit4.rowId) == null && (_edit4 === null || _edit4 === void 0 ? void 0 : _edit4.keyColumn) != null && (_edit4 === null || _edit4 === void 0 ? void 0 : _edit4.keyValue) != null && lookupKeys.has(lookupKeyOf(String(_edit4.keyColumn), String(_edit4.keyValue))))) {
85966
- _context21.next = 468;
86109
+ _context21.next = 471;
85967
86110
  break;
85968
86111
  }
85969
- return _context21.abrupt("continue", 482);
85970
- case 468:
86112
+ return _context21.abrupt("continue", 485);
86113
+ case 471:
85971
86114
  _column2 = String((_edit4$column = _edit4 === null || _edit4 === void 0 ? void 0 : _edit4.column) !== null && _edit4$column !== void 0 ? _edit4$column : '');
85972
- _context21.next = 471;
86115
+ _context21.next = 474;
85973
86116
  return resolveTarget(_edit4);
85974
- case 471:
86117
+ case 474:
85975
86118
  _target2 = _context21.sent;
85976
86119
  if (!(_target2.error || !_target2.node)) {
85977
- _context21.next = 475;
86120
+ _context21.next = 478;
85978
86121
  break;
85979
86122
  }
85980
86123
  failed.push({
@@ -85982,12 +86125,12 @@ function createNavigationToolset(ctx) {
85982
86125
  column: _column2,
85983
86126
  error: (_target2$error = _target2.error) !== null && _target2$error !== void 0 ? _target2$error : 'Row not found.'
85984
86127
  });
85985
- return _context21.abrupt("continue", 482);
85986
- case 475:
86128
+ return _context21.abrupt("continue", 485);
86129
+ case 478:
85987
86130
  _node2 = _target2.node;
85988
86131
  _rowId2 = String(_node2.id);
85989
86132
  if (!removeRowIds.includes(_rowId2)) {
85990
- _context21.next = 480;
86133
+ _context21.next = 483;
85991
86134
  break;
85992
86135
  }
85993
86136
  failed.push({
@@ -85995,25 +86138,25 @@ function createNavigationToolset(ctx) {
85995
86138
  column: _column2,
85996
86139
  error: 'This row is also being removed — edit OR remove a row, not both.'
85997
86140
  });
85998
- return _context21.abrupt("continue", 482);
85999
- case 480:
86000
- _context21.next = 482;
86141
+ return _context21.abrupt("continue", 485);
86142
+ case 483:
86143
+ _context21.next = 485;
86001
86144
  return applyEditToNode(_node2, _rowId2, _column2, _edit4 === null || _edit4 === void 0 ? void 0 : _edit4.newValue);
86002
- case 482:
86003
- _context21.next = 464;
86145
+ case 485:
86146
+ _context21.next = 467;
86004
86147
  break;
86005
- case 484:
86006
- _context21.next = 489;
86148
+ case 487:
86149
+ _context21.next = 492;
86007
86150
  break;
86008
- case 486:
86009
- _context21.prev = 486;
86010
- _context21.t10 = _context21["catch"](462);
86011
- _iterator31.e(_context21.t10);
86012
86151
  case 489:
86013
86152
  _context21.prev = 489;
86014
- _iterator31.f();
86015
- return _context21.finish(489);
86153
+ _context21.t10 = _context21["catch"](465);
86154
+ _iterator31.e(_context21.t10);
86016
86155
  case 492:
86156
+ _context21.prev = 492;
86157
+ _iterator31.f();
86158
+ return _context21.finish(492);
86159
+ case 495:
86017
86160
  targets = removeRowIds.filter(function (rowId) {
86018
86161
  if (isRealRow(_api2.getRowNode(rowId))) return true;
86019
86162
  failed.push({
@@ -86034,14 +86177,14 @@ function createNavigationToolset(ctx) {
86034
86177
  _iterator32.f();
86035
86178
  }
86036
86179
  if (!targets.length) {
86037
- _context21.next = 499;
86180
+ _context21.next = 502;
86038
86181
  break;
86039
86182
  }
86040
- _context21.next = 498;
86183
+ _context21.next = 501;
86041
86184
  return handle.stageRemoveRows(targets);
86042
- case 498:
86185
+ case 501:
86043
86186
  removed.push.apply(removed, _toConsumableArray(targets));
86044
- case 499:
86187
+ case 502:
86045
86188
  /** `sent`: what this call wrote per column it was given (plain value or lookup key) — the receipt reads these columns back. */
86046
86189
  addedRows = [];
86047
86190
  /** Columns the AGENT provided per added row — lookup writes drag companion fields into `values`. */
@@ -86052,7 +86195,7 @@ function createNavigationToolset(ctx) {
86052
86195
  addRowsStopAt = addRows.length;
86053
86196
  _loop4 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop4() {
86054
86197
  var _addRows$_i7$values, _addRows$_i, _handle$getApplicatio5, _handle$getApplicatio6;
86055
- var madeProgress, rawValues, plainCols, lookupCols, bad, _i10, _Object$entries3, _Object$entries3$_i, _column3, rawValue, check, provided, _loop7, _i11, _lookupCols, hasField, requiredMissing, seed, newId, values, sent, _i12, _plainCols, _plainCols$_i, _column4, text, ok, appData, rowDepsOf, lookupColumns, _loop8, _ret4, _api2$getRowNode$data, _api2$getRowNode8, finished, _iterator42, _step42, _divaDefOf3, _step42$value, _column5, _text, isPosCountRow, _ok2, _api2$getRowNode$data2, _api2$getRowNode9, _finished, _i13, _arr4, _divaDefOf4, _column6, editableFn, locked;
86198
+ var madeProgress, rawValues, plainCols, lookupCols, bad, _i10, _Object$entries3, _Object$entries3$_i, _column3, rawValue, check, provided, _loop7, _i11, _lookupCols, hasField, requiredMissing, seed, newId, values, sent, _i12, _plainCols, _plainCols$_i, _column4, text, ok, appData, rowDepsOf, lookupColumns, _loop8, _ret4, _api2$getRowNode$data, _api2$getRowNode9, finished, _iterator42, _step42, _divaDefOf3, _step42$value, _column5, _text, isPosCountRow, _ok2, _api2$getRowNode$data2, _api2$getRowNode10, _finished, _i13, _arr4, _divaDefOf4, _column6, editableFn, locked;
86056
86199
  return _regeneratorRuntime.wrap(function _loop4$(_context15) {
86057
86200
  while (1) switch (_context15.prev = _context15.next) {
86058
86201
  case 0:
@@ -86125,9 +86268,9 @@ function createNavigationToolset(ctx) {
86125
86268
  case 28:
86126
86269
  // Fail fast with the COMPLETE list of missing required columns; defaulted ones are filled by the add itself.
86127
86270
  // A lookup also fills its companion fields (name field, mapped fields), so those count as provided.
86128
- provided = new Set(plainCols.map(function (_ref45) {
86129
- var _ref46 = _slicedToArray(_ref45, 1),
86130
- column = _ref46[0];
86271
+ provided = new Set(plainCols.map(function (_ref46) {
86272
+ var _ref47 = _slicedToArray(_ref46, 1),
86273
+ column = _ref47[0];
86131
86274
  return column;
86132
86275
  }));
86133
86276
  _loop7 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop7() {
@@ -86256,21 +86399,21 @@ function createNavigationToolset(ctx) {
86256
86399
  return appData[dep] === undefined;
86257
86400
  });
86258
86401
  }; // The loop below consumes `lookupCols`, and the finished row is judged on every column the call wrote.
86259
- lookupColumns = lookupCols.map(function (_ref47) {
86260
- var _ref48 = _slicedToArray(_ref47, 1),
86261
- column = _ref48[0];
86402
+ lookupColumns = lookupCols.map(function (_ref48) {
86403
+ var _ref49 = _slicedToArray(_ref48, 1),
86404
+ column = _ref49[0];
86262
86405
  return column;
86263
86406
  });
86264
86407
  _loop8 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop8() {
86265
- var _api2$getRowNode$data3, _api2$getRowNode10, _lookupWriteCache$get, _api2$getRowNode11, _res$data2;
86408
+ var _api2$getRowNode$data3, _api2$getRowNode11, _lookupWriteCache$get, _api2$getRowNode12, _res$data2;
86266
86409
  var readyIdx, _lookupCols$splice$, column, rawValue, missingDeps, providers, lookupRowData, lookupCacheKey, res, resolvedWrite, _i14, _Object$entries4, _res$data, _Object$entries4$_i, _key3, _value5, write;
86267
86410
  return _regeneratorRuntime.wrap(function _loop8$(_context14) {
86268
86411
  while (1) switch (_context14.prev = _context14.next) {
86269
86412
  case 0:
86270
86413
  // Prefer a lookup whose row dependencies are already satisfied — its write may provide what the deferred one needs.
86271
- readyIdx = lookupCols.findIndex(function (_ref51) {
86272
- var _ref52 = _slicedToArray(_ref51, 1),
86273
- column = _ref52[0];
86414
+ readyIdx = lookupCols.findIndex(function (_ref52) {
86415
+ var _ref53 = _slicedToArray(_ref52, 1),
86416
+ column = _ref53[0];
86274
86417
  return rowDepsOf(column).every(function (dep) {
86275
86418
  return values[dep] !== undefined || rawValues[dep] !== undefined;
86276
86419
  });
@@ -86298,7 +86441,7 @@ function createNavigationToolset(ctx) {
86298
86441
  bad = true;
86299
86442
  return _context14.abrupt("return", 0);
86300
86443
  case 8:
86301
- lookupRowData = _objectSpread$C(_objectSpread$C(_objectSpread$C({}, rawValues), (_api2$getRowNode$data3 = (_api2$getRowNode10 = _api2.getRowNode(newId)) === null || _api2$getRowNode10 === void 0 ? void 0 : _api2$getRowNode10.data) !== null && _api2$getRowNode$data3 !== void 0 ? _api2$getRowNode$data3 : {}), values); // Resolving a lookup costs a server round-trip, and a batch of added rows overwhelmingly repeats the
86444
+ lookupRowData = _objectSpread$C(_objectSpread$C(_objectSpread$C({}, rawValues), (_api2$getRowNode$data3 = (_api2$getRowNode11 = _api2.getRowNode(newId)) === null || _api2$getRowNode11 === void 0 ? void 0 : _api2$getRowNode11.data) !== null && _api2$getRowNode$data3 !== void 0 ? _api2$getRowNode$data3 : {}), values); // Resolving a lookup costs a server round-trip, and a batch of added rows overwhelmingly repeats the
86302
86445
  // SAME key in a column (one feature class for 200 articles). Without this the staging window grows with
86303
86446
  // the row count, and a server-side grid evicts the pending rows added first - they then fail to stage
86304
86447
  // as "row disappeared" and the receipt under-reports what was written. Measured on 200 rows.
@@ -86339,11 +86482,11 @@ function createNavigationToolset(ctx) {
86339
86482
  _Object$entries4$_i = _slicedToArray(_Object$entries4[_i14], 2), _key3 = _Object$entries4$_i[0], _value5 = _Object$entries4$_i[1];
86340
86483
  if (_value5 !== undefined) resolvedWrite[_key3] = _value5;
86341
86484
  }
86342
- write = withoutProvidedValues(resolvedWrite, plainCols.map(function (_ref53) {
86343
- var _ref54 = _slicedToArray(_ref53, 1),
86344
- field = _ref54[0];
86485
+ write = withoutProvidedValues(resolvedWrite, plainCols.map(function (_ref54) {
86486
+ var _ref55 = _slicedToArray(_ref54, 1),
86487
+ field = _ref55[0];
86345
86488
  return field;
86346
- }), (_api2$getRowNode11 = _api2.getRowNode(newId)) === null || _api2$getRowNode11 === void 0 ? void 0 : _api2$getRowNode11.data);
86489
+ }), (_api2$getRowNode12 = _api2.getRowNode(newId)) === null || _api2$getRowNode12 === void 0 ? void 0 : _api2$getRowNode12.data);
86347
86490
  _context14.t1 = Object.keys(write).length;
86348
86491
  if (!_context14.t1) {
86349
86492
  _context14.next = 31;
@@ -86397,7 +86540,7 @@ function createNavigationToolset(ctx) {
86397
86540
  _context15.next = 106;
86398
86541
  break;
86399
86542
  }
86400
- finished = (_api2$getRowNode$data = (_api2$getRowNode8 = _api2.getRowNode(newId)) === null || _api2$getRowNode8 === void 0 ? void 0 : _api2$getRowNode8.data) !== null && _api2$getRowNode$data !== void 0 ? _api2$getRowNode$data : values; // A row-dependent PARSER needs the finished row just as much: the count column stores
86543
+ finished = (_api2$getRowNode$data = (_api2$getRowNode9 = _api2.getRowNode(newId)) === null || _api2$getRowNode9 === void 0 ? void 0 : _api2$getRowNode9.data) !== null && _api2$getRowNode$data !== void 0 ? _api2$getRowNode$data : values; // A row-dependent PARSER needs the finished row just as much: the count column stores
86401
86544
  // SET_POS_COUNT_VALUE:n only once the row's decision is known, and that decision is a lookup written
86402
86545
  // after it. Writing the same text again now lets the column parse it into the shape it really has.
86403
86546
  _iterator42 = _createForOfIteratorHelper$i(plainCols);
@@ -86453,11 +86596,11 @@ function createNavigationToolset(ctx) {
86453
86596
  _context15.next = 124;
86454
86597
  break;
86455
86598
  }
86456
- _finished = (_api2$getRowNode$data2 = (_api2$getRowNode9 = _api2.getRowNode(newId)) === null || _api2$getRowNode9 === void 0 ? void 0 : _api2$getRowNode9.data) !== null && _api2$getRowNode$data2 !== void 0 ? _api2$getRowNode$data2 : values; // Lookup columns too: `lookupWrite` never evaluates the rule, so a lookup a creatable table locks on the
86599
+ _finished = (_api2$getRowNode$data2 = (_api2$getRowNode10 = _api2.getRowNode(newId)) === null || _api2$getRowNode10 === void 0 ? void 0 : _api2$getRowNode10.data) !== null && _api2$getRowNode$data2 !== void 0 ? _api2$getRowNode$data2 : values; // Lookup columns too: `lookupWrite` never evaluates the rule, so a lookup a creatable table locks on the
86457
86600
  // finished row (a parent key chosen by another column) would otherwise reach the server unchecked.
86458
- _i13 = 0, _arr4 = [].concat(_toConsumableArray(plainCols.map(function (_ref49) {
86459
- var _ref50 = _slicedToArray(_ref49, 1),
86460
- field = _ref50[0];
86601
+ _i13 = 0, _arr4 = [].concat(_toConsumableArray(plainCols.map(function (_ref50) {
86602
+ var _ref51 = _slicedToArray(_ref50, 1),
86603
+ field = _ref51[0];
86461
86604
  return field;
86462
86605
  })), _toConsumableArray(lookupColumns));
86463
86606
  case 109:
@@ -86521,30 +86664,30 @@ function createNavigationToolset(ctx) {
86521
86664
  }, _loop4, null, [[80, 100, 103, 106]]);
86522
86665
  });
86523
86666
  _i7 = 0;
86524
- case 506:
86667
+ case 509:
86525
86668
  if (!(_i7 < addRows.length)) {
86526
- _context21.next = 516;
86669
+ _context21.next = 519;
86527
86670
  break;
86528
86671
  }
86529
- return _context21.delegateYield(_loop4(), "t11", 508);
86530
- case 508:
86672
+ return _context21.delegateYield(_loop4(), "t11", 511);
86673
+ case 511:
86531
86674
  _ret3 = _context21.t11;
86532
86675
  if (!(_ret3 === 0)) {
86533
- _context21.next = 511;
86676
+ _context21.next = 514;
86534
86677
  break;
86535
86678
  }
86536
- return _context21.abrupt("break", 516);
86537
- case 511:
86679
+ return _context21.abrupt("break", 519);
86680
+ case 514:
86538
86681
  if (!(_ret3 === 1)) {
86539
- _context21.next = 513;
86682
+ _context21.next = 516;
86540
86683
  break;
86541
86684
  }
86542
- return _context21.abrupt("continue", 513);
86543
- case 513:
86685
+ return _context21.abrupt("continue", 516);
86686
+ case 516:
86544
86687
  _i7++;
86545
- _context21.next = 506;
86688
+ _context21.next = 509;
86546
86689
  break;
86547
- case 516:
86690
+ case 519:
86548
86691
  unsentListedRows = addRows.slice(Math.min(addRowsStopAt, listedAddRowCount), listedAddRowCount);
86549
86692
  unsentTsvLines = tsvRowLines.slice(Math.max(0, addRowsStopAt - listedAddRowCount));
86550
86693
  keyRemainingCount = remainingEdits.length + remainingRemovals.length;
@@ -86578,16 +86721,16 @@ function createNavigationToolset(ctx) {
86578
86721
  return " ADD SCHEMA of '".concat(_entry2.label, "' \u2014 required: ").concat(req.join(', ') || 'none').concat(defaulted.length ? "; defaulted (OMIT): ".concat(defaulted.join(', ')) : '', ". Enum/lookup columns take only their listed values (listGrids/readColumnOptions).");
86579
86722
  };
86580
86723
  if (!(!staged.length && !addedRows.length && !removed.length)) {
86581
- _context21.next = 529;
86724
+ _context21.next = 532;
86582
86725
  break;
86583
86726
  }
86584
86727
  if (!handle.hasPendingChanges()) {
86585
- _context21.next = 527;
86728
+ _context21.next = 530;
86586
86729
  break;
86587
86730
  }
86588
- _context21.next = 527;
86731
+ _context21.next = 530;
86589
86732
  return handle.rollback();
86590
- case 527:
86733
+ case 530:
86591
86734
  restoreUserFilter();
86592
86735
  return _context21.abrupt("return", _objectSpread$C(_objectSpread$C({
86593
86736
  applied: false,
@@ -86597,7 +86740,7 @@ function createNavigationToolset(ctx) {
86597
86740
  }, remainingPart), {}, {
86598
86741
  note: unchanged.length ? 'NOTHING was staged: every proposed value equals the current cell value (the change may already have been applied earlier). Tell the user the data already matches — do NOT claim you changed anything.' : "Nothing could be staged \u2014 nothing to approve. Fix the failures (fresh readGridRows) and try again.".concat(failed.length ? addSchemaHint() : '')
86599
86742
  }));
86600
- case 529:
86743
+ case 532:
86601
86744
  // The table would silently skip invalid staged rows on save — surface that as a failure instead of a fake success.
86602
86745
  validationErrors = []; // Rows the sequential lookup pass already sent carry the SERVER's verdict (a rejection leaves the same
86603
86746
  // error markers) — that is reported as a server error below, not as a validation failure of the rest.
@@ -86609,21 +86752,21 @@ function createNavigationToolset(ctx) {
86609
86752
  })), _toConsumableArray(addedRows.map(function (a) {
86610
86753
  return a.rowId;
86611
86754
  })))));
86612
- _context21.prev = 532;
86755
+ _context21.prev = 535;
86613
86756
  _iterator33.s();
86614
- case 534:
86757
+ case 537:
86615
86758
  if ((_step33 = _iterator33.n()).done) {
86616
- _context21.next = 542;
86759
+ _context21.next = 545;
86617
86760
  break;
86618
86761
  }
86619
86762
  _rowId3 = _step33.value;
86620
86763
  if (!alreadySent.has(_rowId3)) {
86621
- _context21.next = 538;
86764
+ _context21.next = 541;
86622
86765
  break;
86623
86766
  }
86624
- return _context21.abrupt("continue", 540);
86625
- case 538:
86626
- rowErrors = (_api2$getRowNode12 = _api2.getRowNode(_rowId3)) === null || _api2$getRowNode12 === void 0 || (_api2$getRowNode12 = _api2$getRowNode12.data) === null || _api2$getRowNode12 === void 0 || (_api2$getRowNode12 = _api2$getRowNode12.__diva_context) === null || _api2$getRowNode12 === void 0 ? void 0 : _api2$getRowNode12.errors;
86767
+ return _context21.abrupt("continue", 543);
86768
+ case 541:
86769
+ rowErrors = (_api2$getRowNode13 = _api2.getRowNode(_rowId3)) === null || _api2$getRowNode13 === void 0 || (_api2$getRowNode13 = _api2$getRowNode13.data) === null || _api2$getRowNode13 === void 0 || (_api2$getRowNode13 = _api2$getRowNode13.__diva_context) === null || _api2$getRowNode13 === void 0 ? void 0 : _api2$getRowNode13.errors;
86627
86770
  if (Array.isArray(rowErrors) && rowErrors.length) {
86628
86771
  validationErrors.push({
86629
86772
  rowId: _rowId3,
@@ -86632,28 +86775,28 @@ function createNavigationToolset(ctx) {
86632
86775
  })
86633
86776
  });
86634
86777
  }
86635
- case 540:
86636
- _context21.next = 534;
86778
+ case 543:
86779
+ _context21.next = 537;
86637
86780
  break;
86638
- case 542:
86639
- _context21.next = 547;
86781
+ case 545:
86782
+ _context21.next = 550;
86640
86783
  break;
86641
- case 544:
86642
- _context21.prev = 544;
86643
- _context21.t12 = _context21["catch"](532);
86644
- _iterator33.e(_context21.t12);
86645
86784
  case 547:
86646
86785
  _context21.prev = 547;
86647
- _iterator33.f();
86648
- return _context21.finish(547);
86786
+ _context21.t12 = _context21["catch"](535);
86787
+ _iterator33.e(_context21.t12);
86649
86788
  case 550:
86789
+ _context21.prev = 550;
86790
+ _iterator33.f();
86791
+ return _context21.finish(550);
86792
+ case 553:
86650
86793
  if (!validationErrors.length) {
86651
- _context21.next = 555;
86794
+ _context21.next = 558;
86652
86795
  break;
86653
86796
  }
86654
- _context21.next = 553;
86797
+ _context21.next = 556;
86655
86798
  return handle.rollback();
86656
- case 553:
86799
+ case 556:
86657
86800
  restoreUserFilter();
86658
86801
  // Rows resolved by the sequential lookup pass above commit individually, BEFORE this check runs —
86659
86802
  // a validation failure in the rest of the batch cannot roll those back, so "everything was reverted"
@@ -86669,9 +86812,9 @@ function createNavigationToolset(ctx) {
86669
86812
  }, remainingPart), {}, {
86670
86813
  note: mergedOutcome.committed.length ? "".concat(mergedOutcome.committed.length, " row(s) addressed by keyColumn/keyValue were already COMMITTED individually before this validation failure (each such row is located, staged and saved on its own, to avoid losing it to a later filter change) \u2014 do NOT re-send those, see committedRowIds. The REST of the batch failed validation and was reverted: fix the listed problems and try ONE new stageTableEdits call for just those.").concat(addSchemaHint()) : "NOTHING was staged for approval: some rows fail the table's validation (everything was reverted). Fix the listed problems \u2014 e.g. fill the required columns \u2014 and try ONE new stageTableEdits call.".concat(addSchemaHint())
86671
86814
  }));
86672
- case 555:
86815
+ case 558:
86673
86816
  // Bring the first staged row into view; staged cells/rows are highlighted.
86674
- focusNode = _api2.getRowNode((_ref31 = (_ref32 = (_staged$0$rowId = (_staged$ = staged[0]) === null || _staged$ === void 0 ? void 0 : _staged$.rowId) !== null && _staged$0$rowId !== void 0 ? _staged$0$rowId : removed[0]) !== null && _ref32 !== void 0 ? _ref32 : (_addedRows$ = addedRows[0]) === null || _addedRows$ === void 0 ? void 0 : _addedRows$.rowId) !== null && _ref31 !== void 0 ? _ref31 : '');
86817
+ focusNode = _api2.getRowNode((_ref32 = (_ref33 = (_staged$0$rowId = (_staged$ = staged[0]) === null || _staged$ === void 0 ? void 0 : _staged$.rowId) !== null && _staged$0$rowId !== void 0 ? _staged$0$rowId : removed[0]) !== null && _ref33 !== void 0 ? _ref33 : (_addedRows$ = addedRows[0]) === null || _addedRows$ === void 0 ? void 0 : _addedRows$.rowId) !== null && _ref32 !== void 0 ? _ref32 : '');
86675
86818
  if ((focusNode === null || focusNode === void 0 ? void 0 : focusNode.rowIndex) != null) _api2.ensureIndexVisible(focusNode.rowIndex, 'middle');
86676
86819
  totalStaged = staged.length + addedRows.length + removed.length;
86677
86820
  /**
@@ -86703,22 +86846,22 @@ function createNavigationToolset(ctx) {
86703
86846
  cleaningLabel = (input === null || input === void 0 ? void 0 : input.cleanReferences) === true && removed.length ? "".concat(totalStaged, " change(s) - deletes ").concat(removed.length, " row(s) and removes their references (cannot be undone)") : undefined;
86704
86847
  _context21.t13 = ctx.autoApprove || preApproved;
86705
86848
  if (_context21.t13) {
86706
- _context21.next = 566;
86849
+ _context21.next = 569;
86707
86850
  break;
86708
86851
  }
86709
- _context21.next = 565;
86852
+ _context21.next = 568;
86710
86853
  return _entry2.requestAgentApproval(totalStaged, cleaningLabel, signal);
86711
- case 565:
86854
+ case 568:
86712
86855
  _context21.t13 = _context21.sent;
86713
- case 566:
86856
+ case 569:
86714
86857
  approved = _context21.t13;
86715
86858
  if (approved) {
86716
- _context21.next = 578;
86859
+ _context21.next = 581;
86717
86860
  break;
86718
86861
  }
86719
- _context21.next = 570;
86862
+ _context21.next = 573;
86720
86863
  return handle.rollback();
86721
- case 570:
86864
+ case 573:
86722
86865
  survived = survivingOperations();
86723
86866
  survivedCount = survived.changes.length + survived.addedRowIds.length + survived.removedRowIds.length;
86724
86867
  restoreUserFilter();
@@ -86726,7 +86869,7 @@ function createNavigationToolset(ctx) {
86726
86869
  withdrawn = (signal === null || signal === void 0 ? void 0 : signal.aborted) === true;
86727
86870
  decision = withdrawn ? 'The approval bar was WITHDRAWN because the call was cancelled (the client stopped waiting) — the user did NOT decide' : 'The user DISCARDED the staged changes';
86728
86871
  if (survivedCount) {
86729
- _context21.next = 577;
86872
+ _context21.next = 580;
86730
86873
  break;
86731
86874
  }
86732
86875
  return _context21.abrupt("return", {
@@ -86736,7 +86879,7 @@ function createNavigationToolset(ctx) {
86736
86879
  failed: failed.length ? summarizeFailures(failed) : undefined,
86737
86880
  note: withdrawn ? "".concat(decision, " and nothing was saved. Stage the same changes again and tell the user the bar is waiting for them.") : "".concat(decision, " \u2014 nothing was saved. Do NOT re-stage the same values; ask what to adjust instead.")
86738
86881
  });
86739
- case 577:
86882
+ case 580:
86740
86883
  return _context21.abrupt("return", {
86741
86884
  applied: true,
86742
86885
  appliedCount: survivedCount,
@@ -86754,7 +86897,7 @@ function createNavigationToolset(ctx) {
86754
86897
  outcome: withdrawn ? 'WITHDRAWN' : 'DISCARDED',
86755
86898
  note: "".concat(decision, ", but the table had ALREADY SAVED the listed operations before that ") + '(it saves pending edits by itself when the user clicks outside the grid), so the rollback found nothing to revert. ' + 'Report EXACTLY these operations as live on the server and ask the user whether to undo them — do NOT re-send them, and do not claim the discard took effect.'
86756
86899
  });
86757
- case 578:
86900
+ case 581:
86758
86901
  // Trim the echoed row: drop `*DisplayTexts` mirrors, collapse localized objects to one language.
86759
86902
  trimEcho = function trimEcho(values) {
86760
86903
  var isLocalized = function isLocalized(v) {
@@ -86780,9 +86923,9 @@ function createNavigationToolset(ctx) {
86780
86923
  return [column, cellValueOf(_api2, node, column)];
86781
86924
  })) : undefined;
86782
86925
  }; // The commit REPORTS what the server confirmed; grid state cannot (a vanished rejected row gets no marker).
86783
- _context21.next = 582;
86926
+ _context21.next = 585;
86784
86927
  return handle.commitStagedChanges();
86785
- case 582:
86928
+ case 585:
86786
86929
  finalOutcome = _context21.sent;
86787
86930
  // Rows resolved by the sequential lookup pass above were already committed individually — merge
86788
86931
  // their outcomes in. When that pass never ran (the common case), this is exactly `finalOutcome`.
@@ -86806,10 +86949,10 @@ function createNavigationToolset(ctx) {
86806
86949
  })), _toConsumableArray(addedRows.filter(function (a) {
86807
86950
  return a.rowId === rowId;
86808
86951
  }).flatMap(function (a) {
86809
- return Object.entries(a.values).map(function (_ref33) {
86810
- var _ref34 = _slicedToArray(_ref33, 2),
86811
- column = _ref34[0],
86812
- value = _ref34[1];
86952
+ return Object.entries(a.values).map(function (_ref34) {
86953
+ var _ref35 = _slicedToArray(_ref34, 2),
86954
+ column = _ref35[0],
86955
+ value = _ref35[1];
86813
86956
  return {
86814
86957
  column: column,
86815
86958
  length: String(value !== null && value !== void 0 ? value : '').length
@@ -86891,7 +87034,7 @@ function createNavigationToolset(ctx) {
86891
87034
  try {
86892
87035
  for (_iterator37.s(); !(_step37 = _iterator37.n()).done;) {
86893
87036
  _rowId6 = _step37.value;
86894
- _rowErrors = (_api2$getRowNode13 = _api2.getRowNode(_rowId6)) === null || _api2$getRowNode13 === void 0 || (_api2$getRowNode13 = _api2$getRowNode13.data) === null || _api2$getRowNode13 === void 0 || (_api2$getRowNode13 = _api2$getRowNode13.__diva_context) === null || _api2$getRowNode13 === void 0 ? void 0 : _api2$getRowNode13.errors;
87037
+ _rowErrors = (_api2$getRowNode14 = _api2.getRowNode(_rowId6)) === null || _api2$getRowNode14 === void 0 || (_api2$getRowNode14 = _api2$getRowNode14.data) === null || _api2$getRowNode14 === void 0 || (_api2$getRowNode14 = _api2$getRowNode14.__diva_context) === null || _api2$getRowNode14 === void 0 ? void 0 : _api2$getRowNode14.errors;
86895
87038
  if (Array.isArray(_rowErrors) && _rowErrors.length) {
86896
87039
  addError(_rowId6, _rowErrors.map(function (e) {
86897
87040
  return [e.field, e.errorText].filter(Boolean).join(': ');
@@ -86916,12 +87059,12 @@ function createNavigationToolset(ctx) {
86916
87059
  survivedAfterCommit = outcomeIsEmpty ? survivingOperations() : undefined;
86917
87060
  autoCommitted = !!survivedAfterCommit && survivedAfterCommit.changes.length + survivedAfterCommit.addedRowIds.length + survivedAfterCommit.removedRowIds.length > 0;
86918
87061
  if (!(outcomeIsEmpty && !autoCommitted && !serverErrors.length)) {
86919
- _context21.next = 608;
87062
+ _context21.next = 611;
86920
87063
  break;
86921
87064
  }
86922
- _context21.next = 606;
87065
+ _context21.next = 609;
86923
87066
  return handle.rollback();
86924
- case 606:
87067
+ case 609:
86925
87068
  restoreUserFilter();
86926
87069
  return _context21.abrupt("return", _objectSpread$C(_objectSpread$C({
86927
87070
  applied: false,
@@ -86930,13 +87073,13 @@ function createNavigationToolset(ctx) {
86930
87073
  }, remainingPart), {}, {
86931
87074
  note: 'NOTHING was saved: the commit reported no row as saved or rejected, and the grid holds none of the staged values any more ' + '(the table dropped the pending edits before they were sent). Do NOT report this as done — re-read the rows (readGridRows) and stage the batch again.'
86932
87075
  }));
86933
- case 608:
87076
+ case 611:
86934
87077
  autoCommittedOps = autoCommitted ? survivedAfterCommit : undefined;
86935
87078
  committedIds = new Set(autoCommittedOps ? [].concat(_toConsumableArray(autoCommittedOps.changes.map(function (change) {
86936
87079
  return change.rowId;
86937
87080
  })), _toConsumableArray(autoCommittedOps.addedRowIds), _toConsumableArray(autoCommittedOps.removedRowIds)) : (_outcome$committed = outcome === null || outcome === void 0 ? void 0 : outcome.committed) !== null && _outcome$committed !== void 0 ? _outcome$committed : []);
86938
87081
  if (!serverErrors.length) {
86939
- _context21.next = 687;
87082
+ _context21.next = 690;
86940
87083
  break;
86941
87084
  }
86942
87085
  failedIds = new Set(serverErrors.map(function (s) {
@@ -86970,9 +87113,9 @@ function createNavigationToolset(ctx) {
86970
87113
  _id: removedRecordIds.get(rowId)
86971
87114
  };
86972
87115
  }); // Clear the rejected leftovers (they would block the next staging).
86973
- _context21.next = 617;
87116
+ _context21.next = 620;
86974
87117
  return handle.rollback();
86975
- case 617:
87118
+ case 620:
86976
87119
  restoreUserFilter();
86977
87120
  // Partial failure: neither the commit report nor the rollback is reliable — read the server back per operation.
86978
87121
  hasIdColumn = !!_api2.getColumnDef('_id'); // A COUNT budget bounded nothing: one probe can spend three 8s row-waits, so 25 of them ran for ten
@@ -86987,7 +87130,7 @@ function createNavigationToolset(ctx) {
86987
87130
  filterBeforeVerify = _api2.getFilterModel();
86988
87131
  verifyFilterApplied = false;
86989
87132
  probeServerRow = /*#__PURE__*/function () {
86990
- var _ref35 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_id, onFound) {
87133
+ var _ref36 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_id, onFound) {
86991
87134
  var _id2, _located3$node$data, _located3, exact;
86992
87135
  return _regeneratorRuntime.wrap(function _callee9$(_context10) {
86993
87136
  while (1) switch (_context10.prev = _context10.next) {
@@ -87049,7 +87192,7 @@ function createNavigationToolset(ctx) {
87049
87192
  }, _callee9, null, [[5, 17]]);
87050
87193
  }));
87051
87194
  return function probeServerRow(_x40, _x41) {
87052
- return _ref35.apply(this, arguments);
87195
+ return _ref36.apply(this, arguments);
87053
87196
  };
87054
87197
  }();
87055
87198
  restoreVerifyFilter = function restoreVerifyFilter() {
@@ -87060,9 +87203,9 @@ function createNavigationToolset(ctx) {
87060
87203
  verifiedChanges = [];
87061
87204
  verifiedAdds = [];
87062
87205
  verifiedRemovals = [];
87063
- _context21.prev = 628;
87206
+ _context21.prev = 631;
87064
87207
  _iterator38 = _createForOfIteratorHelper$i(editTargets);
87065
- _context21.prev = 630;
87208
+ _context21.prev = 633;
87066
87209
  _loop5 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop5() {
87067
87210
  var _expectedValueOf, _target$from;
87068
87211
  var target, probe, serverValue, serverState;
@@ -87107,35 +87250,35 @@ function createNavigationToolset(ctx) {
87107
87250
  }, _loop5);
87108
87251
  });
87109
87252
  _iterator38.s();
87110
- case 633:
87253
+ case 636:
87111
87254
  if ((_step38 = _iterator38.n()).done) {
87112
- _context21.next = 639;
87255
+ _context21.next = 642;
87113
87256
  break;
87114
87257
  }
87115
- return _context21.delegateYield(_loop5(), "t14", 635);
87116
- case 635:
87258
+ return _context21.delegateYield(_loop5(), "t14", 638);
87259
+ case 638:
87117
87260
  if (!_context21.t14) {
87118
- _context21.next = 637;
87261
+ _context21.next = 640;
87119
87262
  break;
87120
87263
  }
87121
- return _context21.abrupt("continue", 637);
87122
- case 637:
87123
- _context21.next = 633;
87264
+ return _context21.abrupt("continue", 640);
87265
+ case 640:
87266
+ _context21.next = 636;
87124
87267
  break;
87125
- case 639:
87126
- _context21.next = 644;
87268
+ case 642:
87269
+ _context21.next = 647;
87127
87270
  break;
87128
- case 641:
87129
- _context21.prev = 641;
87130
- _context21.t15 = _context21["catch"](630);
87131
- _iterator38.e(_context21.t15);
87132
87271
  case 644:
87133
87272
  _context21.prev = 644;
87134
- _iterator38.f();
87135
- return _context21.finish(644);
87273
+ _context21.t15 = _context21["catch"](633);
87274
+ _iterator38.e(_context21.t15);
87136
87275
  case 647:
87276
+ _context21.prev = 647;
87277
+ _iterator38.f();
87278
+ return _context21.finish(647);
87279
+ case 650:
87137
87280
  _iterator39 = _createForOfIteratorHelper$i(addTargets);
87138
- _context21.prev = 648;
87281
+ _context21.prev = 651;
87139
87282
  _loop6 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop6() {
87140
87283
  var target, probe;
87141
87284
  return _regeneratorRuntime.wrap(function _loop6$(_context12) {
@@ -87163,66 +87306,66 @@ function createNavigationToolset(ctx) {
87163
87306
  }, _loop6);
87164
87307
  });
87165
87308
  _iterator39.s();
87166
- case 651:
87309
+ case 654:
87167
87310
  if ((_step39 = _iterator39.n()).done) {
87168
- _context21.next = 655;
87311
+ _context21.next = 658;
87169
87312
  break;
87170
87313
  }
87171
- return _context21.delegateYield(_loop6(), "t16", 653);
87172
- case 653:
87173
- _context21.next = 651;
87314
+ return _context21.delegateYield(_loop6(), "t16", 656);
87315
+ case 656:
87316
+ _context21.next = 654;
87174
87317
  break;
87175
- case 655:
87176
- _context21.next = 660;
87318
+ case 658:
87319
+ _context21.next = 663;
87177
87320
  break;
87178
- case 657:
87179
- _context21.prev = 657;
87180
- _context21.t17 = _context21["catch"](648);
87181
- _iterator39.e(_context21.t17);
87182
87321
  case 660:
87183
87322
  _context21.prev = 660;
87184
- _iterator39.f();
87185
- return _context21.finish(660);
87323
+ _context21.t17 = _context21["catch"](651);
87324
+ _iterator39.e(_context21.t17);
87186
87325
  case 663:
87326
+ _context21.prev = 663;
87327
+ _iterator39.f();
87328
+ return _context21.finish(663);
87329
+ case 666:
87187
87330
  _iterator40 = _createForOfIteratorHelper$i(removalTargets);
87188
- _context21.prev = 664;
87331
+ _context21.prev = 667;
87189
87332
  _iterator40.s();
87190
- case 666:
87333
+ case 669:
87191
87334
  if ((_step40 = _iterator40.n()).done) {
87192
- _context21.next = 674;
87335
+ _context21.next = 677;
87193
87336
  break;
87194
87337
  }
87195
87338
  target = _step40.value;
87196
- _context21.next = 670;
87339
+ _context21.next = 673;
87197
87340
  return probeServerRow(target._id, function () {
87198
87341
  return true;
87199
87342
  });
87200
- case 670:
87343
+ case 673:
87201
87344
  probe = _context21.sent;
87202
87345
  verifiedRemovals.push({
87203
87346
  rowId: target.rowId,
87204
87347
  serverState: probe.state === 'missing' ? 'applied' : probe.state === 'found' ? 'reverted' : 'unknown'
87205
87348
  });
87206
- case 672:
87207
- _context21.next = 666;
87349
+ case 675:
87350
+ _context21.next = 669;
87208
87351
  break;
87209
- case 674:
87210
- _context21.next = 679;
87352
+ case 677:
87353
+ _context21.next = 682;
87211
87354
  break;
87212
- case 676:
87213
- _context21.prev = 676;
87214
- _context21.t18 = _context21["catch"](664);
87215
- _iterator40.e(_context21.t18);
87216
87355
  case 679:
87217
87356
  _context21.prev = 679;
87218
- _iterator40.f();
87219
- return _context21.finish(679);
87357
+ _context21.t18 = _context21["catch"](667);
87358
+ _iterator40.e(_context21.t18);
87220
87359
  case 682:
87221
87360
  _context21.prev = 682;
87222
- // The table belongs to the user again before we answer, whatever the probes did.
87223
- restoreVerifyFilter();
87361
+ _iterator40.f();
87224
87362
  return _context21.finish(682);
87225
87363
  case 685:
87364
+ _context21.prev = 685;
87365
+ // The table belongs to the user again before we answer, whatever the probes did.
87366
+ restoreVerifyFilter();
87367
+ return _context21.finish(685);
87368
+ case 688:
87226
87369
  appliedCount = [].concat(verifiedChanges, verifiedAdds, verifiedRemovals).filter(function (v) {
87227
87370
  return v.serverState === 'applied';
87228
87371
  }).length;
@@ -87248,7 +87391,7 @@ function createNavigationToolset(ctx) {
87248
87391
  }, remainingPart), {}, {
87249
87392
  note: 'The SERVER REJECTED the listed rows. Every other operation was READ BACK from the server — its `serverState` is the truth: ' + 'applied = the effect IS on the server (do NOT re-send it), reverted = re-send it after fixing the rejection cause, ' + 'unknown = verify with readGridRows/locateRow before re-sending. Never re-send an applied or unknown operation blindly — that is how silent duplicates happen.' + (verifyDeadlineHit ? ' The read-back ran out of time, so some `unknown`s mean UNCHECKED rather than unanswered — check those yourself before deciding.' : '') + parentBindingNote
87250
87393
  }));
87251
- case 687:
87394
+ case 690:
87252
87395
  // Return the real _id so references are not built from grid rowIds; catalogs/packages list rows are new EDITORS.
87253
87396
  livePath = (_root$navigationState3 = root.navigationState.path) !== null && _root$navigationState3 !== void 0 ? _root$navigationState3 : '';
87254
87397
  editorPathFor = function editorPathFor(id) {
@@ -87320,38 +87463,38 @@ function createNavigationToolset(ctx) {
87320
87463
  column: s.column
87321
87464
  };
87322
87465
  })), _toConsumableArray(addedRows.flatMap(function (a) {
87323
- return Object.entries(a.values).filter(function (_ref36) {
87466
+ return Object.entries(a.values).filter(function (_ref37) {
87324
87467
  var _providedAddColumns$g, _providedAddColumns$g2;
87325
- var _ref37 = _slicedToArray(_ref36, 2),
87326
- column = _ref37[0],
87327
- value = _ref37[1];
87468
+ var _ref38 = _slicedToArray(_ref37, 2),
87469
+ column = _ref38[0],
87470
+ value = _ref38[1];
87328
87471
  return !isEmptyCell(value) && ((_providedAddColumns$g = (_providedAddColumns$g2 = providedAddColumns.get(a.rowId)) === null || _providedAddColumns$g2 === void 0 ? void 0 : _providedAddColumns$g2.has(column)) !== null && _providedAddColumns$g !== void 0 ? _providedAddColumns$g : true);
87329
- }).map(function (_ref38) {
87330
- var _ref39 = _slicedToArray(_ref38, 1),
87331
- column = _ref39[0];
87472
+ }).map(function (_ref39) {
87473
+ var _ref40 = _slicedToArray(_ref39, 1),
87474
+ column = _ref40[0];
87332
87475
  return {
87333
87476
  rowId: a.rowId,
87334
87477
  column: column
87335
87478
  };
87336
87479
  });
87337
- }))).filter(function (_ref40) {
87338
- var rowId = _ref40.rowId,
87339
- column = _ref40.column;
87480
+ }))).filter(function (_ref41) {
87481
+ var rowId = _ref41.rowId,
87482
+ column = _ref41.column;
87340
87483
  var node = _api2.getRowNode(rowId);
87341
87484
  return node ? isEmptyCell(cellValueOf(_api2, node, column)) : false;
87342
87485
  }); // A kept value is not proof it is the given one: a lookup's companion fields or the server can replace it.
87343
87486
  storedDiffers = addedRows.flatMap(function (a) {
87344
87487
  var _storedOf;
87345
- return Object.entries((_storedOf = storedOf(_api2.getRowNode(a.rowId), a.sent)) !== null && _storedOf !== void 0 ? _storedOf : {}).filter(function (_ref41) {
87488
+ return Object.entries((_storedOf = storedOf(_api2.getRowNode(a.rowId), a.sent)) !== null && _storedOf !== void 0 ? _storedOf : {}).filter(function (_ref42) {
87346
87489
  var _fmt2, _fmt3;
87347
- var _ref42 = _slicedToArray(_ref41, 2),
87348
- column = _ref42[0],
87349
- value = _ref42[1];
87490
+ var _ref43 = _slicedToArray(_ref42, 2),
87491
+ column = _ref43[0],
87492
+ value = _ref43[1];
87350
87493
  return !isEmptyCell(value) && String((_fmt2 = fmt(value)) !== null && _fmt2 !== void 0 ? _fmt2 : '') !== String((_fmt3 = fmt(a.sent[column])) !== null && _fmt3 !== void 0 ? _fmt3 : '');
87351
- }).map(function (_ref43) {
87352
- var _ref44 = _slicedToArray(_ref43, 2),
87353
- column = _ref44[0],
87354
- value = _ref44[1];
87494
+ }).map(function (_ref44) {
87495
+ var _ref45 = _slicedToArray(_ref44, 2),
87496
+ column = _ref45[0],
87497
+ value = _ref45[1];
87355
87498
  return {
87356
87499
  rowId: a.rowId,
87357
87500
  column: column,
@@ -87359,7 +87502,19 @@ function createNavigationToolset(ctx) {
87359
87502
  stored: fmt(value)
87360
87503
  };
87361
87504
  });
87362
- });
87505
+ }); // A new IDM item has no prices yet, and the IDM export refuses an item without its one base price group (a
87506
+ // reference item excepted). Named per item in the receipt: the same rule in the view knowledge was not acted on.
87507
+ unpricedNewItems = _entry2.label === 'items' && !!((_entry2$readUrl = _entry2.readUrl) !== null && _entry2$readUrl !== void 0 && _entry2$readUrl.includes('/catalogs/')) ? addedRows.filter(function (a) {
87508
+ return !notCommittedRowIds.includes(a.rowId);
87509
+ }).map(function (a) {
87510
+ var _api2$getRowNode8;
87511
+ return _objectSpread$C(_objectSpread$C({}, a.sent), (_api2$getRowNode8 = _api2.getRowNode(a.rowId)) === null || _api2$getRowNode8 === void 0 ? void 0 : _api2$getRowNode8.data);
87512
+ }).filter(function (row) {
87513
+ return isEmptyCell(row.itemRefSerieId) && isEmptyCell(row.itemRefTypeNo);
87514
+ }).map(function (row) {
87515
+ var _row$typeNo;
87516
+ return String((_row$typeNo = row.typeNo) !== null && _row$typeNo !== void 0 ? _row$typeNo : '(no typeNo)');
87517
+ }) : [];
87363
87518
  restoreUserFilter();
87364
87519
  return _context21.abrupt("return", _objectSpread$C(_objectSpread$C(_objectSpread$C(_objectSpread$C(_objectSpread$C(_objectSpread$C(_objectSpread$C(_objectSpread$C(_objectSpread$C({
87365
87520
  applied: true,
@@ -87399,13 +87554,13 @@ function createNavigationToolset(ctx) {
87399
87554
  return a.editorPath;
87400
87555
  }) ? ' A created catalog/pack is a new EDITOR: the list view only holds its shell — when the task continues with its content (series, articles, features, overlays, …), navigateTo its editorPath and work INSIDE (all sub-views appear in listViews there).' : '') + (
87401
87556
  // A freshly created decision reports persisted:true and then does NOTHING — it only runs where referenced.
87402
- _entry2.label === 'decisions' && withServerIds.length ? ' A NEW DECISION RUNS NOWHERE YET: it only executes once it is referenced — wire it now, right here through its usedIn* cells (stageTableEdits on usedInSeries, usedInItems, …; see the grid description), or via series.decisionRefs / items.decisionRefs; check usageCount > 0 afterwards. The planner picks the wiring up on its next use.' : '') + (ctx.autoApprove ? ' AUTO-APPROVE is on — committed WITHOUT the approval bar; mention that ONCE per reply, not per call.' : '') + (
87557
+ _entry2.label === 'decisions' && withServerIds.length ? ' A NEW DECISION RUNS NOWHERE YET: it only executes once it is referenced — wire it now, right here through its usedIn* cells (stageTableEdits on usedInSeries, usedInItems, …; see the grid description), or via series.decisionRefs / items.decisionRefs; check usageCount > 0 afterwards. The planner picks the wiring up on its next use.' : '') + (unpricedNewItems.length ? " NEW ITEM(S) ".concat(namedWithRest(unpricedNewItems, NAMED_NEW_ITEMS_LIMIT), " HAVE NO BASE PRICE GROUP \u2014 the IDM export fails without one; add ONE base price group at 0 per item (never invent a price; prices view, getGuide('pricing.authoring')) and TELL THE USER which prices are missing.") : '') + (ctx.autoApprove ? ' AUTO-APPROVE is on — committed WITHOUT the approval bar; mention that ONCE per reply, not per call.' : '') + (
87403
87558
  // A subtable commit does NOT refresh the parent row — verifying via the parent invites duplicates.
87404
87559
  isSubtable ? ' SUBTABLE WRITE: verify in THIS subtable (readGridRows), never via the parent row — the subtable is the instance, a parent aggregate is not. A parent row keeps its pre-change values and lastUpdatedDate until its table loads anew (reloadPage); only featureclasses reloads itself after a features write, a moment later.' : '') + parentBindingNote + (
87405
87560
  // The serie by NUMBER AND NAME, not by 24-hex id — the thing to check is whether this is serie 0.
87406
87561
  serieScope && (addedRows.length || staged.length || removed.length) ? " SERIE-SCOPED TABLE: these rows belong to ".concat(serieLabelOf(serieScope), " \u2014 the serie the VIEW's selector held, which AUTO-SELECTS THE FIRST serie when nobody chose one").concat(addedRows.length ? ', so a new row can land in the components serie without anyone deciding that' : '', ". CONFIRM it is the serie you meant before continuing.").concat(foreignSeries.length ? " MISMATCH: the saved record(s) report serieId ".concat(foreignSeries.join(', '), ", which is NOT this view's scope \u2014 read the rows back before doing anything else.") : '') : '') + (removed.length ? ' REMOVALS: deleting without cleanReferences is safe and IS the reference check on the catalog tables that check it (decisions, features, options, option groups, feature classes, items, series, partlists, formulas, price feature groups, finishes, detail infos, packages, pricelists): unreferenced → deleted; referenced → nothing changes and the answer lists every place by kind (first 100 + the total). Do not check references beforehand - delete, read the answer, then report the places and re-send with cleanReferences: true only after the user agreed (the answer says how many were removed; that delete cannot be undone), or re-wire the places first. ' + 'Other tables delete without checking: after such a delete read the referrers yourself - lintCatalog on the refreshed planner finds most dead pointers.' : '') + plannerStaleNote() + (stagingNotes.length ? " HOUSE-STYLE NOTES: ".concat(stagingNotes.join(' ')) : '')
87407
87562
  }));
87408
- case 702:
87563
+ case 706:
87409
87564
  // Thrown (not returned) so the refusal does NOT end the turn — the model tells the user to decide on the staged edits first.
87410
87565
  dirtyGrids = root.gridRegistry.entries.filter(function (entry) {
87411
87566
  var _entry$getHandle6;
@@ -87414,46 +87569,44 @@ function createNavigationToolset(ctx) {
87414
87569
  return entry.label;
87415
87570
  });
87416
87571
  if (!dirtyGrids.length) {
87417
- _context21.next = 705;
87572
+ _context21.next = 709;
87418
87573
  break;
87419
87574
  }
87420
87575
  throw new Error("Page reload refused: table(s) ".concat(dirtyGrids.join(', '), " still carry staged, unapproved edits that a reload would silently drop. Ask the user to \xDCbernehmen or Verwerfen them first, then call reloadPage again."));
87421
- case 705:
87576
+ case 709:
87422
87577
  rememberReloadSelection((_root$navigationState4 = root.navigationState.path) !== null && _root$navigationState4 !== void 0 ? _root$navigationState4 : '', (_ctx$getSelection = ctx.getSelection) === null || _ctx$getSelection === void 0 ? void 0 : _ctx$getSelection.call(ctx));
87423
- // Deferred so the tool result reaches the chat and the turn is persisted (the stored endedByTool record is what
87424
- // triggers the automatic 'Continue.' after the reload) before the document unloads.
87425
- setTimeout(function () {
87426
- return window.location.reload();
87427
- }, 2000);
87578
+ // Deferred until the chat has SAVED this turn (the stored endedByTool record is what triggers the automatic
87579
+ // 'Continue.' after the reload) — the agent panel reloads then; a bridge call keeps its short delay.
87580
+ requestPageReload();
87428
87581
  return _context21.abrupt("return", {
87429
87582
  ok: true,
87430
- // Tells the bridge client not to wait for a settled context — this document is gone in 2 s.
87583
+ // Tells the bridge client not to wait for a settled context — this document is gone in a moment.
87431
87584
  pageReload: true,
87432
87585
  note: "Full page reload triggered — this turn ends here. The chat reopens on this conversation and an automatic 'Continue.' follows once the view is ready (if the agent panel is not open after the reload, it fires when the user opens it). The view comes back with the same serie/article selected. Every planner instance is rebuilt from a FRESH article payload, so decisionRefs and media changes are now in effect — verify with listDecisions / getMediaInfo, do not assume."
87433
87586
  });
87434
- case 708:
87587
+ case 712:
87435
87588
  _livePath = (_root$navigationState5 = root.navigationState.path) !== null && _root$navigationState5 !== void 0 ? _root$navigationState5 : '';
87436
87589
  packageBase = (_livePath$match = _livePath.match(/^\/?packages\/([^/]+)/)) === null || _livePath$match === void 0 ? void 0 : _livePath$match[1];
87437
87590
  catalogBase = (_livePath$match2 = _livePath.match(/^\/?catalogs\/([^/]+)/)) === null || _livePath$match2 === void 0 ? void 0 : _livePath$match2[1];
87438
- baseId = (_ref55 = (_ref56 = packageBase !== null && packageBase !== void 0 ? packageBase : catalogBase) !== null && _ref56 !== void 0 ? _ref56 : ctx.packageId) !== null && _ref55 !== void 0 ? _ref55 : ctx.catalogId;
87591
+ baseId = (_ref56 = (_ref57 = packageBase !== null && packageBase !== void 0 ? packageBase : catalogBase) !== null && _ref57 !== void 0 ? _ref57 : ctx.packageId) !== null && _ref56 !== void 0 ? _ref56 : ctx.catalogId;
87439
87592
  if (baseId) {
87440
- _context21.next = 714;
87593
+ _context21.next = 718;
87441
87594
  break;
87442
87595
  }
87443
87596
  return _context21.abrupt("return", {
87444
87597
  error: 'No catalog/package context — nothing to reload.'
87445
87598
  });
87446
- case 714:
87599
+ case 718:
87447
87600
  // Package views load the ENRICHER pack, catalog views the raw IDM catalog.
87448
87601
  isPack = baseId === packageBase || !packageBase && !catalogBase && baseId === ctx.packageId;
87449
87602
  _root$webplannerInsta = root.webplannerInstanceStore.invalidateByBase(baseId), destroyed = _root$webplannerInsta.destroyed, reloadTriggered = _root$webplannerInsta.reloadTriggered, knownKeys = _root$webplannerInsta.knownKeys;
87450
87603
  source = isPack ? "PACKAGE ".concat(baseId, " (enricher pack: pricelist factors and manual prices APPLY)") : "CATALOG ".concat(baseId, " (raw IDM catalog: enricher pricelists do NOT apply \u2014 to verify pack prices, navigateTo the package view first, then reloadPlanner there)"); // A base matching no instance key invalidates nothing — report that instead of claiming the discard happened.
87451
87604
  if (!(!destroyed && !reloadTriggered)) {
87452
- _context21.next = 721;
87605
+ _context21.next = 725;
87453
87606
  break;
87454
87607
  }
87455
87608
  if (knownKeys.length) {
87456
- _context21.next = 720;
87609
+ _context21.next = 724;
87457
87610
  break;
87458
87611
  }
87459
87612
  return _context21.abrupt("return", {
@@ -87463,7 +87616,7 @@ function createNavigationToolset(ctx) {
87463
87616
  environmentUnchanged: true,
87464
87617
  note: "NOTHING TO RELOAD \u2014 no planner instance is loaded for ".concat(baseId, ", so there was no stale snapshot to discard. The next planner use loads CURRENT data from ").concat(source, ".")
87465
87618
  });
87466
- case 720:
87619
+ case 724:
87467
87620
  return _context21.abrupt("return", {
87468
87621
  ok: false,
87469
87622
  destroyed: destroyed,
@@ -87472,32 +87625,32 @@ function createNavigationToolset(ctx) {
87472
87625
  knownKeys: knownKeys,
87473
87626
  error: "Nothing was invalidated: no loaded planner belongs to '".concat(baseId, "'. Loaded instance keys are [").concat(knownKeys.join(', '), "] ") + "(key = catalogId|serieNo|itemTypeNo|language). A key whose first segment is EMPTY or differs from '".concat(baseId, "' means the ") + "configurator was mounted without the catalog binding \u2014 reload the page to re-bind, then reloadPlanner again. Do NOT treat " + "planner reads as current until this succeeds."
87474
87627
  });
87475
- case 721:
87628
+ case 725:
87476
87629
  return _context21.abrupt("return", {
87477
87630
  ok: true,
87478
87631
  destroyed: destroyed,
87479
87632
  reloadTriggered: reloadTriggered,
87480
87633
  note: "Planner instances were discarded \u2014 the next planner use loads CURRENT data from ".concat(source) + (reloadTriggered ? ' (the open configurator reloads itself, and its stale instance is destroyed rather than re-adopted)' : '') + ". The turn ends here; an automatic 'Continue.' follows."
87481
87634
  });
87482
- case 722:
87635
+ case 726:
87483
87636
  _resolveGrid4 = resolveGrid(args.grid), _entry3 = _resolveGrid4.entry, _error3 = _resolveGrid4.error;
87484
87637
  if (!(_error3 || !_entry3)) {
87485
- _context21.next = 725;
87638
+ _context21.next = 729;
87486
87639
  break;
87487
87640
  }
87488
87641
  return _context21.abrupt("return", {
87489
87642
  error: _error3
87490
87643
  });
87491
- case 725:
87644
+ case 729:
87492
87645
  _handle = _entry3.getHandle();
87493
87646
  if (_handle) {
87494
- _context21.next = 728;
87647
+ _context21.next = 732;
87495
87648
  break;
87496
87649
  }
87497
87650
  return _context21.abrupt("return", {
87498
87651
  error: "Table '".concat(_entry3.label, "' is not ready.")
87499
87652
  });
87500
- case 728:
87653
+ case 732:
87501
87654
  actionName = String((_action = input === null || input === void 0 ? void 0 : input.action) !== null && _action !== void 0 ? _action : '');
87502
87655
  actionInput = String((_input = input === null || input === void 0 ? void 0 : input.input) !== null && _input !== void 0 ? _input : '').trim();
87503
87656
  _addTargets = _handle.getDivaColumnDefs().filter(isHeaderAddColumn);
@@ -87509,15 +87662,15 @@ function createNavigationToolset(ctx) {
87509
87662
  return action.name;
87510
87663
  })));
87511
87664
  if (available.includes(actionName)) {
87512
- _context21.next = 736;
87665
+ _context21.next = 740;
87513
87666
  break;
87514
87667
  }
87515
87668
  return _context21.abrupt("return", {
87516
87669
  error: "Action '".concat(actionName, "' is not available on '").concat(_entry3.label, "' \u2014 this table has: ").concat(available.join(', ') || 'no actions', " (listGrids shows each table's actions).")
87517
87670
  });
87518
- case 736:
87671
+ case 740:
87519
87672
  approve = /*#__PURE__*/function () {
87520
- var _ref57 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(label) {
87673
+ var _ref58 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(label) {
87521
87674
  return _regeneratorRuntime.wrap(function _callee10$(_context16) {
87522
87675
  while (1) switch (_context16.prev = _context16.next) {
87523
87676
  case 0:
@@ -87540,7 +87693,7 @@ function createNavigationToolset(ctx) {
87540
87693
  }, _callee10);
87541
87694
  }));
87542
87695
  return function approve(_x42) {
87543
- return _ref57.apply(this, arguments);
87696
+ return _ref58.apply(this, arguments);
87544
87697
  };
87545
87698
  }();
87546
87699
  declined = {
@@ -87549,7 +87702,7 @@ function createNavigationToolset(ctx) {
87549
87702
  }; // Same transparency rule as stageTableEdits: a silently executed action must be reported as such.
87550
87703
  autoNote = ctx.autoApprove ? ' AUTO-APPROVE is on — executed WITHOUT the approval bar; mention that ONCE per reply, not per call.' : '';
87551
87704
  authorizedFetch = /*#__PURE__*/function () {
87552
- var _ref58 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(url, method, body) {
87705
+ var _ref59 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(url, method, body) {
87553
87706
  var response, detail;
87554
87707
  return _regeneratorRuntime.wrap(function _callee11$(_context17) {
87555
87708
  while (1) switch (_context17.prev = _context17.next) {
@@ -87584,11 +87737,11 @@ function createNavigationToolset(ctx) {
87584
87737
  }, _callee11);
87585
87738
  }));
87586
87739
  return function authorizedFetch(_x43, _x44, _x45) {
87587
- return _ref58.apply(this, arguments);
87740
+ return _ref59.apply(this, arguments);
87588
87741
  };
87589
87742
  }(); // The reload is asynchronous — purge, then wait bounded until rows are back.
87590
87743
  refreshAndSettle = /*#__PURE__*/function () {
87591
- var _ref59 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
87744
+ var _ref60 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
87592
87745
  var api, deadline;
87593
87746
  return _regeneratorRuntime.wrap(function _callee12$(_context18) {
87594
87747
  while (1) switch (_context18.prev = _context18.next) {
@@ -87615,7 +87768,7 @@ function createNavigationToolset(ctx) {
87615
87768
  }, _callee12);
87616
87769
  }));
87617
87770
  return function refreshAndSettle() {
87618
- return _ref59.apply(this, arguments);
87771
+ return _ref60.apply(this, arguments);
87619
87772
  };
87620
87773
  }();
87621
87774
  unsettledNote = ' WARNING: the table has NOT repopulated yet (server still recomputing) — before reading it, reopen the view: locateRow the parent row again, openToolbarTool the subtable.'; // Declared by the VIEW and executed by it — this toolset only carries the input and the approval.
@@ -87623,336 +87776,336 @@ function createNavigationToolset(ctx) {
87623
87776
  return action.name === actionName;
87624
87777
  });
87625
87778
  if (!viewAction) {
87626
- _context21.next = 764;
87779
+ _context21.next = 768;
87627
87780
  break;
87628
87781
  }
87629
87782
  mutating = viewAction.mutating !== false;
87630
87783
  _context21.t19 = mutating;
87631
87784
  if (!_context21.t19) {
87632
- _context21.next = 750;
87785
+ _context21.next = 754;
87633
87786
  break;
87634
87787
  }
87635
- _context21.next = 749;
87788
+ _context21.next = 753;
87636
87789
  return approve("".concat(actionName, ": ").concat(actionInput || '(no input)'));
87637
- case 749:
87790
+ case 753:
87638
87791
  _context21.t19 = !_context21.sent;
87639
- case 750:
87792
+ case 754:
87640
87793
  if (!_context21.t19) {
87641
- _context21.next = 752;
87794
+ _context21.next = 756;
87642
87795
  break;
87643
87796
  }
87644
87797
  return _context21.abrupt("return", declined);
87645
- case 752:
87646
- _context21.prev = 752;
87798
+ case 756:
87799
+ _context21.prev = 756;
87647
87800
  _context21.t20 = "";
87648
- _context21.next = 756;
87801
+ _context21.next = 760;
87649
87802
  return viewAction.run(actionInput);
87650
- case 756:
87803
+ case 760:
87651
87804
  _context21.t21 = _context21.sent;
87652
87805
  _context21.t22 = _context21.t20.concat.call(_context21.t20, _context21.t21).concat(mutating ? autoNote : '');
87653
87806
  return _context21.abrupt("return", {
87654
87807
  applied: true,
87655
87808
  note: _context21.t22
87656
87809
  });
87657
- case 761:
87658
- _context21.prev = 761;
87659
- _context21.t23 = _context21["catch"](752);
87810
+ case 765:
87811
+ _context21.prev = 765;
87812
+ _context21.t23 = _context21["catch"](756);
87660
87813
  return _context21.abrupt("return", {
87661
87814
  error: _context21.t23 instanceof Error ? _context21.t23.message : String(_context21.t23)
87662
87815
  });
87663
- case 764:
87816
+ case 768:
87664
87817
  if (!(actionName === 'cloneCatalog')) {
87665
- _context21.next = 783;
87818
+ _context21.next = 787;
87666
87819
  break;
87667
87820
  }
87668
87821
  if (isRecordId(actionInput)) {
87669
- _context21.next = 767;
87822
+ _context21.next = 771;
87670
87823
  break;
87671
87824
  }
87672
87825
  return _context21.abrupt("return", {
87673
87826
  error: "input must be the catalog's _id (24-hex) — read it from the _id column (readGridRows)."
87674
87827
  });
87675
- case 767:
87676
- _context21.next = 769;
87828
+ case 771:
87829
+ _context21.next = 773;
87677
87830
  return approve("cloneCatalog: ".concat(actionInput));
87678
- case 769:
87831
+ case 773:
87679
87832
  if (_context21.sent) {
87680
- _context21.next = 771;
87833
+ _context21.next = 775;
87681
87834
  break;
87682
87835
  }
87683
87836
  return _context21.abrupt("return", declined);
87684
- case 771:
87685
- _context21.prev = 771;
87686
- _context21.next = 774;
87837
+ case 775:
87838
+ _context21.prev = 775;
87839
+ _context21.next = 778;
87687
87840
  return authorizedFetch("".concat(root.configurationStore.apiConfig.idmService, "/catalogs/").concat(actionInput, "/clone"), 'POST', '{}');
87688
- case 774:
87689
- _context21.next = 779;
87841
+ case 778:
87842
+ _context21.next = 783;
87690
87843
  break;
87691
- case 776:
87692
- _context21.prev = 776;
87693
- _context21.t24 = _context21["catch"](771);
87844
+ case 780:
87845
+ _context21.prev = 780;
87846
+ _context21.t24 = _context21["catch"](775);
87694
87847
  return _context21.abrupt("return", {
87695
87848
  error: _context21.t24 instanceof Error ? _context21.t24.message : String(_context21.t24)
87696
87849
  });
87697
- case 779:
87698
- _context21.next = 781;
87850
+ case 783:
87851
+ _context21.next = 785;
87699
87852
  return refreshAndSettle();
87700
- case 781:
87853
+ case 785:
87701
87854
  cloneSettled = _context21.sent;
87702
87855
  return _context21.abrupt("return", {
87703
87856
  applied: true,
87704
87857
  note: "Catalog cloned server-side \u2014 the table refreshes; the copy appears as a new row (readGridRows to find it and REPORT its name + _id).".concat(autoNote).concat(cloneSettled ? '' : unsettledNote)
87705
87858
  });
87706
- case 783:
87859
+ case 787:
87707
87860
  if (!(actionName === 'importGlobalFeatures')) {
87708
- _context21.next = 803;
87861
+ _context21.next = 807;
87709
87862
  break;
87710
87863
  }
87711
87864
  catalogId = String((_catalogId = ((_handle$getApplicatio7 = (_handle$getApplicatio8 = _handle.getApplicationData) === null || _handle$getApplicatio8 === void 0 ? void 0 : _handle$getApplicatio8.call(_handle)) !== null && _handle$getApplicatio7 !== void 0 ? _handle$getApplicatio7 : {}).catalogId) !== null && _catalogId !== void 0 ? _catalogId : '');
87712
87865
  if (catalogId) {
87713
- _context21.next = 787;
87866
+ _context21.next = 791;
87714
87867
  break;
87715
87868
  }
87716
87869
  return _context21.abrupt("return", {
87717
87870
  error: 'No catalog context on this table.'
87718
87871
  });
87719
- case 787:
87720
- _context21.next = 789;
87872
+ case 791:
87873
+ _context21.next = 793;
87721
87874
  return approve('importGlobalFeatures');
87722
- case 789:
87875
+ case 793:
87723
87876
  if (_context21.sent) {
87724
- _context21.next = 791;
87877
+ _context21.next = 795;
87725
87878
  break;
87726
87879
  }
87727
87880
  return _context21.abrupt("return", declined);
87728
- case 791:
87729
- _context21.prev = 791;
87730
- _context21.next = 794;
87881
+ case 795:
87882
+ _context21.prev = 795;
87883
+ _context21.next = 798;
87731
87884
  return authorizedFetch("".concat(root.configurationStore.apiConfig.idmService, "/catalogs/").concat(catalogId, "/features/global"), 'POST');
87732
- case 794:
87733
- _context21.next = 799;
87885
+ case 798:
87886
+ _context21.next = 803;
87734
87887
  break;
87735
- case 796:
87736
- _context21.prev = 796;
87737
- _context21.t25 = _context21["catch"](791);
87888
+ case 800:
87889
+ _context21.prev = 800;
87890
+ _context21.t25 = _context21["catch"](795);
87738
87891
  return _context21.abrupt("return", {
87739
87892
  error: _context21.t25 instanceof Error ? _context21.t25.message : String(_context21.t25)
87740
87893
  });
87741
- case 799:
87742
- _context21.next = 801;
87894
+ case 803:
87895
+ _context21.next = 805;
87743
87896
  return refreshAndSettle();
87744
- case 801:
87897
+ case 805:
87745
87898
  importSettled = _context21.sent;
87746
87899
  return _context21.abrupt("return", {
87747
87900
  applied: true,
87748
87901
  note: "Global features imported \u2014 the table refreshes with the added feature rows.".concat(autoNote).concat(importSettled ? '' : unsettledNote)
87749
87902
  });
87750
- case 803:
87903
+ case 807:
87751
87904
  if (!(actionName === 'setPriceFactor' || actionName === 'setPriceFactorPriority')) {
87752
- _context21.next = 864;
87905
+ _context21.next = 868;
87753
87906
  break;
87754
87907
  }
87755
87908
  app = (_handle$getApplicatio9 = (_handle$getApplicatio10 = _handle.getApplicationData) === null || _handle$getApplicatio10 === void 0 ? void 0 : _handle$getApplicatio10.call(_handle)) !== null && _handle$getApplicatio9 !== void 0 ? _handle$getApplicatio9 : {};
87756
87909
  serieNo = Number(app.serieNo);
87757
- _context21.prev = 806;
87910
+ _context21.prev = 810;
87758
87911
  _params2 = JSON.parse(actionInput || '{}');
87759
- _context21.next = 813;
87912
+ _context21.next = 817;
87760
87913
  break;
87761
- case 810:
87762
- _context21.prev = 810;
87763
- _context21.t26 = _context21["catch"](806);
87914
+ case 814:
87915
+ _context21.prev = 814;
87916
+ _context21.t26 = _context21["catch"](810);
87764
87917
  return _context21.abrupt("return", {
87765
87918
  error: "input must be a JSON object — listGrids shows this action's exact shape."
87766
87919
  });
87767
- case 813:
87920
+ case 817:
87768
87921
  scope = String((_params2$scope = _params2.scope) !== null && _params2$scope !== void 0 ? _params2$scope : '');
87769
87922
  if (scope in PRICE_FACTOR_FIELDS) {
87770
- _context21.next = 816;
87923
+ _context21.next = 820;
87771
87924
  break;
87772
87925
  }
87773
87926
  return _context21.abrupt("return", {
87774
87927
  error: "scope must be one of: ".concat(Object.keys(PRICE_FACTOR_FIELDS).join(', '), ".")
87775
87928
  });
87776
- case 816:
87929
+ case 820:
87777
87930
  _key4 = _params2.key === undefined ? undefined : String(_params2.key); // The factor maps live on the PRICELIST record — the write goes through the parent pricelists grid row.
87778
87931
  parent = resolveGrid('pricelists');
87779
87932
  if (!(parent.error || !parent.entry || !parent.api)) {
87780
- _context21.next = 820;
87933
+ _context21.next = 824;
87781
87934
  break;
87782
87935
  }
87783
87936
  return _context21.abrupt("return", {
87784
87937
  error: "The parent 'pricelists' table must be on screen for factor actions."
87785
87938
  });
87786
- case 820:
87939
+ case 824:
87787
87940
  parentHandle = parent.entry.getHandle();
87788
87941
  if (parentHandle) {
87789
- _context21.next = 823;
87942
+ _context21.next = 827;
87790
87943
  break;
87791
87944
  }
87792
87945
  return _context21.abrupt("return", {
87793
87946
  error: "Table 'pricelists' is not ready."
87794
87947
  });
87795
- case 823:
87948
+ case 827:
87796
87949
  parent.api.forEachNode(function (node) {
87797
87950
  var _node$data5;
87798
87951
  if (((_node$data5 = node.data) === null || _node$data5 === void 0 ? void 0 : _node$data5._id) === app.pricelistId) pricelistNode = node;
87799
87952
  });
87800
87953
  if ((_pricelistNode = pricelistNode) !== null && _pricelistNode !== void 0 && _pricelistNode.id) {
87801
- _context21.next = 826;
87954
+ _context21.next = 830;
87802
87955
  break;
87803
87956
  }
87804
87957
  return _context21.abrupt("return", {
87805
87958
  error: "Pricelist ".concat(app.pricelistId, " is not loaded in the 'pricelists' table.")
87806
87959
  });
87807
- case 826:
87808
- _context21.prev = 826;
87960
+ case 830:
87961
+ _context21.prev = 830;
87809
87962
  if (!(actionName === 'setPriceFactor')) {
87810
- _context21.next = 835;
87963
+ _context21.next = 839;
87811
87964
  break;
87812
87965
  }
87813
87966
  factors = _params2.factors;
87814
87967
  if (!(!Array.isArray(factors) || factors.some(function (f) {
87815
87968
  return typeof f !== 'number' || !Number.isFinite(f) || f <= 0;
87816
87969
  }))) {
87817
- _context21.next = 831;
87970
+ _context21.next = 835;
87818
87971
  break;
87819
87972
  }
87820
87973
  return _context21.abrupt("return", {
87821
87974
  error: 'factors must be an array of positive numbers (>1 = factor, <1 = discount fraction, e.g. 0.95 = 5% off); [] clears the entry.'
87822
87975
  });
87823
- case 831:
87976
+ case 835:
87824
87977
  patch = applyPriceFactor(pricelistNode.data, serieNo, scope, _key4, factors);
87825
87978
  label = "setPriceFactor ".concat(scope).concat(_key4 ? " ".concat(_key4) : '', " \u2192 [").concat(factors.join('; '), "] (Serie ").concat(serieNo, ")");
87826
- _context21.next = 841;
87979
+ _context21.next = 845;
87827
87980
  break;
87828
- case 835:
87981
+ case 839:
87829
87982
  if (!(typeof _params2.priority !== 'boolean')) {
87830
- _context21.next = 837;
87983
+ _context21.next = 841;
87831
87984
  break;
87832
87985
  }
87833
87986
  return _context21.abrupt("return", {
87834
87987
  error: 'priority must be true or false.'
87835
87988
  });
87836
- case 837:
87989
+ case 841:
87837
87990
  if (_key4) {
87838
- _context21.next = 839;
87991
+ _context21.next = 843;
87839
87992
  break;
87840
87993
  }
87841
87994
  return _context21.abrupt("return", {
87842
87995
  error: 'key is required (the pfg id / price group).'
87843
87996
  });
87844
- case 839:
87997
+ case 843:
87845
87998
  patch = applyPriceFactorPriority(pricelistNode.data, serieNo, scope, _key4, _params2.priority);
87846
87999
  label = "setPriceFactorPriority ".concat(scope, " ").concat(_key4, " \u2192 ").concat(_params2.priority, " (Serie ").concat(serieNo, ")");
87847
- case 841:
87848
- _context21.next = 846;
88000
+ case 845:
88001
+ _context21.next = 850;
87849
88002
  break;
87850
- case 843:
87851
- _context21.prev = 843;
87852
- _context21.t27 = _context21["catch"](826);
88003
+ case 847:
88004
+ _context21.prev = 847;
88005
+ _context21.t27 = _context21["catch"](830);
87853
88006
  return _context21.abrupt("return", {
87854
88007
  error: _context21.t27 instanceof Error ? _context21.t27.message : String(_context21.t27)
87855
88008
  });
87856
- case 846:
87857
- _context21.next = 848;
88009
+ case 850:
88010
+ _context21.next = 852;
87858
88011
  return approve(label);
87859
- case 848:
88012
+ case 852:
87860
88013
  if (_context21.sent) {
87861
- _context21.next = 850;
88014
+ _context21.next = 854;
87862
88015
  break;
87863
88016
  }
87864
88017
  return _context21.abrupt("return", declined);
87865
- case 850:
88018
+ case 854:
87866
88019
  pricelistRowId = pricelistNode.id;
87867
- _context21.next = 853;
88020
+ _context21.next = 857;
87868
88021
  return parentHandle.setNodeDataValue(pricelistRowId, patch, {
87869
88022
  suppressAutoCommit: true
87870
88023
  });
87871
- case 853:
88024
+ case 857:
87872
88025
  if (_context21.sent) {
87873
- _context21.next = 855;
88026
+ _context21.next = 859;
87874
88027
  break;
87875
88028
  }
87876
88029
  return _context21.abrupt("return", {
87877
88030
  error: 'The pricelist row rejected the update.'
87878
88031
  });
87879
- case 855:
87880
- _context21.next = 857;
88032
+ case 859:
88033
+ _context21.next = 861;
87881
88034
  return parentHandle.commitStagedChanges();
87882
- case 857:
88035
+ case 861:
87883
88036
  factorOutcome = _context21.sent;
87884
88037
  rejected = factorOutcome === null || factorOutcome === void 0 ? void 0 : factorOutcome.failed.find(function (failure) {
87885
88038
  return failure.rowId === pricelistRowId;
87886
88039
  });
87887
88040
  if (!rejected) {
87888
- _context21.next = 861;
88041
+ _context21.next = 865;
87889
88042
  break;
87890
88043
  }
87891
88044
  return _context21.abrupt("return", {
87892
88045
  error: "The server rejected the factor update: ".concat(rejected.errors.join(' ') || 'no reason given', ". Nothing was changed.")
87893
88046
  });
87894
- case 861:
88047
+ case 865:
87895
88048
  if (!(factorOutcome && !factorOutcome.committed.includes(pricelistRowId))) {
87896
- _context21.next = 863;
88049
+ _context21.next = 867;
87897
88050
  break;
87898
88051
  }
87899
88052
  return _context21.abrupt("return", {
87900
88053
  error: 'The factor update was NOT saved — the commit did not confirm the pricelist row. Re-read the pricelist (readGridRows) before retrying.'
87901
88054
  });
87902
- case 863:
88055
+ case 867:
87903
88056
  return _context21.abrupt("return", {
87904
88057
  applied: true,
87905
88058
  note: "Saved on the pricelist record and confirmed by the server (same path as the factor modal) \u2014 the prices table reflects it immediately.".concat(autoNote)
87906
88059
  });
87907
- case 864:
88060
+ case 868:
87908
88061
  if (!(actionName === 'deleteAllManualPrices')) {
87909
- _context21.next = 882;
88062
+ _context21.next = 886;
87910
88063
  break;
87911
88064
  }
87912
88065
  _app = (_handle$getApplicatio11 = (_handle$getApplicatio12 = _handle.getApplicationData) === null || _handle$getApplicatio12 === void 0 ? void 0 : _handle$getApplicatio12.call(_handle)) !== null && _handle$getApplicatio11 !== void 0 ? _handle$getApplicatio11 : {};
87913
- _context21.next = 868;
88066
+ _context21.next = 872;
87914
88067
  return approve("deleteAllManualPrices (Pricelist ".concat(_app.pricelistId, ", Serie ").concat(_app.serieNo, ")"));
87915
- case 868:
88068
+ case 872:
87916
88069
  if (_context21.sent) {
87917
- _context21.next = 870;
88070
+ _context21.next = 874;
87918
88071
  break;
87919
88072
  }
87920
88073
  return _context21.abrupt("return", declined);
87921
- case 870:
87922
- _context21.prev = 870;
87923
- _context21.next = 873;
88074
+ case 874:
88075
+ _context21.prev = 874;
88076
+ _context21.next = 877;
87924
88077
  return authorizedFetch("".concat(root.configurationStore.apiConfig.enricherService, "/packages/").concat(_app.packageId, "/pricelists/").concat(_app.pricelistId, "/serie/").concat(_app.serieNo, "/prices/manual"), 'DELETE');
87925
- case 873:
87926
- _context21.next = 878;
88078
+ case 877:
88079
+ _context21.next = 882;
87927
88080
  break;
87928
- case 875:
87929
- _context21.prev = 875;
87930
- _context21.t28 = _context21["catch"](870);
88081
+ case 879:
88082
+ _context21.prev = 879;
88083
+ _context21.t28 = _context21["catch"](874);
87931
88084
  return _context21.abrupt("return", {
87932
88085
  error: _context21.t28 instanceof Error ? _context21.t28.message : String(_context21.t28)
87933
88086
  });
87934
- case 878:
87935
- _context21.next = 880;
88087
+ case 882:
88088
+ _context21.next = 884;
87936
88089
  return refreshAndSettle();
87937
- case 880:
88090
+ case 884:
87938
88091
  pricesSettled = _context21.sent;
87939
88092
  return _context21.abrupt("return", {
87940
88093
  applied: true,
87941
88094
  note: "All manual price overrides of this pricelist+serie were deleted (irreversible) \u2014 the table refreshed; origPrices and factors now determine every cell.".concat(autoNote).concat(pricesSettled ? '' : unsettledNote)
87942
88095
  });
87943
- case 882:
88096
+ case 886:
87944
88097
  if (!(actionName === 'removeColumn')) {
87945
- _context21.next = 921;
88098
+ _context21.next = 925;
87946
88099
  break;
87947
88100
  }
87948
88101
  if (actionInput) {
87949
- _context21.next = 885;
88102
+ _context21.next = 889;
87950
88103
  break;
87951
88104
  }
87952
88105
  return _context21.abrupt("return", {
87953
88106
  error: "Provide input: the column to remove — its field id ('optionsSetRefs.2305') or the bare key ('2305'); listGrids shows the columns."
87954
88107
  });
87955
- case 885:
88108
+ case 889:
87956
88109
  removeTargetIn = function removeTargetIn(defs) {
87957
88110
  return defs.find(function (def) {
87958
88111
  return def.field === actionInput || def.colId === actionInput || String(def.field).endsWith(".".concat(actionInput));
@@ -87960,7 +88113,7 @@ function createNavigationToolset(ctx) {
87960
88113
  };
87961
88114
  _target3 = removeTargetIn(removeTargets);
87962
88115
  if (_target3) {
87963
- _context21.next = 889;
88116
+ _context21.next = 893;
87964
88117
  break;
87965
88118
  }
87966
88119
  return _context21.abrupt("return", {
@@ -87968,75 +88121,75 @@ function createNavigationToolset(ctx) {
87968
88121
  return "'".concat(def.field, "'");
87969
88122
  }).join(', ') || 'none', ".")
87970
88123
  });
87971
- case 889:
88124
+ case 893:
87972
88125
  _header = typeof _target3.headerName === 'string' ? root.t(_target3.headerName) : String(_target3.field);
87973
- _context21.next = 892;
88126
+ _context21.next = 896;
87974
88127
  return approve("removeColumn: ".concat(_header));
87975
- case 892:
88128
+ case 896:
87976
88129
  if (_context21.sent) {
87977
- _context21.next = 894;
88130
+ _context21.next = 898;
87978
88131
  break;
87979
88132
  }
87980
88133
  return _context21.abrupt("return", declined);
87981
- case 894:
88134
+ case 898:
87982
88135
  // The defs are rebuilt on every render, each onRemove closing over the feature list of ITS render — the
87983
88136
  // pre-wait closure would drop a feature the user added while the bar was open. Re-resolve after the wait.
87984
88137
  live = removeTargetIn(_handle.getDivaColumnDefs().filter(isRemovableColumn));
87985
88138
  if (live) {
87986
- _context21.next = 897;
88139
+ _context21.next = 901;
87987
88140
  break;
87988
88141
  }
87989
88142
  return _context21.abrupt("return", {
87990
88143
  applied: false,
87991
88144
  note: "'".concat(_target3.field, "' left the table while the approval was pending \u2014 nothing was removed. listGrids shows the current columns.")
87992
88145
  });
87993
- case 897:
87994
- _context21.prev = 897;
87995
- _context21.next = 900;
88146
+ case 901:
88147
+ _context21.prev = 901;
88148
+ _context21.next = 904;
87996
88149
  return live.headerComponentParams.onRemove();
87997
- case 900:
88150
+ case 904:
87998
88151
  saved = _context21.sent;
87999
- _context21.next = 906;
88152
+ _context21.next = 910;
88000
88153
  break;
88001
- case 903:
88002
- _context21.prev = 903;
88003
- _context21.t29 = _context21["catch"](897);
88154
+ case 907:
88155
+ _context21.prev = 907;
88156
+ _context21.t29 = _context21["catch"](901);
88004
88157
  return _context21.abrupt("return", {
88005
88158
  error: _context21.t29 instanceof Error ? _context21.t29.message : String(_context21.t29)
88006
88159
  });
88007
- case 906:
88160
+ case 910:
88008
88161
  if (!(saved === false)) {
88009
- _context21.next = 908;
88162
+ _context21.next = 912;
88010
88163
  break;
88011
88164
  }
88012
88165
  return _context21.abrupt("return", {
88013
88166
  applied: false,
88014
88167
  note: "The parent row did not take the new feature list \u2014 '".concat(_target3.field, "' was NOT removed. locateRow the parent row again so the view reloads, then retry.")
88015
88168
  });
88016
- case 908:
88169
+ case 912:
88017
88170
  // Poll until the column left the view — the parent entity's write and the rebuild are asynchronous.
88018
88171
  gone = false;
88019
88172
  attempt = 0;
88020
- case 910:
88173
+ case 914:
88021
88174
  if (!(attempt < 20 && !gone)) {
88022
- _context21.next = 917;
88175
+ _context21.next = 921;
88023
88176
  break;
88024
88177
  }
88025
- _context21.next = 913;
88178
+ _context21.next = 917;
88026
88179
  return sleep(100);
88027
- case 913:
88180
+ case 917:
88028
88181
  gone = !_handle.getDivaColumnDefs().some(function (def) {
88029
88182
  return def.field === _target3.field;
88030
88183
  });
88031
- case 914:
88184
+ case 918:
88032
88185
  attempt++;
88033
- _context21.next = 910;
88186
+ _context21.next = 914;
88034
88187
  break;
88035
- case 917:
88188
+ case 921:
88036
88189
  // The view declares what becomes of the rows' cells of a removed feature column.
88037
88190
  rowsNote = _target3.headerComponentParams.removeKeepsCells ? ' The rows KEEP their cells for that feature (hidden now, still exported) — re-add the column to see or clear them.' : " The server also strips that feature's cells from every row of this table.";
88038
88191
  if (gone) {
88039
- _context21.next = 920;
88192
+ _context21.next = 924;
88040
88193
  break;
88041
88194
  }
88042
88195
  return _context21.abrupt("return", {
@@ -88048,7 +88201,7 @@ function createNavigationToolset(ctx) {
88048
88201
  viewNotRebuilt: true,
88049
88202
  note: "The parent row took the new feature list, but '".concat(_target3.field, "' is still in the view after the wait \u2014 the rebuild is pending. Re-read the columns (listGrids) before touching this table again; do NOT retry the removal.") + rowsNote + autoNote
88050
88203
  });
88051
- case 920:
88204
+ case 924:
88052
88205
  return _context21.abrupt("return", {
88053
88206
  applied: true,
88054
88207
  removed: {
@@ -88057,25 +88210,25 @@ function createNavigationToolset(ctx) {
88057
88210
  },
88058
88211
  note: 'Column removed.' + rowsNote + autoNote
88059
88212
  });
88060
- case 921:
88213
+ case 925:
88061
88214
  // addColumn: one approval, sequential adds — parallel adds race the view rebuild.
88062
88215
  _target4 = _addTargets[0];
88063
88216
  markAdded = plannerStaleMarkFor(root);
88064
88217
  if (actionInput) {
88065
- _context21.next = 925;
88218
+ _context21.next = 929;
88066
88219
  break;
88067
88220
  }
88068
88221
  return _context21.abrupt("return", {
88069
88222
  error: "Provide input: the key(s) to add, comma-separated \u2014 readColumnOptions('".concat(_target4.field, "') lists the addable entries.")
88070
88223
  });
88071
- case 925:
88224
+ case 929:
88072
88225
  keys = actionInput.split(',').map(function (k) {
88073
88226
  return k.trim();
88074
88227
  }).filter(Boolean); // Resolve ALL keys BEFORE asking approval: the bar shows the real labels, invalid keys fail fast.
88075
88228
  resolved = [];
88076
- _context21.prev = 927;
88229
+ _context21.prev = 931;
88077
88230
  _iterator43 = _createForOfIteratorHelper$i(keys);
88078
- _context21.prev = 929;
88231
+ _context21.prev = 933;
88079
88232
  _loop9 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop9() {
88080
88233
  var key, options, option;
88081
88234
  return _regeneratorRuntime.wrap(function _loop9$(_context19) {
@@ -88110,57 +88263,57 @@ function createNavigationToolset(ctx) {
88110
88263
  }, _loop9);
88111
88264
  });
88112
88265
  _iterator43.s();
88113
- case 932:
88266
+ case 936:
88114
88267
  if ((_step43 = _iterator43.n()).done) {
88115
- _context21.next = 939;
88268
+ _context21.next = 943;
88116
88269
  break;
88117
88270
  }
88118
- return _context21.delegateYield(_loop9(), "t30", 934);
88119
- case 934:
88271
+ return _context21.delegateYield(_loop9(), "t30", 938);
88272
+ case 938:
88120
88273
  _ret5 = _context21.t30;
88121
88274
  if (!_ret5) {
88122
- _context21.next = 937;
88275
+ _context21.next = 941;
88123
88276
  break;
88124
88277
  }
88125
88278
  return _context21.abrupt("return", _ret5.v);
88126
- case 937:
88127
- _context21.next = 932;
88279
+ case 941:
88280
+ _context21.next = 936;
88128
88281
  break;
88129
- case 939:
88130
- _context21.next = 944;
88282
+ case 943:
88283
+ _context21.next = 948;
88131
88284
  break;
88132
- case 941:
88133
- _context21.prev = 941;
88134
- _context21.t31 = _context21["catch"](929);
88285
+ case 945:
88286
+ _context21.prev = 945;
88287
+ _context21.t31 = _context21["catch"](933);
88135
88288
  _iterator43.e(_context21.t31);
88136
- case 944:
88137
- _context21.prev = 944;
88289
+ case 948:
88290
+ _context21.prev = 948;
88138
88291
  _iterator43.f();
88139
- return _context21.finish(944);
88140
- case 947:
88141
- _context21.next = 952;
88292
+ return _context21.finish(948);
88293
+ case 951:
88294
+ _context21.next = 956;
88142
88295
  break;
88143
- case 949:
88144
- _context21.prev = 949;
88145
- _context21.t32 = _context21["catch"](927);
88296
+ case 953:
88297
+ _context21.prev = 953;
88298
+ _context21.t32 = _context21["catch"](931);
88146
88299
  return _context21.abrupt("return", {
88147
88300
  error: _context21.t32 instanceof Error ? _context21.t32.message : String(_context21.t32)
88148
88301
  });
88149
- case 952:
88150
- _context21.next = 954;
88302
+ case 956:
88303
+ _context21.next = 958;
88151
88304
  return approve("addColumn: ".concat(resolved.map(function (r) {
88152
88305
  return r.label;
88153
88306
  }).join(', ')));
88154
- case 954:
88307
+ case 958:
88155
88308
  if (_context21.sent) {
88156
- _context21.next = 956;
88309
+ _context21.next = 960;
88157
88310
  break;
88158
88311
  }
88159
88312
  return _context21.abrupt("return", declined);
88160
- case 956:
88313
+ case 960:
88161
88314
  added = [];
88162
88315
  newColumns = [];
88163
- _context21.prev = 958;
88316
+ _context21.prev = 962;
88164
88317
  _loop10 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop10() {
88165
88318
  var key, beforeFields, _attempt, newColumn;
88166
88319
  return _regeneratorRuntime.wrap(function _loop10$(_context20) {
@@ -88207,17 +88360,17 @@ function createNavigationToolset(ctx) {
88207
88360
  }, _loop10);
88208
88361
  });
88209
88362
  _i15 = 0, _resolved = resolved;
88210
- case 961:
88363
+ case 965:
88211
88364
  if (!(_i15 < _resolved.length)) {
88212
- _context21.next = 966;
88365
+ _context21.next = 970;
88213
88366
  break;
88214
88367
  }
88215
- return _context21.delegateYield(_loop10(), "t33", 963);
88216
- case 963:
88368
+ return _context21.delegateYield(_loop10(), "t33", 967);
88369
+ case 967:
88217
88370
  _i15++;
88218
- _context21.next = 961;
88371
+ _context21.next = 965;
88219
88372
  break;
88220
- case 966:
88373
+ case 970:
88221
88374
  // On a decision's option-combinations subtable the add also writes the decision's featureRefs.
88222
88375
  decisionSubtableNote = /optioncombination/i.test(_entry3.label) ? " NOTE: on a decision's option-combinations subtable this ALSO wrote the feature(s) into the decision's featureRefs — existing rows carry NO condition for it, which in a type-0/1 re-opens that feature entirely. Re-read the decision row; fill the rows or revert featureRefs if you only wanted to look." : '';
88223
88376
  partialNote = newColumns.length < resolved.length ? " ".concat(resolved.length - newColumns.length, " added column(s) did not surface a field id within the poll \u2014 listGrids shows the final columns.") : '';
@@ -88233,33 +88386,33 @@ function createNavigationToolset(ctx) {
88233
88386
  return "'".concat(c, "'");
88234
88387
  }).join(', '), ".") : 'Column(s) added — the table re-renders; listGrids shows the new columns and their field ids.') + partialNote + decisionSubtableNote + autoNote
88235
88388
  }));
88236
- case 971:
88237
- _context21.prev = 971;
88238
- _context21.t34 = _context21["catch"](958);
88389
+ case 975:
88390
+ _context21.prev = 975;
88391
+ _context21.t34 = _context21["catch"](962);
88239
88392
  // Sequential adds: everything before the failing key IS added — report the partial state.
88240
88393
  if (added.length) markAdded();
88241
88394
  return _context21.abrupt("return", {
88242
88395
  error: "".concat(_context21.t34 instanceof Error ? _context21.t34.message : String(_context21.t34)).concat(newColumns.length ? " \u2014 ".concat(newColumns.length, " column(s) were already added before the failure: ").concat(newColumns.join(', ')) : '')
88243
88396
  });
88244
- case 975:
88397
+ case 979:
88245
88398
  _resolveGrid5 = resolveGrid(args.grid), _entry4 = _resolveGrid5.entry, _api3 = _resolveGrid5.api, _error4 = _resolveGrid5.error;
88246
88399
  if (!(_error4 || !_api3 || !_entry4)) {
88247
- _context21.next = 978;
88400
+ _context21.next = 982;
88248
88401
  break;
88249
88402
  }
88250
88403
  return _context21.abrupt("return", {
88251
88404
  error: _error4
88252
88405
  });
88253
- case 978:
88406
+ case 982:
88254
88407
  _handle2 = _entry4.getHandle();
88255
88408
  if (_handle2) {
88256
- _context21.next = 981;
88409
+ _context21.next = 985;
88257
88410
  break;
88258
88411
  }
88259
88412
  return _context21.abrupt("return", {
88260
88413
  error: "Table '".concat(_entry4.label, "' is not ready.")
88261
88414
  });
88262
- case 981:
88415
+ case 985:
88263
88416
  _column7 = String((_column8 = input === null || input === void 0 ? void 0 : input.column) !== null && _column8 !== void 0 ? _column8 : '');
88264
88417
  search = String((_search = input === null || input === void 0 ? void 0 : input.search) !== null && _search !== void 0 ? _search : '');
88265
88418
  _limit = Math.min(Number(input === null || input === void 0 ? void 0 : input.limit) > 0 ? Number(input.limit) : 50, 200); // `exact` is one contract for every source below: action values and enum values as well as lookups.
@@ -88274,11 +88427,11 @@ function createNavigationToolset(ctx) {
88274
88427
  return action.name === _column7;
88275
88428
  });
88276
88429
  if (!optionAction) {
88277
- _context21.next = 1003;
88430
+ _context21.next = 1007;
88278
88431
  break;
88279
88432
  }
88280
88433
  if (optionAction.options) {
88281
- _context21.next = 991;
88434
+ _context21.next = 995;
88282
88435
  break;
88283
88436
  }
88284
88437
  return _context21.abrupt("return", {
@@ -88287,11 +88440,11 @@ function createNavigationToolset(ctx) {
88287
88440
  hasMore: false,
88288
88441
  note: "'".concat(_column7, "' is a table ACTION with no value list \u2014 its input is described in listGrids: ").concat(optionAction.description)
88289
88442
  });
88290
- case 991:
88291
- _context21.prev = 991;
88292
- _context21.next = 994;
88443
+ case 995:
88444
+ _context21.prev = 995;
88445
+ _context21.next = 998;
88293
88446
  return optionAction.options(search, _limit);
88294
- case 994:
88447
+ case 998:
88295
88448
  _yield$optionAction$o = _context21.sent;
88296
88449
  options = _yield$optionAction$o.options;
88297
88450
  note = _yield$optionAction$o.note;
@@ -88304,20 +88457,20 @@ function createNavigationToolset(ctx) {
88304
88457
  } : {}), {}, {
88305
88458
  note: "Values for runTableAction('".concat(_column7, "', <input>) \u2014 pass the VALUE(s), not the label.").concat(note ? " ".concat(note) : '').concat(wantsExact ? ' exact:true — only options whose value or label equals the search.' : '')
88306
88459
  }));
88307
- case 1000:
88308
- _context21.prev = 1000;
88309
- _context21.t35 = _context21["catch"](991);
88460
+ case 1004:
88461
+ _context21.prev = 1004;
88462
+ _context21.t35 = _context21["catch"](995);
88310
88463
  return _context21.abrupt("return", {
88311
88464
  error: _context21.t35 instanceof Error ? _context21.t35.message : String(_context21.t35)
88312
88465
  });
88313
- case 1003:
88466
+ case 1007:
88314
88467
  // Enum columns are answered here too: 'which values does this column take' is ONE question.
88315
88468
  enumDef = _handle2.getDivaColumnDefs().find(function (d) {
88316
88469
  return d.field === _column7;
88317
88470
  });
88318
88471
  enumData = enumEntriesOf(enumDef === null || enumDef === void 0 || (_enumDef$customParams = enumDef.customParams) === null || _enumDef$customParams === void 0 ? void 0 : _enumDef$customParams.enumData);
88319
88472
  if (!enumData.length) {
88320
- _context21.next = 1007;
88473
+ _context21.next = 1011;
88321
88474
  break;
88322
88475
  }
88323
88476
  return _context21.abrupt("return", _objectSpread$C(_objectSpread$C({
@@ -88337,14 +88490,14 @@ function createNavigationToolset(ctx) {
88337
88490
  } : {}), {}, {
88338
88491
  note: "Enum column \u2014 this is the COMPLETE allowed set (also in listGrids). Stage the VALUE, not the label".concat(enumDef !== null && enumDef !== void 0 && (_enumDef$customParams2 = enumDef.customParams) !== null && _enumDef$customParams2 !== void 0 && _enumDef$customParams2.multiple ? ', comma-separated for multiple' : '', ".").concat(wantsExact ? ' exact:true — only options whose value or label equals the search.' : '')
88339
88492
  }));
88340
- case 1007:
88493
+ case 1011:
88341
88494
  if (enumDef) {
88342
- _context21.next = 1014;
88495
+ _context21.next = 1018;
88343
88496
  break;
88344
88497
  }
88345
88498
  computedDef = divaDefOf(_handle2.getDivaColumnDefs(), _column7);
88346
88499
  if (!isComputedColumn(computedDef)) {
88347
- _context21.next = 1012;
88500
+ _context21.next = 1016;
88348
88501
  break;
88349
88502
  }
88350
88503
  // Same source as listGrids, so the two cannot disagree about whether a new row may carry this column.
@@ -88355,16 +88508,16 @@ function createNavigationToolset(ctx) {
88355
88508
  hasMore: false,
88356
88509
  note: savedRowsOnly ? "'".concat(_column7, "' is a computed matrix cell \u2014 it has no option list, and addRows cannot set it. Create the row, then set it with stageTableEdits 'edits'.") : "'".concat(_column7, "' is a computed matrix cell \u2014 it has no option list; stage its value directly with stageTableEdits.")
88357
88510
  });
88358
- case 1012:
88511
+ case 1016:
88359
88512
  _fields2 = _handle2.getDivaColumnDefs().map(function (d) {
88360
88513
  return d.field;
88361
88514
  }).filter(Boolean);
88362
88515
  return _context21.abrupt("return", {
88363
88516
  error: "Column '".concat(_column7, "' not found. Fields of '").concat(_entry4.label, "': ").concat(_fields2.join(', '), ".")
88364
88517
  });
88365
- case 1014:
88518
+ case 1018:
88366
88519
  if (!(enumDef.cellDataType === 'asset')) {
88367
- _context21.next = 1016;
88520
+ _context21.next = 1020;
88368
88521
  break;
88369
88522
  }
88370
88523
  return _context21.abrupt("return", {
@@ -88373,9 +88526,9 @@ function createNavigationToolset(ctx) {
88373
88526
  hasMore: false,
88374
88527
  note: "'".concat(_column7, "' is an ASSET cell \u2014 no option list; write it via uploadAsset + setAssetCell.")
88375
88528
  });
88376
- case 1016:
88529
+ case 1020:
88377
88530
  if (!(enumDef.cellDataType !== 'lookup' && !isHeaderAddColumn(enumDef))) {
88378
- _context21.next = 1018;
88531
+ _context21.next = 1022;
88379
88532
  break;
88380
88533
  }
88381
88534
  return _context21.abrupt("return", {
@@ -88384,20 +88537,20 @@ function createNavigationToolset(ctx) {
88384
88537
  hasMore: false,
88385
88538
  note: "'".concat(_column7, "' is a free-form ").concat((_enumDef$cellDataType = enumDef.cellDataType) !== null && _enumDef$cellDataType !== void 0 ? _enumDef$cellDataType : 'text', " column \u2014 it has no option list; stage a ").concat(enumDef.cellDataType === 'number' ? 'number' : 'value', " directly with stageTableEdits.")
88386
88539
  });
88387
- case 1018:
88540
+ case 1022:
88388
88541
  // Row-dependent url/filter templates resolve against the row the options are for: the given rowId, else a NEW
88389
88542
  // row, whose empty data drops the row filters as the cell editor does — never an arbitrary loaded row, whose
88390
88543
  // values narrowed e.g. a pack's basedCatalogId list to that row's catalog.
88391
88544
  optionsRowId = (input === null || input === void 0 ? void 0 : input.rowId) != null ? String(input.rowId) : '';
88392
88545
  optionsRow = optionsRowId ? _api3.getRowNode(optionsRowId) : undefined;
88393
88546
  if (!(optionsRowId && !isRealRow(optionsRow))) {
88394
- _context21.next = 1022;
88547
+ _context21.next = 1026;
88395
88548
  break;
88396
88549
  }
88397
88550
  return _context21.abrupt("return", {
88398
88551
  error: "No loaded row with rowId '".concat(optionsRowId, "' on '").concat(_entry4.label, "' \u2014 take the rowId from readGridRows, or omit it for the options of a NEW row.")
88399
88552
  });
88400
- case 1022:
88553
+ case 1026:
88401
88554
  rowData = (_optionsRow$data = optionsRow === null || optionsRow === void 0 ? void 0 : optionsRow.data) !== null && _optionsRow$data !== void 0 ? _optionsRow$data : {}; // The server's contains-filter reads the search as a pattern: a bracket or a pipe in it returns nothing at all
88402
88555
  // ('Bettbreite (90)' — measured as a false negative on an existence check). Query the longest plain word and
88403
88556
  // match the whole text here; `exact` is matched here as well.
@@ -88408,10 +88561,10 @@ function createNavigationToolset(ctx) {
88408
88561
  })[0]) !== null && _plainWords$sort$ !== void 0 ? _plainWords$sort$ : '' : search;
88409
88562
  matchLocally = remoteSearch !== search || wantsExact; // The local match only sees ONE capped fetch — a plain word with more hits than that can still hide the value.
88410
88563
  fetchLimit = matchLocally ? Math.max(_limit, 200) : _limit;
88411
- _context21.prev = 1028;
88412
- _context21.next = 1031;
88564
+ _context21.prev = 1032;
88565
+ _context21.next = 1035;
88413
88566
  return _handle2.fetchLookupOptions(_column7, remoteSearch, rowData, 0, fetchLimit);
88414
- case 1031:
88567
+ case 1035:
88415
88568
  fetched = _context21.sent;
88416
88569
  text = function text(o) {
88417
88570
  var _o$label2;
@@ -88439,9 +88592,9 @@ function createNavigationToolset(ctx) {
88439
88592
  } : {}), {}, {
88440
88593
  note: (isHeaderAddColumn(enumDef) ? "These entries are ADDABLE via runTableAction 'addColumn' (each becomes a table column) — they are not cell values to stage." : 'Stage this column with the VALUE(s) — comma-separated when the column is multi-select (see columnMeta.multiSelect).') + (remoteSearch !== search ? " The search contains characters the server filter reads as a pattern \u2014 the server was asked for '".concat(remoteSearch, "' and the full text '").concat(search, "' was matched here.") : '') + (wantsExact ? ' exact:true — only options whose value or label equals the search.' : '') + nestedLookupNote(enumDef) + (fetchCapped ? " The ".concat(wantsExact ? 'exact' : 'full-text', " check ran on the first ").concat(fetchLimit, " rows").concat(remoteSearch ? " matching '".concat(remoteSearch, "'") : '', " only \u2014 narrow the search if the value is not among them.") : '')
88441
88594
  }));
88442
- case 1038:
88443
- _context21.prev = 1038;
88444
- _context21.t36 = _context21["catch"](1028);
88595
+ case 1042:
88596
+ _context21.prev = 1042;
88597
+ _context21.t36 = _context21["catch"](1032);
88445
88598
  // A row-dependent lookup cannot run without its row values — teach the recovery instead of the opaque error.
88446
88599
  appScope = (_handle2$getApplicati = (_handle2$getApplicati2 = _handle2.getApplicationData) === null || _handle2$getApplicati2 === void 0 ? void 0 : _handle2$getApplicati2.call(_handle2)) !== null && _handle2$getApplicati !== void 0 ? _handle2$getApplicati : {};
88447
88600
  deps = lookupRowDeps(_handle2.lookupTemplateFields(_column7), _handle2.getDivaColumnDefs(), function (dep) {
@@ -88451,92 +88604,92 @@ function createNavigationToolset(ctx) {
88451
88604
  return _context21.abrupt("return", {
88452
88605
  error: (_context21.t36 instanceof Error ? _context21.t36.message : String(_context21.t36)) + hint
88453
88606
  });
88454
- case 1044:
88607
+ case 1048:
88455
88608
  _resolveGrid6 = resolveGrid(args.grid), _api4 = _resolveGrid6.api, _error5 = _resolveGrid6.error;
88456
88609
  if (!(_error5 || !_api4)) {
88457
- _context21.next = 1047;
88610
+ _context21.next = 1051;
88458
88611
  break;
88459
88612
  }
88460
88613
  return _context21.abrupt("return", {
88461
88614
  error: _error5
88462
88615
  });
88463
- case 1047:
88616
+ case 1051:
88464
88617
  _api4.setFilterModel(null);
88465
88618
  return _context21.abrupt("return", {
88466
88619
  ok: true
88467
88620
  });
88468
- case 1049:
88621
+ case 1053:
88469
88622
  _resolveGrid7 = resolveGrid(args.grid), _entry5 = _resolveGrid7.entry, _error6 = _resolveGrid7.error;
88470
88623
  if (!(_error6 || !_entry5)) {
88471
- _context21.next = 1052;
88624
+ _context21.next = 1056;
88472
88625
  break;
88473
88626
  }
88474
88627
  return _context21.abrupt("return", {
88475
88628
  error: _error6
88476
88629
  });
88477
- case 1052:
88630
+ case 1056:
88478
88631
  _handle3 = _entry5.getHandle();
88479
88632
  if (_handle3) {
88480
- _context21.next = 1055;
88633
+ _context21.next = 1059;
88481
88634
  break;
88482
88635
  }
88483
88636
  return _context21.abrupt("return", {
88484
88637
  error: "Table '".concat(_entry5.label, "' is not ready.")
88485
88638
  });
88486
- case 1055:
88639
+ case 1059:
88487
88640
  if (_handle3.hasPendingChanges()) {
88488
- _context21.next = 1057;
88641
+ _context21.next = 1061;
88489
88642
  break;
88490
88643
  }
88491
88644
  return _context21.abrupt("return", {
88492
88645
  discarded: false,
88493
88646
  note: "Nothing is staged on '".concat(_entry5.label, "' \u2014 no staging blocks writes to it.")
88494
88647
  });
88495
- case 1057:
88648
+ case 1061:
88496
88649
  if (ctx.autoApprove) {
88497
- _context21.next = 1064;
88650
+ _context21.next = 1068;
88498
88651
  break;
88499
88652
  }
88500
88653
  awaitingApproval();
88501
88654
  // The bar's own buttons read Apply/Discard — the label says what Apply does, or Discard reads as the action.
88502
88655
  _label = "discardStagedChanges: every staged change on '".concat(_entry5.label, "' is dropped, the table returns to its last committed state");
88503
- _context21.next = 1062;
88656
+ _context21.next = 1066;
88504
88657
  return _entry5.requestAgentApproval(1, _label, signal);
88505
- case 1062:
88658
+ case 1066:
88506
88659
  if (_context21.sent) {
88507
- _context21.next = 1064;
88660
+ _context21.next = 1068;
88508
88661
  break;
88509
88662
  }
88510
88663
  return _context21.abrupt("return", {
88511
88664
  discarded: false,
88512
88665
  note: 'The user KEPT the staged changes — nothing was discarded. Ask what to do with them instead.'
88513
88666
  });
88514
- case 1064:
88667
+ case 1068:
88515
88668
  if (_handle3.hasPendingChanges()) {
88516
- _context21.next = 1066;
88669
+ _context21.next = 1070;
88517
88670
  break;
88518
88671
  }
88519
88672
  return _context21.abrupt("return", {
88520
88673
  discarded: false,
88521
88674
  note: "The table SAVED the staged changes on '".concat(_entry5.label, "' before the decision arrived (it saves pending edits by itself when the user clicks outside the grid) \u2014 nothing was discarded, those changes are live on the server. Read the rows back (readGridRows) and ask the user whether to undo them.")
88522
88675
  });
88523
- case 1066:
88524
- _context21.next = 1068;
88676
+ case 1070:
88677
+ _context21.next = 1072;
88525
88678
  return _handle3.rollback();
88526
- case 1068:
88679
+ case 1072:
88527
88680
  // Same transparency rule as runTableAction: a discard executed without the bar must be reported as such.
88528
88681
  _autoNote = ctx.autoApprove ? ' AUTO-APPROVE is on — executed WITHOUT the approval bar, so the user could not keep their own pending edits; mention that ONCE per reply, not per call.' : '';
88529
88682
  return _context21.abrupt("return", {
88530
88683
  discarded: true,
88531
88684
  note: "The staged changes on '".concat(_entry5.label, "' were discarded \u2014 the table is back at its last committed state, nothing was sent to the server, and writes to it are possible again.").concat(_autoNote)
88532
88685
  });
88533
- case 1070:
88686
+ case 1074:
88534
88687
  throw new Error("Unknown navigation tool: ".concat(name));
88535
- case 1071:
88688
+ case 1075:
88536
88689
  case "end":
88537
88690
  return _context21.stop();
88538
88691
  }
88539
- }, _callee13, null, [[42, 48], [69, 75], [142, 156, 159, 162], [327, 341, 344, 347], [379, 422, 425, 428], [389, 396], [437, 455, 458, 461], [462, 486, 489, 492], [532, 544, 547, 550], [628,, 682, 685], [630, 641, 644, 647], [648, 657, 660, 663], [664, 676, 679, 682], [752, 761], [771, 776], [791, 796], [806, 810], [826, 843], [870, 875], [897, 903], [927, 949], [929, 941, 944, 947], [958, 971], [991, 1000], [1028, 1038]]);
88692
+ }, _callee13, null, [[42, 48], [71, 77], [145, 159, 162, 165], [330, 344, 347, 350], [382, 425, 428, 431], [392, 399], [440, 458, 461, 464], [465, 489, 492, 495], [535, 547, 550, 553], [631,, 685, 688], [633, 644, 647, 650], [651, 660, 663, 666], [667, 679, 682, 685], [756, 765], [775, 780], [795, 800], [810, 814], [830, 847], [874, 879], [901, 907], [931, 953], [933, 945, 948, 951], [962, 975], [995, 1004], [1032, 1042]]);
88540
88693
  }));
88541
88694
  function dispatch(_x20, _x21, _x22, _x23) {
88542
88695
  return _dispatch.apply(this, arguments);
@@ -88547,9 +88700,9 @@ function createNavigationToolset(ctx) {
88547
88700
  // Table actions write past the grid's commit path, which flags the planners for cell edits — so they flag them here.
88548
88701
  var dispatchNavigation = toolset.dispatch;
88549
88702
  toolset.dispatch = /*#__PURE__*/function () {
88550
- var _ref60 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(name, input, signal, onProgress) {
88703
+ var _ref61 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(name, input, signal, onProgress) {
88551
88704
  var _resolveGrid$entry, _resolveGrid$entry$ge, _resolveGrid$entry2, _resolveGrid$entry2$g, _declared$find, _result$note;
88552
- var _target$getBoundParen, target, _toolId, lockedTool, markSaved, staleNote, writeHandle, scope, result, viewNotes, note, _ref61, grid, action, declared;
88705
+ var _target$getBoundParen, target, _toolId, lockedTool, markSaved, staleNote, writeHandle, scope, result, viewNotes, note, _ref62, grid, action, declared;
88553
88706
  return _regeneratorRuntime.wrap(function _callee14$(_context22) {
88554
88707
  while (1) switch (_context22.prev = _context22.next) {
88555
88708
  case 0:
@@ -88601,7 +88754,7 @@ function createNavigationToolset(ctx) {
88601
88754
  }
88602
88755
  return _context22.abrupt("return", result);
88603
88756
  case 20:
88604
- _ref61 = input !== null && input !== void 0 ? input : {}, grid = _ref61.grid, action = _ref61.action;
88757
+ _ref62 = input !== null && input !== void 0 ? input : {}, grid = _ref62.grid, action = _ref62.action;
88605
88758
  declared = (_resolveGrid$entry$ge = (_resolveGrid$entry2 = resolveGrid(grid).entry) === null || _resolveGrid$entry2 === void 0 || (_resolveGrid$entry2$g = _resolveGrid$entry2.getActions) === null || _resolveGrid$entry2$g === void 0 ? void 0 : _resolveGrid$entry2$g.call(_resolveGrid$entry2)) !== null && _resolveGrid$entry$ge !== void 0 ? _resolveGrid$entry$ge : [];
88606
88759
  if (!(((_declared$find = declared.find(function (candidate) {
88607
88760
  return candidate.name === action;
@@ -88622,7 +88775,7 @@ function createNavigationToolset(ctx) {
88622
88775
  }, _callee14, null, [[10,, 14, 18]]);
88623
88776
  }));
88624
88777
  return function (_x46, _x47, _x48, _x49) {
88625
- return _ref60.apply(this, arguments);
88778
+ return _ref61.apply(this, arguments);
88626
88779
  };
88627
88780
  }();
88628
88781
  return toolset;
@@ -89037,15 +89190,24 @@ var TIME_BUDGET_MS = 100000;
89037
89190
  /** IDM's media name (DETAIL_INFO INTERNAL_NAME, languagetext40) holds at most this many characters. */
89038
89191
  var IDM_MEDIA_NAME_MAX = 40;
89039
89192
 
89193
+ /**
89194
+ * What a media name over the limit does, per IDM format major of the open catalog: IDM 4 refuses the write (v4_1
89195
+ * languagetext40 pattern), IDM 3 stores it, but its 3.0 XML export breaks the XSD ({1,40}). Unknown version: both.
89196
+ * The one wording of this rule — the too-long and the shortened note both use it.
89197
+ */
89198
+ var longNameEffect = function longNameEffect(catalogMajor) {
89199
+ return catalogMajor === 4 ? 'this IDM 4 catalog REFUSES it in setAssetCell' : catalogMajor === 3 ? 'this IDM 3 catalog stores it, but its IDM 3.0 XML export then breaks the XSD (40 characters)' : 'an IDM 4 catalog REFUSES it in setAssetCell; an IDM 3 catalog stores it, but its IDM 3.0 XML export then breaks the XSD (40 characters)';
89200
+ };
89201
+
89040
89202
  /**
89041
89203
  * The upload takes any file name, but an IDM asset cell stores the MEDIA ITEM's own name (idm ItemService
89042
- * CreateMediaitemAndDetailinfo), so a longer one makes every later write of it fail — a cell 'name' does not help.
89204
+ * CreateMediaitemAndDetailinfo), so a longer one breaks every later write or export of it — a cell 'name' does not help.
89043
89205
  */
89044
- var longNameNote = function longNameNote(fileNames) {
89206
+ var longNameNote = function longNameNote(fileNames, catalogMajor) {
89045
89207
  var tooLong = fileNames.filter(function (fileName) {
89046
89208
  return fileName.length > IDM_MEDIA_NAME_MAX;
89047
89209
  });
89048
- return tooLong.length ? " NAME TOO LONG for an IDM asset cell (at most ".concat(IDM_MEDIA_NAME_MAX, " characters): ").concat(tooLong.join(', '), " \u2014 writing it into a catalog table with setAssetCell WILL be refused, because IDM takes the media item's own name: upload it again under a name of at most ").concat(IDM_MEDIA_NAME_MAX, " characters.") : '';
89210
+ return tooLong.length ? " NAME TOO LONG for an IDM asset cell (at most ".concat(IDM_MEDIA_NAME_MAX, " characters): ").concat(tooLong.join(', '), " \u2014 ").concat(longNameEffect(catalogMajor), ", because IDM takes the media item's own name: upload it again under a name of at most ").concat(IDM_MEDIA_NAME_MAX, " characters.") : '';
89049
89211
  };
89050
89212
 
89051
89213
  /** A media name an IDM asset cell takes: cut to the limit, keeping the extension (it names the file type in the cell). */
@@ -89056,9 +89218,9 @@ function fitMediaName(fileName) {
89056
89218
  return "".concat(fileName.slice(0, IDM_MEDIA_NAME_MAX - suffix.length).trimEnd()).concat(suffix);
89057
89219
  }
89058
89220
 
89059
- /** The note part about media names cut to the IDM limit before the upload. */
89060
- var shortenedNameNote = function shortenedNameNote(names) {
89061
- return names.length ? " NAME SHORTENED to ".concat(names.join(', '), ": an IDM asset cell takes the media item's own name, which holds at most ").concat(IDM_MEDIA_NAME_MAX, " characters.") : '';
89221
+ /** The note part about media names cut to the IDM limit before the upload — cut for every version (export rule). */
89222
+ var shortenedNameNote = function shortenedNameNote(names, catalogMajor) {
89223
+ return names.length ? " NAME SHORTENED to ".concat(names.join(', '), ": an IDM asset cell takes the media item's own name, which holds at most ").concat(IDM_MEDIA_NAME_MAX, " characters \u2014 a longer one: ").concat(longNameEffect(catalogMajor), ".") : '';
89062
89224
  };
89063
89225
 
89064
89226
  /**
@@ -90031,7 +90193,7 @@ function _generateImageAsset() {
90031
90193
  requestedFileName: requestedFileName
90032
90194
  } : {}), {}, {
90033
90195
  attached: false,
90034
- note: 'Generated and uploaded — the bytes stayed in the browser. LOOK at it before using it: open the url, or set it with setAssetCell and ' + "check the tile. ".concat(NOT_ATTACHED_NOTE).concat(shortenedNameNote(shortened ? [fileName] : []))
90196
+ note: 'Generated and uploaded — the bytes stayed in the browser. LOOK at it before using it: open the url, or set it with setAssetCell and ' + "check the tile. ".concat(NOT_ATTACHED_NOTE).concat(shortenedNameNote(shortened ? [fileName] : [], openCatalogMajor(root)))
90035
90197
  }));
90036
90198
  case 108:
90037
90199
  _context10.prev = 108;
@@ -90230,10 +90392,7 @@ function loadedCarriers(api, keyColumn, keyValue) {
90230
90392
  return carriers;
90231
90393
  }
90232
90394
  var notUniqueRefusal = function notUniqueRefusal(keyColumn, keyValue, carriers) {
90233
- return "".concat(keyColumn, " = '").concat(keyValue, "' is carried by ").concat(carriers.length, " rows (_id ").concat(carriers.map(function (node) {
90234
- var _node$data$_id, _node$data;
90235
- return String((_node$data$_id = (_node$data = node.data) === null || _node$data === void 0 ? void 0 : _node$data._id) !== null && _node$data$_id !== void 0 ? _node$data$_id : node.id);
90236
- }).join(', '), ") \u2014 not a UNIQUE key: write it with keyColumn '_id' and the id of the one you mean.");
90395
+ return "".concat(keyColumn, " = '").concat(keyValue, "' is carried by ").concat(carriers.length, " rows (_id ").concat(carrierIdsOf(carriers), ") \u2014 not a UNIQUE key: write it with keyColumn '_id' and the id of the one you mean.").concat(askWhichFeature(carriers));
90237
90396
  };
90238
90397
 
90239
90398
  /**
@@ -90478,7 +90637,9 @@ function sharedOptionRow(entry, node) {
90478
90637
  var sharedRowFacts = function sharedRowFacts(shared) {
90479
90638
  return shared ? {
90480
90639
  sharedWith: shared.features,
90481
- note: "Option row shared by features ".concat(shared.features.join(', '), ": its images show in ALL of them. A different picture per feature needs its own option row") + (shared.serieScope ? "; a picture per serie needs the image entry's serie scope (serieNo, set in the cell's Edit Metadata dialog — setAssetCell does not write it)." : '.')
90640
+ note:
90641
+ // Said to the user, not just noted: on the re-test 22.10. the agent had the note and passed none of it on.
90642
+ "TELL THE USER: option row shared by features ".concat(shared.features.join(', '), ": its images show in ALL of them. A different picture per feature needs its own option row") + (shared.serieScope ? "; a picture per serie needs the image entry's serie scope (serieNo, set in the cell's Edit Metadata dialog — setAssetCell does not write it)." : '.')
90482
90643
  } : {};
90483
90644
  };
90484
90645
  function writeAssetCell(_x33, _x34) {
@@ -91948,7 +92109,7 @@ function _generateArticleSvgBatch() {
91948
92109
  results: results,
91949
92110
  note: "".concat(results.length, " asset(s) generated + uploaded, NONE attached. Write them with ONE setAssetCell cells:[{keyValue: <typeNo>, mediaItemId}] on column '").concat(column, "' \u2014 that is a single approval bar for the whole serie.") + (failed.length ? " ".concat(failed.length, " entr(y|ies) FAILED and are listed in 'failed' \u2014 the rest is uploaded and usable.") : '') + (remaining.length ? " ".concat(remaining.length, " entr(y|ies) were NOT processed (").concat(signal !== null && signal !== void 0 && signal.aborted ? 'the turn was aborted' : 'time budget', ") \u2014 repeat the call with ONLY the 'remaining' articles.") : '') + shortenedNameNote(results.flatMap(function (result) {
91950
92111
  return result.requestedFileName ? [result.fileName] : [];
91951
- }))
92112
+ }), openCatalogMajor(root))
91952
92113
  }));
91953
92114
  case 66:
91954
92115
  case "end":
@@ -92097,7 +92258,7 @@ function createMediaToolset(ctx) {
92097
92258
  return !r.error;
92098
92259
  }).map(function (r) {
92099
92260
  return String(r.fileName);
92100
- }))
92261
+ }), openCatalogMajor(root))
92101
92262
  }));
92102
92263
  case 42:
92103
92264
  _context2.next = 44;
@@ -92111,7 +92272,7 @@ function createMediaToolset(ctx) {
92111
92272
  return _context2.abrupt("return", result);
92112
92273
  case 47:
92113
92274
  return _context2.abrupt("return", _objectSpread$B(_objectSpread$B({}, result), {}, {
92114
- note: 'Asset uploaded — reference it via setAssetCell (asset columns) using this mediaItemId. It is unused until referenced.' + longNameNote([String((_result$fileName = result.fileName) !== null && _result$fileName !== void 0 ? _result$fileName : '')])
92275
+ note: 'Asset uploaded — reference it via setAssetCell (asset columns) using this mediaItemId. It is unused until referenced.' + longNameNote([String((_result$fileName = result.fileName) !== null && _result$fileName !== void 0 ? _result$fileName : '')], openCatalogMajor(root))
92115
92276
  }));
92116
92277
  case 48:
92117
92278
  if (!(Array.isArray(args.batch) && !args.batch.length)) {
@@ -92257,7 +92418,7 @@ function createMediaToolset(ctx) {
92257
92418
  return _context2.abrupt("return", _objectSpread$B(_objectSpread$B(_objectSpread$B({}, receipt), {}, {
92258
92419
  target: target
92259
92420
  }, outcome), {}, {
92260
- note: (outcome.attached ? "Generated, uploaded and attached to ".concat(where, ". LOOK at it (open the url, or the tile) before reporting it as done.") : "Generated and uploaded, but NOT attached to ".concat(where, ": ").concat(outcome.attachError, ". ").concat(NOT_ATTACHED_NOTE)) + (outcome.attached && outcome.note ? " ".concat(outcome.note) : '') + shortenedNameNote(one.requestedFileName ? [String(one.fileName)] : [])
92421
+ note: (outcome.attached ? "Generated, uploaded and attached to ".concat(where, ". LOOK at it (open the url, or the tile) before reporting it as done.") : "Generated and uploaded, but NOT attached to ".concat(where, ": ").concat(outcome.attachError, ". ").concat(NOT_ATTACHED_NOTE)) + (outcome.attached && outcome.note ? " ".concat(outcome.note) : '') + shortenedNameNote(one.requestedFileName ? [String(one.fileName)] : [], openCatalogMajor(root))
92261
92422
  }));
92262
92423
  case 94:
92263
92424
  // BULK: a feature's option set is never ONE image — N swatches would cost N round-trips.
@@ -92392,7 +92553,7 @@ function createMediaToolset(ctx) {
92392
92553
  } : {}), {}, {
92393
92554
  note: "".concat(generated.length, "/").concat(_results.length, " generated (usage = cumulative counters after the last one).") + (_failed.length ? ' Failed entries carry their reason — retry only those.' : '') + (_remaining.length ? " ".concat(notStartedNote(_remaining), " \u2014 re-call with only those; the entries in 'generated' are generated and uploaded, do not generate them again.") : '') + (targeted.length ? " ".concat(attachedCount, "/").concat(targeted.length, " attached to their rows.") : '') + (attachedCount < targeted.length ? ' The entries with attached:false carry the reason in attachError — they are generated (do not generate them again) but NOT on their rows: fix the cause, then write their mediaItemId with setAssetCell cells.' : '') + (untargeted.length ? ' LOOK at the results before wiring (one contact sheet, not one review per file), then write the entries without a target with setAssetCell cells.' : ' LOOK at the results (one contact sheet, not one review per file).') + (allAttached ? '' : " ".concat(targeted.length ? 'For every entry with attached:false: ' : '').concat(NOT_ATTACHED_NOTE)) + shortenedNameNote(generated.flatMap(function (result) {
92394
92555
  return result.requestedFileName ? [String(result.fileName)] : [];
92395
- })),
92556
+ }), openCatalogMajor(root)),
92396
92557
  attached: allAttached
92397
92558
  }));
92398
92559
  case 146:
@@ -92678,7 +92839,7 @@ function createMediaToolset(ctx) {
92678
92839
  rawName = String((_args$fileName = args.fileName) !== null && _args$fileName !== void 0 ? _args$fileName : typeNo ? "top-".concat(typeNo).concat(extension) : "top-view".concat(extension));
92679
92840
  requestedFileName = rawName.toLowerCase().endsWith(extension) ? rawName : "".concat(rawName.replace(/\.(svg|jpe?g)$/i, '')).concat(extension); // Fitted before the upload: an IDM asset cell takes the media item's own name (at most 40 characters).
92680
92841
  _fileName = fitMediaName(requestedFileName);
92681
- nameNote = shortenedNameNote(_fileName !== requestedFileName ? [_fileName] : []);
92842
+ nameNote = shortenedNameNote(_fileName !== requestedFileName ? [_fileName] : [], openCatalogMajor(root));
92682
92843
  _context2.prev = 245;
92683
92844
  if (!(format === 'jpg')) {
92684
92845
  _context2.next = 257;
@@ -93080,6 +93241,54 @@ var DivaAgent = function DivaAgent(_ref) {
93080
93241
  return _ref4.apply(this, arguments);
93081
93242
  };
93082
93243
  }(), [root]);
93244
+
93245
+ // The DDE report "Katalog prüfen" as JSON, which lintCatalog lists as its export rules. Only a Data Engine catalog has
93246
+ // one; an enricher package is checked through its base catalog.
93247
+ var analysedCatalogId = isIDMData && !packageId ? catalogId : undefined;
93248
+ var fetchCatalogAnalysis = useCallback(/*#__PURE__*/function () {
93249
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(signal) {
93250
+ var response, body;
93251
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
93252
+ while (1) switch (_context3.prev = _context3.next) {
93253
+ case 0:
93254
+ if (analysedCatalogId) {
93255
+ _context3.next = 2;
93256
+ break;
93257
+ }
93258
+ return _context3.abrupt("return", undefined);
93259
+ case 2:
93260
+ _context3.next = 4;
93261
+ return fetch("".concat(root.configurationStore.apiConfig.idmService, "/catalogs/").concat(encodeURIComponent(analysedCatalogId), "/analyse"), {
93262
+ headers: {
93263
+ Authorization: "Bearer ".concat(root.dataStore.jwt)
93264
+ },
93265
+ signal: signal
93266
+ });
93267
+ case 4:
93268
+ response = _context3.sent;
93269
+ if (response.ok) {
93270
+ _context3.next = 10;
93271
+ break;
93272
+ }
93273
+ _context3.next = 8;
93274
+ return response.json()["catch"](function () {
93275
+ return undefined;
93276
+ });
93277
+ case 8:
93278
+ body = _context3.sent;
93279
+ throw new Error("idm-service answered ".concat(response.status).concat(typeof (body === null || body === void 0 ? void 0 : body.error) === 'string' ? ": ".concat(body.error) : ''));
93280
+ case 10:
93281
+ return _context3.abrupt("return", response.json());
93282
+ case 11:
93283
+ case "end":
93284
+ return _context3.stop();
93285
+ }
93286
+ }, _callee3);
93287
+ }));
93288
+ return function (_x4) {
93289
+ return _ref5.apply(this, arguments);
93290
+ };
93291
+ }(), [analysedCatalogId, root]);
93083
93292
  var viewRebuilding = root.webplannerInstanceStore.isRebuilding(key);
93084
93293
  useEffect(function () {
93085
93294
  if (!key || !serie || planner || viewRebuilding) return;
@@ -93112,6 +93321,22 @@ var DivaAgent = function DivaAgent(_ref) {
93112
93321
  };
93113
93322
  }, [pendingNav]);
93114
93323
 
93324
+ // reloadPage from this chat's turn reloads once the turn is SAVED (pageReloadDue); the tool's timer is the fallback.
93325
+ var chatTurn = useRef({
93326
+ isStreaming: false
93327
+ });
93328
+ useEffect(function () {
93329
+ return setChatTurnProbe(function () {
93330
+ return chatTurn.current;
93331
+ });
93332
+ }, []);
93333
+ // True from the reload on: the old document must not send the automatic 'Continue.' itself — it would be cut off.
93334
+ var onTurnState = useCallback(function (state) {
93335
+ chatTurn.current = state;
93336
+ if (pageReloadDue(pendingPageReload.get(), state)) reloadPendingPage();
93337
+ return isPageReloading();
93338
+ }, []);
93339
+
93115
93340
  /**
93116
93341
  * Brings the configurator in front of the user for `showInPlanner`; false = this view registered none.
93117
93342
  * Deliberately NOT `revealTool`: detaching REMOUNTS the configurator and discards the navigation just performed.
@@ -93189,12 +93414,14 @@ var DivaAgent = function DivaAgent(_ref) {
93189
93414
  getVisiblePlanner: getVisiblePlanner,
93190
93415
  getExpectedSelection: getExpectedSelection,
93191
93416
  refreshStalePlanner: refreshStalePlanner,
93417
+ fetchCatalogAnalysis: fetchCatalogAnalysis,
93192
93418
  extraToolsets: extraToolsets,
93193
93419
  useCase: "backoffice",
93194
93420
  contextKey: contextKey,
93195
93421
  contextTag: contextTag,
93196
93422
  contextLabel: contextLabel,
93197
93423
  readyForAutoContinue: (!serie || !!planner || !!initError) && !pendingNav && !restoringSelection,
93424
+ onTurnState: onTurnState,
93198
93425
  onEntityLink: onEntityLink,
93199
93426
  enableBridge: mcpPermitted,
93200
93427
  allowAutoApprove: editPermitted,