@uxland/primary-shell 7.20.0 → 7.21.1

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.
@@ -3361,8 +3361,17 @@ var NotificationMappings = (
3361
3361
  })()
3362
3362
  );
3363
3363
  const BROKER_EVENTS = {
3364
- refreshHistoryDataRequested: "refresh_history_data_requested",
3365
- errorLoadingActivityHistoryData: "error_loading_activity_history_data"
3364
+ activityHistory: {
3365
+ refreshDataRequested: "refresh_history_data_requested",
3366
+ errorLoadingData: "error_loading_activity_history_data",
3367
+ searched: "activity_history_searched",
3368
+ filtersCleaned: "activity_history_filters_cleaned",
3369
+ diagnosticFilterDeactivated: "activity_history_diagnostic_filter_deactivated",
3370
+ injectAsyncHistoryItemsRequest: "inject_async_history_items_request",
3371
+ addHistoryItemRequest: "add_history_item_request",
3372
+ addHistoryItemsRequest: "add_history_items_request",
3373
+ updateHistoryItemRequest: "update_history_item_request"
3374
+ }
3366
3375
  }, disposableFactory = (te) => ({
3367
3376
  dispose: () => {
3368
3377
  mediatorSettings.resolver.remove(te.name);
@@ -9610,12 +9619,15 @@ const shellRegions = {
9610
9619
  sidebar: "clinical-monitoring-widgets-sidebar-region",
9611
9620
  header: "clinical-monitoring-header-widgets-region",
9612
9621
  content: "clinical-monitoring-content-widgets-region"
9622
+ }, activityHistoryRegions = {
9623
+ customFilters: "clinical-monitoring-activity-history-filters-region"
9613
9624
  };
9614
9625
  class RegionManagerProxy {
9615
9626
  constructor(J, X, re) {
9616
9627
  this.pluginInfo = J, this.regionManager = X, this.broker = re, this.regions = {
9617
9628
  shell: shellRegions,
9618
- clinicalMonitoring: clinicalMonitoringRegions
9629
+ clinicalMonitoring: clinicalMonitoringRegions,
9630
+ activityHistory: activityHistoryRegions
9619
9631
  };
9620
9632
  }
9621
9633
  /**
@@ -9770,7 +9782,7 @@ class ImportDataManagerImpl {
9770
9782
  async import(J) {
9771
9783
  this.currentImporterId = J, this.selectedItems = {}, this.pluginTexts = {};
9772
9784
  try {
9773
- const { ImportDataManagerModal: X } = await import("./component-D0BI_Ste.js"), { confirmed: re } = await this.interactionService.confirm(
9785
+ const { ImportDataManagerModal: X } = await import("./component-BkA2uC0M.js"), { confirmed: re } = await this.interactionService.confirm(
9774
9786
  void 0,
9775
9787
  { component: X },
9776
9788
  {
@@ -11176,6 +11188,14 @@ function addCustomFiltersReducer(te, J) {
11176
11188
  function clearCustomFiltersReducer(te) {
11177
11189
  te.filters = te.filters.filter((J) => !isCustomFilter(J));
11178
11190
  }
11191
+ function setCustomFilterAllValuesReducer(te, J) {
11192
+ te.filters = te.filters.map((X) => X.id === J.payload.filterGroupId ? {
11193
+ ...X,
11194
+ filters: X.filters.map(
11195
+ (re) => re.id === J.payload.filterId ? { ...re, enabledValues: J.payload.values } : re
11196
+ )
11197
+ } : X);
11198
+ }
11179
11199
  function setCustomFilterGroupValueReducer(te, J) {
11180
11200
  te.filters = te.filters.map((X) => X.id === J.payload.id ? {
11181
11201
  ...X,
@@ -11204,23 +11224,45 @@ const setMultipleOptionsFilterValue = (te, J) => {
11204
11224
  enabled: J,
11205
11225
  enabledValues: J ? [!0] : []
11206
11226
  });
11207
- function addDiagnosticFiltersReducer(te, J) {
11208
- const X = te.filters.findIndex(isDiagnosticFilter);
11209
- if (X === -1)
11210
- te.filters.push(J.payload);
11227
+ function deleteDiagnosticFilterValueReducer(te, J) {
11228
+ te.filters.some(isDiagnosticFilter) && (te.filters = [...te.filters].map((re) => {
11229
+ if (isDiagnosticFilter(re)) {
11230
+ const ne = re.enabledValues.filter((oe) => {
11231
+ if (oe.codi === J.payload.diagnosticCodi)
11232
+ return !1;
11233
+ const de = re.enabledValues.some(
11234
+ (ue) => ue.codi === J.payload.diagnosticCodi && ue.evolucions?.some((he) => he.codi === oe.codi)
11235
+ ), ce = re.enabledValues.some(
11236
+ (ue) => ue.codi === J.payload.diagnosticCodi && ue.relacions?.some((he) => he.codi === oe.codi)
11237
+ );
11238
+ return !de && !ce;
11239
+ });
11240
+ return { ...re, enabledValues: ne };
11241
+ }
11242
+ return re;
11243
+ }));
11244
+ }
11245
+ function setDiagnosticFilterValuesReducer(te, J) {
11246
+ if (te.filters.some(isDiagnosticFilter))
11247
+ te.filters = [...te.filters].map((re) => isDiagnosticFilter(re) ? { ...re, enabledValues: J.payload } : re);
11211
11248
  else {
11212
- const re = te.filters[X], ne = [
11213
- ...re.values,
11214
- ...J.payload.values.filter((oe) => !re.values.some((de) => de.value === oe.value))
11215
- ];
11216
- te.filters[X] = {
11217
- ...re,
11218
- values: ne
11249
+ const re = {
11250
+ id: diagnosticsfilterId,
11251
+ title: "Diagnòstics",
11252
+ values: [],
11253
+ enabledValues: J.payload
11219
11254
  };
11255
+ te.filters = [...te.filters, re];
11220
11256
  }
11221
11257
  }
11222
- function setDiagnosticFilterValuesReducer(te, J) {
11223
- te.filters = [...te.filters].map((X) => isDiagnosticFilter(X) ? { ...X, enabledValues: J.payload } : X);
11258
+ function resetFiltersReducer(te, J) {
11259
+ te.filters = te.filters.map((X) => X.id !== "common" && X.id !== "history-diagnostics" && X.id !== "history-up" ? {
11260
+ ...X,
11261
+ filters: X.filters.map((re) => re.singleOption ? { ...re, enabled: !1 } : { ...re, enabled: !0, enabledValues: [] })
11262
+ } : X.id === "history-diagnostics" || X.id === "history-up" ? {
11263
+ ...X,
11264
+ enabledValues: []
11265
+ } : X.id === "common" ? commonFilters[0] : X);
11224
11266
  }
11225
11267
  function addUpFiltersReducer(te, J) {
11226
11268
  const X = te.filters.findIndex(isUpFilter);
@@ -11240,23 +11282,6 @@ function addUpFiltersReducer(te, J) {
11240
11282
  function setUpFilterValuesReducer(te, J) {
11241
11283
  te.filters = [...te.filters].map((X) => isUpFilter(X) ? { ...X, enabledValues: J.payload } : X);
11242
11284
  }
11243
- function resetFiltersReducer(te, J) {
11244
- te.filters = te.filters.map((X) => X.id !== "common" && X.id !== "history-diagnostics" && X.id !== "history-up" ? {
11245
- ...X,
11246
- filters: X.filters.map((re) => re.singleOption ? { ...re, enabled: !1 } : { ...re, enabled: !0, enabledValues: [] })
11247
- } : X.id === "history-diagnostics" || X.id === "history-up" ? {
11248
- ...X,
11249
- enabledValues: []
11250
- } : X.id === "common" ? commonFilters[0] : X);
11251
- }
11252
- function setCustomFilterAllValuesReducer(te, J) {
11253
- te.filters = te.filters.map((X) => X.id === J.payload.filterGroupId ? {
11254
- ...X,
11255
- filters: X.filters.map(
11256
- (re) => re.id === J.payload.filterId ? { ...re, enabledValues: J.payload.values } : re
11257
- )
11258
- } : X);
11259
- }
11260
11285
  const activityHistoryFiltersSlice = createSlice({
11261
11286
  name: "activity-history-filters",
11262
11287
  initialState: {
@@ -11271,8 +11296,8 @@ const activityHistoryFiltersSlice = createSlice({
11271
11296
  setCustomFilterGroupValue: setCustomFilterGroupValueReducer,
11272
11297
  setCustomFilterValue: setCustomFilterValueReducer,
11273
11298
  setCustomFilterAllValues: setCustomFilterAllValuesReducer,
11274
- addDiagnosticFilters: addDiagnosticFiltersReducer,
11275
11299
  setDiagnosticFilterValues: setDiagnosticFilterValuesReducer,
11300
+ deleteDiagnosticFilterValue: deleteDiagnosticFilterValueReducer,
11276
11301
  addUpFilters: addUpFiltersReducer,
11277
11302
  setUpFilterValues: setUpFilterValuesReducer,
11278
11303
  resetFilters: resetFiltersReducer
@@ -11351,7 +11376,7 @@ class InjectAsyncHistoryItemsHandler extends BaseHandler {
11351
11376
  this.store.dispatch(addBusyHistoryItem(J.entityId));
11352
11377
  try {
11353
11378
  const X = await J.asyncDataProvider();
11354
- validateAddAsyncCommand(J, X), this.api.broker.send("add_history_items_request", {
11379
+ validateAddAsyncCommand(J, X), this.api.broker.send(this.api.broker.events.activityHistory.addHistoryItemsRequest, {
11355
11380
  entityId: J.entityId,
11356
11381
  entityDescription: J.entityDescription,
11357
11382
  items: X,
@@ -11372,51 +11397,15 @@ class InjectAsyncHistoryItemsHandler extends BaseHandler {
11372
11397
  }
11373
11398
  }
11374
11399
  }
11375
- let request$m;
11376
- const bootstrapInjectAsyncHistoryItems = (te) => {
11377
- request$m = te.registerRequest("inject_async_history_items_request", InjectAsyncHistoryItemsHandler);
11400
+ let request$k;
11401
+ const bootstrapInjectAsyncHistoryItems = (te, J) => {
11402
+ request$k = te.registerRequest(
11403
+ J.broker.events.activityHistory.injectAsyncHistoryItemsRequest,
11404
+ InjectAsyncHistoryItemsHandler
11405
+ );
11378
11406
  }, teardownInjectAsyncHistoryItems = () => {
11379
- request$m?.dispose();
11380
- }, isString = (te) => typeof te == "string" && te.trim() !== "", isValidDateString = (te) => {
11381
- if (typeof te != "string" || te.trim() === "") return !1;
11382
- const J = new Date(te);
11383
- return J instanceof Date && !Number.isNaN(J.getTime());
11384
- }, isValidBasicActivityHistoryItem = (te) => te && isString(te.id) && // Verifica que "id" esté informado
11385
- isValidDateString(te.date), ensureAreValidBasicActivityHistoryItems = (te) => {
11386
- if (!te.every(isValidBasicActivityHistoryItem))
11387
- throw console.error("Invalid activity history items", te), new Error("Invalid activity history items");
11388
- return te;
11389
- }, notifyInvalidItem = (te) => {
11390
- console.error("Invalid history item", te);
11391
- }, validateAndFilterBasicItems = (te) => {
11392
- const J = [];
11393
- for (const X of te)
11394
- isValidBasicActivityHistoryItem(X) ? J.push(X) : notifyInvalidItem(X);
11395
- return J;
11396
- }, handleAddDiagnosticsFilter = (te, J) => {
11397
- const X = te.flatMap((re) => re.diagnostics ?? []).filter((re) => typeof re.codi == "string" && re.codi.trim() !== "").filter((re, ne, oe) => ne === oe.findIndex((de) => de.codi === re.codi));
11398
- if (X.length > 0) {
11399
- const re = {
11400
- id: diagnosticsfilterId,
11401
- title: "Diagnòstics",
11402
- values: mapArrayToLabelValue(X, "descripcio", "codi"),
11403
- enabledValues: []
11404
- };
11405
- J.dispatch(activityHistoryFiltersSlice.actions.addDiagnosticFilters(re));
11406
- }
11407
- }, getUpFilter = (te) => {
11408
- const J = te.flatMap((X) => X.up ?? []).filter((X) => X?.id?.trim()).filter((X, re, ne) => re === ne.findIndex((oe) => oe.id === X.id));
11409
- if (J.length > 0)
11410
- return {
11411
- id: upFilterId,
11412
- title: "UP",
11413
- values: mapArrayToLabelValue(J, "description", "id"),
11414
- enabledValues: []
11415
- };
11416
- }, handleAddUpFilter = (te, J) => {
11417
- const X = getUpFilter(te);
11418
- X && J.dispatch(activityHistoryFiltersSlice.actions.addUpFilters(X));
11419
- }, { addActivityHistoryItem } = activityHistoryCollectionsSlice.actions;
11407
+ request$k?.dispose();
11408
+ };
11420
11409
  let pluginLocaleManager;
11421
11410
  const initializeLocalization = async (te) => {
11422
11411
  pluginLocaleManager = await te.createLocaleManager(locales);
@@ -11512,7 +11501,35 @@ const initializeLocalization = async (te) => {
11512
11501
  }, existItemInCollection = (te, J, X) => {
11513
11502
  const re = te?.[J];
11514
11503
  return re?.items ? re.items.some((ne) => ne.id === X) : !1;
11515
- };
11504
+ }, isString = (te) => typeof te == "string" && te.trim() !== "", isValidDateString = (te) => {
11505
+ if (typeof te != "string" || te.trim() === "") return !1;
11506
+ const J = new Date(te);
11507
+ return J instanceof Date && !Number.isNaN(J.getTime());
11508
+ }, isValidBasicActivityHistoryItem = (te) => te && isString(te.id) && // Verifica que "id" esté informado
11509
+ isValidDateString(te.date), ensureAreValidBasicActivityHistoryItems = (te) => {
11510
+ if (!te.every(isValidBasicActivityHistoryItem))
11511
+ throw console.error("Invalid activity history items", te), new Error("Invalid activity history items");
11512
+ return te;
11513
+ }, notifyInvalidItem = (te) => {
11514
+ console.error("Invalid history item", te);
11515
+ }, validateAndFilterBasicItems = (te) => {
11516
+ const J = [];
11517
+ for (const X of te)
11518
+ isValidBasicActivityHistoryItem(X) ? J.push(X) : notifyInvalidItem(X);
11519
+ return J;
11520
+ }, getUpFilter = (te) => {
11521
+ const J = te.flatMap((X) => X.up ?? []).filter((X) => X?.id?.trim()).filter((X, re, ne) => re === ne.findIndex((oe) => oe.id === X.id));
11522
+ if (J.length > 0)
11523
+ return {
11524
+ id: upFilterId,
11525
+ title: "UP",
11526
+ values: mapArrayToLabelValue(J, "description", "id"),
11527
+ enabledValues: []
11528
+ };
11529
+ }, handleAddUpFilter = (te, J) => {
11530
+ const X = getUpFilter(te);
11531
+ X && J.dispatch(activityHistoryFiltersSlice.actions.addUpFilters(X));
11532
+ }, { addActivityHistoryItem } = activityHistoryCollectionsSlice.actions;
11516
11533
  class AddHistoryItemHandler extends BaseHandler {
11517
11534
  async handle(J) {
11518
11535
  try {
@@ -11522,7 +11539,7 @@ class AddHistoryItemHandler extends BaseHandler {
11522
11539
  throw new Error(translate("error.itemAlreadyExists"));
11523
11540
  if (!ne)
11524
11541
  throw new Error(translate("error.filterNotInitialized"));
11525
- handleAddDiagnosticsFilter([J.item], this.store), handleAddUpFilter([J.item], this.store), this.store.dispatch(
11542
+ handleAddUpFilter([J.item], this.store), this.store.dispatch(
11526
11543
  addActivityHistoryItem({
11527
11544
  id: J.entityId,
11528
11545
  item: J.item,
@@ -11534,24 +11551,25 @@ class AddHistoryItemHandler extends BaseHandler {
11534
11551
  }
11535
11552
  }
11536
11553
  }
11537
- let request$l;
11538
- const bootstrapAddHistoryItem = (te) => {
11539
- request$l = te.registerRequest("add_history_item_request", AddHistoryItemHandler);
11554
+ let request$j;
11555
+ const bootstrapAddHistoryItem = (te, J) => {
11556
+ request$j = te.registerRequest(J.broker.events.activityHistory.addHistoryItemRequest, AddHistoryItemHandler);
11540
11557
  }, teardownAddHistoryItem = () => {
11541
- request$l?.dispose();
11542
- }, { addActivityHistoryItems } = activityHistoryCollectionsSlice.actions;
11558
+ request$j?.dispose();
11559
+ };
11543
11560
  class AddCustomFiltersCommand {
11544
11561
  constructor(J) {
11545
11562
  this.payload = J;
11546
11563
  }
11547
11564
  }
11565
+ const { addActivityHistoryItems } = activityHistoryCollectionsSlice.actions;
11548
11566
  class AddHistoryItemsHandler extends BaseHandler {
11549
11567
  async handle(J) {
11550
11568
  try {
11551
11569
  const X = validateAndFilterBasicItems(J.items), re = this.filterDuplicateItems(X, J.entityId);
11552
11570
  if (!this.store.getState().activityHistoryFilters?.filters?.find((de) => de.id === J.entityId) && !J.filters)
11553
11571
  throw new Error(translate("error.filterNotInitialized"));
11554
- re.length > 0 && (handleAddDiagnosticsFilter(re, this.store), handleAddUpFilter(re, this.store), this.store.dispatch(
11572
+ re.length > 0 && (handleAddUpFilter(re, this.store), this.store.dispatch(
11555
11573
  addActivityHistoryItems({
11556
11574
  id: J.entityId,
11557
11575
  items: re,
@@ -11572,16 +11590,16 @@ class AddHistoryItemsHandler extends BaseHandler {
11572
11590
  return ne.length < J.length && this.api.notificationService.warning(translate("warning.someItemsAlreadyExist")), ne;
11573
11591
  }
11574
11592
  }
11575
- let request$k;
11576
- const bootstrapAddHistoryItems = (te) => {
11577
- request$k = te.registerRequest("add_history_items_request", AddHistoryItemsHandler);
11593
+ let request$i;
11594
+ const bootstrapAddHistoryItems = (te, J) => {
11595
+ request$i = te.registerRequest(J.broker.events.activityHistory.addHistoryItemsRequest, AddHistoryItemsHandler);
11578
11596
  }, teardownAddHistoryItems = () => {
11579
- request$k?.dispose();
11580
- }, styles$k = ".spinner-container{display:flex;flex-direction:row;align-items:center;gap:24px;justify-content:center;padding-top:16px}.skeleton-container{padding:20px;height:100%}", template$m = (te) => te.isCollectionInitialState ? ke$1`<div class="skeleton-container">${te.skeletons}</div>` : te.isSomeCollectionLoadedAndOtherLoading ? ke$1`<div class="spinner-container"><dss-spinner size="sm"></dss-spinner><div class="busy-description">${translate("busyEntriesLoading")}</div></div>` : D$5;
11597
+ request$i?.dispose();
11598
+ };
11581
11599
  function connectedProperty(te, J = {}) {
11582
11600
  return createConnectedProperty(store)(te, J);
11583
11601
  }
11584
- const isAnyCollectionBusySelector = (te) => te.activityHistoryCollections.busy.length > 0, isSomeCollectionLoadedAndOtherLoading = (te) => Object.values(te.activityHistoryCollections.collections) && isAnyCollectionBusySelector(te), isCollectionInitialState = (te) => !Object.values(te.activityHistoryCollections.collections)?.length && !isAnyCollectionBusySelector(te);
11602
+ const isAnyCollectionBusySelector = (te) => te.activityHistoryCollections.busy.length > 0, isSomeCollectionLoadedAndOtherLoading = (te) => Object.values(te.activityHistoryCollections.collections) && isAnyCollectionBusySelector(te), isEmptyDataAndOtherLoading = (te) => !Object.values(te.activityHistoryCollections.collections)?.length && isAnyCollectionBusySelector(te), styles$k = ".spinner-container{display:flex;flex-direction:row;align-items:center;gap:24px;justify-content:center;padding-top:16px}.skeleton-container{padding:20px;height:100%}", template$m = (te) => te.isEmptyDataAndOtherLoading ? ke$1`<div class="skeleton-container">${te.skeletons}</div>` : te.isSomeCollectionLoadedAndOtherLoading ? ke$1`<div class="spinner-container"><dss-spinner size="sm"></dss-spinner><div class="busy-description">${translate("busyEntriesLoading")}</div></div>` : D$5;
11585
11603
  var __defProp$o = Object.defineProperty, __getOwnPropDesc$i = Object.getOwnPropertyDescriptor, __decorateClass$u = (te, J, X, re) => {
11586
11604
  for (var ne = re > 1 ? void 0 : re ? __getOwnPropDesc$i(J, X) : J, oe = te.length - 1, de; oe >= 0; oe--)
11587
11605
  (de = te[oe]) && (ne = (re ? de(J, X, ne) : de(ne)) || ne);
@@ -11598,12 +11616,12 @@ let ActivityHistoryBusy = class extends h$q {
11598
11616
  ActivityHistoryBusy.styles = i$I`
11599
11617
  ${r$L(styles$k)}
11600
11618
  `;
11601
- __decorateClass$u([
11602
- connectedProperty(isCollectionInitialState)
11603
- ], ActivityHistoryBusy.prototype, "isCollectionInitialState", 2);
11604
11619
  __decorateClass$u([
11605
11620
  connectedProperty(isSomeCollectionLoadedAndOtherLoading)
11606
11621
  ], ActivityHistoryBusy.prototype, "isSomeCollectionLoadedAndOtherLoading", 2);
11622
+ __decorateClass$u([
11623
+ connectedProperty(isEmptyDataAndOtherLoading)
11624
+ ], ActivityHistoryBusy.prototype, "isEmptyDataAndOtherLoading", 2);
11607
11625
  ActivityHistoryBusy = __decorateClass$u([
11608
11626
  t$n("activity-history-busy")
11609
11627
  ], ActivityHistoryBusy);
@@ -11616,7 +11634,7 @@ class HandleHistoryItemsAddErrorHandler extends BaseHandler {
11616
11634
  async handle(J) {
11617
11635
  try {
11618
11636
  const X = J.entities.map((re) => re.entityId);
11619
- await this.dispatchRemoveErrorItems(X), this.api.broker.publish(this.api.broker.events.errorLoadingActivityHistoryData, X);
11637
+ await this.dispatchRemoveErrorItems(X), this.api.broker.publish(this.api.broker.events.activityHistory.errorLoadingData, X);
11620
11638
  } catch {
11621
11639
  this.api.notificationService.error(translate("error.errorToRefresh"));
11622
11640
  }
@@ -11626,11 +11644,11 @@ class HandleHistoryItemsAddErrorHandler extends BaseHandler {
11626
11644
  this.store.dispatch(removeErrorHistoryItem(X));
11627
11645
  }
11628
11646
  }
11629
- let request$j;
11647
+ let request$h;
11630
11648
  const bootstrapHandleHistoryItemsAddError = (te) => {
11631
- teardownHandleHistoryItemsAddError(), request$j = te.registerRequest(HandleHistoryItemsAddError, HandleHistoryItemsAddErrorHandler);
11649
+ teardownHandleHistoryItemsAddError(), request$h = te.registerRequest(HandleHistoryItemsAddError, HandleHistoryItemsAddErrorHandler);
11632
11650
  }, teardownHandleHistoryItemsAddError = () => {
11633
- request$j?.dispose();
11651
+ request$h?.dispose();
11634
11652
  }, styles$j = ".wrapper{display:flex;flex-direction:column;align-items:center;gap:24px;width:484px;height:auto}.wrapper .content-options{display:flex;flex-direction:column;align-items:center;gap:16px}.wrapper .selector-options{display:flex;flex-direction:row;gap:16px}.wrapper .content-date{display:flex;flex-direction:column;align-items:center;gap:16px;height:124px}.wrapper .datepicker-canvas{display:flex;flex-direction:row;justify-content:center;align-content:center;gap:16px}.wrapper .actions{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:16px}dss-datepicker{width:234px;height:48px;border-radius:var(--dss-radius-sm);border:var(--dss-border-width-sm);padding:var(--dss-spacing-sm);gap:var(--dss-spacing-xs);color:var(--color-neutral-100)}", template$l = (te) => {
11635
11653
  const { arrayElements: J, text: X } = te;
11636
11654
  return ke$1`
@@ -11742,133 +11760,12 @@ class ExportToPdfHandler extends ApiBaseHandler {
11742
11760
  }
11743
11761
  class ExportPdf {
11744
11762
  }
11745
- let request$i;
11763
+ let request$g;
11746
11764
  const bootstrapExportPdf = (te) => {
11747
- request$i = te.registerRequest(ExportPdf, ExportToPdfHandler);
11765
+ request$g = te.registerRequest(ExportPdf, ExportToPdfHandler);
11748
11766
  }, teardownExportPdf = () => {
11749
- request$i?.dispose();
11750
- }, styles$i = ".filters-sidebar{padding:8px 4px;border-right:1px solid rgb(189,189,189);width:56px;height:100%;box-sizing:border-box;display:flex;flex-direction:column}.filters-sidebar dss-icon-button{align-self:center}.filters-sidebar[expanded]{width:296px}.filters-sidebar[expanded] .filters-sidebar-opened{display:flex;align-items:center;justify-content:space-between;padding-inline:8px;color:var(--color-neutral-900);font-weight:700;font-size:16px;line-height:24px}.filter-container{display:flex;flex-direction:column;padding:16px 8px 8px;overflow:auto}.filter-container .filter{padding:8px 0;border-bottom:1px solid var(--color-neutral-200)}.filter-group{display:flex;flex-direction:column;padding-top:12px;gap:var(--dss-spacing-xs)}.filter-group .custom-filter{display:flex;flex-direction:column;padding:6px 8px 6px var(--dss-spacing-xl)}.filter-group .custom-filter .custom-filter-content{display:flex;flex-direction:column;gap:8px}";
11751
- /**
11752
- * @license
11753
- * Copyright 2021 Google LLC
11754
- * SPDX-License-Identifier: BSD-3-Clause
11755
- */
11756
- function nn(te, J, X) {
11757
- return te ? J(te) : X?.(te);
11758
- }
11759
- const filterTemplates = {
11760
- [ActivityHistoryFilterType.Switch]: (te, J, X, re, ne) => ke$1`
11761
- <dss-input-switch size="sm" @onChangeValue=${X} .checked=${re}>
11762
- <input slot="input" id="switch-${te}" aria-label=${J} type="checkbox" ?disabled=${!ne}>
11763
- <label slot="label" for="switch-${te}">${J || te}</label>
11764
- </dss-input-switch>`,
11765
- [ActivityHistoryFilterType.Checkbox]: (te, J, X, re, ne) => ke$1`
11766
- <dss-checkbox variant="default" @onChange=${(oe) => X(oe)}>
11767
- <input slot="input" id="checkboxStory-${te}" type="checkbox" .checked=${re} ?disabled=${!ne}>
11768
- <label slot="label" for="checkboxStory-${te}">${J || te}</label>
11769
- </dss-checkbox>`
11770
- /* [ActivityHistoryFilterType.Dropdown]: (id, title, handleChange, isSelected, isEnabled) => html`
11771
- <dss-input-dropdown type="default" @onChange=${(e) => handleChange(e)}>
11772
- <input slot="input" id="dropdownStory-${id}" type="text" .checked=${isSelected} ?disabled=${!isEnabled}>
11773
- <label slot="label" for="dropdownStory-${id}">${title || id}</label>
11774
- </dss-input-dropdown>`, */
11775
- }, getFilterTemplate = (te, J, X, re) => {
11776
- const ne = !!X?.id && !!re, oe = generateId(), de = ne ? re.title || re.id : te.title, ce = (pe) => {
11777
- te.singleOption ? J(X?.id, te.id, null, pe.detail) : ne && re ? J(X?.id, te.id, re.id, pe.detail) : J(te.id, pe.detail);
11778
- }, ue = ne && re ? te.enabledValues?.includes(re.id) : te.enabled, he = ne && re || te.singleOption ? X.enabled : !0;
11779
- return filterTemplates[te.type]?.(oe, de, ce, ue, he) || ke$1``;
11780
- }, template$k = (te) => ke$1`
11781
- <div class="filters-sidebar" ?expanded=${te.filtersExpanded} >
11782
- ${te.filtersExpanded ? ke$1`<div class="filters-sidebar-opened">${translate("filters.filters")}<dss-icon-button ?hidden=${te.wrapperMaximized} @click=${() => te._toggleFilters()} size="md" variant="primary" icon="keyboard_double_arrow_left"></dss-icon-button></div>
11783
- <div class="filter-container">
11784
- ${Qt(te.commonFilters, (J) => ke$1`<div class="filter">${getFilterTemplate(J, te._onChangeCommonFilterValue.bind(te))}</div> `)}
11785
- ${te.diagnosticFilter && ke$1`<div class="filter">
11786
- <dss-input-dropdown inputsize="md" icon="" multiple dropdownFixed type="default" .elements=${te.diagnosticFilter?.values} @onInputDropdownChange=${te._handleDiagnosticFilterChange} .selectedValue=${te.diagnosticFilterEnabledValues} selectorStyle=${"max-height: 450px"}>
11787
- <label slot="label" for="diagnostic-filter">${te.diagnosticFilter.title}</label>
11788
- <input id="diagnostic-filter" slot="input" type="text" class="dss-input" autocomplete="off"/>
11789
- </dss-input-dropdown>
11790
- </div>`}
11791
- ${te.upFilter && ke$1`<div class="filter">
11792
- <dss-input-dropdown inputsize="md" icon="" multiple dropdownFixed type="default" .elements=${te.upFilter?.values} @onInputDropdownChange=${te._handleUpFilterChange} .selectedValue=${te.upFilterEnabledValues} selectorStyle=${"max-height: 450px"}>
11793
- <label slot="label" for="up-filter">${te.upFilter.title}</label>
11794
- <input id="up-filter" slot="input" type="text" class="dss-input" autocomplete="off"/>
11795
- </dss-input-dropdown>
11796
- </div>`}
11797
- ${Qt(
11798
- te.customFilterGroups,
11799
- (J) => ke$1`
11800
- <div class="filter-group">
11801
- <dss-input-switch size="sm" .checked=${J.enabled} @onChangeValue=${(X) => te._onChangeCustomFilterGroupValue(J.id, X.detail)}>
11802
- <input slot="input" id="switch-${J.id}" aria-label=${J.title} type="checkbox">
11803
- <label slot="label" for="switch-${J.id}">${J.title}</label>
11804
- </dss-input-switch>
11805
- ${J?.filters && Qt(J.filters, (X) => customFilterTemplate(X, te, J))}
11806
- </div> `
11807
- )}
11808
- </div> ` : ke$1`<dss-icon-button @click=${() => te._toggleFilters()} size="md" variant="primary" icon="keyboard_double_arrow_right"></dss-icon-button>`}
11809
- </div>
11810
- `, customFilterTemplate = (te, J, X) => {
11811
- if (te.type === ActivityHistoryFilterType.Dropdown) {
11812
- const re = te?.options.map((ne) => ({ value: ne.id, label: ne.title || ne.id }));
11813
- return nn(
11814
- re.length > 0,
11815
- () => ke$1`
11816
- <dss-input-dropdown
11817
- inputsize="md"
11818
- icon=""
11819
- multiple
11820
- dropdownFixed
11821
- type="default"
11822
- .elements=${re}
11823
- @onInputDropdownChange=${(ne) => J._onChangeCustomFilterAllValues(X.id, te.id, ne.detail.selectedValue)}
11824
- .selectedValue=${te.enabledValues}
11825
- selectorStyle="max-height: 450px"
11826
- >
11827
- <label slot="label">${te.title}</label>
11828
- <input slot="input" type="text" class="dss-input" autocomplete="off" />
11829
- </dss-input-dropdown>
11830
- `
11831
- );
11832
- }
11833
- return te.singleOption ? getFilterTemplate(te, J._onChangeCustomFilterValue.bind(J), X) : nn(
11834
- !!te.options?.length,
11835
- () => ke$1`
11836
- <primaria-accordion isOpen>
11837
- <div class="custom-filter-title" slot="title">${te.title}</div>
11838
- <div class="custom-filter-content" slot="content">
11839
- ${te.options.map(
11840
- (re) => getFilterTemplate(te, J._onChangeCustomFilterValue.bind(J), X, re)
11841
- )}
11842
- </div>
11843
- </primaria-accordion>
11844
- `
11845
- );
11767
+ request$g?.dispose();
11846
11768
  };
11847
- class SetCustomFilterGroup {
11848
- constructor(J) {
11849
- this.payload = J;
11850
- }
11851
- }
11852
- class SetCommonFilter {
11853
- constructor(J) {
11854
- this.payload = J;
11855
- }
11856
- }
11857
- const activityHistoryFiltersSelector = (te) => te.activityHistoryFilters.filters, activityHistoryCommonFiltersSelector = createSelector(
11858
- activityHistoryFiltersSelector,
11859
- (te) => te.find(isCommonFilterGroup)?.filters || []
11860
- ), activityHistoryEnabledCommonFiltersSelector = createSelector(
11861
- activityHistoryCommonFiltersSelector,
11862
- (te) => te.filter((J) => J.enabled)
11863
- ), areCommonFiltersActive = createSelector(
11864
- activityHistoryEnabledCommonFiltersSelector,
11865
- (te) => !!te.length
11866
- );
11867
- class SetCustomFilterValue {
11868
- constructor(J) {
11869
- this.payload = J;
11870
- }
11871
- }
11872
11769
  function getUniqueObjects(te, J, X, re) {
11873
11770
  const ne = `Sense ${re.toLocaleLowerCase()}`, oe = /* @__PURE__ */ new Map();
11874
11771
  let de = !1;
@@ -11963,7 +11860,16 @@ class ComposedTypeSpec extends Spec {
11963
11860
  return X.length === 0 ? !0 : X.reduce((ne, oe) => ne.or(new TypeSpec(oe)), new FalseSpec()).isSatisfiedBy(J);
11964
11861
  }
11965
11862
  }
11966
- const activityHistoryCustomFilterGroupsSelector = createSelector(
11863
+ const activityHistoryFiltersSelector = (te) => te.activityHistoryFilters.filters, activityHistoryCommonFiltersSelector = createSelector(
11864
+ activityHistoryFiltersSelector,
11865
+ (te) => te.find(isCommonFilterGroup)?.filters || []
11866
+ ), activityHistoryEnabledCommonFiltersSelector = createSelector(
11867
+ activityHistoryCommonFiltersSelector,
11868
+ (te) => te.filter((J) => J.enabled)
11869
+ ), areCommonFiltersActive = createSelector(
11870
+ activityHistoryEnabledCommonFiltersSelector,
11871
+ (te) => !!te.length
11872
+ ), activityHistoryCustomFilterGroupsSelector = createSelector(
11967
11873
  activityHistoryFiltersSelector,
11968
11874
  (te) => te.filter(isCustomFilter).sort(sortBySortProperty)
11969
11875
  ), sortBySortProperty = (te, J) => Number(te.sort) - Number(J.sort), areCustomFiltersActive = createSelector(
@@ -12079,7 +11985,19 @@ const groupActivityHistoryItems = (te) => {
12079
11985
  );
12080
11986
  class DiagnosticCodeSpec extends Spec {
12081
11987
  constructor(J) {
12082
- super(), this.diagnosticCodes = J;
11988
+ super(), this.diagnosticCodes = this.extractAllCodes(J);
11989
+ }
11990
+ extractAllCodes(J) {
11991
+ const X = /* @__PURE__ */ new Set();
11992
+ for (const re of J) {
11993
+ if (re.codi && X.add(re.codi), re.evolucions && Array.isArray(re.evolucions))
11994
+ for (const ne of re.evolucions)
11995
+ ne.codi && X.add(ne.codi);
11996
+ if (re.relacions && Array.isArray(re.relacions))
11997
+ for (const ne of re.relacions)
11998
+ ne.codi && X.add(ne.codi);
11999
+ }
12000
+ return Array.from(X);
12083
12001
  }
12084
12002
  isSatisfiedBy(J) {
12085
12003
  return this.diagnosticCodes?.length ? (J.diagnostics ?? []).some((re) => this.diagnosticCodes.includes(re.codi)) : !0;
@@ -12140,21 +12058,126 @@ const activityHistoryCollectionsSelector = (te) => te.activityHistoryCollections
12140
12058
  return sortGroupsByMostRecentDate(ce);
12141
12059
  }
12142
12060
  );
12143
- class SetDiagnosticFiltersCommand {
12061
+ class SetCommonFilter {
12144
12062
  constructor(J) {
12145
12063
  this.payload = J;
12146
12064
  }
12147
12065
  }
12148
- class SetUpFiltersCommand {
12066
+ class SetCustomFilterAllValues {
12149
12067
  constructor(J) {
12150
12068
  this.payload = J;
12151
12069
  }
12152
12070
  }
12153
- class SetCustomFilterAllValues {
12071
+ class SetCustomFilterGroup {
12072
+ constructor(J) {
12073
+ this.payload = J;
12074
+ }
12075
+ }
12076
+ class SetCustomFilterValue {
12077
+ constructor(J) {
12078
+ this.payload = J;
12079
+ }
12080
+ }
12081
+ class SetUpFiltersCommand {
12154
12082
  constructor(J) {
12155
12083
  this.payload = J;
12156
12084
  }
12157
12085
  }
12086
+ const styles$i = ".filters-sidebar{padding:8px 4px;border-right:1px solid rgb(189,189,189);width:56px;height:100%;box-sizing:border-box;display:flex;flex-direction:column}.filters-sidebar dss-icon-button{align-self:center}.filters-sidebar[expanded]{width:296px}.filters-sidebar[expanded] .filters-sidebar-opened{display:flex;align-items:center;justify-content:space-between;padding-inline:8px;color:var(--color-neutral-900);font-weight:700;font-size:16px;line-height:24px}.filter-container{display:flex;flex-direction:column;padding:16px 8px 8px;overflow:auto}.filter-container .filter{padding:8px 0;border-bottom:1px solid var(--color-neutral-200)}.filter-group{display:flex;flex-direction:column;padding-top:12px;gap:var(--dss-spacing-xs)}.filter-group .custom-filter{display:flex;flex-direction:column;padding:6px 8px 6px var(--dss-spacing-xl)}.filter-group .custom-filter .custom-filter-content{display:flex;flex-direction:column;gap:8px}";
12087
+ /**
12088
+ * @license
12089
+ * Copyright 2021 Google LLC
12090
+ * SPDX-License-Identifier: BSD-3-Clause
12091
+ */
12092
+ function nn(te, J, X) {
12093
+ return te ? J(te) : X?.(te);
12094
+ }
12095
+ const filterTemplates = {
12096
+ [ActivityHistoryFilterType.Switch]: (te, J, X, re, ne) => ke$1`
12097
+ <dss-input-switch size="sm" @onChangeValue=${X} .checked=${re}>
12098
+ <input slot="input" id="switch-${te}" aria-label=${J} type="checkbox" ?disabled=${!ne}>
12099
+ <label slot="label" for="switch-${te}">${J || te}</label>
12100
+ </dss-input-switch>`,
12101
+ [ActivityHistoryFilterType.Checkbox]: (te, J, X, re, ne) => ke$1`
12102
+ <dss-checkbox variant="default" @onChange=${(oe) => X(oe)}>
12103
+ <input slot="input" id="checkboxStory-${te}" type="checkbox" .checked=${re} ?disabled=${!ne}>
12104
+ <label slot="label" for="checkboxStory-${te}">${J || te}</label>
12105
+ </dss-checkbox>`
12106
+ /* [ActivityHistoryFilterType.Dropdown]: (id, title, handleChange, isSelected, isEnabled) => html`
12107
+ <dss-input-dropdown type="default" @onChange=${(e) => handleChange(e)}>
12108
+ <input slot="input" id="dropdownStory-${id}" type="text" .checked=${isSelected} ?disabled=${!isEnabled}>
12109
+ <label slot="label" for="dropdownStory-${id}">${title || id}</label>
12110
+ </dss-input-dropdown>`, */
12111
+ }, getFilterTemplate = (te, J, X, re) => {
12112
+ const ne = !!X?.id && !!re, oe = generateId(), de = ne ? re.title || re.id : te.title, ce = (pe) => {
12113
+ te.singleOption ? J(X?.id, te.id, null, pe.detail) : ne && re ? J(X?.id, te.id, re.id, pe.detail) : J(te.id, pe.detail);
12114
+ }, ue = ne && re ? te.enabledValues?.includes(re.id) : te.enabled, he = ne && re || te.singleOption ? X.enabled : !0;
12115
+ return filterTemplates[te.type]?.(oe, de, ce, ue, he) || ke$1``;
12116
+ }, template$k = (te) => ke$1`
12117
+ <div class="filters-sidebar" ?expanded=${te.filtersExpanded} >
12118
+ ${te.filtersExpanded ? ke$1`<div class="filters-sidebar-opened">${translate("filters.filters")}<dss-icon-button ?hidden=${te.wrapperMaximized} @click=${() => te._toggleFilters()} size="md" variant="primary" icon="keyboard_double_arrow_left"></dss-icon-button></div>
12119
+ <div class="filter-container">
12120
+ ${Qt(te.commonFilters, (J) => ke$1`<div class="filter">${getFilterTemplate(J, te._onChangeCommonFilterValue.bind(te))}</div> `)}
12121
+ <!-- Regió per al filtre de diagnostics extern -->
12122
+ <div class="filter">
12123
+ <primaria-region name=${te.api.regionManager.regions.activityHistory.customFilters}></primaria-region>
12124
+ </div>
12125
+ ${te.upFilter && ke$1`<div class="filter">
12126
+ <dss-input-dropdown inputsize="md" icon="" multiple dropdownFixed type="default" .elements=${te.upFilter?.values} @onInputDropdownChange=${te._handleUpFilterChange} .selectedValue=${te.upFilterEnabledValues} selectorStyle=${"max-height: 450px"}>
12127
+ <label slot="label" for="up-filter">${te.upFilter.title}</label>
12128
+ <input id="up-filter" slot="input" type="text" class="dss-input" autocomplete="off"/>
12129
+ </dss-input-dropdown>
12130
+ </div>`}
12131
+ ${Qt(
12132
+ te.customFilterGroups,
12133
+ (J) => ke$1`
12134
+ <div class="filter-group">
12135
+ <dss-input-switch size="sm" .checked=${J.enabled} @onChangeValue=${(X) => te._onChangeCustomFilterGroupValue(J.id, X.detail)}>
12136
+ <input slot="input" id="switch-${J.id}" aria-label=${J.title} type="checkbox">
12137
+ <label slot="label" for="switch-${J.id}">${J.title}</label>
12138
+ </dss-input-switch>
12139
+ ${J?.filters && Qt(J.filters, (X) => customFilterTemplate(X, te, J))}
12140
+ </div> `
12141
+ )}
12142
+ </div> ` : ke$1`<dss-icon-button @click=${() => te._toggleFilters()} size="md" variant="primary" icon="keyboard_double_arrow_right"></dss-icon-button>`}
12143
+ </div>
12144
+ `, customFilterTemplate = (te, J, X) => {
12145
+ if (te.type === ActivityHistoryFilterType.Dropdown) {
12146
+ const re = te?.options.map((ne) => ({ value: ne.id, label: ne.title || ne.id }));
12147
+ return nn(
12148
+ re.length > 0,
12149
+ () => ke$1`
12150
+ <dss-input-dropdown
12151
+ inputsize="md"
12152
+ icon=""
12153
+ multiple
12154
+ dropdownFixed
12155
+ type="default"
12156
+ .elements=${re}
12157
+ @onInputDropdownChange=${(ne) => J._onChangeCustomFilterAllValues(X.id, te.id, ne.detail.selectedValue)}
12158
+ .selectedValue=${te.enabledValues}
12159
+ selectorStyle="max-height: 450px"
12160
+ >
12161
+ <label slot="label">${te.title}</label>
12162
+ <input slot="input" type="text" class="dss-input" autocomplete="off" />
12163
+ </dss-input-dropdown>
12164
+ `
12165
+ );
12166
+ }
12167
+ return te.singleOption ? getFilterTemplate(te, J._onChangeCustomFilterValue.bind(J), X) : nn(
12168
+ !!te.options?.length,
12169
+ () => ke$1`
12170
+ <primaria-accordion isOpen>
12171
+ <div class="custom-filter-title" slot="title">${te.title}</div>
12172
+ <div class="custom-filter-content" slot="content">
12173
+ ${te.options.map(
12174
+ (re) => getFilterTemplate(te, J._onChangeCustomFilterValue.bind(J), X, re)
12175
+ )}
12176
+ </div>
12177
+ </primaria-accordion>
12178
+ `
12179
+ );
12180
+ };
12158
12181
  var __defProp$m = Object.defineProperty, __getOwnPropDesc$g = Object.getOwnPropertyDescriptor, __decorateClass$s = (te, J, X, re) => {
12159
12182
  for (var ne = re > 1 ? void 0 : re ? __getOwnPropDesc$g(J, X) : J, oe = te.length - 1, de; oe >= 0; oe--)
12160
12183
  (de = te[oe]) && (ne = (re ? de(J, X, ne) : de(ne)) || ne);
@@ -12198,10 +12221,6 @@ let ActivityHistoryFilters = class extends h$q {
12198
12221
  })
12199
12222
  );
12200
12223
  }
12201
- _handleDiagnosticFilterChange(te) {
12202
- const J = te.detail.selectedValue;
12203
- this.api.broker.send(new SetDiagnosticFiltersCommand(J));
12204
- }
12205
12224
  _handleUpFilterChange(te) {
12206
12225
  const J = te.detail.selectedValue;
12207
12226
  this.api.broker.send(new SetUpFiltersCommand(J));
@@ -12250,11 +12269,11 @@ class SetCommonFilterHandler extends StoreBaseHandler {
12250
12269
  }
12251
12270
  }
12252
12271
  }
12253
- let request$h;
12272
+ let request$f;
12254
12273
  const bootstrapSetCommonFilter = (te) => {
12255
- request$h = te.registerRequest(SetCommonFilter, SetCommonFilterHandler);
12274
+ request$f = te.registerRequest(SetCommonFilter, SetCommonFilterHandler);
12256
12275
  }, teardownSetCommonFilter = () => {
12257
- request$h?.dispose();
12276
+ request$f?.dispose();
12258
12277
  }, { addCustomFilters } = activityHistoryFiltersSlice.actions;
12259
12278
  class AddCustomFiltersHandler extends StoreBaseHandler {
12260
12279
  async handle(J) {
@@ -12265,11 +12284,26 @@ class AddCustomFiltersHandler extends StoreBaseHandler {
12265
12284
  }
12266
12285
  }
12267
12286
  }
12268
- let request$g;
12287
+ let request$e;
12269
12288
  const bootstrapAddCustomFilter = (te) => {
12270
- request$g = te.registerRequest(AddCustomFiltersCommand, AddCustomFiltersHandler);
12289
+ request$e = te.registerRequest(AddCustomFiltersCommand, AddCustomFiltersHandler);
12271
12290
  }, teardownAddCustomFilter = () => {
12272
- request$g?.dispose();
12291
+ request$e?.dispose();
12292
+ }, { setCustomFilterAllValues } = activityHistoryFiltersSlice.actions;
12293
+ class SetCustomFilterAllValuesHandler extends StoreBaseHandler {
12294
+ async handle(J) {
12295
+ try {
12296
+ this.store.dispatch(setCustomFilterAllValues(J.payload));
12297
+ } catch (X) {
12298
+ console.log(X.message);
12299
+ }
12300
+ }
12301
+ }
12302
+ let request$d;
12303
+ const bootstrapSetCustomFilterAllValues = (te) => {
12304
+ request$d = te.registerRequest(SetCustomFilterAllValues, SetCustomFilterAllValuesHandler);
12305
+ }, teardownSetCustomFilterAllValues = () => {
12306
+ request$d?.dispose();
12273
12307
  }, { setCustomFilterGroupValue } = activityHistoryFiltersSlice.actions;
12274
12308
  class SetCustomFilterGroupHandler extends StoreBaseHandler {
12275
12309
  async handle(J) {
@@ -12280,11 +12314,11 @@ class SetCustomFilterGroupHandler extends StoreBaseHandler {
12280
12314
  }
12281
12315
  }
12282
12316
  }
12283
- let request$f;
12317
+ let request$c;
12284
12318
  const bootstrapSetCustomFilterGroup = (te) => {
12285
- request$f = te.registerRequest(SetCustomFilterGroup, SetCustomFilterGroupHandler);
12319
+ request$c = te.registerRequest(SetCustomFilterGroup, SetCustomFilterGroupHandler);
12286
12320
  }, teardownSetCustomFilterGroup = () => {
12287
- request$f?.dispose();
12321
+ request$c?.dispose();
12288
12322
  }, { setCustomFilterValue } = activityHistoryFiltersSlice.actions;
12289
12323
  class SetCustomFilterValueHandler extends StoreBaseHandler {
12290
12324
  async handle(J) {
@@ -12295,46 +12329,80 @@ class SetCustomFilterValueHandler extends StoreBaseHandler {
12295
12329
  }
12296
12330
  }
12297
12331
  }
12298
- let request$e;
12332
+ let request$b;
12299
12333
  const bootstrapSetCustomFilterValue = (te) => {
12300
- request$e = te.registerRequest(SetCustomFilterValue, SetCustomFilterValueHandler);
12334
+ request$b = te.registerRequest(SetCustomFilterValue, SetCustomFilterValueHandler);
12301
12335
  }, teardownSetCustomFilterValue = () => {
12302
- request$e?.dispose();
12303
- }, { addDiagnosticFilters } = activityHistoryFiltersSlice.actions;
12304
- class AddDiagnosticFiltersHandler extends StoreBaseHandler {
12336
+ request$b?.dispose();
12337
+ }, { deleteDiagnosticFilterValue } = activityHistoryFiltersSlice.actions;
12338
+ class DeleteDiagnosticFilterValueHandler extends BaseHandler {
12305
12339
  async handle(J) {
12306
12340
  try {
12307
- this.store.dispatch(addDiagnosticFilters(J.payload));
12341
+ const re = diagnosticFilterEnabledValuesSelector(this.store.getState()).find((ne) => ne.codi === J.payload.diagnosticCodi);
12342
+ if (re) {
12343
+ const { evolucions: ne, relacions: oe, ...de } = re;
12344
+ this.api.broker.publish(this.api.broker.events.activityHistory.diagnosticFilterDeactivated, {
12345
+ diagnostic: de
12346
+ });
12347
+ }
12348
+ this.store.dispatch(deleteDiagnosticFilterValue(J.payload));
12308
12349
  } catch (X) {
12309
- console.log(X.message);
12350
+ console.error(X.message);
12310
12351
  }
12311
12352
  }
12312
12353
  }
12313
- class AddDiagnosticFiltersCommand {
12354
+ class DeleteDiagnosticFilterValueCommand {
12314
12355
  constructor(J) {
12315
12356
  this.payload = J;
12316
12357
  }
12317
12358
  }
12318
- let request$d;
12319
- const bootstrapAddDiagnosticFilter = (te) => {
12320
- request$d = te.registerRequest(AddDiagnosticFiltersCommand, AddDiagnosticFiltersHandler);
12321
- }, teardownAddDiagnosticFilter = () => {
12322
- request$d?.dispose();
12359
+ let deleteFilterValueRequest;
12360
+ const bootstrapDeleteDiagnosticFilterValue = (te) => {
12361
+ deleteFilterValueRequest = te.registerRequest(DeleteDiagnosticFilterValueCommand, DeleteDiagnosticFilterValueHandler);
12362
+ }, teardownDeleteDiagnosticFilterValue = () => {
12363
+ deleteFilterValueRequest?.dispose();
12323
12364
  }, { setDiagnosticFilterValues } = activityHistoryFiltersSlice.actions;
12324
- class SetDiagnosticFiltersHandler extends StoreBaseHandler {
12365
+ class SetDiagnosticFilterValuesHandler extends StoreBaseHandler {
12325
12366
  async handle(J) {
12326
12367
  try {
12327
- this.store.dispatch(setDiagnosticFilterValues(J.payload));
12368
+ this.store.dispatch(setDiagnosticFilterValues(J.payload.diagnostics));
12328
12369
  } catch (X) {
12329
- console.log(X.message);
12370
+ console.error(X.message);
12330
12371
  }
12331
12372
  }
12332
12373
  }
12333
- let request$c;
12374
+ class SetDiagnosticFiltersValuesCommand {
12375
+ constructor(J) {
12376
+ this.payload = J;
12377
+ }
12378
+ }
12379
+ let setFiltersValueRequest;
12334
12380
  const bootstrapSetDiagnosticFilter = (te) => {
12335
- request$c = te.registerRequest(SetDiagnosticFiltersCommand, SetDiagnosticFiltersHandler);
12381
+ setFiltersValueRequest = te.registerRequest(SetDiagnosticFiltersValuesCommand, SetDiagnosticFilterValuesHandler);
12336
12382
  }, teardownSetDiagnosticFilter = () => {
12337
- request$c?.dispose();
12383
+ setFiltersValueRequest?.dispose();
12384
+ }, subscribeDiagnosticFilters = (te) => {
12385
+ te.broker.subscribe("cipds_diagnostic_filter_historic_requested", (J) => {
12386
+ te.broker.send(new SetDiagnosticFiltersValuesCommand(J));
12387
+ });
12388
+ };
12389
+ class ResetFiltersCommand {
12390
+ }
12391
+ const { resetFilters } = activityHistoryFiltersSlice.actions;
12392
+ class ResetFiltersHandler extends BaseHandler {
12393
+ async handle(J) {
12394
+ try {
12395
+ this.api.broker.publish(this.api.broker.events.activityHistory.filtersCleaned), this.store.dispatch(resetFilters());
12396
+ } catch (X) {
12397
+ console.log(X.message);
12398
+ }
12399
+ }
12400
+ }
12401
+ let request$a;
12402
+ const bootstrapResetFilters = (te) => {
12403
+ request$a = te.registerRequest(ResetFiltersCommand, ResetFiltersHandler);
12404
+ }, teardownResetFilters = () => {
12405
+ request$a?.dispose();
12338
12406
  }, { addUpFilters } = activityHistoryFiltersSlice.actions;
12339
12407
  class AddUpFiltersHandler extends StoreBaseHandler {
12340
12408
  async handle(J) {
@@ -12350,11 +12418,11 @@ class AddUpFiltersCommand {
12350
12418
  this.payload = J;
12351
12419
  }
12352
12420
  }
12353
- let request$b;
12421
+ let request$9;
12354
12422
  const bootstrapAddUpFilter = (te) => {
12355
- request$b = te.registerRequest(AddUpFiltersCommand, AddUpFiltersHandler);
12423
+ request$9 = te.registerRequest(AddUpFiltersCommand, AddUpFiltersHandler);
12356
12424
  }, teardownAddUpFilter = () => {
12357
- request$b?.dispose();
12425
+ request$9?.dispose();
12358
12426
  }, { setUpFilterValues } = activityHistoryFiltersSlice.actions;
12359
12427
  class SetUpFiltersHandler extends StoreBaseHandler {
12360
12428
  async handle(J) {
@@ -12365,49 +12433,37 @@ class SetUpFiltersHandler extends StoreBaseHandler {
12365
12433
  }
12366
12434
  }
12367
12435
  }
12368
- let request$a;
12436
+ let request$8;
12369
12437
  const bootstrapSetUpFilter = (te) => {
12370
- request$a = te.registerRequest(SetUpFiltersCommand, SetUpFiltersHandler);
12438
+ request$8 = te.registerRequest(SetUpFiltersCommand, SetUpFiltersHandler);
12371
12439
  }, teardownSetUpFilter = () => {
12372
- request$a?.dispose();
12440
+ request$8?.dispose();
12441
+ }, bootstrapFilters = (te, J) => {
12442
+ bootstrapSetCommonFilter(te), bootstrapAddCustomFilter(te), bootstrapSetCustomFilterGroup(te), bootstrapSetCustomFilterValue(te), bootstrapSetCustomFilterAllValues(te), bootstrapSetDiagnosticFilter(te), bootstrapDeleteDiagnosticFilterValue(te), bootstrapAddUpFilter(te), bootstrapSetUpFilter(te), bootstrapResetFilters(te), subscribeDiagnosticFilters(J);
12443
+ }, teardownFilters = () => {
12444
+ teardownSetCommonFilter(), teardownAddCustomFilter(), teardownSetCustomFilterGroup(), teardownSetCustomFilterValue(), teardownSetCustomFilterAllValues(), teardownSetDiagnosticFilter(), teardownDeleteDiagnosticFilterValue(), teardownAddUpFilter(), teardownSetUpFilter(), teardownResetFilters();
12373
12445
  };
12374
- class ResetFiltersCommand {
12375
- }
12376
- const { resetFilters } = activityHistoryFiltersSlice.actions;
12377
- class ResetFiltersHandler extends StoreBaseHandler {
12378
- async handle(J) {
12379
- try {
12380
- this.store.dispatch(resetFilters());
12381
- } catch (X) {
12382
- console.log(X.message);
12383
- }
12446
+ /**
12447
+ * @license
12448
+ * Copyright 2017 Google LLC
12449
+ * SPDX-License-Identifier: BSD-3-Clause
12450
+ */
12451
+ class le extends i$F {
12452
+ constructor(J) {
12453
+ if (super(J), this.it = D$5, J.type !== t$k.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
12384
12454
  }
12385
- }
12386
- let request$9;
12387
- const bootstrapResetFilters = (te) => {
12388
- request$9 = te.registerRequest(ResetFiltersCommand, ResetFiltersHandler);
12389
- }, teardownResetFilters = () => {
12390
- request$9?.dispose();
12391
- }, { setCustomFilterAllValues } = activityHistoryFiltersSlice.actions;
12392
- class SetCustomFilterAllValuesHandler extends StoreBaseHandler {
12393
- async handle(J) {
12394
- try {
12395
- this.store.dispatch(setCustomFilterAllValues(J.payload));
12396
- } catch (X) {
12397
- console.log(X.message);
12398
- }
12455
+ render(J) {
12456
+ if (J === D$5 || J == null) return this._t = void 0, this.it = J;
12457
+ if (J === R$4) return J;
12458
+ if (typeof J != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
12459
+ if (J === this.it) return this._t;
12460
+ this.it = J;
12461
+ const X = [J];
12462
+ return X.raw = X, this._t = { _$litType$: this.constructor.resultType, strings: X, values: [] };
12399
12463
  }
12400
12464
  }
12401
- let request$8;
12402
- const bootstrapSetCustomFilterAllValues = (te) => {
12403
- request$8 = te.registerRequest(SetCustomFilterAllValues, SetCustomFilterAllValuesHandler);
12404
- }, teardownSetCustomFilterAllValues = () => {
12405
- request$8?.dispose();
12406
- }, bootstrapFilters = (te) => {
12407
- bootstrapSetCommonFilter(te), bootstrapAddCustomFilter(te), bootstrapSetCustomFilterGroup(te), bootstrapSetCustomFilterValue(te), bootstrapSetCustomFilterAllValues(te), bootstrapAddDiagnosticFilter(te), bootstrapSetDiagnosticFilter(te), bootstrapAddUpFilter(te), bootstrapSetUpFilter(te), bootstrapResetFilters(te);
12408
- }, teardownFilters = () => {
12409
- teardownSetCommonFilter(), teardownAddCustomFilter(), teardownSetCustomFilterGroup(), teardownSetCustomFilterValue(), teardownSetCustomFilterAllValues(), teardownAddDiagnosticFilter(), teardownSetDiagnosticFilter(), teardownAddUpFilter(), teardownSetUpFilter(), teardownResetFilters();
12410
- }, styles$h = ":host{min-height:1px;display:flex;flex-direction:column;flex:1 1 0%}.virtual-container{height:100%;position:relative}.virtual-viewport{height:100%;overflow:auto;padding-inline:16px}.virtual-content{position:relative;width:100%}.virtual-items{position:relative}.container{min-height:1px;height:100%}.visit:first-child{margin-top:var(--dss-spacing-md)}.visit{width:calc(100% - var(--dss-spacing-md) - var(--dss-spacing-md));display:flex;flex-direction:column;gap:var(--dss-spacing-sm);background-color:#fff;border-radius:var(--dss-radius-sm);padding:var(--dss-spacing-sm);margin-bottom:var(--dss-spacing-md)}.visit .visit__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .visit__header .title{flex:1;font-size:14px;line-height:24px;display:flex;flex-direction:row;gap:12px;color:var(--color-neutral-800)}.visit .visit__header .title-date{font-weight:700}.visit .visit__header .title-description{font-weight:600;display:flex;flex-direction:row;gap:4px}.visit .visit__header .highlight{background-color:#ff0;font-weight:700}.visit .visit__items{display:flex;flex-direction:column;gap:var(--dss-spacing-sm)}.visit .visit__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .visit__items .item[has-divider]:last-of-type{border:none}.visit .diagnostics{display:flex;flex-direction:column;gap:var(--dss-spacing-sm);border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics:last-of-type{border:none}.visit .diagnostics .diagnostics__header{display:flex;flex-direction:row;align-items:center;gap:16px;flex-wrap:wrap}.visit .diagnostics .diagnostics__items{display:flex;flex-direction:column}.visit .diagnostics .diagnostics__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics .diagnostics__items .item[has-divider]:last-of-type{border:none}.feedback{width:100%;height:100%;display:flex;align-items:center;justify-content:center}";
12465
+ le.directiveName = "unsafeHTML", le.resultType = 1;
12466
+ const ae = e$K(le), styles$h = ":host{min-height:1px;display:flex;flex-direction:column;flex:1 1 0%}.virtual-container{height:100%;position:relative}.virtual-viewport{height:100%;overflow:auto;padding-inline:16px}.virtual-content{position:relative;width:100%}.virtual-items{position:relative}.container{min-height:1px;height:100%}.visit:first-child{margin-top:var(--dss-spacing-md)}.visit{width:calc(100% - var(--dss-spacing-md) - var(--dss-spacing-md));display:flex;flex-direction:column;gap:var(--dss-spacing-sm);background-color:#fff;border-radius:var(--dss-radius-sm);padding:var(--dss-spacing-sm);margin-bottom:var(--dss-spacing-md)}.visit .visit__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .visit__header .title{flex:1;font-size:14px;line-height:24px;display:flex;flex-direction:row;gap:12px;color:var(--color-neutral-800)}.visit .visit__header .title-date{font-weight:700}.visit .visit__header .title-description{font-weight:600;display:flex;flex-direction:row;gap:4px}.visit .visit__header .highlight{background-color:#ff0;font-weight:700}.visit .visit__items{display:flex;flex-direction:column;gap:var(--dss-spacing-sm)}.visit .visit__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .visit__items .item[has-divider]:last-of-type{border:none}.visit .diagnostics{display:flex;flex-direction:column;gap:var(--dss-spacing-sm);border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics:last-of-type{border:none}.visit .diagnostics .diagnostics__header{display:flex;flex-direction:row;align-items:center;gap:16px;flex-wrap:wrap}.visit .diagnostics .diagnostics__items{display:flex;flex-direction:column}.visit .diagnostics .diagnostics__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics .diagnostics__items .item[has-divider]:last-of-type{border:none}.feedback{width:100%;height:100%;display:flex;align-items:center;justify-content:center}";
12411
12467
  function toDate(te) {
12412
12468
  const J = Object.prototype.toString.call(te);
12413
12469
  return te instanceof Date || typeof te == "object" && J === "[object Date]" ? new te.constructor(+te) : typeof te == "number" || J === "[object Number]" || typeof te == "string" || J === "[object String]" ? new Date(te) : /* @__PURE__ */ new Date(NaN);
@@ -15297,12 +15353,12 @@ ${te.searchString?.length > 1 ? ke$1`
15297
15353
  imagesrc=${notFound}
15298
15354
  title=${translate("noResults")}>
15299
15355
  </dss-user-feedback>
15300
- ` : te.isAnyCollectionBusy ? ke$1`<activity-history-is-grouping-busy></activity-history-is-grouping-busy>` : ke$1`<dss-user-feedback
15301
- class="feedback"
15302
- imagesrc=${notFound}
15303
- title=${translate("noData.title")}
15304
- description=${translate("noData.description")}>
15305
- </dss-user-feedback>`}`, visitHeaderTemplate = (te, J) => J ? ke$1`
15356
+ ` : te.isAnyCollectionBusy ? ke$1`<activity-history-is-grouping-busy></activity-history-is-grouping-busy>` : te._canShowNoDataMessage ? ke$1`<dss-user-feedback
15357
+ class="feedback"
15358
+ imagesrc=${notFound}
15359
+ title=${translate("noData.title")}
15360
+ description=${translate("noData.description")}>
15361
+ </dss-user-feedback>` : D$5}`, visitHeaderTemplate = (te, J) => J ? ke$1`
15306
15362
  <div class="visit__header">
15307
15363
  <div class="title">
15308
15364
  <div class="title-date">
@@ -15326,27 +15382,6 @@ ${te.searchString?.length > 1 ? ke$1`
15326
15382
  )}
15327
15383
  </div>
15328
15384
  `;
15329
- /**
15330
- * @license
15331
- * Copyright 2017 Google LLC
15332
- * SPDX-License-Identifier: BSD-3-Clause
15333
- */
15334
- class le extends i$F {
15335
- constructor(J) {
15336
- if (super(J), this.it = D$5, J.type !== t$k.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
15337
- }
15338
- render(J) {
15339
- if (J === D$5 || J == null) return this._t = void 0, this.it = J;
15340
- if (J === R$4) return J;
15341
- if (typeof J != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
15342
- if (J === this.it) return this._t;
15343
- this.it = J;
15344
- const X = [J];
15345
- return X.raw = X, this._t = { _$litType$: this.constructor.resultType, strings: X, values: [] };
15346
- }
15347
- }
15348
- le.directiveName = "unsafeHTML", le.resultType = 1;
15349
- const ae = e$K(le);
15350
15385
  class VirtualScroller {
15351
15386
  constructor(J) {
15352
15387
  this._itemHeights = /* @__PURE__ */ new Map(), this._itemOffsets = /* @__PURE__ */ new Map(), this._totalHeight = 0, this._viewportHeight = 0, this._scrollTop = 0, this._visibleRange = { start: 0, end: 0 }, this._isScrolling = !1, this._options = J, this._initializeHeights();
@@ -15462,7 +15497,7 @@ let ActivityHistoryTimeline = class extends h$q {
15462
15497
  visibleRange: { start: 0, end: 0 },
15463
15498
  containerOffset: 0,
15464
15499
  visibleItems: []
15465
- }, this._onScroll = () => {
15500
+ }, this._canShowNoDataMessage = !1, this._onScroll = () => {
15466
15501
  };
15467
15502
  }
15468
15503
  render() {
@@ -15471,10 +15506,12 @@ let ActivityHistoryTimeline = class extends h$q {
15471
15506
  `;
15472
15507
  }
15473
15508
  connectedCallback() {
15474
- super.connectedCallback();
15509
+ super.connectedCallback(), this._noDataMessageTimer = setTimeout(() => {
15510
+ this._canShowNoDataMessage = !0;
15511
+ }, 2e3);
15475
15512
  }
15476
15513
  disconnectedCallback() {
15477
- super.disconnectedCallback(), this._cleanupVirtualScroller?.();
15514
+ super.disconnectedCallback(), this._cleanupVirtualScroller?.(), this._noDataMessageTimer && clearTimeout(this._noDataMessageTimer);
15478
15515
  }
15479
15516
  async updated(te) {
15480
15517
  te.has("historyGroups") && this.historyGroups?.length && (await this.prepareComponents(this.historyGroups), this._updateVirtualScroller()), this._viewport && this._content && !this._virtualScroller && setTimeout(() => this._setupVirtualScroller(), 0);
@@ -15524,13 +15561,9 @@ let ActivityHistoryTimeline = class extends h$q {
15524
15561
  estimatedItemHeight: 200,
15525
15562
  bufferSize: 50
15526
15563
  // 50% buffer
15527
- }), this._cleanupVirtualScroller = this._virtualScroller.setup(
15528
- this._viewport,
15529
- this._content,
15530
- (te) => {
15531
- this._virtualScrollerState = te, this.requestUpdate();
15532
- }
15533
- ), this._virtualScrollerState = this._virtualScroller.getState());
15564
+ }), this._cleanupVirtualScroller = this._virtualScroller.setup(this._viewport, this._content, (te) => {
15565
+ this._virtualScrollerState = te, this.requestUpdate();
15566
+ }), this._virtualScrollerState = this._virtualScroller.getState());
15534
15567
  }
15535
15568
  _updateVirtualScroller() {
15536
15569
  !this._virtualScroller || !this.historyGroups?.length || (this._virtualScroller.updateItems(this.historyGroups), this._virtualScrollerState = this._virtualScroller.getState());
@@ -15552,9 +15585,6 @@ ActivityHistoryTimeline.styles = i$I`
15552
15585
  __decorateClass$q([
15553
15586
  connectedProperty(activityHistoryGroupedItems)
15554
15587
  ], ActivityHistoryTimeline.prototype, "historyGroups", 2);
15555
- __decorateClass$q([
15556
- connectedProperty(isCollectionInitialState)
15557
- ], ActivityHistoryTimeline.prototype, "isCollectionInitialState", 2);
15558
15588
  __decorateClass$q([
15559
15589
  connectedProperty(isSomeCollectionLoadedAndOtherLoading)
15560
15590
  ], ActivityHistoryTimeline.prototype, "isSomeCollectionLoadedAndOtherLoading", 2);
@@ -15576,6 +15606,9 @@ __decorateClass$q([
15576
15606
  __decorateClass$q([
15577
15607
  r$I()
15578
15608
  ], ActivityHistoryTimeline.prototype, "_virtualScrollerState", 2);
15609
+ __decorateClass$q([
15610
+ r$I()
15611
+ ], ActivityHistoryTimeline.prototype, "_canShowNoDataMessage", 2);
15579
15612
  ActivityHistoryTimeline = __decorateClass$q([
15580
15613
  t$n("activity-history-timeline")
15581
15614
  ], ActivityHistoryTimeline);
@@ -15713,7 +15746,7 @@ ActivityHistoryPartialDataError = __decorateClass$n([
15713
15746
  const { clearActivityHistoryCollections } = activityHistoryCollectionsSlice.actions;
15714
15747
  class RefreshHistoryItemsHandler extends BaseHandler {
15715
15748
  async handle() {
15716
- this.store.dispatch(activityHistoryFiltersSlice.actions.clearCustomFilters()), this.store.dispatch(clearActivityHistoryCollections()), this.api.broker.publish(this.api.broker.events.refreshHistoryDataRequested);
15749
+ this.store.dispatch(activityHistoryFiltersSlice.actions.clearCustomFilters()), this.store.dispatch(clearActivityHistoryCollections()), this.api.broker.publish(this.api.broker.events.activityHistory.refreshDataRequested);
15717
15750
  }
15718
15751
  }
15719
15752
  class HandleRefreshHistoryItems {
@@ -15743,14 +15776,12 @@ const bootstrapRemoveHistoryItem = (te) => {
15743
15776
  request$6 = te.registerRequest("remove_history_item_request", RemoveHistoryItemHandler);
15744
15777
  }, teardownRemoveHistoryItem = () => {
15745
15778
  request$6?.dispose();
15746
- }, events = {
15747
- activityHistorySearched: "activity_history_searched"
15748
15779
  }, { setSearchString } = activityHistoryFiltersSlice.actions;
15749
15780
  class SearchItemsHandler extends BaseHandler {
15750
15781
  async handle(J) {
15751
15782
  try {
15752
15783
  this.store.dispatch(setSearchString(J.searchString)), setTimeout(() => {
15753
- this.api.broker.publish(events.activityHistorySearched, {
15784
+ this.api.broker.publish(this.api.broker.events.activityHistory.searched, {
15754
15785
  searchQuery: J.searchString
15755
15786
  });
15756
15787
  }, 300);
@@ -15859,17 +15890,17 @@ const styles$a = ":host{display:flex;justify-content:space-between}.filters-cont
15859
15890
  @onDelete=${() => X._onDeleteUpFilterValue(te)}
15860
15891
  ></dss-chip>
15861
15892
  `, renderFilterTitle = (te) => ke$1`<div class="filter-title">${`${te}:`}</div>`, template$c = (te) => {
15862
- if (te.enabledFilters.length === 0 && te.enabledCommonFilters.length === 0 && te.diagnosticFilterEnabled.enabledValues.length === 0 && te.upFilterEnabled.enabledValues.length === 0)
15893
+ if (te.enabledFilters.length === 0 && te.enabledCommonFilters.length === 0 && te.diagnosticFilterEnabled?.enabledValues?.length === 0 && te.upFilterEnabled.enabledValues.length === 0)
15863
15894
  return D$5;
15864
15895
  let J = 0;
15865
15896
  const X = [], re = [], ne = [], oe = te.diagnosticFilterEnabled;
15866
15897
  if (oe) {
15867
- const { title: ce, values: ue, enabledValues: he } = oe, pe = ue.filter((fe) => he.includes(fe.value));
15868
- if (pe.length > 0) {
15869
- let fe = !1, be = !1;
15870
- for (const ge of pe) {
15871
- const ve = renderDiagnosticChip(ge.value, ge.label, te);
15872
- J < MAX_VISIBLE_CHIPS ? (fe || (X.push(renderFilterTitle(ce)), fe = !0), X.push(ve), J++) : (be || (re.push(renderFilterTitle(ce)), be = !0), re.push(ve), ne.push(ve));
15898
+ const { title: ce, enabledValues: ue } = oe;
15899
+ if (ue && ue.length > 0) {
15900
+ let he = !1, pe = !1;
15901
+ for (const fe of ue) {
15902
+ const be = renderDiagnosticChip(fe.codi, fe.descripcio, te);
15903
+ J < MAX_VISIBLE_CHIPS ? (he || (X.push(renderFilterTitle(ce)), he = !0), X.push(be), J++) : (pe || (re.push(renderFilterTitle(ce)), pe = !0), re.push(be), ne.push(be));
15873
15904
  }
15874
15905
  }
15875
15906
  }
@@ -15951,9 +15982,7 @@ let ActiveFiltersBadges = class extends h$q {
15951
15982
  this.api.broker.send(new SetCommonFilter({ id: te, enabled: !1 }));
15952
15983
  }
15953
15984
  _onDeleteDiagnosticFilterValue(te) {
15954
- this.api.broker.send(
15955
- new SetDiagnosticFiltersCommand([...this.diagnosticFilterEnabled.enabledValues.filter((J) => J !== te)])
15956
- );
15985
+ this.api.broker.send(new DeleteDiagnosticFilterValueCommand({ diagnosticCodi: te }));
15957
15986
  }
15958
15987
  _onDeleteUpFilterValue(te) {
15959
15988
  this.api.broker.send(new SetUpFiltersCommand([...this.upFilterEnabled.enabledValues.filter((J) => J !== te)]));
@@ -16011,7 +16040,7 @@ const bootstrapUpdateHistoryItem = (te) => {
16011
16040
  };
16012
16041
  let broker;
16013
16042
  const bootstrapActivityHistoryItem = (te) => {
16014
- broker = brokerExtensions(te, container), bootstrapInjectAsyncHistoryItems(broker), bootstrapAddHistoryItem(broker), bootstrapAddHistoryItems(broker), bootstrapHandleHistoryItemsAddError(broker), bootstrapHandleRefreshHistoryItems(broker), bootstrapUpdateHistoryItem(broker), bootstrapExportPdf(broker), bootstrapFilters(broker), bootstrapSearchItems(broker), bootstrapRemoveHistoryItem(broker);
16043
+ broker = brokerExtensions(te, container), bootstrapInjectAsyncHistoryItems(broker, te), bootstrapAddHistoryItem(broker, te), bootstrapAddHistoryItems(broker, te), bootstrapHandleHistoryItemsAddError(broker), bootstrapHandleRefreshHistoryItems(broker), bootstrapUpdateHistoryItem(broker), bootstrapExportPdf(broker), bootstrapFilters(broker, te), bootstrapSearchItems(broker), bootstrapRemoveHistoryItem(broker);
16015
16044
  }, teardownActivityHistoryItem = () => {
16016
16045
  teardownInjectAsyncHistoryItems(), teardownAddHistoryItem(), teardownAddHistoryItems(), teardownHandleHistoryItemsAddError(), teardownUpdateHistoryItem(), teardownExportPdf(), teardownFilters(), teardownSearchItems(), teardownRemoveHistoryItem();
16017
16046
  }, styles$9 = ":host{display:flex;min-height:1px;height:100%;width:100%}.container{display:flex;flex-direction:column;width:100%;border:1px solid rgb(189,189,189);border-radius:var(--dss-radius-sm)}.container[maximized]{position:absolute;background:#fff;top:0;left:0;bottom:0;border:none}.container[maximized] .header-maximized-container{display:flex;flex-direction:column}.container[maximized] .header-maximized-container .header__maximized{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:24px;padding-top:24px;padding-bottom:24px;padding-inline:40px}.container[maximized] .header-maximized-container .header__maximized .header__maximized__search{flex:1;border-radius:8px;border:1px solid rgb(189,189,189);padding:8px;width:300px}.container[maximized] .header-maximized-container .header__maximized .title{color:var(--color-neutral-900);font-weight:700;font-size:20px;line-height:30px;white-space:nowrap}.container[maximized] .header-maximized-container .header__maximized .options{display:flex;align-items:center;color:var(--color-primary-400);font-weight:600;font-size:14px;line-height:24px;cursor:pointer}.container[maximized] .header-maximized-container .header__maximized .header__maximized__left{display:flex;flex-direction:row;gap:24px;align-items:center;width:100%}.container[maximized] .header-maximized-container .header__maximized .header__maximized__right{display:flex;flex-direction:row;gap:16px;align-items:center}.container[maximized] .wrapper{height:calc(100vh - 175px);border:1px solid rgb(189,189,189);border-radius:var(--dss-radius-sm);margin-bottom:24px;margin-inline:40px;width:calc(100% - 80px)}.container .header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:8px 12px;border-bottom:1px solid rgb(189,189,189);gap:16px}.container .header .header__left{display:flex;flex-direction:row;align-items:center;flex:1;gap:16px}.container .header .header__left .title{color:var(--color-neutral-800);font-weight:700;font-size:16px;line-height:24px;white-space:nowrap}.container .header .header__right{display:flex;flex-direction:row;align-items:center;gap:8px}.container .header .header__right .action-icons{display:flex;align-items:center}.container .wrapper{display:flex;flex-direction:row;min-height:1px;width:100%;height:100%}.container .wrapper[maximized] .content{width:100%;background:var(--color-neutral-50);border-top-right-radius:var(--dss-radius-sm);display:flex;flex-direction:column}.container .wrapper .content{width:100%;background:var(--color-neutral-50);border-bottom-right-radius:var(--dss-radius-sm);overflow:hidden;display:flex;flex-direction:column}", template$b = (te) => ke$1`<div class="container" ?maximized=${te.maximized}>
@@ -16044,8 +16073,8 @@ const bootstrapActivityHistoryItem = (te) => {
16044
16073
  <activity-history-filters .wrapperMaximized=${te.maximized}></activity-history-filters>
16045
16074
  <div class="content">
16046
16075
  <active-filters-header></active-filters-header>
16047
- <activity-history-busy></activity-history-busy>
16048
- ${te.isCollectionInitialState ? D$5 : ke$1`<activity-history-timeline></activity-history-timeline>`}
16076
+ ${te.isAnyCollectionBusy ? ke$1`<activity-history-busy></activity-history-busy>` : D$5}
16077
+ ${te.historyGroups?.length || !te.isAnyCollectionBusy ? ke$1`<activity-history-timeline></activity-history-timeline>` : D$5}
16049
16078
  </div>
16050
16079
  </div>
16051
16080
  </div>`, headerMaximizedTemplate = (te) => ke$1`
@@ -16139,14 +16168,14 @@ __decorateClass$j([
16139
16168
  lazyInject(TYPES.primaryApi)
16140
16169
  ], ActivityHistoryMain.prototype, "api", 2);
16141
16170
  __decorateClass$j([
16142
- connectedProperty(activityHistoryCollectionsSelector)
16143
- ], ActivityHistoryMain.prototype, "historyItems", 2);
16144
- __decorateClass$j([
16145
- connectedProperty(isCollectionInitialState)
16146
- ], ActivityHistoryMain.prototype, "isCollectionInitialState", 2);
16171
+ connectedProperty(activityHistoryGroupedItems)
16172
+ ], ActivityHistoryMain.prototype, "historyGroups", 2);
16147
16173
  __decorateClass$j([
16148
16174
  connectedProperty(isSomeCollectionLoadedAndOtherLoading)
16149
16175
  ], ActivityHistoryMain.prototype, "isSomeCollectionLoadedAndOtherLoading", 2);
16176
+ __decorateClass$j([
16177
+ connectedProperty(isAnyCollectionBusySelector)
16178
+ ], ActivityHistoryMain.prototype, "isAnyCollectionBusy", 2);
16150
16179
  __decorateClass$j([
16151
16180
  n$B()
16152
16181
  ], ActivityHistoryMain.prototype, "searchQuery", 2);
@@ -47760,15 +47789,16 @@ export {
47760
47789
  raiseCustomCloseEvent as l,
47761
47790
  shellRegions as m,
47762
47791
  clinicalMonitoringRegions as n,
47763
- bootstrapPlugins as o,
47764
- handleStartupPlugin as p,
47765
- disposePlugins as q,
47792
+ activityHistoryRegions as o,
47793
+ bootstrapPlugins as p,
47794
+ handleStartupPlugin as q,
47766
47795
  r$L as r,
47767
47796
  s$F as s,
47768
47797
  translate$1 as t,
47769
- primariaApiFactory as u,
47770
- PrimariaContentSwitcher as v,
47771
- h as w,
47772
- PrimariaInteractionService as x
47798
+ disposePlugins as u,
47799
+ primariaApiFactory as v,
47800
+ PrimariaContentSwitcher as w,
47801
+ h as x,
47802
+ PrimariaInteractionService as y
47773
47803
  };
47774
- //# sourceMappingURL=index-BClgiJgh.js.map
47804
+ //# sourceMappingURL=index-BasIROCr.js.map