@juice-js/layout 2.1.0-alpha.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,35 +1,36 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, signal, Optional, Injectable, computed, ChangeDetectionStrategy, Component, booleanAttribute, HostListener, Input, Directive, inject, HostBinding, NgModule } from '@angular/core';
2
+ import { InjectionToken, signal, Optional, Injectable, inject, computed, viewChild, ChangeDetectionStrategy, Component, booleanAttribute, HostListener, Input, Directive, ChangeDetectorRef, DestroyRef, HostBinding, effect, untracked, NgModule } from '@angular/core';
3
3
  import * as i1 from '@juice-js/core';
4
- import { AsyncDialog } from '@juice-js/core';
5
- import * as i4$2 from '@angular/cdk/layout';
4
+ import { TenantService, AsyncDialog } from '@juice-js/core';
5
+ import * as i2$2 from '@angular/material/dialog';
6
+ import { MatDialog, MatDialogModule } from '@angular/material/dialog';
7
+ import * as i4$1 from '@angular/cdk/layout';
6
8
  import { Breakpoints } from '@angular/cdk/layout';
7
- import { trigger, transition, style, animate, state } from '@angular/animations';
8
- import * as i1$2 from '@angular/router';
9
- import { RouterModule } from '@angular/router';
10
9
  import * as i1$1 from '@angular/common';
11
- import { CommonModule } from '@angular/common';
10
+ import { DOCUMENT, CommonModule } from '@angular/common';
11
+ import * as i3$1 from '@angular/router';
12
+ import { Router, NavigationEnd, RouterModule } from '@angular/router';
12
13
  import * as i2 from '@angular/material/icon';
13
14
  import { MatIconModule } from '@angular/material/icon';
14
- import * as i7 from '@angular/material/toolbar';
15
+ import * as i2$1 from '@ngx-translate/core';
16
+ import { TranslatePipe, TranslateDirective } from '@ngx-translate/core';
17
+ import { trigger, transition, style, animate, state } from '@angular/animations';
18
+ import * as i8 from '@angular/material/toolbar';
15
19
  import { MatToolbarModule } from '@angular/material/toolbar';
16
- import * as i8 from '@angular/material/sidenav';
20
+ import * as i9 from '@angular/material/sidenav';
17
21
  import { MatSidenavModule } from '@angular/material/sidenav';
18
22
  import * as i3 from '@angular/material/button';
19
23
  import { MatButtonModule } from '@angular/material/button';
20
24
  import * as i4 from '@angular/material/tooltip';
21
25
  import { MatTooltipModule } from '@angular/material/tooltip';
22
- import * as i5 from '@ngx-translate/core';
23
- import { TranslatePipe, TranslateDirective } from '@ngx-translate/core';
24
- import * as i6 from '@angular/material/list';
26
+ import * as i7 from '@angular/material/list';
25
27
  import { MatListModule } from '@angular/material/list';
26
- import * as i4$1 from '@angular/material/expansion';
27
- import { MatExpansionModule } from '@angular/material/expansion';
28
- import * as i3$1 from 'angular-oauth2-oidc';
28
+ import * as i3$2 from '@angular/material/expansion';
29
+ import { MatExpansionPanel, MatExpansionModule } from '@angular/material/expansion';
30
+ import { filter } from 'rxjs/operators';
31
+ import * as i3$3 from 'angular-oauth2-oidc';
29
32
  import { MatFormFieldModule } from '@angular/material/form-field';
30
33
  import { MatInputModule } from '@angular/material/input';
31
- import * as i2$1 from '@angular/material/dialog';
32
- import { MatDialogModule } from '@angular/material/dialog';
33
34
 
34
35
  var ThemeMode;
35
36
  (function (ThemeMode) {
@@ -45,6 +46,7 @@ class LayoutConfig {
45
46
  this.defaultThemeMode = ThemeMode.Auto;
46
47
  this.defaultLanguage = "en-US";
47
48
  this.defaultMenuOpen = false;
49
+ this.pageSwitcher = true;
48
50
  if (options) {
49
51
  Object.assign(this, options);
50
52
  }
@@ -137,6 +139,294 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
137
139
  type: Optional
138
140
  }] }, { type: i1.TenantService }] });
139
141
 
142
+ /** How long a go-to sequence waits for its next key. */
143
+ const SequenceTimeout = 1500;
144
+ /**
145
+ * The page switcher (Ctrl+K or ⌘K) and the go-to keys (`g` then a letter) over the app's menu. Every menu entry with a
146
+ * page of its own is offered, also those kept out of the side menu (`inMenu: false`); a group that only links to its
147
+ * first page is offered as that page.
148
+ *
149
+ * Part of the shell ({@link PageComponent}): the pages are its side menu's own items ({@link setItems}), so they
150
+ * follow it (loaded once, and again when the shell is built again for another tenant), and the keys are live only
151
+ * while the shell is on screen ({@link attach}); the shell also shows the switcher while {@link isOpen}.
152
+ * Keys typed into a field or a widget that takes letters are left alone, and so is a Ctrl+K a page already handled.
153
+ */
154
+ class PageSwitcherService {
155
+ constructor() {
156
+ this.router = inject(Router);
157
+ this.document = inject(DOCUMENT);
158
+ this.tenants = inject(TenantService, { optional: true });
159
+ this.enabled = inject(LayoutConfig, { optional: true })?.pageSwitcher ?? true;
160
+ this._open = signal(false, /* @ts-ignore */
161
+ ...(ngDevMode ? [{ debugName: "_open" }] : /* istanbul ignore next */ []));
162
+ this._pages = signal([], /* @ts-ignore */
163
+ ...(ngDevMode ? [{ debugName: "_pages" }] : /* istanbul ignore next */ []));
164
+ this.readyPromise = new Promise(resolve => this.ready = resolve);
165
+ this.attached = 0;
166
+ /** Counts menu loads, so a slower earlier one can't replace a later one's pages. */
167
+ this.loads = 0;
168
+ this.onKey = (e) => this.onKeydown(e);
169
+ this.sequence = [];
170
+ this.sequenceTimer = null;
171
+ /** Whether the switcher is on display. */
172
+ this.isOpen = this._open.asReadonly();
173
+ /** The pages, in menu order; empty until the side menu has loaded. */
174
+ this.pages = this._pages.asReadonly();
175
+ }
176
+ /** Whether the app has the switcher (`LayoutConfig.pageSwitcher`, default true). */
177
+ get isEnabled() { return this.enabled; }
178
+ /** The menu's items, from the side menu once it has loaded them. Their links are resolved for the tenant. */
179
+ async setItems(items) {
180
+ const load = ++this.loads;
181
+ const tenant = await this.tenants?.getTenantIdentifier().catch(() => null);
182
+ if (load !== this.loads)
183
+ return;
184
+ this._pages.set(flatten(items, tenant));
185
+ this.ready();
186
+ }
187
+ /** Resolves once the pages are known. */
188
+ whenReady() { return this.readyPromise; }
189
+ /** Starts listening for the keys, for the shell on screen; the returned function stops. */
190
+ attach() {
191
+ if (!this.enabled)
192
+ return () => { };
193
+ if (this.attached++ === 0)
194
+ this.document.addEventListener('keydown', this.onKey);
195
+ let done = false;
196
+ return () => {
197
+ if (done)
198
+ return;
199
+ done = true;
200
+ if (--this.attached === 0) {
201
+ this.document.removeEventListener('keydown', this.onKey);
202
+ this.resetSequence();
203
+ this._open.set(false);
204
+ // The shell is gone (another tenant's may follow): its pages go with it until the next menu comes.
205
+ this.loads++;
206
+ this._pages.set([]);
207
+ this.readyPromise = new Promise(resolve => this.ready = resolve);
208
+ }
209
+ };
210
+ }
211
+ open() {
212
+ if (this.enabled && this.attached > 0)
213
+ this._open.set(true);
214
+ }
215
+ close() { this._open.set(false); }
216
+ /** Opens a page the switcher offered, and closes it. */
217
+ go(page) {
218
+ this.close();
219
+ this.router.navigateByUrl(page.routerLink);
220
+ }
221
+ /** The pages matching what was typed, best first: label starts with it, then a word in it does, then it contains it. */
222
+ filter(query) {
223
+ const q = query.trim().toLowerCase();
224
+ if (!q)
225
+ return this._pages();
226
+ const rank = (p) => {
227
+ const label = p.label.toLowerCase();
228
+ if (label.startsWith(q))
229
+ return 0;
230
+ if (label.split(/\s+/).some(w => w.startsWith(q)))
231
+ return 1;
232
+ if (label.includes(q))
233
+ return 2;
234
+ if (p.group?.toLowerCase().includes(q))
235
+ return 3;
236
+ return -1;
237
+ };
238
+ return this._pages()
239
+ .map((page, index) => ({ page, index, rank: rank(page) }))
240
+ .filter(r => r.rank >= 0)
241
+ .sort((a, b) => a.rank - b.rank || a.index - b.index)
242
+ .map(r => r.page);
243
+ }
244
+ onKeydown(e) {
245
+ const target = eventTarget(e);
246
+ // The K key wherever the layout puts its letter (`code`), or a K wherever it is (`key`).
247
+ if ((e.ctrlKey || e.metaKey) && !e.altKey && !e.shiftKey && (e.code === 'KeyK' || e.key.toLowerCase() === 'k')) {
248
+ // An editor's own Ctrl+K (a link, a chord) wins: one that handled it, or any multi-line or rich text editor.
249
+ // Another dialog open: not over it (a page picked would go behind it, its unsaved input with it).
250
+ if (e.defaultPrevented || isEditor(target) || (!this._open() && this.modalOpen()))
251
+ return;
252
+ e.preventDefault();
253
+ this._open() ? this.close() : this.open();
254
+ return;
255
+ }
256
+ if (this._open() || e.defaultPrevented || e.ctrlKey || e.metaKey || e.altKey || e.repeat || isTyping(target)
257
+ || this.modalOpen()) {
258
+ this.resetSequence();
259
+ return;
260
+ }
261
+ if (e.key.length !== 1)
262
+ return;
263
+ const key = e.key.toLowerCase();
264
+ // A key that doesn't go on with the sequence starts a new one: `g g s` is `g s`.
265
+ if (!this.step([...this.sequence, key], e))
266
+ this.step([key], e);
267
+ }
268
+ /** Takes the keys typed so far: goes, waits for more, or (false) leads nowhere. */
269
+ step(keys, e) {
270
+ const typed = keys.join(' ');
271
+ const shortcuts = this._pages().filter(p => p.shortcut).map(p => ({ page: p, keys: normalize(p.shortcut) }));
272
+ const hit = shortcuts.find(s => s.keys === typed);
273
+ const longer = shortcuts.some(s => s.keys.startsWith(typed + ' '));
274
+ this.resetSequence();
275
+ if (hit && !longer) {
276
+ e.preventDefault();
277
+ this.router.navigateByUrl(hit.page.routerLink);
278
+ return true;
279
+ }
280
+ if (longer) {
281
+ // Wait for the next key; a shortcut that is the start of a longer one goes when none comes.
282
+ this.sequence = keys;
283
+ this.sequenceTimer = setTimeout(() => {
284
+ this.resetSequence();
285
+ if (hit)
286
+ this.router.navigateByUrl(hit.page.routerLink);
287
+ }, SequenceTimeout);
288
+ return true;
289
+ }
290
+ return false;
291
+ }
292
+ /** Whether another dialog is open: the keys are its, and a page change would happen behind it. */
293
+ modalOpen() {
294
+ // CDK and Material dialogs and bottom sheets, which leave aria-modal off by default, and anything that sets it.
295
+ return !!this.document.querySelector('[aria-modal="true"], .cdk-dialog-container, .mat-bottom-sheet-container');
296
+ }
297
+ resetSequence() {
298
+ this.sequence = [];
299
+ if (this.sequenceTimer)
300
+ clearTimeout(this.sequenceTimer);
301
+ this.sequenceTimer = null;
302
+ }
303
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PageSwitcherService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
304
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PageSwitcherService, providedIn: 'root' }); }
305
+ }
306
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PageSwitcherService, decorators: [{
307
+ type: Injectable,
308
+ args: [{ providedIn: 'root' }]
309
+ }] });
310
+ /**
311
+ * The menu's pages: those with a page of their own (see `MenuItem.hasOwnPage`), each in the group it sits in, with
312
+ * its link resolved for the tenant (a top-level page's link is still as written: `''` is the home page).
313
+ */
314
+ function flatten(items, tenant, group) {
315
+ const pages = [];
316
+ for (const item of items) {
317
+ if (item.hasOwnPage()) {
318
+ pages.push({
319
+ id: item.id, label: item.label, icon: item.icon, routerLink: (item.routerLink ?? '').injectTenant(tenant),
320
+ group, shortcut: item.shortcut,
321
+ });
322
+ }
323
+ const children = item.children ?? [];
324
+ pages.push(...flatten(children, tenant, children.length ? item.label : group));
325
+ }
326
+ return pages;
327
+ }
328
+ /** `G S` → `g s`. */
329
+ function normalize(shortcut) {
330
+ return shortcut.trim().toLowerCase().split(/\s+/).join(' ');
331
+ }
332
+ /** The element the key went to, also inside a web component (whose host is all `e.target` shows). */
333
+ function eventTarget(e) {
334
+ const first = e.composedPath?.()[0] ?? e.target;
335
+ return first instanceof HTMLElement ? first : null;
336
+ }
337
+ /** A multi-line or rich text editor (a textarea, as code editors use, or editable content). */
338
+ function isEditor(el) {
339
+ return !!el && (el.isContentEditable || el.tagName === 'TEXTAREA');
340
+ }
341
+ /** Widgets that take letter keys themselves (typeahead, cell editing); focus sits on them or on an item inside. */
342
+ const LetterWidgets = ['combobox', 'listbox', 'textbox', 'searchbox', 'menu', 'menubar', 'grid', 'treegrid', 'tree',
343
+ 'spinbutton', 'slider'].map(role => `[role="${role}"]`).join(',');
344
+ /** Whether letter keys go to what has focus: a field, an editor, or a widget that takes them (a menu's typeahead). */
345
+ function isTyping(el) {
346
+ if (!el)
347
+ return false;
348
+ if (isEditor(el) || el.tagName === 'SELECT')
349
+ return true;
350
+ // Inputs that take text; a checkbox, radio, button or range doesn't.
351
+ if (el instanceof HTMLInputElement && !/^(checkbox|radio|button|submit|reset|range|color|file|image)$/.test(el.type))
352
+ return true;
353
+ return !!el.closest(LetterWidgets);
354
+ }
355
+
356
+ /**
357
+ * The page switcher's content: a box to type a page's name in and the pages that match, with their group and go-to
358
+ * keys. Arrow keys move, Enter opens. The shell shows it in a dialog (which brings the focus trap, Escape and the
359
+ * backdrop) while {@link PageSwitcherService.isOpen}.
360
+ */
361
+ class PageSwitcherComponent {
362
+ constructor() {
363
+ this.service = inject(PageSwitcherService);
364
+ this.query = signal('', /* @ts-ignore */
365
+ ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
366
+ this.selected = signal(0, /* @ts-ignore */
367
+ ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
368
+ this.results = computed(() => this.service.filter(this.query()), /* @ts-ignore */
369
+ ...(ngDevMode ? [{ debugName: "results" }] : /* istanbul ignore next */ []));
370
+ this.list = viewChild('list', /* @ts-ignore */
371
+ ...(ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []));
372
+ }
373
+ onInput(value) {
374
+ this.query.set(value);
375
+ this.selected.set(0);
376
+ }
377
+ onKeydown(e) {
378
+ // Keys that confirm or move within an input method's (IME) composition are the IME's.
379
+ if (e.isComposing)
380
+ return;
381
+ const count = this.results().length;
382
+ switch (e.key) {
383
+ case 'ArrowDown':
384
+ e.preventDefault();
385
+ if (count)
386
+ this.select((this.selected() + 1) % count);
387
+ break;
388
+ case 'ArrowUp':
389
+ e.preventDefault();
390
+ if (count)
391
+ this.select((this.selected() - 1 + count) % count);
392
+ break;
393
+ case 'Enter': {
394
+ e.preventDefault();
395
+ const page = this.results()[this.selected()];
396
+ if (page) {
397
+ this.service.go(page);
398
+ }
399
+ else if (this.service.pages().length === 0) {
400
+ // Typed and confirmed before the menu had loaded: open the best match once it has.
401
+ this.service.whenReady().then(() => {
402
+ const first = this.results()[0];
403
+ if (first && this.service.isOpen())
404
+ this.service.go(first);
405
+ });
406
+ }
407
+ break;
408
+ }
409
+ }
410
+ }
411
+ /** Unique per row (menu ids need not be). */
412
+ optionId(index) {
413
+ return `juice-page-switcher-option-${index}`;
414
+ }
415
+ keys(shortcut) {
416
+ return shortcut.trim().split(/\s+/);
417
+ }
418
+ select(index) {
419
+ this.selected.set(index);
420
+ this.list()?.nativeElement.querySelector(`#${this.optionId(index)}`)?.scrollIntoView({ block: 'nearest' });
421
+ }
422
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PageSwitcherComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
423
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: PageSwitcherComponent, isStandalone: false, selector: "juice-page-switcher", viewQueries: [{ propertyName: "list", first: true, predicate: ["list"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"switcher\" (keydown)=\"onKeydown($event)\">\n <div class=\"field\">\n <mat-icon aria-hidden=\"true\">search</mat-icon>\n <input type=\"text\" role=\"combobox\" aria-autocomplete=\"list\" aria-expanded=\"true\"\n aria-controls=\"juice-page-switcher-list\" autocomplete=\"off\" spellcheck=\"false\"\n [attr.aria-activedescendant]=\"results()[selected()] ? optionId(selected()) : null\"\n [placeholder]=\"'Go to page\u2026' | translate\" [value]=\"query()\"\n (input)=\"onInput($any($event.target).value)\">\n <kbd class=\"hint\">Esc</kbd>\n </div>\n <ul #list id=\"juice-page-switcher-list\" role=\"listbox\" [attr.aria-label]=\"'Pages' | translate\">\n @for (page of results(); track page.id + page.routerLink; let i = $index) {\n <li role=\"option\" [id]=\"optionId(i)\" [attr.aria-selected]=\"i === selected()\" [class.selected]=\"i === selected()\"\n (mousemove)=\"selected.set(i)\" (mousedown)=\"$event.preventDefault()\" (click)=\"service.go(page)\">\n <mat-icon aria-hidden=\"true\">{{ page.icon }}</mat-icon>\n <span class=\"label\">{{ page.label }}</span>\n @if (page.group) {\n <span class=\"group\">{{ page.group }}</span>\n }\n @if (page.shortcut) {\n <span class=\"keys\" [attr.aria-label]=\"('Shortcut' | translate) + ' ' + page.shortcut\">\n @for (key of keys(page.shortcut); track $index) { <kbd>{{ key }}</kbd> }\n </span>\n }\n </li>\n } @empty {\n <li class=\"empty\" role=\"presentation\">{{ 'No pages match' | translate }}</li>\n }\n </ul>\n</div>\n", styles: [":host{display:block}.switcher{display:flex;flex-direction:column;max-height:70vh;color:var(--jps-text, var(--mat-sys-on-surface, rgba(0, 0, 0, .87)))}.field{display:flex;align-items:center;gap:12px;padding:0 16px;border-bottom:1px solid var(--jps-line, var(--mat-sys-outline-variant, rgba(0, 0, 0, .12)))}.field mat-icon{color:var(--jps-muted, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, .6)))}.field input{flex:1;min-width:0;height:52px;border:0;outline:0;background:transparent;color:inherit;font:inherit;font-size:1rem}ul{list-style:none;margin:0;padding:6px;overflow-y:auto}li{display:flex;align-items:center;gap:12px;min-height:40px;padding:0 10px;border-radius:8px;cursor:pointer}li mat-icon{color:var(--jps-muted, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, .6)));flex:none}li .label{flex:none}li .group{color:var(--jps-muted, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, .6)));font-size:.85em;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}li .keys{margin-left:auto;display:flex;gap:4px;flex:none}li.selected{background:var(--jps-selected, var(--mat-sys-secondary-container, rgba(0, 0, 0, .06)))}li.empty{cursor:default;color:var(--jps-muted, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, .6)));justify-content:center}kbd{display:inline-block;min-width:1.4em;padding:1px 6px;border:1px solid var(--jps-line, var(--mat-sys-outline-variant, rgba(0, 0, 0, .12)));border-bottom-width:2px;border-radius:4px;font:500 .75rem/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-align:center;color:var(--jps-muted, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, .6)))}.hint{flex:none}\n"], dependencies: [{ kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
424
+ }
425
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PageSwitcherComponent, decorators: [{
426
+ type: Component,
427
+ args: [{ selector: 'juice-page-switcher', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"switcher\" (keydown)=\"onKeydown($event)\">\n <div class=\"field\">\n <mat-icon aria-hidden=\"true\">search</mat-icon>\n <input type=\"text\" role=\"combobox\" aria-autocomplete=\"list\" aria-expanded=\"true\"\n aria-controls=\"juice-page-switcher-list\" autocomplete=\"off\" spellcheck=\"false\"\n [attr.aria-activedescendant]=\"results()[selected()] ? optionId(selected()) : null\"\n [placeholder]=\"'Go to page\u2026' | translate\" [value]=\"query()\"\n (input)=\"onInput($any($event.target).value)\">\n <kbd class=\"hint\">Esc</kbd>\n </div>\n <ul #list id=\"juice-page-switcher-list\" role=\"listbox\" [attr.aria-label]=\"'Pages' | translate\">\n @for (page of results(); track page.id + page.routerLink; let i = $index) {\n <li role=\"option\" [id]=\"optionId(i)\" [attr.aria-selected]=\"i === selected()\" [class.selected]=\"i === selected()\"\n (mousemove)=\"selected.set(i)\" (mousedown)=\"$event.preventDefault()\" (click)=\"service.go(page)\">\n <mat-icon aria-hidden=\"true\">{{ page.icon }}</mat-icon>\n <span class=\"label\">{{ page.label }}</span>\n @if (page.group) {\n <span class=\"group\">{{ page.group }}</span>\n }\n @if (page.shortcut) {\n <span class=\"keys\" [attr.aria-label]=\"('Shortcut' | translate) + ' ' + page.shortcut\">\n @for (key of keys(page.shortcut); track $index) { <kbd>{{ key }}</kbd> }\n </span>\n }\n </li>\n } @empty {\n <li class=\"empty\" role=\"presentation\">{{ 'No pages match' | translate }}</li>\n }\n </ul>\n</div>\n", styles: [":host{display:block}.switcher{display:flex;flex-direction:column;max-height:70vh;color:var(--jps-text, var(--mat-sys-on-surface, rgba(0, 0, 0, .87)))}.field{display:flex;align-items:center;gap:12px;padding:0 16px;border-bottom:1px solid var(--jps-line, var(--mat-sys-outline-variant, rgba(0, 0, 0, .12)))}.field mat-icon{color:var(--jps-muted, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, .6)))}.field input{flex:1;min-width:0;height:52px;border:0;outline:0;background:transparent;color:inherit;font:inherit;font-size:1rem}ul{list-style:none;margin:0;padding:6px;overflow-y:auto}li{display:flex;align-items:center;gap:12px;min-height:40px;padding:0 10px;border-radius:8px;cursor:pointer}li mat-icon{color:var(--jps-muted, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, .6)));flex:none}li .label{flex:none}li .group{color:var(--jps-muted, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, .6)));font-size:.85em;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}li .keys{margin-left:auto;display:flex;gap:4px;flex:none}li.selected{background:var(--jps-selected, var(--mat-sys-secondary-container, rgba(0, 0, 0, .06)))}li.empty{cursor:default;color:var(--jps-muted, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, .6)));justify-content:center}kbd{display:inline-block;min-width:1.4em;padding:1px 6px;border:1px solid var(--jps-line, var(--mat-sys-outline-variant, rgba(0, 0, 0, .12)));border-bottom-width:2px;border-radius:4px;font:500 .75rem/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-align:center;color:var(--jps-muted, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, .6)))}.hint{flex:none}\n"] }]
428
+ }], propDecorators: { list: [{ type: i0.ViewChild, args: ['list', { isSignal: true }] }] } });
429
+
140
430
  /**
141
431
  * Structural type guard used by the shell to detect {@link SearchablePage}.
142
432
  *
@@ -280,7 +570,7 @@ class DarkModeComponent {
280
570
  this.name = this.names.get(mode) ?? "";
281
571
  }
282
572
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DarkModeComponent, deps: [{ token: LayoutService }], target: i0.ɵɵFactoryTarget.Component }); }
283
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: DarkModeComponent, isStandalone: false, selector: "juice-dark-mode", ngImport: i0, template: "<button mat-icon-button (click)=\"toggleDarkMode()\" matTooltip=\"{{ name | translate }}\" matTooltipPosition=\"left\"><mat-icon>{{icon}}</mat-icon></button>", dependencies: [{ kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
573
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: DarkModeComponent, isStandalone: false, selector: "juice-dark-mode", ngImport: i0, template: "<button mat-icon-button (click)=\"toggleDarkMode()\" matTooltip=\"{{ name | translate }}\" matTooltipPosition=\"left\"><mat-icon>{{icon}}</mat-icon></button>", dependencies: [{ kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
284
574
  }
285
575
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: DarkModeComponent, decorators: [{
286
576
  type: Component,
@@ -413,37 +703,112 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
413
703
  args: ['mouseleave']
414
704
  }] } });
415
705
 
706
+ /** A page and the pages under it (`/alerts` and `/alerts/42`), whatever the query string. */
707
+ const Section = { paths: 'subset', queryParams: 'ignored', fragment: 'ignored', matrixParams: 'ignored' };
708
+ const Exact = { paths: 'exact', queryParams: 'ignored', fragment: 'ignored', matrixParams: 'ignored' };
709
+ /**
710
+ * A menu item with children: a header that opens and closes them. The group opens itself whenever a navigation lands
711
+ * on one of its pages (also one kept out of the menu, `inMenu: false`), even if it was closed by hand. A header with a
712
+ * page of its own opens that page too; one without (`routerLink: ''`) only opens and closes.
713
+ */
416
714
  class ExpandableMenuComponent {
417
- constructor(router) {
418
- this.router = router;
715
+ set item(value) {
716
+ this._item = value;
717
+ this.children = value?.menuChildren?.() ?? [];
718
+ this.update();
719
+ }
720
+ get item() { return this._item; }
721
+ constructor() {
722
+ this.router = inject(Router);
723
+ this.cdr = inject(ChangeDetectorRef);
724
+ this.panel = viewChild(MatExpansionPanel, /* @ts-ignore */
725
+ ...(ngDevMode ? [{ debugName: "panel" }] : /* istanbul ignore next */ []));
726
+ this._item = {};
419
727
  this.isExpanded = false;
420
- this.item = {};
421
728
  this.TooltipPosition = TooltipPosition;
729
+ /** The children the side menu shows. */
730
+ this.children = [];
731
+ /** Whether a page of the group (its own, or any child's, or one under them) is on display. */
732
+ this.open = false;
733
+ /** Whether to highlight the header: it has a page of its own and that page is on display. */
734
+ this.headerActive = false;
735
+ /** The header's own page, or null: a header without one (or linking to a child's page) only opens and closes. */
736
+ this.headerLink = null;
737
+ let path = this.path();
738
+ const navigations = this.router.events.pipe(filter(e => e instanceof NavigationEnd)).subscribe(() => {
739
+ this.update();
740
+ // Arriving on one of its pages opens the group, also after it was closed by hand on an earlier one; staying on
741
+ // the same page (a filter writing the query string) leaves it as the user left it.
742
+ const now = this.path();
743
+ if (this.open && now !== path)
744
+ this.panel()?.open();
745
+ path = now;
746
+ this.cdr.markForCheck();
747
+ });
748
+ inject(DestroyRef).onDestroy(() => navigations.unsubscribe());
749
+ }
750
+ update() {
751
+ const item = this._item;
752
+ const all = item?.children ?? [];
753
+ const links = all.map(c => c.routerLink).filter(l => !!l);
754
+ this.headerLink = item?.hasOwnPage?.() ? item.routerLink : null;
755
+ this.headerActive = this.isActive(this.headerLink, Exact);
756
+ // The header's own page opens the group with the pages under it, unless it is the home page or the tenant's root.
757
+ const headerSection = !!this.headerLink && !isRoot(item.rawRouterLink);
758
+ this.open = this.headerActive || (headerSection && this.isActive(this.headerLink, Section))
759
+ || all.some(c => this.isActive(c.routerLink, this.matching(c.routerLink, links)));
760
+ }
761
+ /** The URL's path, without query string or fragment. */
762
+ path() {
763
+ return this.router.url.replace(/[?#].*$/, '');
764
+ }
765
+ /**
766
+ * How a child's link matches: with the pages under it, unless other pages of the group sit under it too (a link to
767
+ * `/` or to the tenant's root), which would make it match every page.
768
+ */
769
+ matching(link, links) {
770
+ const path = link.replace(/[?#].*$/, '').replace(/\/+$/, '');
771
+ if (!path)
772
+ return Exact;
773
+ return links.some(other => other !== link && other.startsWith(path + '/')) ? Exact : Section;
422
774
  }
423
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ExpandableMenuComponent, deps: [{ token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component }); }
424
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ExpandableMenuComponent, isStandalone: false, selector: "juice-expandable-menu", inputs: { isExpanded: "isExpanded", item: "item" }, ngImport: i0, template: "<mat-expansion-panel [expanded]=\"item.routerLink ? router.isActive(item.routerLink, false) : false\" [hideToggle]=\"!isExpanded\" [ngClass]=\"(item.routerLink && router.isActive(item.routerLink, false)) ? 'active' : ''\">\n <mat-expansion-panel-header >\n <mat-list-item routerLink=\"{{ item.routerLink }}\" [routerLinkActive]=\"['active']\"\n [routerLinkActiveOptions]=\"{exact: true}\">\n <mat-icon matListItemIcon>{{ item.icon }}</mat-icon>\n @if (isExpanded) {\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ item.label }}</span>\n }\n </mat-list-item>\n </mat-expansion-panel-header>\n <mat-nav-list>\n @for ( subitem of item.children ; track subitem) {\n <mat-list-item routerLink=\"{{ subitem.routerLink }}\" [routerLinkActive]=\"['active']\"\n [routerLinkActiveOptions]=\"{exact: true}\">\n <mat-icon matListItemIcon>{{ subitem.icon }}</mat-icon>\n @if (isExpanded) {\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ subitem.label }}</span>\n }\n </mat-list-item>\n }\n </mat-nav-list>\n</mat-expansion-panel>\n", styles: [":host ::ng-deep .mat-expansion-panel-header{padding:0}:host ::ng-deep .mat-expansion-panel-header .mdc-list-item{padding:0}:host ::ng-deep .mat-expansion-panel-header .mat-expansion-indicator{position:absolute;right:0;padding:16px}:host ::ng-deep .mat-expansion-panel-body{padding:0}:host ::ng-deep .mat-content.mat-content-hide-toggle{margin-right:0}\n"], dependencies: [{ kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: i1$2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$1.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i4$1.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "component", type: i6.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i6.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i6.MatListItemIcon, selector: "[matListItemIcon]" }, { kind: "directive", type: i6.MatListItemTitle, selector: "[matListItemTitle]" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
775
+ isActive(link, options) {
776
+ return !!link && this.router.isActive(this.router.parseUrl(link), options);
777
+ }
778
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ExpandableMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
779
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: ExpandableMenuComponent, isStandalone: false, selector: "juice-expandable-menu", inputs: { isExpanded: "isExpanded", item: "item" }, host: { properties: { "class.menu-expanded": "isExpanded" } }, viewQueries: [{ propertyName: "panel", first: true, predicate: MatExpansionPanel, descendants: true, isSignal: true }], ngImport: i0, template: "<mat-expansion-panel [expanded]=\"open\" [hideToggle]=\"!isExpanded\" [class.active]=\"open\">\n <mat-expansion-panel-header>\n <mat-list-item [routerLink]=\"headerLink\" [class.active]=\"headerActive\">\n <mat-icon matListItemIcon color=\"accent\">{{ item.icon }}</mat-icon>\n @if (isExpanded) {\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ item.label }}</span>\n }\n </mat-list-item>\n </mat-expansion-panel-header>\n <mat-nav-list>\n @for (subitem of children; track subitem) {\n <mat-list-item routerLink=\"{{ subitem.routerLink }}\" [routerLinkActive]=\"['active']\"\n [routerLinkActiveOptions]=\"{exact: true}\">\n <mat-icon matListItemIcon color=\"accent\">{{ subitem.icon }}</mat-icon>\n @if (isExpanded) {\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ subitem.label }}</span>\n }\n </mat-list-item>\n }\n </mat-nav-list>\n</mat-expansion-panel>\n", styles: [":host ::ng-deep .mat-expansion-panel,:host ::ng-deep .mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:none;background:transparent;border-radius:0;color:inherit}:host ::ng-deep .mat-expansion-panel.mat-expanded,:host ::ng-deep .mat-expansion-panel-spacing{margin:0}:host ::ng-deep .mat-expansion-panel-header{padding:0;background:transparent}:host ::ng-deep .mat-expansion-panel-header .mdc-list-item{padding:0}:host ::ng-deep .mat-expansion-panel-header .mat-expansion-indicator{position:absolute;right:0;padding:16px}:host ::ng-deep .mat-expansion-panel-body{padding:0}:host ::ng-deep .mat-content.mat-content-hide-toggle{margin-right:0}:host.menu-expanded ::ng-deep .mat-expansion-panel-body .mat-mdc-list-item{padding-left:32px}\n"], dependencies: [{ kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: i3$1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$2.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i3$2.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "component", type: i7.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i7.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i7.MatListItemIcon, selector: "[matListItemIcon]" }, { kind: "directive", type: i7.MatListItemTitle, selector: "[matListItemTitle]" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
425
780
  }
426
781
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ExpandableMenuComponent, decorators: [{
427
782
  type: Component,
428
- args: [{ selector: 'juice-expandable-menu', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<mat-expansion-panel [expanded]=\"item.routerLink ? router.isActive(item.routerLink, false) : false\" [hideToggle]=\"!isExpanded\" [ngClass]=\"(item.routerLink && router.isActive(item.routerLink, false)) ? 'active' : ''\">\n <mat-expansion-panel-header >\n <mat-list-item routerLink=\"{{ item.routerLink }}\" [routerLinkActive]=\"['active']\"\n [routerLinkActiveOptions]=\"{exact: true}\">\n <mat-icon matListItemIcon>{{ item.icon }}</mat-icon>\n @if (isExpanded) {\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ item.label }}</span>\n }\n </mat-list-item>\n </mat-expansion-panel-header>\n <mat-nav-list>\n @for ( subitem of item.children ; track subitem) {\n <mat-list-item routerLink=\"{{ subitem.routerLink }}\" [routerLinkActive]=\"['active']\"\n [routerLinkActiveOptions]=\"{exact: true}\">\n <mat-icon matListItemIcon>{{ subitem.icon }}</mat-icon>\n @if (isExpanded) {\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ subitem.label }}</span>\n }\n </mat-list-item>\n }\n </mat-nav-list>\n</mat-expansion-panel>\n", styles: [":host ::ng-deep .mat-expansion-panel-header{padding:0}:host ::ng-deep .mat-expansion-panel-header .mdc-list-item{padding:0}:host ::ng-deep .mat-expansion-panel-header .mat-expansion-indicator{position:absolute;right:0;padding:16px}:host ::ng-deep .mat-expansion-panel-body{padding:0}:host ::ng-deep .mat-content.mat-content-hide-toggle{margin-right:0}\n"] }]
429
- }], ctorParameters: () => [{ type: i1$2.Router }], propDecorators: { isExpanded: [{
783
+ args: [{ selector: 'juice-expandable-menu', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, host: { '[class.menu-expanded]': 'isExpanded' }, template: "<mat-expansion-panel [expanded]=\"open\" [hideToggle]=\"!isExpanded\" [class.active]=\"open\">\n <mat-expansion-panel-header>\n <mat-list-item [routerLink]=\"headerLink\" [class.active]=\"headerActive\">\n <mat-icon matListItemIcon color=\"accent\">{{ item.icon }}</mat-icon>\n @if (isExpanded) {\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ item.label }}</span>\n }\n </mat-list-item>\n </mat-expansion-panel-header>\n <mat-nav-list>\n @for (subitem of children; track subitem) {\n <mat-list-item routerLink=\"{{ subitem.routerLink }}\" [routerLinkActive]=\"['active']\"\n [routerLinkActiveOptions]=\"{exact: true}\">\n <mat-icon matListItemIcon color=\"accent\">{{ subitem.icon }}</mat-icon>\n @if (isExpanded) {\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ subitem.label }}</span>\n }\n </mat-list-item>\n }\n </mat-nav-list>\n</mat-expansion-panel>\n", styles: [":host ::ng-deep .mat-expansion-panel,:host ::ng-deep .mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:none;background:transparent;border-radius:0;color:inherit}:host ::ng-deep .mat-expansion-panel.mat-expanded,:host ::ng-deep .mat-expansion-panel-spacing{margin:0}:host ::ng-deep .mat-expansion-panel-header{padding:0;background:transparent}:host ::ng-deep .mat-expansion-panel-header .mdc-list-item{padding:0}:host ::ng-deep .mat-expansion-panel-header .mat-expansion-indicator{position:absolute;right:0;padding:16px}:host ::ng-deep .mat-expansion-panel-body{padding:0}:host ::ng-deep .mat-content.mat-content-hide-toggle{margin-right:0}:host.menu-expanded ::ng-deep .mat-expansion-panel-body .mat-mdc-list-item{padding-left:32px}\n"] }]
784
+ }], ctorParameters: () => [], propDecorators: { panel: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatExpansionPanel), { isSignal: true }] }], isExpanded: [{
430
785
  type: Input
431
786
  }], item: [{
432
787
  type: Input
433
788
  }] } });
789
+ /** A link as written that names the home page or the tenant's root: `''`, `/`, `:tenant`. */
790
+ function isRoot(rawLink) {
791
+ const path = (rawLink ?? '').replace(/[?#].*$/, '').replace(/^\/+|\/+$/g, '');
792
+ return path === '' || path === ':tenant';
793
+ }
434
794
 
435
795
  class NavMenuComponent {
436
- constructor(service, layout, tenantService, route, breakpointObserver, cdr) {
796
+ constructor(service, layout, tenantService, route, breakpointObserver, cdr, switcher) {
437
797
  this.service = service;
438
798
  this.layout = layout;
439
799
  this.tenantService = tenantService;
440
800
  this.route = route;
441
801
  this.breakpointObserver = breakpointObserver;
442
802
  this.cdr = cdr;
803
+ this.switcher = switcher;
443
804
  this.isExpanded = false;
444
805
  this.isMobile = false;
445
806
  this.items = [];
807
+ /** The items the side menu shows: all but those marked `inMenu: false` (the page switcher still offers them). */
808
+ this.menuItems = [];
446
809
  this.TooltipPosition = TooltipPosition;
810
+ /** The items that show as a group: they have pages the side menu shows. */
811
+ this.groups = new Set();
447
812
  if (route.snapshot.data['settingUrl']) {
448
813
  this.settingUrl = route.snapshot.data['settingUrl'];
449
814
  }
@@ -466,6 +831,11 @@ class NavMenuComponent {
466
831
  this.service.getMenu().subscribe(items => {
467
832
  console.debug('Menu items', JSON.parse(JSON.stringify(items)));
468
833
  this.items = items;
834
+ // A group shows while it has pages to show; one whose pages are all kept out shows as its own page, if it has one.
835
+ this.groups = new Set(items.filter(i => i.menuChildren().length > 0));
836
+ this.menuItems = items.filter(i => i.inMenu !== false && (this.groups.has(i) || i.hasOwnPage()));
837
+ // The switcher offers the same items: one load, renewed whenever the shell (and this menu) is built again.
838
+ this.switcher.setItems(items);
469
839
  this.cdr.markForCheck();
470
840
  });
471
841
  }
@@ -483,13 +853,13 @@ class NavMenuComponent {
483
853
  this.isExpanded = this.layout.isMenuOpen();
484
854
  }
485
855
  }
486
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NavMenuComponent, deps: [{ token: i1.MenuService }, { token: LayoutService }, { token: i1.TenantService }, { token: i1$2.ActivatedRoute }, { token: i4$2.BreakpointObserver }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
487
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NavMenuComponent, isStandalone: false, selector: "juice-nav-menu", ngImport: i0, template: "<mat-nav-list class=\"menu-scroll\" (mouseenter)=\"mouseEnter()\" (mouseleave)=\"mouseLeave()\">\n @for (item of items; track item) {\n @if (!item.children || item.children.length==0) {\n <mat-list-item\n routerLink=\"{{ item.routerLink }}\" [routerLinkActive]=\"['active']\"\n [routerLinkActiveOptions]=\"{exact:true}\">\n <mat-icon matListItemIcon color=\"accent\">{{ item.icon }}</mat-icon>\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ item.label }}</span>\n </mat-list-item>\n }\n @if (item.children && item.children.length>0) {\n <juice-expandable-menu\n [item]=\"item\" [isExpanded]=\"isExpanded\"></juice-expandable-menu>\n }\n }\n</mat-nav-list>\n<mat-divider></mat-divider>\n<mat-action-list class=\"list-horizontal bottom-menu\">\n @if (settingUrl) {\n <a mat-list-item [href]=\"settingUrl\"\n matTooltip=\"{{'Settings' | translate}}\" matTooltipPosition=\"right\" [matTooltipDisabled]=\"isExpanded\">\n <mat-icon>settings</mat-icon>\n </a>\n }\n @if (!isMobile) {\n <button mat-list-item (click)=\"toggle()\">\n <mat-icon [style.transform]= \"isExpanded ? 'rotate(-180deg)':'rotate(0)'\">double_arrow</mat-icon>\n </button>\n }\n</mat-action-list>", styles: [":host ::ng-deep{display:flex;flex-direction:column;justify-content:space-between;height:100%}:host ::ng-deep .menu-scroll{overflow-y:auto;overflow-x:hidden;flex:1}:host ::ng-deep .menu-scroll .mdc-list-item.mdc-list-item--with-one-line .mdc-list-item__start{margin-right:10px}:host ::ng-deep .list-horizontal{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-end}:host ::ng-deep .list-horizontal .mat-mdc-list-item{width:auto;flex:1 auto}:host ::ng-deep .list-horizontal .mat-mdc-list-item .mdc-list-item__content{display:flex;justify-content:center}:host ::ng-deep .list-horizontal .mat-mdc-list-item .mdc-list-item__content .mat-mdc-list-item-unscoped-content{padding-top:5px}:host ::ng-deep .mat-mdc-list-base{padding:0}\n"], dependencies: [{ kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: i1$2.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatActionList, selector: "mat-action-list", exportAs: ["matActionList"] }, { kind: "component", type: i6.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i6.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i6.MatListItemIcon, selector: "[matListItemIcon]" }, { kind: "component", type: i6.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i6.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: ExpandableMenuComponent, selector: "juice-expandable-menu", inputs: ["isExpanded", "item"] }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
856
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NavMenuComponent, deps: [{ token: i1.MenuService }, { token: LayoutService }, { token: i1.TenantService }, { token: i3$1.ActivatedRoute }, { token: i4$1.BreakpointObserver }, { token: i0.ChangeDetectorRef }, { token: PageSwitcherService }], target: i0.ɵɵFactoryTarget.Component }); }
857
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NavMenuComponent, isStandalone: false, selector: "juice-nav-menu", ngImport: i0, template: "<mat-nav-list class=\"menu-scroll\" (mouseenter)=\"mouseEnter()\" (mouseleave)=\"mouseLeave()\">\n @for (item of menuItems; track item) {\n @if (!groups.has(item)) {\n <mat-list-item\n routerLink=\"{{ item.routerLink }}\" [routerLinkActive]=\"['active']\"\n [routerLinkActiveOptions]=\"{exact:true}\">\n <mat-icon matListItemIcon color=\"accent\">{{ item.icon }}</mat-icon>\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ item.label }}</span>\n </mat-list-item>\n } @else {\n <juice-expandable-menu\n [item]=\"item\" [isExpanded]=\"isExpanded\"></juice-expandable-menu>\n }\n }\n</mat-nav-list>\n<mat-divider></mat-divider>\n<mat-action-list class=\"list-horizontal bottom-menu\">\n @if (settingUrl) {\n <a mat-list-item [href]=\"settingUrl\"\n matTooltip=\"{{'Settings' | translate}}\" matTooltipPosition=\"right\" [matTooltipDisabled]=\"isExpanded\">\n <mat-icon>settings</mat-icon>\n </a>\n }\n @if (!isMobile) {\n <button mat-list-item (click)=\"toggle()\">\n <mat-icon [style.transform]= \"isExpanded ? 'rotate(-180deg)':'rotate(0)'\">double_arrow</mat-icon>\n </button>\n }\n</mat-action-list>", styles: [":host ::ng-deep{display:flex;flex-direction:column;justify-content:space-between;height:100%}:host ::ng-deep .menu-scroll{overflow-y:auto;overflow-x:hidden;flex:1}:host ::ng-deep .menu-scroll .mdc-list-item.mdc-list-item--with-one-line .mdc-list-item__start{margin-right:10px}:host ::ng-deep .list-horizontal{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-end}:host ::ng-deep .list-horizontal .mat-mdc-list-item{width:auto;flex:1 auto}:host ::ng-deep .list-horizontal .mat-mdc-list-item .mdc-list-item__content{display:flex;justify-content:center}:host ::ng-deep .list-horizontal .mat-mdc-list-item .mdc-list-item__content .mat-mdc-list-item-unscoped-content{padding-top:5px}:host ::ng-deep .mat-mdc-list-base{padding:0}\n"], dependencies: [{ kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: i3$1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i7.MatActionList, selector: "mat-action-list", exportAs: ["matActionList"] }, { kind: "component", type: i7.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i7.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i7.MatListItemIcon, selector: "[matListItemIcon]" }, { kind: "component", type: i7.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i7.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: ExpandableMenuComponent, selector: "juice-expandable-menu", inputs: ["isExpanded", "item"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
488
858
  }
489
859
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NavMenuComponent, decorators: [{
490
860
  type: Component,
491
- args: [{ selector: 'juice-nav-menu', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<mat-nav-list class=\"menu-scroll\" (mouseenter)=\"mouseEnter()\" (mouseleave)=\"mouseLeave()\">\n @for (item of items; track item) {\n @if (!item.children || item.children.length==0) {\n <mat-list-item\n routerLink=\"{{ item.routerLink }}\" [routerLinkActive]=\"['active']\"\n [routerLinkActiveOptions]=\"{exact:true}\">\n <mat-icon matListItemIcon color=\"accent\">{{ item.icon }}</mat-icon>\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ item.label }}</span>\n </mat-list-item>\n }\n @if (item.children && item.children.length>0) {\n <juice-expandable-menu\n [item]=\"item\" [isExpanded]=\"isExpanded\"></juice-expandable-menu>\n }\n }\n</mat-nav-list>\n<mat-divider></mat-divider>\n<mat-action-list class=\"list-horizontal bottom-menu\">\n @if (settingUrl) {\n <a mat-list-item [href]=\"settingUrl\"\n matTooltip=\"{{'Settings' | translate}}\" matTooltipPosition=\"right\" [matTooltipDisabled]=\"isExpanded\">\n <mat-icon>settings</mat-icon>\n </a>\n }\n @if (!isMobile) {\n <button mat-list-item (click)=\"toggle()\">\n <mat-icon [style.transform]= \"isExpanded ? 'rotate(-180deg)':'rotate(0)'\">double_arrow</mat-icon>\n </button>\n }\n</mat-action-list>", styles: [":host ::ng-deep{display:flex;flex-direction:column;justify-content:space-between;height:100%}:host ::ng-deep .menu-scroll{overflow-y:auto;overflow-x:hidden;flex:1}:host ::ng-deep .menu-scroll .mdc-list-item.mdc-list-item--with-one-line .mdc-list-item__start{margin-right:10px}:host ::ng-deep .list-horizontal{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-end}:host ::ng-deep .list-horizontal .mat-mdc-list-item{width:auto;flex:1 auto}:host ::ng-deep .list-horizontal .mat-mdc-list-item .mdc-list-item__content{display:flex;justify-content:center}:host ::ng-deep .list-horizontal .mat-mdc-list-item .mdc-list-item__content .mat-mdc-list-item-unscoped-content{padding-top:5px}:host ::ng-deep .mat-mdc-list-base{padding:0}\n"] }]
492
- }], ctorParameters: () => [{ type: i1.MenuService }, { type: LayoutService }, { type: i1.TenantService }, { type: i1$2.ActivatedRoute }, { type: i4$2.BreakpointObserver }, { type: i0.ChangeDetectorRef }] });
861
+ args: [{ selector: 'juice-nav-menu', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<mat-nav-list class=\"menu-scroll\" (mouseenter)=\"mouseEnter()\" (mouseleave)=\"mouseLeave()\">\n @for (item of menuItems; track item) {\n @if (!groups.has(item)) {\n <mat-list-item\n routerLink=\"{{ item.routerLink }}\" [routerLinkActive]=\"['active']\"\n [routerLinkActiveOptions]=\"{exact:true}\">\n <mat-icon matListItemIcon color=\"accent\">{{ item.icon }}</mat-icon>\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ item.label }}</span>\n </mat-list-item>\n } @else {\n <juice-expandable-menu\n [item]=\"item\" [isExpanded]=\"isExpanded\"></juice-expandable-menu>\n }\n }\n</mat-nav-list>\n<mat-divider></mat-divider>\n<mat-action-list class=\"list-horizontal bottom-menu\">\n @if (settingUrl) {\n <a mat-list-item [href]=\"settingUrl\"\n matTooltip=\"{{'Settings' | translate}}\" matTooltipPosition=\"right\" [matTooltipDisabled]=\"isExpanded\">\n <mat-icon>settings</mat-icon>\n </a>\n }\n @if (!isMobile) {\n <button mat-list-item (click)=\"toggle()\">\n <mat-icon [style.transform]= \"isExpanded ? 'rotate(-180deg)':'rotate(0)'\">double_arrow</mat-icon>\n </button>\n }\n</mat-action-list>", styles: [":host ::ng-deep{display:flex;flex-direction:column;justify-content:space-between;height:100%}:host ::ng-deep .menu-scroll{overflow-y:auto;overflow-x:hidden;flex:1}:host ::ng-deep .menu-scroll .mdc-list-item.mdc-list-item--with-one-line .mdc-list-item__start{margin-right:10px}:host ::ng-deep .list-horizontal{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-end}:host ::ng-deep .list-horizontal .mat-mdc-list-item{width:auto;flex:1 auto}:host ::ng-deep .list-horizontal .mat-mdc-list-item .mdc-list-item__content{display:flex;justify-content:center}:host ::ng-deep .list-horizontal .mat-mdc-list-item .mdc-list-item__content .mat-mdc-list-item-unscoped-content{padding-top:5px}:host ::ng-deep .mat-mdc-list-base{padding:0}\n"] }]
862
+ }], ctorParameters: () => [{ type: i1.MenuService }, { type: LayoutService }, { type: i1.TenantService }, { type: i3$1.ActivatedRoute }, { type: i4$1.BreakpointObserver }, { type: i0.ChangeDetectorRef }, { type: PageSwitcherService }] });
493
863
 
494
864
  /**
495
865
  * The shell's single search box. Mounted once by the toolbar and shared by every page,
@@ -674,23 +1044,26 @@ class UserProfileComponent {
674
1044
  hasValidToken() {
675
1045
  return this.oauthService.hasValidAccessToken();
676
1046
  }
677
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UserProfileComponent, deps: [{ token: ProfileDialogService, optional: true }, { token: LayoutService }, { token: i3$1.OAuthService }, { token: i1$2.Router }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
678
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: UserProfileComponent, isStandalone: false, selector: "juice-user-profile", host: { properties: { "class.anonymous": "this.anonymous" } }, ngImport: i0, template: "@if (authenticated) {\n <button class=\"user-image\" (click)=\"onClick()\">\n @if (imageUrl && !imageFailed) {\n <img [src]=\"imageUrl\" (error)=\"onImageError()\"/>\n } @else if (initials) {\n <span class=\"user-image-initials\">{{ initials }}</span>\n } @else {\n <mat-icon class=\"user-image-fallback\">account_circle</mat-icon>\n }\n </button>\n} @else {\n <button mat-button class=\"login-button\" (click)=\"login()\">\n <mat-icon>login</mat-icon>\n {{ 'Login' | translate }}\n </button>\n}\n", styles: [":host{height:100%;aspect-ratio:1/1;display:flex;padding:3px;box-sizing:border-box}:host(.anonymous){aspect-ratio:auto;align-items:center}.user-image{flex:1 auto;border:0;padding:0;background:none;container-type:size}.user-image img{width:100%;height:100%;border-radius:50%;object-fit:cover;cursor:pointer}.user-image .user-image-fallback{width:100%;height:100%;font-size:100cqh;line-height:1;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center}.user-image .user-image-initials{width:100%;height:100%;font-size:42cqh;font-weight:600;line-height:1;text-transform:uppercase;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;color:currentColor;background:#0000001f}\n"], dependencies: [{ kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
1047
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UserProfileComponent, deps: [{ token: ProfileDialogService, optional: true }, { token: LayoutService }, { token: i3$3.OAuthService }, { token: i3$1.Router }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
1048
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: UserProfileComponent, isStandalone: false, selector: "juice-user-profile", host: { properties: { "class.anonymous": "this.anonymous" } }, ngImport: i0, template: "@if (authenticated) {\n <button class=\"user-image\" (click)=\"onClick()\">\n @if (imageUrl && !imageFailed) {\n <img [src]=\"imageUrl\" (error)=\"onImageError()\"/>\n } @else if (initials) {\n <span class=\"user-image-initials\">{{ initials }}</span>\n } @else {\n <mat-icon class=\"user-image-fallback\">account_circle</mat-icon>\n }\n </button>\n} @else {\n <button mat-button class=\"login-button\" (click)=\"login()\">\n <mat-icon>login</mat-icon>\n {{ 'Login' | translate }}\n </button>\n}\n", styles: [":host{height:100%;aspect-ratio:1/1;display:flex;padding:3px;box-sizing:border-box}:host(.anonymous){aspect-ratio:auto;align-items:center}.user-image{flex:1 auto;border:0;padding:0;background:none;container-type:size}.user-image img{width:100%;height:100%;border-radius:50%;object-fit:cover;cursor:pointer}.user-image .user-image-fallback{width:100%;height:100%;font-size:100cqh;line-height:1;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center}.user-image .user-image-initials{width:100%;height:100%;font-size:42cqh;font-weight:600;line-height:1;text-transform:uppercase;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;color:currentColor;background:#0000001f}\n"], dependencies: [{ kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
679
1049
  }
680
1050
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UserProfileComponent, decorators: [{
681
1051
  type: Component,
682
1052
  args: [{ selector: 'juice-user-profile', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "@if (authenticated) {\n <button class=\"user-image\" (click)=\"onClick()\">\n @if (imageUrl && !imageFailed) {\n <img [src]=\"imageUrl\" (error)=\"onImageError()\"/>\n } @else if (initials) {\n <span class=\"user-image-initials\">{{ initials }}</span>\n } @else {\n <mat-icon class=\"user-image-fallback\">account_circle</mat-icon>\n }\n </button>\n} @else {\n <button mat-button class=\"login-button\" (click)=\"login()\">\n <mat-icon>login</mat-icon>\n {{ 'Login' | translate }}\n </button>\n}\n", styles: [":host{height:100%;aspect-ratio:1/1;display:flex;padding:3px;box-sizing:border-box}:host(.anonymous){aspect-ratio:auto;align-items:center}.user-image{flex:1 auto;border:0;padding:0;background:none;container-type:size}.user-image img{width:100%;height:100%;border-radius:50%;object-fit:cover;cursor:pointer}.user-image .user-image-fallback{width:100%;height:100%;font-size:100cqh;line-height:1;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center}.user-image .user-image-initials{width:100%;height:100%;font-size:42cqh;font-weight:600;line-height:1;text-transform:uppercase;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;color:currentColor;background:#0000001f}\n"] }]
683
1053
  }], ctorParameters: () => [{ type: ProfileDialogService, decorators: [{
684
1054
  type: Optional
685
- }] }, { type: LayoutService }, { type: i3$1.OAuthService }, { type: i1$2.Router }, { type: i0.ChangeDetectorRef }], propDecorators: { anonymous: [{
1055
+ }] }, { type: LayoutService }, { type: i3$3.OAuthService }, { type: i3$1.Router }, { type: i0.ChangeDetectorRef }], propDecorators: { anonymous: [{
686
1056
  type: HostBinding,
687
1057
  args: ['class.anonymous']
688
1058
  }] } });
689
1059
 
690
1060
  class PageComponent {
691
- constructor(service, search, breakpointObserver, cdr) {
1061
+ constructor(service, search,
1062
+ /** The page switcher: its keys are live while the shell is, and the shell shows it (see the constructor). */
1063
+ switcher, breakpointObserver, cdr) {
692
1064
  this.service = service;
693
1065
  this.search = search;
1066
+ this.switcher = switcher;
694
1067
  this.breakpointObserver = breakpointObserver;
695
1068
  /** The app's own toolbar items ({@link LAYOUT_TOOLBAR_ITEMS}). */
696
1069
  this.toolbarItems = inject(LAYOUT_TOOLBAR_ITEMS, { optional: true }) ?? [];
@@ -704,6 +1077,52 @@ class PageComponent {
704
1077
  this.isSnavOpenned = !this.isMobile;
705
1078
  cdr.markForCheck();
706
1079
  });
1080
+ this.hostPageSwitcher();
1081
+ }
1082
+ /**
1083
+ * Shows the page switcher in a dialog while it is open (the dialog brings the focus trap, Escape, the backdrop and
1084
+ * gives focus back), and its keys while the shell is on screen.
1085
+ */
1086
+ hostPageSwitcher() {
1087
+ const dialog = inject(MatDialog);
1088
+ /** The dialog on display; `closing` once the switcher closed it (not Escape or the backdrop). */
1089
+ let current = null;
1090
+ const show = () => {
1091
+ const shown = {
1092
+ ref: dialog.open(PageSwitcherComponent, {
1093
+ panelClass: 'juice-page-switcher-panel',
1094
+ width: '560px',
1095
+ maxWidth: 'calc(100vw - 32px)',
1096
+ position: { top: '12vh' },
1097
+ autoFocus: 'first-tabbable',
1098
+ restoreFocus: true,
1099
+ // Gone at once: no closing dialog left to take the keys meant for the next one (Ctrl+K again, Escape).
1100
+ exitAnimationDuration: 0,
1101
+ ariaLabel: 'Go to page',
1102
+ }),
1103
+ closing: false,
1104
+ };
1105
+ current = shown;
1106
+ shown.ref.afterClosed().subscribe(() => {
1107
+ if (current !== shown)
1108
+ return; // a newer one is on display
1109
+ current = null;
1110
+ if (!shown.closing)
1111
+ this.switcher.close(); // Escape or the backdrop
1112
+ });
1113
+ };
1114
+ inject(DestroyRef).onDestroy(this.switcher.attach());
1115
+ effect(() => {
1116
+ const open = this.switcher.isOpen();
1117
+ if (open && (!current || current.closing)) {
1118
+ untracked(show); // only isOpen drives this effect // also while the last one is still closing: at once
1119
+ }
1120
+ else if (!open && current && !current.closing) {
1121
+ current.closing = true;
1122
+ const closing = current.ref;
1123
+ untracked(() => closing.close());
1124
+ }
1125
+ });
707
1126
  }
708
1127
  hideSidenavOnMobile() {
709
1128
  if (this.isMobile) {
@@ -730,8 +1149,8 @@ class PageComponent {
730
1149
  onPageDeactivate() {
731
1150
  this.search.unbindPage();
732
1151
  }
733
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PageComponent, deps: [{ token: LayoutService }, { token: SearchService }, { token: i4$2.BreakpointObserver }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
734
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: PageComponent, isStandalone: false, selector: "app-page", ngImport: i0, template: "<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * Delete the template below * * * * * * * * * * -->\n<!-- * * * * * * * to get started with your project! * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<div class=\"container\" [class.mobile]=\"isMobile\">\n <!-- Toolbar -->\n <mat-toolbar color=\"primary\" [style.height]=\"toolbarHeight()\">\n @if (isMobile) {\n <button mat-icon-button (click)=\"toggleSidenav()\" class=\"m-r\">\n <mat-icon aria-hidden=\"false\" fontIcon=\"menu\"></mat-icon>\n </button>\n }\n @if (!isMobile) {\n <a [routerLink]=\"['/',service.tenantIdentifier]\" class=\"nav-link home\">\n <img height=\"40 \" alt=\"{{service.brandName()}} Logo \" [src]=\"service.brandLogo() \" class=\"p-r \" />\n </a>\n }\n @if (!isMobile) {\n <span>{{service.brandName()}}</span>\n }\n <juice-search-bar></juice-search-bar>\n <span class=\"toolbar-spacer \"></span>\n @for (item of toolbarItems; track $index) {\n <ng-container *ngComponentOutlet=\"item\"></ng-container>\n }\n <juice-dark-mode></juice-dark-mode>\n <juice-user-profile></juice-user-profile>\n </mat-toolbar>\n\n <mat-sidenav-container>\n <mat-sidenav [opened]=\"isSnavOpenned\" (closed)=\"isSnavOpenned = false\" #snav\n (navigate)=\"hideSidenavOnMobile\" (click)=\"hideSidenavOnMobile\" (swipeRight)=\"hideSidenavOnMobile\"\n [mode]=\"isMobile ? 'over': 'side' \"\n [@menuTransition]=\" menu.isExpanded ? 'expand' : 'collapsed' \" [fixedInViewport]=\"true\"\n [style.top]=\"isMobile ? toolbarHeight():0\">\n <juice-nav-menu #menu [class.menu-expanded]=\"isSnavOpenned\"\n [class.menu-collapsed]=\"!isSnavOpenned\"></juice-nav-menu>\n </mat-sidenav>\n\n <mat-sidenav-content style=\"margin-left: 0;\">\n <router-outlet (activate)=\"onPageActivate($event)\" (deactivate)=\"onPageDeactivate()\"></router-outlet>\n </mat-sidenav-content>\n\n </mat-sidenav-container>\n</div>\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content above * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * End of Placeholder * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->", styles: [":host .toolbar-spacer{flex:1 1 auto}:host .nav-link{display:flex;margin-right:.5em}:host .mat-sidenav-container{display:flex;flex-direction:row}:host .mat-sidenav-container .mat-drawer-side{position:relative;flex:0 auto}:host .mat-sidenav-container .mat-drawer-over{position:fixed}:host .mat-sidenav-container .mat-sidenav-content{flex:1;height:auto}:host .container{display:flex;flex-direction:column}:host .container .mat-toolbar{flex:0 0 auto}:host .container .mat-sidenav-container{flex:1 1 auto;display:flex;flex-direction:row}\n"], dependencies: [{ kind: "directive", type: i1$2.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: i1$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i7.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i8.MatSidenav, selector: "mat-sidenav", inputs: ["fixedInViewport", "fixedTopGap", "fixedBottomGap"], exportAs: ["matSidenav"] }, { kind: "component", type: i8.MatSidenavContainer, selector: "mat-sidenav-container", exportAs: ["matSidenavContainer"] }, { kind: "component", type: i8.MatSidenavContent, selector: "mat-sidenav-content" }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: DarkModeComponent, selector: "juice-dark-mode" }, { kind: "component", type: NavMenuComponent, selector: "juice-nav-menu" }, { kind: "component", type: SearchBarComponent, selector: "juice-search-bar" }, { kind: "component", type: UserProfileComponent, selector: "juice-user-profile" }], animations: [
1152
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PageComponent, deps: [{ token: LayoutService }, { token: SearchService }, { token: PageSwitcherService }, { token: i4$1.BreakpointObserver }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
1153
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: PageComponent, isStandalone: false, selector: "app-page", ngImport: i0, template: "<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * Delete the template below * * * * * * * * * * -->\n<!-- * * * * * * * to get started with your project! * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<div class=\"container\" [class.mobile]=\"isMobile\">\n <!-- Toolbar -->\n <mat-toolbar color=\"primary\" [style.height]=\"toolbarHeight()\">\n @if (isMobile) {\n <button mat-icon-button (click)=\"toggleSidenav()\" class=\"m-r\">\n <mat-icon aria-hidden=\"false\" fontIcon=\"menu\"></mat-icon>\n </button>\n }\n @if (!isMobile) {\n <a [routerLink]=\"['/',service.tenantIdentifier]\" class=\"nav-link home\">\n <img height=\"40 \" alt=\"{{service.brandName()}} Logo \" [src]=\"service.brandLogo() \" class=\"p-r \" />\n </a>\n }\n @if (!isMobile) {\n <span>{{service.brandName()}}</span>\n }\n <juice-search-bar></juice-search-bar>\n <span class=\"toolbar-spacer \"></span>\n @if (switcher.isEnabled) {\n <button mat-icon-button (click)=\"switcher.open()\" data-testid=\"page-switcher-open\"\n matTooltip=\"{{ 'Go to page' | translate }} (Ctrl+K)\" [attr.aria-label]=\"'Go to page' | translate\">\n <mat-icon>manage_search</mat-icon>\n </button>\n }\n @for (item of toolbarItems; track $index) {\n <ng-container *ngComponentOutlet=\"item\"></ng-container>\n }\n <juice-dark-mode></juice-dark-mode>\n <juice-user-profile></juice-user-profile>\n </mat-toolbar>\n\n <mat-sidenav-container>\n <mat-sidenav [opened]=\"isSnavOpenned\" (closed)=\"isSnavOpenned = false\" #snav\n (navigate)=\"hideSidenavOnMobile\" (click)=\"hideSidenavOnMobile\" (swipeRight)=\"hideSidenavOnMobile\"\n [mode]=\"isMobile ? 'over': 'side' \"\n [@menuTransition]=\" menu.isExpanded ? 'expand' : 'collapsed' \" [fixedInViewport]=\"true\"\n [style.top]=\"isMobile ? toolbarHeight():0\">\n <juice-nav-menu #menu [class.menu-expanded]=\"isSnavOpenned\"\n [class.menu-collapsed]=\"!isSnavOpenned\"></juice-nav-menu>\n </mat-sidenav>\n\n <mat-sidenav-content style=\"margin-left: 0;\">\n <router-outlet (activate)=\"onPageActivate($event)\" (deactivate)=\"onPageDeactivate()\"></router-outlet>\n </mat-sidenav-content>\n\n </mat-sidenav-container>\n</div>\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content above * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * End of Placeholder * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->", styles: [":host .toolbar-spacer{flex:1 1 auto}:host .nav-link{display:flex;margin-right:.5em}:host .mat-sidenav-container{display:flex;flex-direction:row}:host .mat-sidenav-container .mat-drawer-side{position:relative;flex:0 auto}:host .mat-sidenav-container .mat-drawer-over{position:fixed}:host .mat-sidenav-container .mat-sidenav-content{flex:1;height:auto}:host .container{display:flex;flex-direction:column}:host .container .mat-toolbar{flex:0 0 auto}:host .container .mat-sidenav-container{flex:1 1 auto;display:flex;flex-direction:row}\n"], dependencies: [{ kind: "directive", type: i3$1.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: i1$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i8.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i9.MatSidenav, selector: "mat-sidenav", inputs: ["fixedInViewport", "fixedTopGap", "fixedBottomGap"], exportAs: ["matSidenav"] }, { kind: "component", type: i9.MatSidenavContainer, selector: "mat-sidenav-container", exportAs: ["matSidenavContainer"] }, { kind: "component", type: i9.MatSidenavContent, selector: "mat-sidenav-content" }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: DarkModeComponent, selector: "juice-dark-mode" }, { kind: "component", type: NavMenuComponent, selector: "juice-nav-menu" }, { kind: "component", type: SearchBarComponent, selector: "juice-search-bar" }, { kind: "component", type: UserProfileComponent, selector: "juice-user-profile" }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }], animations: [
735
1154
  trigger('menuTransition', [
736
1155
  state('expand', style({
737
1156
  width: '220px'
@@ -799,12 +1218,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
799
1218
  animate('0.15s')
800
1219
  ])
801
1220
  ])
802
- ], changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * Delete the template below * * * * * * * * * * -->\n<!-- * * * * * * * to get started with your project! * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<div class=\"container\" [class.mobile]=\"isMobile\">\n <!-- Toolbar -->\n <mat-toolbar color=\"primary\" [style.height]=\"toolbarHeight()\">\n @if (isMobile) {\n <button mat-icon-button (click)=\"toggleSidenav()\" class=\"m-r\">\n <mat-icon aria-hidden=\"false\" fontIcon=\"menu\"></mat-icon>\n </button>\n }\n @if (!isMobile) {\n <a [routerLink]=\"['/',service.tenantIdentifier]\" class=\"nav-link home\">\n <img height=\"40 \" alt=\"{{service.brandName()}} Logo \" [src]=\"service.brandLogo() \" class=\"p-r \" />\n </a>\n }\n @if (!isMobile) {\n <span>{{service.brandName()}}</span>\n }\n <juice-search-bar></juice-search-bar>\n <span class=\"toolbar-spacer \"></span>\n @for (item of toolbarItems; track $index) {\n <ng-container *ngComponentOutlet=\"item\"></ng-container>\n }\n <juice-dark-mode></juice-dark-mode>\n <juice-user-profile></juice-user-profile>\n </mat-toolbar>\n\n <mat-sidenav-container>\n <mat-sidenav [opened]=\"isSnavOpenned\" (closed)=\"isSnavOpenned = false\" #snav\n (navigate)=\"hideSidenavOnMobile\" (click)=\"hideSidenavOnMobile\" (swipeRight)=\"hideSidenavOnMobile\"\n [mode]=\"isMobile ? 'over': 'side' \"\n [@menuTransition]=\" menu.isExpanded ? 'expand' : 'collapsed' \" [fixedInViewport]=\"true\"\n [style.top]=\"isMobile ? toolbarHeight():0\">\n <juice-nav-menu #menu [class.menu-expanded]=\"isSnavOpenned\"\n [class.menu-collapsed]=\"!isSnavOpenned\"></juice-nav-menu>\n </mat-sidenav>\n\n <mat-sidenav-content style=\"margin-left: 0;\">\n <router-outlet (activate)=\"onPageActivate($event)\" (deactivate)=\"onPageDeactivate()\"></router-outlet>\n </mat-sidenav-content>\n\n </mat-sidenav-container>\n</div>\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content above * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * End of Placeholder * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->", styles: [":host .toolbar-spacer{flex:1 1 auto}:host .nav-link{display:flex;margin-right:.5em}:host .mat-sidenav-container{display:flex;flex-direction:row}:host .mat-sidenav-container .mat-drawer-side{position:relative;flex:0 auto}:host .mat-sidenav-container .mat-drawer-over{position:fixed}:host .mat-sidenav-container .mat-sidenav-content{flex:1;height:auto}:host .container{display:flex;flex-direction:column}:host .container .mat-toolbar{flex:0 0 auto}:host .container .mat-sidenav-container{flex:1 1 auto;display:flex;flex-direction:row}\n"] }]
803
- }], ctorParameters: () => [{ type: LayoutService }, { type: SearchService }, { type: i4$2.BreakpointObserver }, { type: i0.ChangeDetectorRef }] });
1221
+ ], changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * Delete the template below * * * * * * * * * * -->\n<!-- * * * * * * * to get started with your project! * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<div class=\"container\" [class.mobile]=\"isMobile\">\n <!-- Toolbar -->\n <mat-toolbar color=\"primary\" [style.height]=\"toolbarHeight()\">\n @if (isMobile) {\n <button mat-icon-button (click)=\"toggleSidenav()\" class=\"m-r\">\n <mat-icon aria-hidden=\"false\" fontIcon=\"menu\"></mat-icon>\n </button>\n }\n @if (!isMobile) {\n <a [routerLink]=\"['/',service.tenantIdentifier]\" class=\"nav-link home\">\n <img height=\"40 \" alt=\"{{service.brandName()}} Logo \" [src]=\"service.brandLogo() \" class=\"p-r \" />\n </a>\n }\n @if (!isMobile) {\n <span>{{service.brandName()}}</span>\n }\n <juice-search-bar></juice-search-bar>\n <span class=\"toolbar-spacer \"></span>\n @if (switcher.isEnabled) {\n <button mat-icon-button (click)=\"switcher.open()\" data-testid=\"page-switcher-open\"\n matTooltip=\"{{ 'Go to page' | translate }} (Ctrl+K)\" [attr.aria-label]=\"'Go to page' | translate\">\n <mat-icon>manage_search</mat-icon>\n </button>\n }\n @for (item of toolbarItems; track $index) {\n <ng-container *ngComponentOutlet=\"item\"></ng-container>\n }\n <juice-dark-mode></juice-dark-mode>\n <juice-user-profile></juice-user-profile>\n </mat-toolbar>\n\n <mat-sidenav-container>\n <mat-sidenav [opened]=\"isSnavOpenned\" (closed)=\"isSnavOpenned = false\" #snav\n (navigate)=\"hideSidenavOnMobile\" (click)=\"hideSidenavOnMobile\" (swipeRight)=\"hideSidenavOnMobile\"\n [mode]=\"isMobile ? 'over': 'side' \"\n [@menuTransition]=\" menu.isExpanded ? 'expand' : 'collapsed' \" [fixedInViewport]=\"true\"\n [style.top]=\"isMobile ? toolbarHeight():0\">\n <juice-nav-menu #menu [class.menu-expanded]=\"isSnavOpenned\"\n [class.menu-collapsed]=\"!isSnavOpenned\"></juice-nav-menu>\n </mat-sidenav>\n\n <mat-sidenav-content style=\"margin-left: 0;\">\n <router-outlet (activate)=\"onPageActivate($event)\" (deactivate)=\"onPageDeactivate()\"></router-outlet>\n </mat-sidenav-content>\n\n </mat-sidenav-container>\n</div>\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content above * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * End of Placeholder * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->", styles: [":host .toolbar-spacer{flex:1 1 auto}:host .nav-link{display:flex;margin-right:.5em}:host .mat-sidenav-container{display:flex;flex-direction:row}:host .mat-sidenav-container .mat-drawer-side{position:relative;flex:0 auto}:host .mat-sidenav-container .mat-drawer-over{position:fixed}:host .mat-sidenav-container .mat-sidenav-content{flex:1;height:auto}:host .container{display:flex;flex-direction:column}:host .container .mat-toolbar{flex:0 0 auto}:host .container .mat-sidenav-container{flex:1 1 auto;display:flex;flex-direction:row}\n"] }]
1222
+ }], ctorParameters: () => [{ type: LayoutService }, { type: SearchService }, { type: PageSwitcherService }, { type: i4$1.BreakpointObserver }, { type: i0.ChangeDetectorRef }] });
804
1223
 
805
1224
  class PageNotfoundComponent {
806
1225
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PageNotfoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
807
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: PageNotfoundComponent, isStandalone: false, selector: "juice-page-notfound", ngImport: i0, template: "<div class=\"container pt-4\">\n <h1>{{'Not found' | translate }}</h1>\n <p>{{ 'Your requested resource could not be found' | translate}}</p>\n </div>\n ", styles: [""], dependencies: [{ kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
1226
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: PageNotfoundComponent, isStandalone: false, selector: "juice-page-notfound", ngImport: i0, template: "<div class=\"container pt-4\">\n <h1>{{'Not found' | translate }}</h1>\n <p>{{ 'Your requested resource could not be found' | translate}}</p>\n </div>\n ", styles: [""], dependencies: [{ kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
808
1227
  }
809
1228
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PageNotfoundComponent, decorators: [{
810
1229
  type: Component,
@@ -837,7 +1256,8 @@ class LayoutModule {
837
1256
  ExpandableMenuComponent,
838
1257
  PageNotfoundComponent,
839
1258
  SearchBarComponent,
840
- UserProfileComponent], imports: [i1$2.RouterModule, CommonModule,
1259
+ UserProfileComponent,
1260
+ PageSwitcherComponent], imports: [i3$1.RouterModule, CommonModule,
841
1261
  TranslatePipe,
842
1262
  TranslateDirective,
843
1263
  MatIconModule,
@@ -848,7 +1268,8 @@ class LayoutModule {
848
1268
  MatListModule,
849
1269
  MatFormFieldModule,
850
1270
  MatInputModule,
851
- MatTooltipModule], exports: [PageComponent,
1271
+ MatTooltipModule,
1272
+ MatDialogModule], exports: [PageComponent,
852
1273
  RouterModule] }); }
853
1274
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LayoutModule, imports: [RouterModule.forChild(routes),
854
1275
  CommonModule,
@@ -860,7 +1281,8 @@ class LayoutModule {
860
1281
  MatListModule,
861
1282
  MatFormFieldModule,
862
1283
  MatInputModule,
863
- MatTooltipModule, RouterModule] }); }
1284
+ MatTooltipModule,
1285
+ MatDialogModule, RouterModule] }); }
864
1286
  }
865
1287
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LayoutModule, decorators: [{
866
1288
  type: NgModule,
@@ -873,6 +1295,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
873
1295
  PageNotfoundComponent,
874
1296
  SearchBarComponent,
875
1297
  UserProfileComponent,
1298
+ PageSwitcherComponent,
876
1299
  ],
877
1300
  imports: [
878
1301
  RouterModule.forChild(routes),
@@ -887,7 +1310,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
887
1310
  MatListModule,
888
1311
  MatFormFieldModule,
889
1312
  MatInputModule,
890
- MatTooltipModule
1313
+ MatTooltipModule,
1314
+ MatDialogModule
891
1315
  ],
892
1316
  exports: [
893
1317
  PageComponent,
@@ -985,13 +1409,13 @@ class UserProfileDialogComponent {
985
1409
  this.auth.logOut();
986
1410
  });
987
1411
  }
988
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UserProfileDialogComponent, deps: [{ token: i3$1.OAuthService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
989
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: UserProfileDialogComponent, isStandalone: false, selector: "app-user-profile", ngImport: i0, template: "@if (loggedin) {\n <h3 mat-dialog-title>{{name}}</h3>\n}\n<div mat-dialog-content>\n @if (loggedin) {\n <div>\n @if (name) {\n <p>{{'Welcome' | translate}} {{name}}</p>\n }\n @if (email) {\n <p>{{ 'Email' | translate}}: {{email}}</p>\n }\n <!-- Logout -->\n </div>\n }\n @if (!loggedin) {\n <div>\n <p>{{ 'Please login to view your profile' | translate}}</p>\n </div>\n }\n</div>\n<div mat-dialog-actions>\n @if (loggedin) {\n <button mat-raised-button color=\"primary\" (click)=\"logout()\">{{ 'Logout' | translate}}</button>\n }\n <button mat-button mat-dialog-close cdkFocusInitial>{{ 'Close' | translate}}</button>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i2$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i2$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i2$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i2$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i3.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
1412
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UserProfileDialogComponent, deps: [{ token: i3$3.OAuthService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
1413
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: UserProfileDialogComponent, isStandalone: false, selector: "app-user-profile", ngImport: i0, template: "@if (loggedin) {\n <h3 mat-dialog-title>{{name}}</h3>\n}\n<div mat-dialog-content>\n @if (loggedin) {\n <div>\n @if (name) {\n <p>{{'Welcome' | translate}} {{name}}</p>\n }\n @if (email) {\n <p>{{ 'Email' | translate}}: {{email}}</p>\n }\n <!-- Logout -->\n </div>\n }\n @if (!loggedin) {\n <div>\n <p>{{ 'Please login to view your profile' | translate}}</p>\n </div>\n }\n</div>\n<div mat-dialog-actions>\n @if (loggedin) {\n <button mat-raised-button color=\"primary\" (click)=\"logout()\">{{ 'Logout' | translate}}</button>\n }\n <button mat-button mat-dialog-close cdkFocusInitial>{{ 'Close' | translate}}</button>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i2$2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i2$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i2$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i2$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i3.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
990
1414
  }
991
1415
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UserProfileDialogComponent, decorators: [{
992
1416
  type: Component,
993
1417
  args: [{ selector: 'app-user-profile', changeDetection: ChangeDetectionStrategy.Eager, standalone: false, template: "@if (loggedin) {\n <h3 mat-dialog-title>{{name}}</h3>\n}\n<div mat-dialog-content>\n @if (loggedin) {\n <div>\n @if (name) {\n <p>{{'Welcome' | translate}} {{name}}</p>\n }\n @if (email) {\n <p>{{ 'Email' | translate}}: {{email}}</p>\n }\n <!-- Logout -->\n </div>\n }\n @if (!loggedin) {\n <div>\n <p>{{ 'Please login to view your profile' | translate}}</p>\n </div>\n }\n</div>\n<div mat-dialog-actions>\n @if (loggedin) {\n <button mat-raised-button color=\"primary\" (click)=\"logout()\">{{ 'Logout' | translate}}</button>\n }\n <button mat-button mat-dialog-close cdkFocusInitial>{{ 'Close' | translate}}</button>\n</div>" }]
994
- }], ctorParameters: () => [{ type: i3$1.OAuthService }, { type: i0.ChangeDetectorRef }] });
1418
+ }], ctorParameters: () => [{ type: i3$3.OAuthService }, { type: i0.ChangeDetectorRef }] });
995
1419
 
996
1420
  class UserProfileDialogService extends ProfileDialogService {
997
1421
  constructor(matDialog) {
@@ -1000,12 +1424,12 @@ class UserProfileDialogService extends ProfileDialogService {
1000
1424
  async open(data) {
1001
1425
  return this.matDialog.open(UserProfileDialogComponent, { position: { top: '50px', right: '10px' } });
1002
1426
  }
1003
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UserProfileDialogService, deps: [{ token: i2$1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable }); }
1427
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UserProfileDialogService, deps: [{ token: i2$2.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable }); }
1004
1428
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UserProfileDialogService }); }
1005
1429
  }
1006
1430
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UserProfileDialogService, decorators: [{
1007
1431
  type: Injectable
1008
- }], ctorParameters: () => [{ type: i2$1.MatDialog }] });
1432
+ }], ctorParameters: () => [{ type: i2$2.MatDialog }] });
1009
1433
 
1010
1434
  class UserProfileDialogModule {
1011
1435
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UserProfileDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -1054,5 +1478,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
1054
1478
  * Generated bundle index. Do not edit.
1055
1479
  */
1056
1480
 
1057
- export { DevGuard, ExpandableMenuComponent, LAYOUT_TOOLBAR_ITEMS, LayoutModule, LayoutService, NavMenuComponent, PageComponent, PageNotfoundComponent, ProfileDialogService, SearchService, TooltipDirective, TooltipModule, TooltipPosition, UserProfileDialogModule, isSearchablePage };
1481
+ export { DevGuard, ExpandableMenuComponent, LAYOUT_TOOLBAR_ITEMS, LayoutModule, LayoutService, NavMenuComponent, PageComponent, PageNotfoundComponent, PageSwitcherComponent, PageSwitcherService, ProfileDialogService, SearchService, TooltipDirective, TooltipModule, TooltipPosition, UserProfileDialogModule, flatten, isSearchablePage };
1058
1482
  //# sourceMappingURL=juice-js-layout.mjs.map