@uxland/primary-shell 5.6.4 → 5.6.6

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.
Files changed (17) hide show
  1. package/dist/index.js +142 -83
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.umd.cjs +43 -30
  4. package/dist/index.umd.cjs.map +1 -1
  5. package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/add/handle-busy/is-grouping-busy/component.d.ts +6 -0
  6. package/dist/primary/shell/src/internal-plugins/activity-history/activity-history-item/add/handle-busy/is-grouping-busy/template.d.ts +3 -0
  7. package/dist/primary/shell/src/internal-plugins/activity-history/localization.d.ts +5 -0
  8. package/package.json +1 -1
  9. package/src/internal-plugins/activity-history/activity-history-item/add/add-history-item/handler.ts +2 -2
  10. package/src/internal-plugins/activity-history/activity-history-item/add/add-history-items/handler.ts +2 -2
  11. package/src/internal-plugins/activity-history/activity-history-item/add/handle-busy/is-grouping-busy/component.ts +15 -0
  12. package/src/internal-plugins/activity-history/activity-history-item/add/handle-busy/is-grouping-busy/styles.css +8 -0
  13. package/src/internal-plugins/activity-history/activity-history-item/add/handle-busy/is-grouping-busy/template.ts +10 -0
  14. package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/activity-history-timeline.ts +12 -5
  15. package/src/internal-plugins/activity-history/activity-history-item/list/UI/timeline/template.ts +20 -13
  16. package/src/internal-plugins/activity-history/activity-history-item/list/group-history-items/group-history-items.ts +69 -36
  17. package/src/internal-plugins/activity-history/localization.ts +5 -0
package/dist/index.js CHANGED
@@ -8950,7 +8950,7 @@ const useLocalization = async (te) => {
8950
8950
  }
8951
8951
  }
8952
8952
  }
8953
- }, styles$n = ".item{display:flex;cursor:pointer;border-radius:8px;padding:8px;justify-content:center;transition:background-color .3s ease}.item[expanded]{justify-content:space-between}.item:hover{background-color:var(--color-primary-900);color:#fff}.item .icon-label{display:flex;gap:8px;transition:background-color .3s}.item.active{outline:2px solid white;outline-offset:-2px}";
8953
+ }, styles$o = ".item{display:flex;cursor:pointer;border-radius:8px;padding:8px;justify-content:center;transition:background-color .3s ease}.item[expanded]{justify-content:space-between}.item:hover{background-color:var(--color-primary-900);color:#fff}.item .icon-label{display:flex;gap:8px;transition:background-color .3s}.item.active{outline:2px solid white;outline-offset:-2px}";
8954
8954
  /**
8955
8955
  * @license
8956
8956
  * Copyright 2017 Google LLC
@@ -9001,7 +9001,7 @@ const Rt = e$L(class extends i$v {
9001
9001
  }
9002
9002
  return R$3;
9003
9003
  }
9004
- }), template$o = (te) => ke$1`
9004
+ }), template$p = (te) => ke$1`
9005
9005
  <div
9006
9006
  class=${Rt({ item: !0, active: te.isActive })}
9007
9007
  @click=${te.config.callbackFn}
@@ -9018,10 +9018,10 @@ const Rt = e$L(class extends i$v {
9018
9018
  </dss-tooltip>`}
9019
9019
  </div>
9020
9020
  `;
9021
- var __defProp$w = Object.defineProperty, __decorateClass$w = (te, J, X, re) => {
9021
+ var __defProp$x = Object.defineProperty, __decorateClass$x = (te, J, X, re) => {
9022
9022
  for (var ne = void 0, oe = te.length - 1, de; oe >= 0; oe--)
9023
9023
  (de = te[oe]) && (ne = de(J, X, ne) || ne);
9024
- return ne && __defProp$w(J, X, ne), ne;
9024
+ return ne && __defProp$x(J, X, ne), ne;
9025
9025
  };
9026
9026
  const Ji = class Ji extends k$7(h$q) {
9027
9027
  constructor(J) {
@@ -9059,23 +9059,23 @@ const Ji = class Ji extends k$7(h$q) {
9059
9059
  this.subscriptions.forEach((J) => J.dispose());
9060
9060
  }
9061
9061
  render() {
9062
- return ke$1`${template$o(this)}`;
9062
+ return ke$1`${template$p(this)}`;
9063
9063
  }
9064
9064
  };
9065
9065
  Ji.styles = i$y`
9066
- ${r$H(styles$n)}
9066
+ ${r$H(styles$o)}
9067
9067
  `;
9068
9068
  let PrimariaNavItem = Ji;
9069
- __decorateClass$w([
9069
+ __decorateClass$x([
9070
9070
  n$x({ type: Number })
9071
9071
  ], PrimariaNavItem.prototype, "containerWidth");
9072
- __decorateClass$w([
9072
+ __decorateClass$x([
9073
9073
  r$E()
9074
9074
  ], PrimariaNavItem.prototype, "showText");
9075
- __decorateClass$w([
9075
+ __decorateClass$x([
9076
9076
  r$E()
9077
9077
  ], PrimariaNavItem.prototype, "isActive");
9078
- __decorateClass$w([
9078
+ __decorateClass$x([
9079
9079
  n$x({ type: Object })
9080
9080
  ], PrimariaNavItem.prototype, "config");
9081
9081
  const shellRegions = {
@@ -9168,7 +9168,7 @@ const container$1 = new Container(), { lazyInject: lazyInject$1 } = getDecorator
9168
9168
  primaryApi: Symbol.for("primaryApi"),
9169
9169
  store: Symbol.for("store"),
9170
9170
  localeManager: Symbol.for("localeManager")
9171
- }, styles$m = ":host{min-height:1px;height:100%;width:100%;display:flex}iframe{border:none;flex:1;height:100%}.pdf-container{display:flex;justify-content:center;align-items:center;height:100%;flex:1;border:1px solid #ccc}.no-pdf{text-align:center;color:#666;font-size:1.2rem;font-weight:700}";
9171
+ }, styles$n = ":host{min-height:1px;height:100%;width:100%;display:flex}iframe{border:none;flex:1;height:100%}.pdf-container{display:flex;justify-content:center;align-items:center;height:100%;flex:1;border:1px solid #ccc}.no-pdf{text-align:center;color:#666;font-size:1.2rem;font-weight:700}";
9172
9172
  function base64ToBlob(te, J = "application/octet-stream") {
9173
9173
  const X = window.atob(te), re = X.length, ne = new Uint8Array(re);
9174
9174
  for (let oe = 0; oe < re; oe++)
@@ -9181,10 +9181,10 @@ const createUrlFromBase64 = (te, J) => {
9181
9181
  return URL.createObjectURL(X);
9182
9182
  }
9183
9183
  };
9184
- var __defProp$v = Object.defineProperty, __decorateClass$v = (te, J, X, re) => {
9184
+ var __defProp$w = Object.defineProperty, __decorateClass$w = (te, J, X, re) => {
9185
9185
  for (var ne = void 0, oe = te.length - 1, de; oe >= 0; oe--)
9186
9186
  (de = te[oe]) && (ne = de(J, X, ne) || ne);
9187
- return ne && __defProp$v(J, X, ne), ne;
9187
+ return ne && __defProp$w(J, X, ne), ne;
9188
9188
  };
9189
9189
  const Yi = class Yi extends h$q {
9190
9190
  constructor() {
@@ -9252,15 +9252,15 @@ const Yi = class Yi extends h$q {
9252
9252
  `;
9253
9253
  }
9254
9254
  };
9255
- Yi.styles = i$y`${r$H(styles$m)}`;
9255
+ Yi.styles = i$y`${r$H(styles$n)}`;
9256
9256
  let PdfVisor = Yi;
9257
- __decorateClass$v([
9257
+ __decorateClass$w([
9258
9258
  lazyInject$1(TYPES$1.primaryApi)
9259
9259
  ], PdfVisor.prototype, "api");
9260
- __decorateClass$v([
9260
+ __decorateClass$w([
9261
9261
  n$x({ type: Array })
9262
9262
  ], PdfVisor.prototype, "pdfList");
9263
- __decorateClass$v([
9263
+ __decorateClass$w([
9264
9264
  n$x({ type: Array })
9265
9265
  ], PdfVisor.prototype, "activePdfs");
9266
9266
  const registerPdfViewerNavItem = () => {
@@ -9285,7 +9285,7 @@ const registerPdfViewerNavItem = () => {
9285
9285
  return Promise.resolve(te);
9286
9286
  }
9287
9287
  });
9288
- }, styles$l = ":host{width:250px;gap:8px}.pdf-item{display:flex;align-items:flex-start;padding:8px;gap:8px;color:#000;border-bottom:1px solid var(--color-neutral-100)}.header-icons{display:flex;gap:8px}.container{gap:8px;display:flex;flex-direction:column}";
9288
+ }, styles$m = ":host{width:250px;gap:8px}.pdf-item{display:flex;align-items:flex-start;padding:8px;gap:8px;color:#000;border-bottom:1px solid var(--color-neutral-100)}.header-icons{display:flex;gap:8px}.container{gap:8px;display:flex;flex-direction:column}";
9289
9289
  /**
9290
9290
  * @license
9291
9291
  * Copyright 2020 Google LLC
@@ -9376,7 +9376,7 @@ const Jt = (te, J, X) => {
9376
9376
  }
9377
9377
  return this.ut = de, dt(te, he), R$3;
9378
9378
  }
9379
- }), template$n = (te) => {
9379
+ }), template$o = (te) => {
9380
9380
  const J = (X) => ke$1`
9381
9381
  <div class="pdf-item">
9382
9382
  <dss-checkbox @onChange=${() => te.setActivePdf(X.id)}>
@@ -9405,17 +9405,17 @@ const Jt = (te, J, X) => {
9405
9405
  </div>
9406
9406
  `;
9407
9407
  };
9408
- var __defProp$u = Object.defineProperty, __decorateClass$u = (te, J, X, re) => {
9408
+ var __defProp$v = Object.defineProperty, __decorateClass$v = (te, J, X, re) => {
9409
9409
  for (var ne = void 0, oe = te.length - 1, de; oe >= 0; oe--)
9410
9410
  (de = te[oe]) && (ne = de(J, X, ne) || ne);
9411
- return ne && __defProp$u(J, X, ne), ne;
9411
+ return ne && __defProp$v(J, X, ne), ne;
9412
9412
  };
9413
9413
  const Ki = class Ki extends h$q {
9414
9414
  constructor() {
9415
9415
  super(...arguments), this.activePdfs = [];
9416
9416
  }
9417
9417
  render() {
9418
- return template$n(this);
9418
+ return template$o(this);
9419
9419
  }
9420
9420
  removePdf(J) {
9421
9421
  this.dispatchEvent(
@@ -9433,13 +9433,13 @@ const Ki = class Ki extends h$q {
9433
9433
  }
9434
9434
  };
9435
9435
  Ki.styles = i$y`
9436
- ${r$H(styles$l)}
9436
+ ${r$H(styles$m)}
9437
9437
  `;
9438
9438
  let PdfSelector = Ki;
9439
- __decorateClass$u([
9439
+ __decorateClass$v([
9440
9440
  n$x({ type: Array })
9441
9441
  ], PdfSelector.prototype, "pdfList");
9442
- __decorateClass$u([
9442
+ __decorateClass$v([
9443
9443
  n$x({ type: Array })
9444
9444
  ], PdfSelector.prototype, "activePdfs");
9445
9445
  class PdfViewerManager {
@@ -9469,7 +9469,7 @@ class PdfViewerManager {
9469
9469
  registerPdfViewerNavItem();
9470
9470
  }
9471
9471
  }
9472
- const createPdfViewerManager = (te, J) => new PdfViewerManager(te, J), styles$k = ".container{display:flex;flex-direction:column;gap:4px;align-items:center}.title{font-size:15px;line-height:24px;font-weight:600;color:var(--color-red-600)}.list{display:flex;flex-direction:column;gap:8px}", template$m = (te) => {
9472
+ const createPdfViewerManager = (te, J) => new PdfViewerManager(te, J), styles$l = ".container{display:flex;flex-direction:column;gap:4px;align-items:center}.title{font-size:15px;line-height:24px;font-weight:600;color:var(--color-red-600)}.list{display:flex;flex-direction:column;gap:8px}", template$n = (te) => {
9473
9473
  var J, X;
9474
9474
  return ke$1`
9475
9475
  <div class="container">
@@ -9481,11 +9481,11 @@ const createPdfViewerManager = (te, J) => new PdfViewerManager(te, J), styles$k
9481
9481
  `;
9482
9482
  }, Zi = class Zi extends h$q {
9483
9483
  render() {
9484
- return ke$1`${template$m(this)}`;
9484
+ return ke$1`${template$n(this)}`;
9485
9485
  }
9486
9486
  };
9487
9487
  Zi.styles = i$y`
9488
- ${r$H(styles$k)}
9488
+ ${r$H(styles$l)}
9489
9489
  `;
9490
9490
  let PluginBusyList = Zi;
9491
9491
  class PluginBusyManagerImpl {
@@ -11115,17 +11115,17 @@ const container = new Container(), { lazyInject } = getDecorators(container), bi
11115
11115
  }, unbindDeps = () => {
11116
11116
  container.unbind(TYPES.primaryApi), container.unbind(TYPES.store);
11117
11117
  }, addAsyncHistoryItemsCommand = "inject_async_history_items_request";
11118
- var __defProp$t = Object.defineProperty, __getOwnPropDesc$i = Object.getOwnPropertyDescriptor, __decorateClass$t = (te, J, X, re) => {
11119
- for (var ne = re > 1 ? void 0 : re ? __getOwnPropDesc$i(J, X) : J, oe = te.length - 1, de; oe >= 0; oe--)
11118
+ var __defProp$u = Object.defineProperty, __getOwnPropDesc$j = Object.getOwnPropertyDescriptor, __decorateClass$u = (te, J, X, re) => {
11119
+ for (var ne = re > 1 ? void 0 : re ? __getOwnPropDesc$j(J, X) : J, oe = te.length - 1, de; oe >= 0; oe--)
11120
11120
  (de = te[oe]) && (ne = (re ? de(J, X, ne) : de(ne)) || ne);
11121
- return re && ne && __defProp$t(J, X, ne), ne;
11121
+ return re && ne && __defProp$u(J, X, ne), ne;
11122
11122
  }, __decorateParam$5 = (te, J) => (X, re) => J(X, re, te);
11123
11123
  let StoreBaseHandler = class {
11124
11124
  constructor(te) {
11125
11125
  this.store = te;
11126
11126
  }
11127
11127
  };
11128
- StoreBaseHandler = __decorateClass$t([
11128
+ StoreBaseHandler = __decorateClass$u([
11129
11129
  injectable(),
11130
11130
  __decorateParam$5(0, inject(TYPES.store))
11131
11131
  ], StoreBaseHandler);
@@ -11134,7 +11134,7 @@ let ApiBaseHandler = class {
11134
11134
  this.api = te;
11135
11135
  }
11136
11136
  };
11137
- ApiBaseHandler = __decorateClass$t([
11137
+ ApiBaseHandler = __decorateClass$u([
11138
11138
  injectable(),
11139
11139
  __decorateParam$5(0, inject(TYPES.primaryApi))
11140
11140
  ], ApiBaseHandler);
@@ -11143,7 +11143,7 @@ let BaseHandler = class {
11143
11143
  this.store = te, this.api = J;
11144
11144
  }
11145
11145
  };
11146
- BaseHandler = __decorateClass$t([
11146
+ BaseHandler = __decorateClass$u([
11147
11147
  injectable(),
11148
11148
  __decorateParam$5(0, inject(TYPES.store)),
11149
11149
  __decorateParam$5(1, inject(TYPES.primaryApi))
@@ -11233,12 +11233,12 @@ isValidDateString(te.date), ensureAreValidBasicActivityHistoryItems = (te) => {
11233
11233
  class AddHistoryItemHandler extends StoreBaseHandler {
11234
11234
  async handle(J) {
11235
11235
  try {
11236
- ensureAreValidBasicActivityHistoryItems([J.item]), this.store.dispatch(
11236
+ ensureAreValidBasicActivityHistoryItems([J.item]), handleAddDiagnosticsFilter([J.item], this.store), handleAddUpFilter([J.item], this.store), this.store.dispatch(
11237
11237
  addActivityHistoryItem({
11238
11238
  id: J.entityId,
11239
11239
  item: J.item
11240
11240
  })
11241
- ), handleAddDiagnosticsFilter([J.item], this.store), handleAddUpFilter([J.item], this.store);
11241
+ );
11242
11242
  } catch (X) {
11243
11243
  console.log(X.message);
11244
11244
  }
@@ -11265,6 +11265,11 @@ const initializeLocalization = async (te) => {
11265
11265
  goToDate: "Anar a data",
11266
11266
  busyEntriesLoading: "Carregant totes les entrades",
11267
11267
  noResults: "Sense resultats. Modifica la cerca",
11268
+ noData: {
11269
+ title: "Sense dades",
11270
+ description: "No existeix informació per a mostrar"
11271
+ },
11272
+ isGrouping: "Creant agrupacions i preparant les dades...",
11268
11273
  searchBarResults: "Resultats per",
11269
11274
  actions: {
11270
11275
  cronogram: "Cronograma",
@@ -11331,7 +11336,7 @@ const initializeLocalization = async (te) => {
11331
11336
  }
11332
11337
  }
11333
11338
  }
11334
- }, 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) => {
11339
+ }, styles$k = ".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$m = (te) => {
11335
11340
  const { arrayElements: J, text: X } = te;
11336
11341
  return ke$1`
11337
11342
  <div class="wrapper">
@@ -11373,10 +11378,10 @@ const initializeLocalization = async (te) => {
11373
11378
  </div>` : D$1}
11374
11379
  </div>`;
11375
11380
  };
11376
- var __defProp$s = Object.defineProperty, __getOwnPropDesc$h = Object.getOwnPropertyDescriptor, __decorateClass$s = (te, J, X, re) => {
11377
- for (var ne = re > 1 ? void 0 : re ? __getOwnPropDesc$h(J, X) : J, oe = te.length - 1, de; oe >= 0; oe--)
11381
+ var __defProp$t = Object.defineProperty, __getOwnPropDesc$i = Object.getOwnPropertyDescriptor, __decorateClass$t = (te, J, X, re) => {
11382
+ for (var ne = re > 1 ? void 0 : re ? __getOwnPropDesc$i(J, X) : J, oe = te.length - 1, de; oe >= 0; oe--)
11378
11383
  (de = te[oe]) && (ne = (re ? de(J, X, ne) : de(ne)) || ne);
11379
- return re && ne && __defProp$s(J, X, ne), ne;
11384
+ return re && ne && __defProp$t(J, X, ne), ne;
11380
11385
  };
11381
11386
  let ExportPdfModal = class extends h$q {
11382
11387
  constructor() {
@@ -11389,12 +11394,12 @@ let ExportPdfModal = class extends h$q {
11389
11394
  }
11390
11395
  render() {
11391
11396
  return ke$1`
11392
- ${template$l(this)}
11397
+ ${template$m(this)}
11393
11398
  `;
11394
11399
  }
11395
11400
  static get styles() {
11396
11401
  return i$y`
11397
- ${r$H(styles$j)}
11402
+ ${r$H(styles$k)}
11398
11403
  `;
11399
11404
  }
11400
11405
  handleTest() {
@@ -11404,22 +11409,22 @@ let ExportPdfModal = class extends h$q {
11404
11409
  );
11405
11410
  }
11406
11411
  };
11407
- __decorateClass$s([
11412
+ __decorateClass$t([
11408
11413
  n$x()
11409
11414
  ], ExportPdfModal.prototype, "selectedRadioOption", 2);
11410
- __decorateClass$s([
11415
+ __decorateClass$t([
11411
11416
  n$x()
11412
11417
  ], ExportPdfModal.prototype, "text", 2);
11413
- __decorateClass$s([
11418
+ __decorateClass$t([
11414
11419
  n$x()
11415
11420
  ], ExportPdfModal.prototype, "selectedVisibilityLevelElement", 2);
11416
- __decorateClass$s([
11421
+ __decorateClass$t([
11417
11422
  n$x()
11418
11423
  ], ExportPdfModal.prototype, "selectedPeriodDate", 2);
11419
- __decorateClass$s([
11424
+ __decorateClass$t([
11420
11425
  n$x({ type: Array })
11421
11426
  ], ExportPdfModal.prototype, "arrayElements", 2);
11422
- ExportPdfModal = __decorateClass$s([
11427
+ ExportPdfModal = __decorateClass$t([
11423
11428
  t$k("export-pdf-modal")
11424
11429
  ], ExportPdfModal);
11425
11430
  class ExportToPdfHandler extends ApiBaseHandler {
@@ -11452,14 +11457,14 @@ class AddHistoryItemsHandler extends StoreBaseHandler {
11452
11457
  async handle(J) {
11453
11458
  try {
11454
11459
  const X = validateAndFilterBasicItems(J.items);
11455
- this.store.dispatch(
11460
+ handleAddDiagnosticsFilter(X, this.store), handleAddUpFilter(X, this.store), this.store.dispatch(
11456
11461
  addActivityHistoryItems({
11457
11462
  id: J.entityId,
11458
11463
  items: X,
11459
11464
  componentFactory: J.componentFactory,
11460
11465
  searchPredicate: J.searchPredicate
11461
11466
  })
11462
- ), handleAddDiagnosticsFilter(X, this.store), handleAddUpFilter(X, this.store);
11467
+ );
11463
11468
  } catch (X) {
11464
11469
  console.log(X.message);
11465
11470
  }
@@ -11633,11 +11638,14 @@ const areSameDiagnostics = (te, J) => {
11633
11638
  return !1;
11634
11639
  const X = te.map((ne) => ne.codi).sort(), re = J.map((ne) => ne.codi).sort();
11635
11640
  return X.every((ne, oe) => ne === re[oe]);
11636
- }, hasValidDiagnostic = (te) => te != null && typeof te.codi == "string" && typeof te.cataleg == "string" && typeof te.descripcio == "string", hasValidDiagnostics = (te) => te == null ? !0 : Array.isArray(te) && te.every(hasValidDiagnostic), isSameVisit = (te, J) => {
11637
- var oe, de, ce, he, ue, pe, fe, ge, me, ve, be, ye, we, Se, Ce, _e, Ae, Le;
11638
- const X = ((oe = te.professional) == null ? void 0 : oe.id) === ((de = J.professional) == null ? void 0 : de.id) && ((he = (ce = te.professional) == null ? void 0 : ce.role) == null ? void 0 : he.id) === ((pe = (ue = J.professional) == null ? void 0 : ue.role) == null ? void 0 : pe.id) && ((ge = (fe = te.professional) == null ? void 0 : fe.speciality) == null ? void 0 : ge.id) === ((ve = (me = J.professional) == null ? void 0 : me.speciality) == null ? void 0 : ve.id), re = ((be = te.ep) == null ? void 0 : be.id) === ((ye = J.ep) == null ? void 0 : ye.id) && ((we = te.up) == null ? void 0 : we.id) === ((Se = J.up) == null ? void 0 : Se.id) && ((Ce = te.center) == null ? void 0 : Ce.id) === ((_e = J.center) == null ? void 0 : _e.id) && ((Ae = te.service) == null ? void 0 : Ae.id) === ((Le = J.service) == null ? void 0 : Le.id), ne = new Date(te.date).toDateString() === new Date(J.date).toDateString();
11639
- return X && re && ne;
11640
- }, withinEightHours = (te, J) => Math.abs(new Date(te).getTime() - new Date(J).getTime()) <= 8 * 60 * 60 * 1e3;
11641
+ }, hasValidDiagnostic = (te) => te != null && typeof te.codi == "string" && typeof te.cataleg == "string" && typeof te.descripcio == "string", hasValidDiagnostics = (te) => te == null ? !0 : Array.isArray(te) && te.every(hasValidDiagnostic), dateStringCache = /* @__PURE__ */ new Map(), dateObjectCache = /* @__PURE__ */ new Map(), getDateString = (te) => (dateStringCache.has(te) || dateStringCache.set(te, new Date(te).toDateString()), dateStringCache.get(te)), getDateObject = (te) => (dateObjectCache.has(te) || dateObjectCache.set(te, new Date(te)), dateObjectCache.get(te)), createVisitKey = (te) => {
11642
+ var ne, oe, de, ce, he, ue, pe, fe, ge;
11643
+ const J = `${((ne = te.professional) == null ? void 0 : ne.id) || "null"}-${((de = (oe = te.professional) == null ? void 0 : oe.role) == null ? void 0 : de.id) || "null"}-${((he = (ce = te.professional) == null ? void 0 : ce.speciality) == null ? void 0 : he.id) || "null"}`, X = `${((ue = te.ep) == null ? void 0 : ue.id) || "null"}-${((pe = te.up) == null ? void 0 : pe.id) || "null"}-${((fe = te.center) == null ? void 0 : fe.id) || "null"}-${((ge = te.service) == null ? void 0 : ge.id) || "null"}`, re = getDateString(te.date);
11644
+ return `${J}|${X}|${re}`;
11645
+ }, withinEightHours = (te, J) => {
11646
+ const X = getDateObject(te).getTime(), re = getDateObject(J).getTime();
11647
+ return Math.abs(X - re) <= 8 * 60 * 60 * 1e3;
11648
+ };
11641
11649
  function groupByValidDiagnostics(te) {
11642
11650
  te.forEach((J) => {
11643
11651
  const X = [], re = [];
@@ -11662,21 +11670,33 @@ function groupByValidDiagnostics(te) {
11662
11670
  });
11663
11671
  }
11664
11672
  const groupActivityHistoryItems = (te) => {
11665
- const J = [];
11666
- return te == null || te.forEach((X) => {
11667
- let re = !1;
11668
- for (const ne of J) {
11669
- const oe = ne.items[0], de = ne.items[ne.items.length - 1];
11670
- if (isSameVisit(oe, X) && withinEightHours(oe.date, X.date) && withinEightHours(de.date, X.date)) {
11671
- ne.items.push(X), re = !0;
11672
- break;
11673
+ if (!(te != null && te.length)) return [];
11674
+ dateStringCache.clear(), dateObjectCache.clear();
11675
+ const J = /* @__PURE__ */ new Map();
11676
+ te.forEach((re) => {
11677
+ const ne = createVisitKey(re);
11678
+ if (!J.has(ne))
11679
+ J.set(ne, {
11680
+ idGroup: Math.random().toString(36).substr(2, 9),
11681
+ items: [re]
11682
+ });
11683
+ else {
11684
+ const oe = J.get(ne), de = oe.items[0], ce = oe.items[oe.items.length - 1];
11685
+ if (withinEightHours(de.date, re.date) && withinEightHours(ce.date, re.date))
11686
+ oe.items.push(re);
11687
+ else {
11688
+ let he = 1, ue = `${ne}_${he}`;
11689
+ for (; J.has(ue); )
11690
+ he++, ue = `${ne}_${he}`;
11691
+ J.set(ue, {
11692
+ idGroup: Math.random().toString(36).substr(2, 9),
11693
+ items: [re]
11694
+ });
11673
11695
  }
11674
11696
  }
11675
- re || J.push({
11676
- idGroup: Math.random().toString(36).substr(2, 9),
11677
- items: [X]
11678
- });
11679
- }), groupByValidDiagnostics(J), J;
11697
+ });
11698
+ const X = Array.from(J.values());
11699
+ return groupByValidDiagnostics(X), X;
11680
11700
  }, sortGroupsByMostRecentDate = (te) => {
11681
11701
  const J = (oe) => oe.reduce((de, ce) => {
11682
11702
  const he = new Date(ce.date);
@@ -11768,7 +11788,7 @@ const activityHistoryCollectionsSelector = (te) => te.activityHistoryCollections
11768
11788
  ), ce = groupActivityHistoryItems(de);
11769
11789
  return sortGroupsByMostRecentDate(ce);
11770
11790
  }
11771
- ), styles$i = ":host{min-height:1px;height:100%}.virtualizer{height:100%;padding-inline:16px}.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}";
11791
+ ), styles$j = ":host{min-height:1px;height:100%}.virtualizer{height:100%;padding-inline:16px}.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}";
11772
11792
  function toDate(te) {
11773
11793
  const J = Object.prototype.toString.call(te);
11774
11794
  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);
@@ -14561,9 +14581,31 @@ const hasItemDivider = (te, J) => {
14561
14581
  subGroup: re
14562
14582
  }));
14563
14583
  return [...J, ...X].sort((re, ne) => ne.date.getTime() - re.date.getTime());
14564
- }, template$k = (te) => {
14584
+ }, styles$i = ".grouping-busy-container{display:flex;flex-direction:row;align-items:center;gap:24px;justify-content:center;padding-top:16px}", template$l = (te) => ke$1`
14585
+ <div class="grouping-busy-container">
14586
+ <dss-spinner size="sm"></dss-spinner>
14587
+ <div>${translate("isGrouping")}</div>
14588
+ </div>
14589
+ `;
14590
+ var __defProp$s = Object.defineProperty, __getOwnPropDesc$h = Object.getOwnPropertyDescriptor, __decorateClass$s = (te, J, X, re) => {
14591
+ for (var ne = re > 1 ? void 0 : re ? __getOwnPropDesc$h(J, X) : J, oe = te.length - 1, de; oe >= 0; oe--)
14592
+ (de = te[oe]) && (ne = (re ? de(J, X, ne) : de(ne)) || ne);
14593
+ return re && ne && __defProp$s(J, X, ne), ne;
14594
+ };
14595
+ let ActivityHistoryIsGroupingBusy = class extends h$q {
14596
+ render() {
14597
+ return template$l();
14598
+ }
14599
+ };
14600
+ ActivityHistoryIsGroupingBusy.styles = i$y`
14601
+ ${r$H(styles$i)}
14602
+ `;
14603
+ ActivityHistoryIsGroupingBusy = __decorateClass$s([
14604
+ t$k("activity-history-is-grouping-busy")
14605
+ ], ActivityHistoryIsGroupingBusy);
14606
+ const template$k = (te) => {
14565
14607
  var J;
14566
- return te._hasUpdatedOnce ? ke$1`
14608
+ return ke$1`
14567
14609
  <div class="container">
14568
14610
  <activity-history-full-data-error></activity-history-full-data-error>
14569
14611
  <activity-history-partial-data-error></activity-history-partial-data-error>
@@ -14619,15 +14661,24 @@ const hasItemDivider = (te, J) => {
14619
14661
  `;
14620
14662
  }}
14621
14663
  ></lit-virtualizer>
14622
- ` : !te.isCollectionInitialState && !te.isSomeCollectionLoadedAndOtherLoading ? ke$1`
14623
- <dss-user-feedback
14624
- class="feedback"
14625
- imagesrc=${notFound}
14626
- title=${translate("noResults")}>
14627
- </dss-user-feedback>
14628
- ` : D$1}
14664
+ ` : noGroupsTemplate(te)}
14629
14665
  </div>
14630
- ` : ke$1`<div class="container"></div>`;
14666
+ `;
14667
+ }, noGroupsTemplate = (te) => {
14668
+ var J;
14669
+ return ke$1`
14670
+ ${((J = te.searchString) == null ? void 0 : J.length) > 1 ? ke$1`
14671
+ <dss-user-feedback
14672
+ class="feedback"
14673
+ imagesrc=${notFound}
14674
+ title=${translate("noResults")}>
14675
+ </dss-user-feedback>
14676
+ ` : te.renderGroupsControlTimeExpired ? ke$1`<dss-user-feedback
14677
+ class="feedback"
14678
+ imagesrc=${notFound}
14679
+ title=${translate("noData.title")}
14680
+ description=${translate("noData.description")}>
14681
+ </dss-user-feedback>` : ke$1`<activity-history-is-grouping-busy></activity-history-is-grouping-busy>`}`;
14631
14682
  }, visitHeaderTemplate = (te, J) => J ? ke$1`
14632
14683
  <div class="visit__header">
14633
14684
  <div class="title">
@@ -15332,7 +15383,7 @@ const createZIndexStyles = (te) => {
15332
15383
  };
15333
15384
  let ActivityHistoryTimeline = class extends h$q {
15334
15385
  constructor() {
15335
- super(...arguments), this._hasUpdatedOnce = !1;
15386
+ super(...arguments), this.renderGroupsControlTimeExpired = !1;
15336
15387
  }
15337
15388
  render() {
15338
15389
  var X;
@@ -15344,8 +15395,13 @@ let ActivityHistoryTimeline = class extends h$q {
15344
15395
  ${template$k(this)}
15345
15396
  `;
15346
15397
  }
15347
- firstUpdated(te) {
15348
- super.firstUpdated(te), this._hasUpdatedOnce = !0;
15398
+ connectedCallback() {
15399
+ super.connectedCallback(), setTimeout(() => {
15400
+ this.renderGroupsControlTimeExpired = !0;
15401
+ }, 8e3);
15402
+ }
15403
+ disconnectedCallback() {
15404
+ super.disconnectedCallback();
15349
15405
  }
15350
15406
  async updated(te) {
15351
15407
  var J;
@@ -15389,7 +15445,7 @@ let ActivityHistoryTimeline = class extends h$q {
15389
15445
  }
15390
15446
  };
15391
15447
  ActivityHistoryTimeline.styles = i$y`
15392
- ${r$H(styles$i)}
15448
+ ${r$H(styles$j)}
15393
15449
  `;
15394
15450
  __decorateClass$r([
15395
15451
  connectedProperty(activityHistoryGroupedItems)
@@ -15406,6 +15462,9 @@ __decorateClass$r([
15406
15462
  __decorateClass$r([
15407
15463
  e$O(".virtualizer")
15408
15464
  ], ActivityHistoryTimeline.prototype, "_virtualizer", 2);
15465
+ __decorateClass$r([
15466
+ r$E()
15467
+ ], ActivityHistoryTimeline.prototype, "renderGroupsControlTimeExpired", 2);
15409
15468
  ActivityHistoryTimeline = __decorateClass$r([
15410
15469
  t$k("activity-history-timeline")
15411
15470
  ], ActivityHistoryTimeline);