@sdcorejs/angular 20.3.0 → 20.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/README.md +2 -2
  2. package/assets/STYLE-GUIDE.md +25 -5
  3. package/assets/THEME.md +237 -5
  4. package/assets/licenses/tiptap-oss-NOTICES.txt +332 -0
  5. package/assets/scss/ckeditor5.scss +2 -88
  6. package/assets/scss/core/_control.scss +39 -0
  7. package/assets/scss/core/form.scss +156 -45
  8. package/assets/scss/core/view.scss +24 -0
  9. package/assets/scss/editor-content.scss +173 -0
  10. package/assets/scss/sd-core.scss +1 -0
  11. package/assets/scss/themes/_component-tokens.scss +93 -31
  12. package/assets/scss/themes/_material-tokens.scss +112 -0
  13. package/assets/scss/themes/_presets.scss +25 -0
  14. package/assets/scss/themes/_scales.scss +10 -0
  15. package/assets/scss/themes/_semantic.scss +13 -0
  16. package/assets/scss/themes/default.scss +8 -2
  17. package/components/avatar/index.d.ts +67 -2
  18. package/components/badge/index.d.ts +188 -6
  19. package/components/button/index.d.ts +20 -1
  20. package/components/ckeditor-styles/index.d.ts +3 -18
  21. package/components/editor/index.d.ts +20 -17
  22. package/components/editor-engine/index.d.ts +246 -0
  23. package/components/file-explorer/index.d.ts +449 -57
  24. package/components/form-generic/index.d.ts +301 -37
  25. package/components/index.d.ts +2 -0
  26. package/components/kanban/index.d.ts +179 -0
  27. package/components/mini-editor/index.d.ts +33 -70
  28. package/components/modal-resizable/index.d.ts +1 -124
  29. package/components/operator/index.d.ts +137 -8
  30. package/components/section/index.d.ts +2 -1
  31. package/components/tab/index.d.ts +3 -1
  32. package/components/tab-router/index.d.ts +31 -18
  33. package/components/table/index.d.ts +84 -6
  34. package/components/window/index.d.ts +81 -0
  35. package/configurations/index.d.ts +8 -1
  36. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +5 -5
  37. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -1
  38. package/fesm2022/sdcorejs-angular-components-avatar.mjs +142 -11
  39. package/fesm2022/sdcorejs-angular-components-avatar.mjs.map +1 -1
  40. package/fesm2022/sdcorejs-angular-components-badge.mjs +548 -24
  41. package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
  42. package/fesm2022/sdcorejs-angular-components-button.mjs +33 -3
  43. package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
  44. package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs +5 -20
  45. package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs.map +1 -1
  46. package/fesm2022/sdcorejs-angular-components-data-state.mjs +1 -1
  47. package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
  48. package/fesm2022/sdcorejs-angular-components-editor-engine.mjs +1872 -0
  49. package/fesm2022/sdcorejs-angular-components-editor-engine.mjs.map +1 -0
  50. package/fesm2022/sdcorejs-angular-components-editor.mjs +457 -756
  51. package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
  52. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +2209 -106
  53. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -1
  54. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +2616 -1054
  55. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  56. package/fesm2022/sdcorejs-angular-components-history.mjs +5 -2
  57. package/fesm2022/sdcorejs-angular-components-history.mjs.map +1 -1
  58. package/fesm2022/sdcorejs-angular-components-image-editor.mjs +1 -1
  59. package/fesm2022/sdcorejs-angular-components-image-editor.mjs.map +1 -1
  60. package/fesm2022/sdcorejs-angular-components-import-excel.mjs +21 -6
  61. package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
  62. package/fesm2022/sdcorejs-angular-components-inform.mjs +1 -1
  63. package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
  64. package/fesm2022/sdcorejs-angular-components-kanban.mjs +451 -0
  65. package/fesm2022/sdcorejs-angular-components-kanban.mjs.map +1 -0
  66. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +177 -283
  67. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
  68. package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs +1 -308
  69. package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs.map +1 -1
  70. package/fesm2022/sdcorejs-angular-components-modal.mjs +2 -2
  71. package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
  72. package/fesm2022/sdcorejs-angular-components-operator.mjs +262 -43
  73. package/fesm2022/sdcorejs-angular-components-operator.mjs.map +1 -1
  74. package/fesm2022/sdcorejs-angular-components-query-bar.mjs +12 -12
  75. package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
  76. package/fesm2022/sdcorejs-angular-components-query-builder.mjs +1 -1
  77. package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
  78. package/fesm2022/sdcorejs-angular-components-section.mjs +5 -4
  79. package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
  80. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
  81. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  82. package/fesm2022/sdcorejs-angular-components-stepper.mjs +5 -1
  83. package/fesm2022/sdcorejs-angular-components-stepper.mjs.map +1 -1
  84. package/fesm2022/sdcorejs-angular-components-tab-router.mjs +192 -42
  85. package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
  86. package/fesm2022/sdcorejs-angular-components-tab.mjs +12 -4
  87. package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
  88. package/fesm2022/sdcorejs-angular-components-table.mjs +564 -110
  89. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  90. package/fesm2022/sdcorejs-angular-components-tree.mjs +1 -1
  91. package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
  92. package/fesm2022/sdcorejs-angular-components-upload-file.mjs +1 -1
  93. package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
  94. package/fesm2022/sdcorejs-angular-components-view.mjs +2 -2
  95. package/fesm2022/sdcorejs-angular-components-view.mjs.map +1 -1
  96. package/fesm2022/sdcorejs-angular-components-window.mjs +486 -0
  97. package/fesm2022/sdcorejs-angular-components-window.mjs.map +1 -0
  98. package/fesm2022/sdcorejs-angular-components.mjs +2 -0
  99. package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
  100. package/fesm2022/sdcorejs-angular-configurations.mjs.map +1 -1
  101. package/fesm2022/sdcorejs-angular-directives.mjs +18 -1
  102. package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
  103. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +15 -2
  104. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
  105. package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +2 -2
  106. package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
  107. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +460 -125
  108. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
  109. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +75 -13
  110. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  111. package/fesm2022/sdcorejs-angular-forms-date.mjs +71 -18
  112. package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
  113. package/fesm2022/sdcorejs-angular-forms-datetime.mjs +75 -16
  114. package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
  115. package/fesm2022/sdcorejs-angular-forms-directives.mjs +82 -2
  116. package/fesm2022/sdcorejs-angular-forms-directives.mjs.map +1 -1
  117. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +2 -2
  118. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
  119. package/fesm2022/sdcorejs-angular-forms-input-color.mjs +1 -1
  120. package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
  121. package/fesm2022/sdcorejs-angular-forms-input-number.mjs +40 -5
  122. package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
  123. package/fesm2022/sdcorejs-angular-forms-input.mjs +50 -7
  124. package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
  125. package/fesm2022/sdcorejs-angular-forms-models.mjs +88 -5
  126. package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
  127. package/fesm2022/sdcorejs-angular-forms-radio.mjs +2 -2
  128. package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
  129. package/fesm2022/sdcorejs-angular-forms-segmented.mjs +245 -0
  130. package/fesm2022/sdcorejs-angular-forms-segmented.mjs.map +1 -0
  131. package/fesm2022/sdcorejs-angular-forms-select.mjs +63 -15
  132. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  133. package/fesm2022/sdcorejs-angular-forms-switch.mjs +2 -2
  134. package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
  135. package/fesm2022/sdcorejs-angular-forms-textarea.mjs +2 -2
  136. package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
  137. package/fesm2022/sdcorejs-angular-forms-time.mjs +2 -2
  138. package/fesm2022/sdcorejs-angular-forms-time.mjs.map +1 -1
  139. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +1 -1
  140. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
  141. package/fesm2022/sdcorejs-angular-forms.mjs +8 -0
  142. package/fesm2022/sdcorejs-angular-forms.mjs.map +1 -1
  143. package/fesm2022/sdcorejs-angular-i18n.mjs +1830 -17
  144. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  145. package/fesm2022/sdcorejs-angular-interceptors.mjs +1 -1
  146. package/fesm2022/sdcorejs-angular-interceptors.mjs.map +1 -1
  147. package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-DnbDCdcz.mjs +478 -0
  148. package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-DnbDCdcz.mjs.map +1 -0
  149. package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-EBHM4kx2.mjs +214 -0
  150. package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-EBHM4kx2.mjs.map +1 -0
  151. package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-BtHe8YIW.mjs +277 -0
  152. package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-BtHe8YIW.mjs.map +1 -0
  153. package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-eFshU7ew.mjs +1556 -0
  154. package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-eFshU7ew.mjs.map +1 -0
  155. package/fesm2022/sdcorejs-angular-modules-generic.mjs +2 -0
  156. package/fesm2022/sdcorejs-angular-modules-generic.mjs.map +1 -0
  157. package/fesm2022/sdcorejs-angular-modules-icon.mjs +96 -3
  158. package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -1
  159. package/fesm2022/sdcorejs-angular-modules-layout.mjs +1825 -62
  160. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  161. package/fesm2022/sdcorejs-angular-modules.mjs +1 -0
  162. package/fesm2022/sdcorejs-angular-modules.mjs.map +1 -1
  163. package/fesm2022/sdcorejs-angular-pipes.mjs +27 -7
  164. package/fesm2022/sdcorejs-angular-pipes.mjs.map +1 -1
  165. package/fesm2022/sdcorejs-angular-services-confirm.mjs +2 -2
  166. package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
  167. package/fesm2022/sdcorejs-angular-services-date-time.mjs +143 -0
  168. package/fesm2022/sdcorejs-angular-services-date-time.mjs.map +1 -0
  169. package/fesm2022/sdcorejs-angular-services-storage.mjs +44 -8
  170. package/fesm2022/sdcorejs-angular-services-storage.mjs.map +1 -1
  171. package/fesm2022/sdcorejs-angular-services.mjs +1 -0
  172. package/fesm2022/sdcorejs-angular-services.mjs.map +1 -1
  173. package/fesm2022/sdcorejs-angular-utilities-read-state.mjs +4 -0
  174. package/fesm2022/sdcorejs-angular-utilities-read-state.mjs.map +1 -1
  175. package/fesm2022/sdcorejs-angular-utilities-theme.mjs +10 -0
  176. package/fesm2022/sdcorejs-angular-utilities-theme.mjs.map +1 -1
  177. package/forms/autocomplete/index.d.ts +5 -0
  178. package/forms/chip-calendar/index.d.ts +163 -18
  179. package/forms/date/index.d.ts +23 -2
  180. package/forms/date-range/index.d.ts +24 -2
  181. package/forms/directives/index.d.ts +47 -2
  182. package/forms/index.d.ts +8 -6
  183. package/forms/input/index.d.ts +23 -2
  184. package/forms/input-number/index.d.ts +23 -2
  185. package/forms/models/index.d.ts +38 -3
  186. package/forms/segmented/index.d.ts +90 -0
  187. package/forms/select/index.d.ts +32 -2
  188. package/i18n/index.d.ts +360 -1
  189. package/modules/generic/index.d.ts +316 -0
  190. package/modules/icon/index.d.ts +37 -6
  191. package/modules/index.d.ts +1 -0
  192. package/modules/layout/index.d.ts +536 -86
  193. package/package.json +49 -8
  194. package/pipes/index.d.ts +2 -0
  195. package/services/date-time/index.d.ts +57 -0
  196. package/services/index.d.ts +1 -0
  197. package/services/storage/index.d.ts +8 -1
  198. package/utilities/read-state/index.d.ts +2 -0
  199. package/utilities/theme/index.d.ts +1 -1
@@ -1,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, input, booleanAttribute, effect, Component, InjectionToken, Injectable, signal, computed, Pipe, DestroyRef, viewChild, output, isSignal, ChangeDetectionStrategy, untracked, model, NgModule } from '@angular/core';
2
+ import { inject, ElementRef, input, booleanAttribute, effect, Component, InjectionToken, Injectable, signal, computed, DestroyRef, isDevMode, Pipe, ViewContainerRef, viewChild, untracked, ChangeDetectionStrategy, output, isSignal, model, Injector, ChangeDetectorRef, NgModule } from '@angular/core';
3
3
  import * as i2 from '@angular/common';
4
- import { DOCUMENT, CommonModule, NgTemplateOutlet } from '@angular/common';
4
+ import { DOCUMENT, NgTemplateOutlet, CommonModule } from '@angular/common';
5
5
  import * as i1$3 from '@angular/router';
6
- import { Router, NavigationEnd, RouterModule, ActivatedRoute } from '@angular/router';
6
+ import { Router, NavigationEnd, RouterModule, NavigationSkipped, ActivatedRoute } from '@angular/router';
7
7
  import { __decorate } from 'tslib';
8
8
  import { SdAvatar, SdTabComponent, SdButton } from '@sdcorejs/angular/components';
9
9
  import { I18nService, I18N_STORAGE_KEY, I18N_MESSAGES, SdTranslatePipe } from '@sdcorejs/angular/i18n';
@@ -24,11 +24,13 @@ import { MatTooltipModule } from '@angular/material/tooltip';
24
24
  import * as i3 from '@angular/material/tree';
25
25
  import { MatTreeNestedDataSource, MatTreeModule } from '@angular/material/tree';
26
26
  import { SdSafeHtmlPipe } from '@sdcorejs/angular/pipes';
27
- import { SdIcon } from '@sdcorejs/angular/modules/icon';
27
+ import * as i1$2 from '@angular/cdk/a11y';
28
+ import { CdkTrapFocus, A11yModule } from '@angular/cdk/a11y';
29
+ import { Overlay, CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay';
30
+ import { TemplatePortal } from '@angular/cdk/portal';
31
+ import { SD_ICON_CONFIGURATION, SdIcon } from '@sdcorejs/angular/modules/icon';
28
32
  import { isObservable } from 'rxjs';
29
33
  import { SdInput } from '@sdcorejs/angular/forms';
30
- import * as i1$2 from '@angular/cdk/a11y';
31
- import { A11yModule } from '@angular/cdk/a11y';
32
34
 
33
35
  class SdPageComponent {
34
36
  el = inject(ElementRef);
@@ -70,6 +72,14 @@ function searchMenuLeaves(menus, query) {
70
72
  return leaves;
71
73
  return leaves.filter(menu => [menu.title, menu.tooltipTitle].some(value => value && StringUtilities.aliasIncludes(value, normalizedQuery)));
72
74
  }
75
+ /** Matches like `searchMenuLeaves` but leaves out `comingSoon` leaves and every leaf under a `comingSoon` group (sidebar V4 search). */
76
+ function searchAvailableMenuLeaves(menus, query) {
77
+ const leaves = collectAvailableMenuLeaves(menus, []);
78
+ const normalizedQuery = query?.trim();
79
+ if (!normalizedQuery)
80
+ return leaves;
81
+ return leaves.filter(menu => [menu.title, menu.tooltipTitle].some(value => value && StringUtilities.aliasIncludes(value, normalizedQuery)));
82
+ }
73
83
  function selectPrimaryMenuGroups(menus, requestedIds, maximum = 3) {
74
84
  const limit = Number.isFinite(maximum) && maximum > 0 ? Math.min(3, Math.floor(maximum)) : 3;
75
85
  const byId = new Map(menus.filter(menu => typeof menu.id === 'string').map(menu => [menu.id, menu]));
@@ -113,6 +123,70 @@ function flattenMenuLeaves(menus) {
113
123
  });
114
124
  return leaves;
115
125
  }
126
+ /**
127
+ * Groups top-level menus by `section` in order of first appearance (sidebar V4).
128
+ * An unsectioned menu joins only the immediately preceding output group when that group is unsectioned (`section: null`);
129
+ * otherwise it starts a new unsectioned group.
130
+ */
131
+ function groupMenusBySection(menus) {
132
+ const groups = [];
133
+ const groupBySection = new Map();
134
+ for (const menu of menus ?? []) {
135
+ if (!menu || typeof menu !== 'object')
136
+ continue;
137
+ const section = typeof menu.section === 'string' ? menu.section.trim() : '';
138
+ if (!section) {
139
+ // why: chỉ nối vào nhóm null nếu nó là nhóm cuối, để không gộp vượt qua một nhóm có section
140
+ const last = groups[groups.length - 1];
141
+ if (last?.section === null)
142
+ last.menus.push(menu);
143
+ else
144
+ groups.push({ section: null, menus: [menu] });
145
+ continue;
146
+ }
147
+ const group = groupBySection.get(section);
148
+ if (group) {
149
+ group.menus.push(menu);
150
+ continue;
151
+ }
152
+ const created = { section, menus: [menu] };
153
+ groupBySection.set(section, created);
154
+ groups.push(created);
155
+ }
156
+ return groups;
157
+ }
158
+ /** The one trailing element sidebar V4 renders, in the order `comingSoon`, `badge`, `status`; empty values are skipped. */
159
+ function resolveMenuTrailing(menu) {
160
+ if (!menu || typeof menu !== 'object')
161
+ return null;
162
+ if (menu.comingSoon === true)
163
+ return { kind: 'soon' };
164
+ const badge = menu.badge;
165
+ if (badge && hasBadgeValue(badge.value)) {
166
+ return badge.tone === 'warning' || badge.tone === 'error'
167
+ ? { kind: 'badge', value: badge.value, tone: badge.tone }
168
+ : { kind: 'count', value: badge.value };
169
+ }
170
+ const status = menu.status;
171
+ if (status && typeof status.label === 'string' && status.label.trim()) {
172
+ return { kind: 'status', label: status.label, tone: status.tone, live: status.live === true };
173
+ }
174
+ return null;
175
+ }
176
+ function hasBadgeValue(value) {
177
+ return typeof value === 'number' ? Number.isFinite(value) : typeof value === 'string' && !!value.trim();
178
+ }
179
+ function collectAvailableMenuLeaves(menus, leaves) {
180
+ for (const menu of menus ?? []) {
181
+ if (!menu || typeof menu !== 'object' || menu.comingSoon === true)
182
+ continue;
183
+ if ('path' in menu && typeof menu.path === 'string' && menu.path)
184
+ leaves.push(menu);
185
+ if ('children' in menu && Array.isArray(menu.children))
186
+ collectAvailableMenuLeaves(menu.children, leaves);
187
+ }
188
+ return leaves;
189
+ }
116
190
  function visitMenus(menus, ancestors, visitor) {
117
191
  for (const menu of menus ?? []) {
118
192
  if (!menu || typeof menu !== 'object')
@@ -135,7 +209,7 @@ function visitMenus(menus, ancestors, visitor) {
135
209
  *
136
210
  * ⚠️ `SdLayoutStorageService` là singleton `providedIn: 'root'`, thường được khởi tạo TRƯỚC khi biết
137
211
  * người dùng là ai. Vì vậy hãy cấp một **hàm** — nó được gọi lại ở mỗi lần truy cập handle, nên khi
138
- * danh tính đến (hoặc đổi) thì cả bảy handle tự dựng lại trên namespace mới:
212
+ * danh tính đến (hoặc đổi) thì cả tám handle tự dựng lại trên namespace mới:
139
213
  *
140
214
  * ```ts
141
215
  * providers: [
@@ -160,7 +234,7 @@ class SdLayoutStorageService {
160
234
  // nên nó chạy ở lần inject đầu tiên, thường TRƯỚC khi đăng nhập xong, và factory theo user trả về
161
235
  // `undefined` cho cả phiên; biện pháp "pinned/recent của A không lộ sang B" quảng cáo trong doc khi
162
236
  // đó không bao giờ có hiệu lực. Giải quyết bằng cách resolve LƯỜI ở mỗi lần truy cập handle: khi
163
- // danh tính đến (hoặc đổi user trong cùng phiên SPA) thì bảy handle được dựng lại trên namespace mới.
237
+ // danh tính đến (hoặc đổi user trong cùng phiên SPA) thì tám handle được dựng lại trên namespace mới.
164
238
  get isShowSidebar() {
165
239
  return this.#resolveHandles().isShowSidebar;
166
240
  }
@@ -182,6 +256,10 @@ class SdLayoutStorageService {
182
256
  get versionStates() {
183
257
  return this.#resolveHandles().versionStates;
184
258
  }
259
+ /** Snapshot context hiện tại (`{ id, title, subtitle?, avatar? }`), chỉ `SdLayoutContextService` đọc/ghi. */
260
+ get currentContext() {
261
+ return this.#resolveHandles().currentContext;
262
+ }
185
263
  /**
186
264
  * Xoá toàn bộ state layout đã persist.
187
265
  *
@@ -198,6 +276,13 @@ class SdLayoutStorageService {
198
276
  for (const handle of this.#allHandles(handles))
199
277
  handle.remove();
200
278
  }
279
+ /**
280
+ * Namespace mà các handle đang dùng tại lúc gọi (đã trim; rỗng/không cấu hình → `undefined`).
281
+ * So hai lần gọi để biết partition lưu trữ đã đổi (đăng nhập/đăng xuất trong SPA).
282
+ */
283
+ resolvedNamespace() {
284
+ return this.#resolveNamespace();
285
+ }
201
286
  // why: namespace rỗng/space phải quy về undefined, nếu không mỗi chuỗi rác lại tạo ra một không
202
287
  // gian lưu trữ khác và state của chính user đó biến mất sau khi reload.
203
288
  #resolveNamespace() {
@@ -233,6 +318,7 @@ class SdLayoutStorageService {
233
318
  pinnedMenuKeys: this.#sdStorageService.create('4bdc7f80-9ff4-4fe0-908f-6c9f7fe4100a', option),
234
319
  recentMenuKeys: this.#sdStorageService.create('fb989dc1-f6e7-4b62-a611-861a8f214a51', option),
235
320
  versionStates: this.#sdStorageService.create('ca8e4261-fbd4-4209-af88-2dbe278c1a1b', option),
321
+ currentContext: this.#sdStorageService.create('f628621f-7d5d-4f22-b40d-4cc5bf0fa7ae', option),
236
322
  };
237
323
  }
238
324
  #allHandles(handles) {
@@ -244,6 +330,7 @@ class SdLayoutStorageService {
244
330
  handles.pinnedMenuKeys,
245
331
  handles.recentMenuKeys,
246
332
  handles.versionStates,
333
+ handles.currentContext,
247
334
  ];
248
335
  }
249
336
  readPinnedMenuKeys(menus) {
@@ -277,6 +364,24 @@ class SdLayoutStorageService {
277
364
  this.versionStates.set({ ...states, [String(version)]: nextState });
278
365
  return nextState;
279
366
  }
367
+ /** Đọc snapshot context từ bộ nhớ; trả bản sao, hoặc `null` khi chưa có hay sai dạng (thiếu/rỗng `id`, `title`). */
368
+ readCurrentContext() {
369
+ return this.#parseContext(this.currentContext.get());
370
+ }
371
+ /** Lưu snapshot context, chỉ giữ `id`, `title`, `subtitle`, `avatar`; bỏ field tuỳ chọn đang `undefined`. */
372
+ writeCurrentContext(context) {
373
+ const { id, title, subtitle, avatar } = context;
374
+ this.currentContext.set({ id, title, ...(subtitle === undefined ? {} : { subtitle }), ...(avatar === undefined ? {} : { avatar }) });
375
+ }
376
+ /**
377
+ * Đọc lại snapshot context từ storage, bỏ qua entry trong bộ nhớ; kiểm dạng như `readCurrentContext()`.
378
+ *
379
+ * why: `set()` cập nhật bộ nhớ trước và không báo ghi lỗi, còn tab khác ghi thì entry trong bộ nhớ không
380
+ * đổi — chỉ `refresh()` mới cho biết giá trị thật sự đã lưu.
381
+ */
382
+ refreshCurrentContext() {
383
+ return this.#parseContext(this.currentContext.refresh());
384
+ }
280
385
  #getLegacyPinnedKeys() {
281
386
  const legacyGroup = this.pinnedMenuGroup.get();
282
387
  if (!legacyGroup || !Array.isArray(legacyGroup.children))
@@ -291,6 +396,23 @@ class SdLayoutStorageService {
291
396
  #sameKeys(left, right) {
292
397
  return left.length === right.length && left.every((key, index) => key === right[index]);
293
398
  }
399
+ // why: giá trị trong storage có thể do bản cũ, tab khác hoặc tay người sửa — không tin kiểu đã khai báo.
400
+ #parseContext(value) {
401
+ if (typeof value !== 'object' || value === null)
402
+ return null;
403
+ const { id, title, subtitle, avatar } = value;
404
+ if (!this.#isFilledString(id) || !this.#isFilledString(title))
405
+ return null;
406
+ return {
407
+ id,
408
+ title,
409
+ ...(typeof subtitle === 'string' ? { subtitle } : {}),
410
+ ...(typeof avatar === 'string' ? { avatar } : {}),
411
+ };
412
+ }
413
+ #isFilledString(value) {
414
+ return typeof value === 'string' && value.trim().length > 0;
415
+ }
294
416
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdLayoutStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
295
417
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdLayoutStorageService, providedIn: 'root' });
296
418
  }
@@ -319,6 +441,10 @@ function resolveSidebarV3Recent(sidebar) {
319
441
  maxItems,
320
442
  };
321
443
  }
444
+ function sanitizeSidebarV4BottomBar(bottomBar) {
445
+ const ids = Array.isArray(bottomBar) ? bottomBar.filter((id) => typeof id === 'string').map(id => id.trim()) : [];
446
+ return [...new Set(ids.filter(Boolean))].slice(0, 4);
447
+ }
322
448
  function normalizeSidebarConfiguration(sidebar) {
323
449
  if (sidebar.version === 2) {
324
450
  return {
@@ -334,6 +460,20 @@ function normalizeSidebarConfiguration(sidebar) {
334
460
  recent: resolveSidebarV3Recent(sidebar),
335
461
  };
336
462
  }
463
+ if (sidebar.version === 4) {
464
+ const { mobile } = sidebar;
465
+ return {
466
+ ...sidebar,
467
+ defaultCollapsed: sidebar.defaultCollapsed ?? false,
468
+ // why: V4 kế thừa `recent` của V3; dùng lại đúng resolver V3 mà không nới kiểu tham số public của nó.
469
+ recent: resolveSidebarV3Recent({ version: 3, recent: sidebar.recent }),
470
+ itemShape: sidebar.itemShape === 'soft' ? 'soft' : 'pill',
471
+ density: sidebar.density === 'comfortable' ? 'comfortable' : 'compact',
472
+ collapsedGroup: sidebar.collapsedGroup === 'expand' ? 'expand' : 'flyout',
473
+ // why: không có `bottomBar` thì giữ nguyên `mobile` (kể cả vắng mặt) — không tự tạo bottom bar rỗng.
474
+ ...(mobile?.bottomBar == null ? {} : { mobile: { ...mobile, bottomBar: sanitizeSidebarV4BottomBar(mobile.bottomBar) } }),
475
+ };
476
+ }
337
477
  return sidebar;
338
478
  }
339
479
  const SD_LAYOUT_CONFIGURATION = new InjectionToken('sd.layout.configuration');
@@ -506,6 +646,317 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
506
646
  }]
507
647
  }], ctorParameters: () => [] });
508
648
 
649
+ /** Session storage key of the per-tab reconcile marker (id of the last context reconcile reload target). */
650
+ const SD_LAYOUT_CONTEXT_MARKER_KEY = 'sd.layout.context.reconcile-marker';
651
+
652
+ /**
653
+ * Browser effects of the layout context feature: page reload, cross-tab `storage` events and the
654
+ * per-tab reconcile marker. Defaults to the document window; provide a fake `SdLayoutContextRuntime`
655
+ * in specs and demos so nothing reloads for real:
656
+ *
657
+ * ```ts
658
+ * providers: [{ provide: SD_LAYOUT_CONTEXT_RUNTIME, useValue: fakeRuntime }];
659
+ * ```
660
+ */
661
+ const SD_LAYOUT_CONTEXT_RUNTIME = new InjectionToken('sd.layout.context.runtime', {
662
+ providedIn: 'root',
663
+ factory: () => createSdLayoutContextBrowserRuntime(inject(DOCUMENT).defaultView),
664
+ });
665
+ /** Creates the default runtime over `view`; without a window every operation is a no-op. */
666
+ function createSdLayoutContextBrowserRuntime(view) {
667
+ if (!view) {
668
+ return {
669
+ reload: () => undefined,
670
+ onStorage: () => () => undefined,
671
+ readMarker: () => undefined,
672
+ writeMarker: () => false,
673
+ };
674
+ }
675
+ return {
676
+ reload: () => view.location.reload(),
677
+ onStorage: listener => {
678
+ const handler = (event) => {
679
+ // why: chỉ localStorage mới chứa snapshot. `localStorage.clear()` ở tab khác vẫn mang `storageArea`
680
+ // (chỉ `key` là null); `storageArea` null chỉ gặp ở sự kiện tự dựng — vẫn chuyển tiếp cho an toàn.
681
+ const area = event.storageArea;
682
+ if (area === null || (area !== undefined && area === readLocalStorage(view)))
683
+ listener();
684
+ };
685
+ view.addEventListener('storage', handler);
686
+ return () => view.removeEventListener('storage', handler);
687
+ },
688
+ readMarker: () => {
689
+ try {
690
+ const storage = view.sessionStorage;
691
+ return storage ? storage.getItem(SD_LAYOUT_CONTEXT_MARKER_KEY) : undefined;
692
+ }
693
+ catch {
694
+ return undefined;
695
+ }
696
+ },
697
+ writeMarker: value => {
698
+ try {
699
+ const storage = view.sessionStorage;
700
+ if (!storage)
701
+ return false;
702
+ if (value === null)
703
+ storage.removeItem(SD_LAYOUT_CONTEXT_MARKER_KEY);
704
+ else
705
+ storage.setItem(SD_LAYOUT_CONTEXT_MARKER_KEY, value);
706
+ // why: đọc lại để xác nhận — có trình duyệt nuốt lỗi ghi thay vì ném.
707
+ return storage.getItem(SD_LAYOUT_CONTEXT_MARKER_KEY) === value;
708
+ }
709
+ catch {
710
+ return false;
711
+ }
712
+ },
713
+ };
714
+ }
715
+ // why: truy cập `localStorage` có thể ném SecurityError khi trình duyệt chặn storage.
716
+ function readLocalStorage(view) {
717
+ try {
718
+ return view.localStorage ?? undefined;
719
+ }
720
+ catch {
721
+ return undefined;
722
+ }
723
+ }
724
+
725
+ /**
726
+ * Owns the current layout context (for example a store or a legal entity) and its persisted snapshot.
727
+ *
728
+ * The snapshot is captured once, when the service is first injected, so `SD_LAYOUT_STORAGE_NAMESPACE`
729
+ * must already resolve at that moment (see `sd-layout.md`). Switching reloads the page — there is no
730
+ * change event. Read the context during bootstrap:
731
+ *
732
+ * ```ts
733
+ * provideAppInitializer(() => {
734
+ * const context = inject(SdLayoutContextService).getCurrentContext();
735
+ * inject(ApiContextHeader).set(context?.id);
736
+ * });
737
+ * ```
738
+ *
739
+ * The service works without `SD_LAYOUT_CONFIGURATION`; the context switcher passes the configured items to
740
+ * `syncItems()`, which reconciles the snapshot. A reconcile reload happens at most once per target id
741
+ * while the per-tab marker holds that id.
742
+ */
743
+ class SdLayoutContextService {
744
+ #storage = inject(SdLayoutStorageService);
745
+ #runtime = inject(SD_LAYOUT_CONTEXT_RUNTIME);
746
+ #destroyRef = inject(DestroyRef);
747
+ // why: chụp một lần lúc khởi tạo (D-008) — id này quyết định có cần reload đối chiếu hay không,
748
+ // còn namespace lúc chụp giúp nhận ra partition lưu trữ đã đổi (đăng nhập/đăng xuất trong SPA).
749
+ #loadTimeId;
750
+ #capturedNamespace;
751
+ #stopListening;
752
+ // why: đã xin reload thì trang sắp tải lại — mọi lời gọi sau trong lần load này bỏ qua, tránh ghi đè
753
+ // đích đang chờ, reload lần hai hay cảnh báo marker giả.
754
+ #reloadRequested = false;
755
+ #markerWarned = false;
756
+ #current = signal(null, ...(ngDevMode ? [{ debugName: "#current" }] : []));
757
+ #items = signal([], ...(ngDevMode ? [{ debugName: "#items" }] : []));
758
+ #switchingId = signal(null, ...(ngDevMode ? [{ debugName: "#switchingId" }] : []));
759
+ #switchFailed = signal(false, ...(ngDevMode ? [{ debugName: "#switchFailed" }] : []));
760
+ #changedElsewhere = signal(false, ...(ngDevMode ? [{ debugName: "#changedElsewhere" }] : []));
761
+ /** Context of this page load; title, subtitle and avatar may refresh from the configured items. */
762
+ current = this.#current.asReadonly();
763
+ /** Valid items last passed to `syncItems()` (entries without `id`/`title` and duplicate ids are dropped). */
764
+ items = this.#items.asReadonly();
765
+ /** Id of the context being switched to, or `null`. */
766
+ switchingId = this.#switchingId.asReadonly();
767
+ /** `true` when the last switch could not be persisted (no reload happened). */
768
+ switchFailed = this.#switchFailed.asReadonly();
769
+ /** `true` when another tab switched the stored context; this tab keeps its context until reloaded. */
770
+ changedElsewhere = this.#changedElsewhere.asReadonly();
771
+ constructor() {
772
+ const snapshot = this.#storage.readCurrentContext();
773
+ this.#loadTimeId = snapshot?.id ?? null;
774
+ this.#capturedNamespace = this.#storage.resolvedNamespace();
775
+ this.#current.set(snapshot);
776
+ }
777
+ /** Returns a copy of the current context, or `null` before any context was stored. */
778
+ getCurrentContext() {
779
+ const current = this.#current();
780
+ return current ? { ...current } : null;
781
+ }
782
+ /**
783
+ * Switches to the item with `id`, then reloads the page once the snapshot is confirmed in storage.
784
+ * Ignored for the active id, before `syncItems()`, for ids that are not in `items` and once a reload
785
+ * was requested in this page load.
786
+ */
787
+ setCurrentContext(id) {
788
+ if (this.#reloadRequested || id === this.#current()?.id)
789
+ return;
790
+ const item = this.#items().find(entry => entry.id === id);
791
+ if (!item)
792
+ return;
793
+ this.#switchingId.set(id);
794
+ this.#switchFailed.set(false);
795
+ if (this.#persist(toSnapshot(item))) {
796
+ // why: ghi marker = đích để namespace resolve trễ không tốn thêm một reload đối chiếu ở lần load sau;
797
+ // ghi lỗi không chặn — người dùng chủ động chuyển nên vẫn reload.
798
+ this.#runtime.writeMarker(id);
799
+ this.#requestReload();
800
+ return;
801
+ }
802
+ this.#switchingId.set(null);
803
+ this.#switchFailed.set(true);
804
+ }
805
+ /**
806
+ * Reconciles the stored snapshot with the configured items: a valid id only refreshes its metadata;
807
+ * a missing or stale id falls back to `items[0]` and reloads, unless the per-tab marker already holds
808
+ * that target. Empty items store nothing. While the load-time context is still in `items`, a different
809
+ * stored id only raises `changedElsewhere` and a removed snapshot keeps the context in memory.
810
+ * Repeated calls with the same items neither write nor reload again.
811
+ */
812
+ syncItems(items) {
813
+ if (this.#reloadRequested)
814
+ return;
815
+ const validItems = normalizeItems(items);
816
+ this.#items.set(validItems);
817
+ // why: listener chỉ đăng ký ở lần gọi đầu (D-021) — app không cấu hình `context` không tạo listener.
818
+ this.#listenToStorage();
819
+ if (!validItems.length)
820
+ return;
821
+ const namespace = this.#storage.resolvedNamespace();
822
+ const namespaceChanged = namespace !== this.#capturedNamespace;
823
+ if (namespaceChanged)
824
+ this.#recapture(namespace);
825
+ const fresh = this.#storage.refreshCurrentContext();
826
+ const current = this.#current();
827
+ const currentItem = !namespaceChanged && current ? validItems.find(item => item.id === current.id) : undefined;
828
+ // why: INV-004/D-011/D-026 đứng trên D-025 bước 4 — context của lần load còn hợp lệ thì không bị thay:
829
+ // storage giữ id khác nghĩa là tab khác đã chuyển → chỉ báo; snapshot mất (clear() ở tab khác, hoặc
830
+ // lần chuyển ghi lỗi) → giữ context, chỉ làm mới metadata trong bộ nhớ. Không ghi, không marker, không reload.
831
+ if (currentItem && fresh?.id !== currentItem.id) {
832
+ if (fresh)
833
+ this.#changedElsewhere.set(true);
834
+ else
835
+ this.#current.set(toSnapshot(currentItem));
836
+ return;
837
+ }
838
+ const target = toSnapshot(validItems.find(item => item.id === fresh?.id) ?? validItems[0]);
839
+ if (!sameContext(target, fresh) && !this.#persist(target)) {
840
+ this.#current.set(target);
841
+ // @i18n-ignore
842
+ this.#warn('Could not persist the current context; it is kept in memory and the page is not reloaded.');
843
+ return;
844
+ }
845
+ this.#current.set(target);
846
+ if (target.id === this.#loadTimeId) {
847
+ this.#runtime.writeMarker(null);
848
+ return;
849
+ }
850
+ // why: marker phiên chặn vòng lặp reload khi namespace theo user resolve SAU getCurrentContext() —
851
+ // mỗi lần load đều thấy id lúc load khác đích; marker cho tối đa một reload đối chiếu mỗi id đích
852
+ // trong lúc nó còn giữ id đó (D-025).
853
+ const marker = this.#runtime.readMarker();
854
+ if (marker === undefined || marker === target.id || !this.#runtime.writeMarker(target.id)) {
855
+ this.#warnMarkerBlocked();
856
+ return;
857
+ }
858
+ this.#requestReload();
859
+ }
860
+ /** Reloads the page, for example from the "changed in another tab" notice. Does nothing once a reload was requested. */
861
+ reload() {
862
+ this.#requestReload();
863
+ }
864
+ #requestReload() {
865
+ if (this.#reloadRequested)
866
+ return;
867
+ this.#reloadRequested = true;
868
+ this.#runtime.reload();
869
+ }
870
+ // why: cảnh báo một lần mỗi instance — lời gọi lặp của switcher không làm ngập console.
871
+ #warnMarkerBlocked() {
872
+ if (this.#markerWarned)
873
+ return;
874
+ this.#markerWarned = true;
875
+ this.#warn(
876
+ // @i18n-ignore
877
+ 'Skipped the context reconcile reload to avoid a reload loop: the per-tab marker already holds the target or is unavailable. ' +
878
+ // @i18n-ignore
879
+ 'Make SD_LAYOUT_STORAGE_NAMESPACE resolvable before SdLayoutContextService is first injected (see sd-layout.md).');
880
+ }
881
+ #persist(snapshot) {
882
+ this.#storage.writeCurrentContext(snapshot);
883
+ // why: `set()` cập nhật bộ nhớ trước và không báo ghi lỗi — chỉ đọc lại từ storage mới xác nhận được (D-019).
884
+ return this.#storage.refreshCurrentContext()?.id === snapshot.id;
885
+ }
886
+ // why: đổi namespace (đăng nhập/đăng xuất trong SPA) là partition khác, không phải đổi ở tab khác → tắt thông báo.
887
+ #recapture(namespace) {
888
+ this.#capturedNamespace = namespace;
889
+ this.#current.set(this.#storage.refreshCurrentContext());
890
+ this.#changedElsewhere.set(false);
891
+ }
892
+ #listenToStorage() {
893
+ if (this.#stopListening)
894
+ return;
895
+ this.#stopListening = this.#runtime.onStorage(() => this.#onStorage());
896
+ this.#destroyRef.onDestroy(() => this.#stopListening?.());
897
+ }
898
+ // why: key thật là digest nên không lọc theo key được — mọi sự kiện đều đọc lại rồi so id (D-020).
899
+ #onStorage() {
900
+ if (this.#reloadRequested)
901
+ return;
902
+ const namespace = this.#storage.resolvedNamespace();
903
+ if (namespace !== this.#capturedNamespace) {
904
+ this.#recapture(namespace);
905
+ return;
906
+ }
907
+ const fresh = this.#storage.refreshCurrentContext();
908
+ // why: tính lại cả hai chiều để cờ tắt khi tab khác chuyển về; snapshot bị xoá (signout nơi khác) giữ nguyên cờ.
909
+ if (fresh)
910
+ this.#changedElsewhere.set(fresh.id !== this.#current()?.id);
911
+ }
912
+ #warn(message) {
913
+ if (!isDevMode())
914
+ return;
915
+ // @i18n-ignore dev-facing console.warn — không cần dịch
916
+ console.warn(`[SdLayoutContextService] ${message}`);
917
+ }
918
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdLayoutContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
919
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdLayoutContextService, providedIn: 'root' });
920
+ }
921
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdLayoutContextService, decorators: [{
922
+ type: Injectable,
923
+ args: [{ providedIn: 'root' }]
924
+ }], ctorParameters: () => [] });
925
+ // why: chỉ giữ đúng 4 field của snapshot và bỏ field tuỳ chọn không phải chuỗi — khớp cách
926
+ // `SdLayoutStorageService` đọc lại, nên so sánh ổn định và lời gọi lặp không ghi lại.
927
+ function toSnapshot(item) {
928
+ const { id, title, subtitle, avatar } = item;
929
+ return {
930
+ id,
931
+ title,
932
+ ...(typeof subtitle === 'string' ? { subtitle } : {}),
933
+ ...(typeof avatar === 'string' ? { avatar } : {}),
934
+ };
935
+ }
936
+ function sameContext(left, right) {
937
+ return !!right && left.id === right.id && left.title === right.title && left.subtitle === right.subtitle && left.avatar === right.avatar;
938
+ }
939
+ function normalizeItems(items) {
940
+ if (!Array.isArray(items))
941
+ return [];
942
+ const seen = new Set();
943
+ const result = [];
944
+ for (const item of items) {
945
+ if (typeof item !== 'object' || item === null)
946
+ continue;
947
+ const { id, title } = item;
948
+ // why: cùng luật hợp lệ với `SdLayoutStorageService` (chuỗi không rỗng sau trim) — mục nào ghi được thì đọc lại được.
949
+ if (!isFilledString(id) || !isFilledString(title) || seen.has(id))
950
+ continue;
951
+ seen.add(id);
952
+ result.push(item);
953
+ }
954
+ return result;
955
+ }
956
+ function isFilledString(value) {
957
+ return typeof value === 'string' && value.trim().length > 0;
958
+ }
959
+
509
960
  // End
510
961
  class MenuPipe {
511
962
  permissionService = inject(SdPermissionService);
@@ -821,6 +1272,247 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
821
1272
  }]
822
1273
  }] });
823
1274
 
1275
+ /**
1276
+ * CSS variable a sidebar can set on (or above) the switcher host to size the header popover. It wins over the
1277
+ * width derived from `anchor`. The popover lives in the CDK overlay container, so the resolved value is copied
1278
+ * onto it when it opens.
1279
+ */
1280
+ const POPOVER_WIDTH_VARIABLE = '--sd-layout-context-switcher-popover-width';
1281
+ /** Horizontal inset of the header popover inside its anchor (the popover is `anchor width − 2 × inset` wide). */
1282
+ const ANCHOR_INSET = 12;
1283
+ const BELOW_TRIGGER_POSITIONS = [
1284
+ { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 6 },
1285
+ { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -6 },
1286
+ ];
1287
+ const BELOW_ANCHOR_POSITIONS = [
1288
+ { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetX: ANCHOR_INSET },
1289
+ { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetX: ANCHOR_INSET },
1290
+ ];
1291
+ const RIGHT_POSITIONS = [
1292
+ { originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top', offsetX: 8 },
1293
+ { originX: 'end', originY: 'bottom', overlayX: 'start', overlayY: 'bottom', offsetX: 8 },
1294
+ ];
1295
+ let nextSheetTitleId = 0;
1296
+ /**
1297
+ * Context switcher shared by sidebar versions 1–4 and their mobile drawers.
1298
+ *
1299
+ * Forwards `configuration.items` to `SdLayoutContextService.syncItems()` and renders the service state:
1300
+ * the current context, the switching row and the "changed in another tab" notice. Selecting another
1301
+ * context calls `setCurrentContext()`, which reloads the page; there is no change event.
1302
+ */
1303
+ class SdLayoutContextSwitcher {
1304
+ #context = inject(SdLayoutContextService);
1305
+ #iconConfiguration = inject(SD_ICON_CONFIGURATION);
1306
+ #overlay = inject(Overlay);
1307
+ #viewContainerRef = inject(ViewContainerRef);
1308
+ #host = inject(ElementRef);
1309
+ #document = inject(DOCUMENT);
1310
+ trigger = viewChild('trigger', ...(ngDevMode ? [{ debugName: "trigger" }] : []));
1311
+ sheetTemplate = viewChild.required('sheet');
1312
+ #sheetRef;
1313
+ /** Context configuration of the sidebar; nothing renders without items. */
1314
+ configuration = input(...(ngDevMode ? [undefined, { debugName: "configuration" }] : []));
1315
+ /** Header trigger, collapsed-rail avatar, or mobile row that opens a bottom sheet. */
1316
+ appearance = input('header', ...(ngDevMode ? [{ debugName: "appearance" }] : []));
1317
+ /** Side the desktop popover opens on; defaults to `below` for the header and `right` for the rail. The sheet ignores it. */
1318
+ placement = input(...(ngDevMode ? [undefined, { debugName: "placement" }] : []));
1319
+ /**
1320
+ * Element the desktop popover aligns to; defaults to the trigger. Pass the sidebar header for `below`
1321
+ * (the popover sits under it, 12px inside both edges) and the rail or aside for `right` (the popover opens
1322
+ * 8px from its right edge, top-aligned with the trigger).
1323
+ */
1324
+ anchor = input(...(ngDevMode ? [undefined, { debugName: "anchor" }] : []));
1325
+ #isOpen = signal(false, ...(ngDevMode ? [{ debugName: "#isOpen" }] : []));
1326
+ /** `true` while the popover or the bottom sheet is open. */
1327
+ isOpen = this.#isOpen.asReadonly();
1328
+ query = signal('', ...(ngDevMode ? [{ debugName: "query" }] : []));
1329
+ popoverWidth = signal(null, ...(ngDevMode ? [{ debugName: "popoverWidth" }] : []));
1330
+ popoverOrigin = signal(null, ...(ngDevMode ? [{ debugName: "popoverOrigin" }] : []));
1331
+ #failedAvatars = signal(new Set(), ...(ngDevMode ? [{ debugName: "#failedAvatars" }] : []));
1332
+ sheetTitleId = `sd-layout-context-switcher-sheet-title-${nextSheetTitleId++}`;
1333
+ // why: Lucide chỉ render icon đã đăng ký và ném lỗi với tên lạ — `unfold_less` không có alias Lucide mặc định,
1334
+ // nên khi app dùng Lucide mà không tự alias thì giữ `unfold_more` (đã có alias) cho trạng thái mở.
1335
+ openIcon = this.#iconConfiguration.defaultFontSet === 'lucide' && !this.#iconConfiguration.lucideAliases['unfold_less']
1336
+ ? 'unfold_more'
1337
+ : 'unfold_less';
1338
+ switchFailed = this.#context.switchFailed;
1339
+ changedElsewhere = this.#context.changedElsewhere;
1340
+ /** Normalized items of the service; empty while no configuration is bound (INV-013). */
1341
+ items = computed(() => (this.configuration() ? this.#context.items() : []), ...(ngDevMode ? [{ debugName: "items" }] : []));
1342
+ customLabel = computed(() => this.configuration()?.label?.trim() || null, ...(ngDevMode ? [{ debugName: "customLabel" }] : []));
1343
+ canOpen = computed(() => this.items().length > 1, ...(ngDevMode ? [{ debugName: "canOpen" }] : []));
1344
+ searchable = computed(() => this.configuration()?.searchable ?? this.items().length > 7, ...(ngDevMode ? [{ debugName: "searchable" }] : []));
1345
+ activeId = computed(() => this.#context.current()?.id ?? null, ...(ngDevMode ? [{ debugName: "activeId" }] : []));
1346
+ activeItem = computed(() => {
1347
+ const items = this.items();
1348
+ return items.find(item => item.id === this.activeId()) ?? items[0] ?? null;
1349
+ }, ...(ngDevMode ? [{ debugName: "activeItem" }] : []));
1350
+ activeInitial = computed(() => initialOf(this.activeItem()?.title), ...(ngDevMode ? [{ debugName: "activeInitial" }] : []));
1351
+ #placement = computed(() => this.placement() ?? (this.appearance() === 'rail' ? 'right' : 'below'), ...(ngDevMode ? [{ debugName: "#placement" }] : []));
1352
+ positions = computed(() => {
1353
+ if (this.#placement() === 'right')
1354
+ return RIGHT_POSITIONS;
1355
+ return this.anchor() ? BELOW_ANCHOR_POSITIONS : BELOW_TRIGGER_POSITIONS;
1356
+ }, ...(ngDevMode ? [{ debugName: "positions" }] : []));
1357
+ rows = computed(() => {
1358
+ const query = this.searchable() ? this.query().trim() : '';
1359
+ const activeId = this.activeId();
1360
+ const switchingId = this.#context.switchingId();
1361
+ return this.items()
1362
+ .filter(item => !query || [item.title, item.subtitle].some(value => !!value && StringUtilities.aliasIncludes(value, query)))
1363
+ .map(item => ({
1364
+ item,
1365
+ initial: initialOf(item.title),
1366
+ active: item.id === activeId,
1367
+ busy: item.id === switchingId,
1368
+ disabled: !!switchingId && item.id !== switchingId,
1369
+ }));
1370
+ }, ...(ngDevMode ? [{ debugName: "rows" }] : []));
1371
+ isSwitching = computed(() => !!this.#context.switchingId(), ...(ngDevMode ? [{ debugName: "isSwitching" }] : []));
1372
+ constructor() {
1373
+ // why: switcher chuyển items vào syncItems (D-021). Sidebar mobile có switcher nằm trong drawer/sheet render
1374
+ // lười cũng tự chuyển items lúc khởi tạo (EXEC-D1) — syncItems idempotent nên gọi lặp không ghi/reload thêm.
1375
+ // untracked để signal đọc trong service không thành dependency của effect. Không có configuration thì không
1376
+ // gọi — app không cấu hình context không tạo listener.
1377
+ effect(() => {
1378
+ const configuration = this.configuration();
1379
+ if (!configuration)
1380
+ return;
1381
+ const items = configuration.items;
1382
+ untracked(() => this.#context.syncItems(items));
1383
+ });
1384
+ // why: đổi appearance (thu gọn/mở rộng) hoặc còn ≤ 1 mục khi đang mở thì đóng hẳn, tránh overlay mồ côi.
1385
+ effect(() => {
1386
+ this.appearance();
1387
+ this.canOpen();
1388
+ untracked(() => this.close(false));
1389
+ });
1390
+ inject(DestroyRef).onDestroy(() => this.#disposeSheet());
1391
+ }
1392
+ /** Opens or closes the popover (header, rail) or the bottom sheet (sheet). */
1393
+ toggle() {
1394
+ if (this.#isOpen())
1395
+ this.close();
1396
+ else
1397
+ this.open();
1398
+ }
1399
+ /** Opens the popover or the bottom sheet; ignored with fewer than two contexts. */
1400
+ open() {
1401
+ if (this.#isOpen() || !this.canOpen())
1402
+ return;
1403
+ this.query.set('');
1404
+ if (this.appearance() === 'sheet') {
1405
+ this.#isOpen.set(true);
1406
+ this.#openSheet();
1407
+ return;
1408
+ }
1409
+ // why: đo lúc mở — popover nằm ngoài sidebar nên không kế thừa được kích thước/biến CSS của nó.
1410
+ this.popoverOrigin.set(this.#resolveOrigin());
1411
+ this.popoverWidth.set(this.#resolvePopoverWidth());
1412
+ this.#isOpen.set(true);
1413
+ }
1414
+ /** Closes the popover or the bottom sheet; focus returns to the trigger unless `restoreFocus` is false. */
1415
+ close(restoreFocus = true) {
1416
+ if (!this.#isOpen())
1417
+ return;
1418
+ this.#isOpen.set(false);
1419
+ this.query.set('');
1420
+ this.#disposeSheet();
1421
+ if (restoreFocus)
1422
+ this.trigger()?.nativeElement.focus();
1423
+ }
1424
+ select(row) {
1425
+ // why: đang chuyển thì trang sắp reload — khoá mọi lựa chọn để setCurrentContext chỉ chạy một lần (CS2).
1426
+ if (this.isSwitching())
1427
+ return;
1428
+ if (row.active) {
1429
+ this.close();
1430
+ return;
1431
+ }
1432
+ this.#context.setCurrentContext(row.item.id);
1433
+ }
1434
+ reload() {
1435
+ this.#context.reload();
1436
+ }
1437
+ onSearch(event) {
1438
+ this.query.set(event.target.value);
1439
+ }
1440
+ onPanelKeydown(event) {
1441
+ if (event.key !== 'Escape')
1442
+ return;
1443
+ event.preventDefault();
1444
+ // why: sheet nằm trên drawer/sheet menu (D-027) — Esc chỉ đóng sheet context, không tới handler của lớp dưới.
1445
+ event.stopPropagation();
1446
+ this.close();
1447
+ }
1448
+ showAvatarImage(item) {
1449
+ return !!item?.avatar && !this.#failedAvatars().has(item.avatar);
1450
+ }
1451
+ onAvatarError(url) {
1452
+ if (!url)
1453
+ return;
1454
+ this.#failedAvatars.update(failed => new Set(failed).add(url));
1455
+ }
1456
+ #openSheet() {
1457
+ const ref = this.#overlay.create({
1458
+ positionStrategy: this.#overlay.position().global().top('0').left('0'),
1459
+ width: '100%',
1460
+ height: '100%',
1461
+ scrollStrategy: this.#overlay.scrollStrategies.block(),
1462
+ panelClass: 'sd-layout-context-switcher-sheet-pane',
1463
+ });
1464
+ this.#sheetRef = ref;
1465
+ ref.attach(new TemplatePortal(this.sheetTemplate(), this.#viewContainerRef)).detectChanges();
1466
+ }
1467
+ #disposeSheet() {
1468
+ this.#sheetRef?.dispose();
1469
+ this.#sheetRef = undefined;
1470
+ }
1471
+ /** `null` keeps the trigger as origin. */
1472
+ #resolveOrigin() {
1473
+ const anchor = this.anchor();
1474
+ if (!anchor)
1475
+ return null;
1476
+ if (this.#placement() === 'below')
1477
+ return anchor;
1478
+ const trigger = this.trigger()?.nativeElement;
1479
+ if (!trigger)
1480
+ return anchor;
1481
+ // why: mở từ mép phải của anchor (rail/aside) nhưng canh đỉnh theo trigger — một điểm gốc gộp cả hai trục.
1482
+ const anchorRect = anchor.getBoundingClientRect();
1483
+ const triggerRect = trigger.getBoundingClientRect();
1484
+ return { x: anchorRect.right, y: triggerRect.top, width: 0, height: triggerRect.height };
1485
+ }
1486
+ #resolvePopoverWidth() {
1487
+ const fromVariable = this.#document.defaultView
1488
+ ?.getComputedStyle(this.#host.nativeElement)
1489
+ .getPropertyValue(POPOVER_WIDTH_VARIABLE)
1490
+ .trim();
1491
+ if (fromVariable)
1492
+ return fromVariable;
1493
+ const anchor = this.anchor();
1494
+ if (!anchor || this.#placement() !== 'below')
1495
+ return null;
1496
+ const width = anchor.getBoundingClientRect().width - 2 * ANCHOR_INSET;
1497
+ return width > 0 ? `${width}px` : null;
1498
+ }
1499
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdLayoutContextSwitcher, deps: [], target: i0.ɵɵFactoryTarget.Component });
1500
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdLayoutContextSwitcher, isStandalone: true, selector: "sd-layout-context-switcher", inputs: { configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, anchor: { classPropertyName: "anchor", publicName: "anchor", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.sd-layout-context-switcher--header": "appearance() === \"header\"", "class.sd-layout-context-switcher--rail": "appearance() === \"rail\"", "class.sd-layout-context-switcher--sheet": "appearance() === \"sheet\"" }, classAttribute: "sd-layout-context-switcher" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "sheetTemplate", first: true, predicate: ["sheet"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _items = items();\n@let _appearance = appearance();\n@let _active = activeItem();\n@let _open = isOpen();\n@let _label = customLabel() ?? ('core.module.layout.context.default-label' | sdTranslate);\n@let _chooseTitle = 'core.module.layout.context.choose-title' | sdTranslate: { label: _label };\n@let _triggerName = (_active?.title ?? '') + ', ' + ('core.module.layout.context.trigger' | sdTranslate: { label: _label });\n@if (_items.length) {\n @if (!canOpen()) {\n @if (_appearance === 'rail') {\n <span\n data-context-static\n class=\"sd-layout-context-switcher__rail-avatar\"\n role=\"img\"\n [attr.title]=\"_active?.title\"\n [attr.aria-label]=\"_active?.title\">\n <ng-container\n [ngTemplateOutlet]=\"avatar\"\n [ngTemplateOutletContext]=\"{ $implicit: _active, initial: activeInitial(), active: true }\" />\n @if (changedElsewhere()) {\n <span data-context-dot class=\"sd-layout-context-switcher__dot\" aria-hidden=\"true\"></span>\n }\n </span>\n } @else {\n <span\n data-context-static\n class=\"sd-layout-context-switcher__static\"\n [class.sd-layout-context-switcher__static--sheet]=\"_appearance === 'sheet'\">\n {{ _active?.title }}\n </span>\n }\n } @else if (_appearance === 'sheet') {\n <button\n #trigger\n data-context-trigger\n type=\"button\"\n class=\"sd-layout-context-switcher__trigger sd-layout-context-switcher__trigger--sheet\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"_open\"\n [attr.aria-label]=\"_triggerName\"\n (click)=\"toggle()\">\n <span class=\"sd-layout-context-switcher__trigger-title\">{{ _active?.title }}</span>\n <sd-icon name=\"unfold_more\" size=\"20px\"></sd-icon>\n </button>\n } @else {\n <button\n #trigger\n data-context-trigger\n cdkOverlayOrigin\n #origin=\"cdkOverlayOrigin\"\n type=\"button\"\n class=\"sd-layout-context-switcher__trigger\"\n [class.sd-layout-context-switcher__trigger--header]=\"_appearance === 'header'\"\n [class.sd-layout-context-switcher__trigger--rail]=\"_appearance === 'rail'\"\n [class.sd-layout-context-switcher__trigger--open]=\"_open\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"_open\"\n [attr.aria-label]=\"_triggerName\"\n [attr.title]=\"_appearance === 'rail' ? _active?.title : null\"\n (click)=\"toggle()\">\n @if (_appearance === 'rail') {\n <span class=\"sd-layout-context-switcher__rail-avatar\">\n <ng-container\n [ngTemplateOutlet]=\"avatar\"\n [ngTemplateOutletContext]=\"{ $implicit: _active, initial: activeInitial(), active: true }\" />\n @if (changedElsewhere()) {\n <span data-context-dot class=\"sd-layout-context-switcher__dot\" aria-hidden=\"true\"></span>\n }\n </span>\n } @else {\n <span class=\"sd-layout-context-switcher__trigger-title\">{{ _active?.title }}</span>\n <sd-icon [name]=\"_open ? openIcon : 'unfold_more'\" size=\"16px\"></sd-icon>\n }\n </button>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"popoverOrigin() ?? origin\"\n [cdkConnectedOverlayOpen]=\"_open\"\n [cdkConnectedOverlayPositions]=\"positions()\"\n [cdkConnectedOverlayViewportMargin]=\"8\"\n [cdkConnectedOverlayFlexibleDimensions]=\"false\"\n [cdkConnectedOverlayPush]=\"true\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"close(false)\">\n <div\n data-context-popover\n class=\"sd-layout-context-switcher__popover\"\n [class.sd-layout-context-switcher__popover--rail]=\"_appearance === 'rail'\"\n role=\"dialog\"\n [attr.aria-label]=\"_chooseTitle\"\n [style.--sd-layout-context-switcher-popover-width]=\"popoverWidth()\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onPanelKeydown($event)\">\n @if (_appearance === 'rail' && changedElsewhere()) {\n <ng-container [ngTemplateOutlet]=\"notice\" />\n }\n <ng-container [ngTemplateOutlet]=\"list\" [ngTemplateOutletContext]=\"{ $implicit: 'popover' }\" />\n </div>\n </ng-template>\n }\n\n @if (_appearance !== 'rail' && changedElsewhere()) {\n <ng-container [ngTemplateOutlet]=\"notice\" />\n }\n}\n\n<ng-template #sheet>\n <div class=\"sd-layout-context-switcher__sheet-layer\">\n <div class=\"sd-layout-context-switcher__sheet-backdrop\" aria-hidden=\"true\" (click)=\"close()\"></div>\n <div\n data-context-sheet\n class=\"sd-layout-context-switcher__sheet\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"sheetTitleId\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onPanelKeydown($event)\">\n <span class=\"sd-layout-context-switcher__handle\" aria-hidden=\"true\"></span>\n <div class=\"sd-layout-context-switcher__sheet-header\">\n <h2 class=\"sd-layout-context-switcher__sheet-title\" [id]=\"sheetTitleId\">{{ _chooseTitle }}</h2>\n <button\n data-context-close\n type=\"button\"\n class=\"sd-layout-context-switcher__close\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"close()\">\n <sd-icon name=\"close\" size=\"22px\"></sd-icon>\n </button>\n </div>\n <ng-container [ngTemplateOutlet]=\"list\" [ngTemplateOutletContext]=\"{ $implicit: 'sheet' }\" />\n </div>\n </div>\n</ng-template>\n\n<ng-template #list let-variant>\n @let _sheet = variant === 'sheet';\n @let _switching = isSwitching();\n @if (searchable()) {\n @let _placeholder = 'core.module.layout.context.search-placeholder' | sdTranslate: { label: _label };\n <label data-context-search class=\"sd-layout-context-switcher__search\">\n <sd-icon name=\"search\" size=\"20px\"></sd-icon>\n <input\n type=\"search\"\n class=\"sd-layout-context-switcher__search-input\"\n cdkFocusInitial\n autocomplete=\"off\"\n [value]=\"query()\"\n [attr.placeholder]=\"_placeholder\"\n [attr.aria-label]=\"_placeholder\"\n (input)=\"onSearch($event)\" />\n </label>\n }\n @if (!_sheet) {\n <div data-context-label class=\"sd-layout-context-switcher__label\">{{ _label }} \u00B7 {{ _items.length }}</div>\n }\n @if (switchFailed()) {\n <div data-context-error class=\"sd-layout-context-switcher__error\" role=\"alert\">\n {{ 'core.module.layout.context.switch-failed' | sdTranslate }}\n </div>\n }\n <div class=\"sd-layout-context-switcher__list\">\n @for (row of rows(); track row.item.id) {\n @let _highlighted = row.busy || (row.active && !_switching);\n <button\n data-context-row\n type=\"button\"\n class=\"sd-layout-context-switcher__row\"\n [class.sd-layout-context-switcher__row--sheet]=\"_sheet\"\n [class.sd-layout-context-switcher__row--active]=\"row.active && !_switching\"\n [class.sd-layout-context-switcher__row--busy]=\"row.busy\"\n [attr.aria-current]=\"row.active ? 'true' : null\"\n [attr.aria-busy]=\"row.busy ? 'true' : null\"\n [attr.cdkFocusInitial]=\"row.active && !searchable() ? '' : null\"\n [disabled]=\"row.disabled\"\n (click)=\"select(row)\">\n <ng-container\n [ngTemplateOutlet]=\"avatar\"\n [ngTemplateOutletContext]=\"{ $implicit: row.item, initial: row.initial, active: _highlighted, large: _sheet }\" />\n <span class=\"sd-layout-context-switcher__row-text\">\n <span data-context-row-title class=\"sd-layout-context-switcher__row-title\">{{ row.item.title }}</span>\n @if (row.busy) {\n <span data-context-row-subtitle class=\"sd-layout-context-switcher__row-subtitle\">\n {{ 'core.module.layout.context.switching' | sdTranslate }}\n </span>\n } @else if (row.item.subtitle) {\n <span data-context-row-subtitle class=\"sd-layout-context-switcher__row-subtitle\">{{ row.item.subtitle }}</span>\n }\n </span>\n @if (row.busy) {\n <sd-icon\n class=\"sd-layout-context-switcher__row-icon sd-layout-context-switcher__spinner\"\n name=\"refresh\"\n [size]=\"_sheet ? '22px' : '20px'\"></sd-icon>\n } @else if (row.active && !_switching) {\n <sd-icon class=\"sd-layout-context-switcher__row-icon\" name=\"check\" [size]=\"_sheet ? '22px' : '20px'\"></sd-icon>\n }\n </button>\n }\n </div>\n</ng-template>\n\n<ng-template #avatar let-item let-initial=\"initial\" let-active=\"active\" let-large=\"large\">\n <span\n data-context-avatar\n class=\"sd-layout-context-switcher__avatar\"\n [class.sd-layout-context-switcher__avatar--active]=\"active\"\n [class.sd-layout-context-switcher__avatar--large]=\"large\"\n aria-hidden=\"true\">\n @if (showAvatarImage(item)) {\n <img [src]=\"item.avatar\" alt=\"\" (error)=\"onAvatarError(item.avatar)\" />\n } @else {\n {{ initial }}\n }\n </span>\n</ng-template>\n\n<ng-template #notice>\n <div data-context-notice class=\"sd-layout-context-switcher__notice\" role=\"status\">\n <span class=\"sd-layout-context-switcher__notice-text\">{{ 'core.module.layout.context.changed-elsewhere' | sdTranslate }}</span>\n <button data-context-reload type=\"button\" class=\"sd-layout-context-switcher__notice-action\" (click)=\"reload()\">\n {{ 'core.common.reload' | sdTranslate }}\n </button>\n </div>\n</ng-template>\n", styles: [":host{--sd-layout-context-switcher-hover-bg: color-mix(in srgb, var(--sd-text) 6%, transparent);--sd-layout-context-switcher-muted-ink: color-mix(in srgb, var(--sd-text) 60%, transparent);display:block;min-width:0;color:var(--sd-text)}:host(.sd-layout-context-switcher--rail){display:flex;justify-content:center}.sd-layout-context-switcher__popover,.sd-layout-context-switcher__sheet{--sd-layout-context-switcher-hover-bg: color-mix(in srgb, var(--sd-text) 6%, transparent);--sd-layout-context-switcher-muted-ink: color-mix(in srgb, var(--sd-text) 60%, transparent)}.sd-layout-context-switcher__trigger{display:inline-flex;align-items:center;max-width:100%;min-width:0;margin:0;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-layout-context-switcher__trigger:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-context-switcher__trigger--header{gap:2px;margin-inline-start:-6px;padding:2px 4px 2px 6px;border-radius:var(--sd-radius-12, 12px);color:var(--sd-text-secondary);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__trigger--header:hover,.sd-layout-context-switcher__trigger--header.sd-layout-context-switcher__trigger--open{background:var(--sd-layout-context-switcher-hover-bg)}.sd-layout-context-switcher__trigger--sheet{justify-content:space-between;gap:var(--sd-space-8, 8px);width:100%;min-height:44px;padding:0 var(--sd-space-12, 12px);border-radius:var(--sd-radius-999, 999px);color:var(--sd-text-secondary);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.sd-layout-context-switcher__trigger--sheet:hover{background:var(--sd-layout-context-switcher-hover-bg)}.sd-layout-context-switcher__trigger-title,.sd-layout-context-switcher__static{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-layout-context-switcher__static{display:block;color:var(--sd-text-secondary);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__static--sheet{display:flex;align-items:center;min-height:44px;padding:0 var(--sd-space-12, 12px);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.sd-layout-context-switcher__trigger--rail{flex:none;justify-content:center;width:28px;max-width:none;height:28px;border-radius:var(--sd-radius-8, 8px)}.sd-layout-context-switcher__trigger--rail:focus-visible{outline:2px solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px;box-shadow:none}.sd-layout-context-switcher__rail-avatar{position:relative;display:inline-flex}.sd-layout-context-switcher__dot{position:absolute;top:-3px;right:-3px;width:8px;height:8px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-primary);box-shadow:0 0 0 2px var(--sd-layout-context-switcher-dot-ring-color, var(--sd-surface))}.sd-layout-context-switcher__avatar{display:inline-flex;flex:none;align-items:center;justify-content:center;width:28px;height:28px;overflow:hidden;border-radius:var(--sd-radius-8, 8px);background:color-mix(in srgb,var(--sd-text) 10%,var(--sd-surface));color:var(--sd-text-secondary);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:1}.sd-layout-context-switcher__avatar img{display:block;width:100%;height:100%;object-fit:cover}.sd-layout-context-switcher__avatar--active{background:var(--sd-primary);color:var(--sd-primary-contrast)}.sd-layout-context-switcher__avatar--large{width:32px;height:32px;font-size:var(--sd-font-size-12, 12px)}.sd-layout-context-switcher__popover{box-sizing:border-box;width:var(--sd-layout-context-switcher-popover-width, min(256px, 100vw - 32px));padding:var(--sd-space-8, 8px);border:1px solid color-mix(in srgb,var(--sd-border) 45%,var(--sd-surface));border-radius:var(--sd-radius-16, 16px);background:var(--sd-surface);color:var(--sd-text);box-shadow:0 6px 24px color-mix(in srgb,var(--sd-text) 14%,transparent)}.sd-layout-context-switcher__popover--rail{width:232px}.sd-layout-context-switcher__search{display:flex;align-items:center;gap:var(--sd-space-8, 8px);height:36px;padding:0 var(--sd-space-12, 12px);border-radius:var(--sd-radius-999, 999px);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--sd-border) 55%,var(--sd-surface));color:var(--sd-text-secondary);cursor:text}.sd-layout-context-switcher__search:focus-within{box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-context-switcher__search-input{flex:1;min-width:0;padding:0;border:0;background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-13, 13px);appearance:none}.sd-layout-context-switcher__search-input::-webkit-search-decoration{appearance:none}.sd-layout-context-switcher__search-input::placeholder{color:var(--sd-layout-context-switcher-muted-ink)}.sd-layout-context-switcher__search-input:focus,.sd-layout-context-switcher__search-input:focus-visible{outline:none}.sd-layout-context-switcher__label{padding:10px var(--sd-space-12, 12px) var(--sd-space-4, 4px);color:var(--sd-text-secondary);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px}.sd-layout-context-switcher__label:first-child{padding-top:var(--sd-space-6, 6px)}.sd-layout-context-switcher__error{margin:var(--sd-space-4, 4px) var(--sd-space-12, 12px);color:var(--sd-error);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__list{display:flex;flex-direction:column;max-height:336px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.sd-layout-context-switcher__row{display:flex;flex:none;align-items:center;gap:var(--sd-space-12, 12px);width:100%;min-height:48px;margin:0;padding:0 var(--sd-space-12, 12px);border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-text);font:inherit;text-align:left;cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-layout-context-switcher__row:hover:not(:disabled){background:var(--sd-layout-context-switcher-hover-bg)}.sd-layout-context-switcher__row:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-context-switcher__row:disabled{color:var(--sd-layout-context-switcher-muted-ink);cursor:default}.sd-layout-context-switcher__row:disabled .sd-layout-context-switcher__avatar{background:color-mix(in srgb,var(--sd-text) 6%,var(--sd-surface));color:var(--sd-layout-context-switcher-muted-ink)}.sd-layout-context-switcher__row:disabled .sd-layout-context-switcher__row-subtitle{color:inherit}.sd-layout-context-switcher__row--active,.sd-layout-context-switcher__row--active:hover:not(:disabled),.sd-layout-context-switcher__row--busy,.sd-layout-context-switcher__row--busy:hover:not(:disabled){background:var(--sd-primary-light)}.sd-layout-context-switcher__row--active .sd-layout-context-switcher__row-title,.sd-layout-context-switcher__row--busy .sd-layout-context-switcher__row-title{color:var(--sd-primary);font-weight:var(--sd-font-weight-medium, 500)}.sd-layout-context-switcher__row--busy{cursor:progress}.sd-layout-context-switcher__row-text{display:flex;flex:1;flex-direction:column;min-width:0}.sd-layout-context-switcher__row-title,.sd-layout-context-switcher__row-subtitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-layout-context-switcher__row-title{font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px)}.sd-layout-context-switcher__row-subtitle{color:var(--sd-text-secondary);font-size:11.5px;line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__row-icon{color:var(--sd-primary)}.sd-layout-context-switcher__spinner{animation:sd-layout-context-switcher-spin 1s linear infinite}@keyframes sd-layout-context-switcher-spin{to{transform:rotate(360deg)}}.sd-layout-context-switcher__row--sheet{gap:14px;min-height:56px;padding:0 var(--sd-space-16, 16px)}.sd-layout-context-switcher__row--sheet .sd-layout-context-switcher__row-title{font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.sd-layout-context-switcher__row--sheet .sd-layout-context-switcher__row-subtitle{font-size:var(--sd-font-size-12, 12px)}.sd-layout-context-switcher__notice{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sd-space-4, 4px) var(--sd-space-8, 8px);margin-top:var(--sd-space-6, 6px);padding:var(--sd-space-6, 6px) var(--sd-space-6, 6px) var(--sd-space-6, 6px) var(--sd-space-10, 10px);border-radius:var(--sd-radius-12, 12px);background:var(--sd-primary-light);color:var(--sd-text);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__popover>.sd-layout-context-switcher__notice:first-child{margin:0 0 var(--sd-space-6, 6px)}.sd-layout-context-switcher__notice-text{flex:1 1 auto;min-width:0}.sd-layout-context-switcher__notice-action{min-height:28px;padding:0 var(--sd-space-10, 10px);border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-primary);font:inherit;font-weight:var(--sd-font-weight-medium, 500);cursor:pointer}.sd-layout-context-switcher__notice-action:hover{background:color-mix(in srgb,var(--sd-primary) 10%,transparent)}.sd-layout-context-switcher__notice-action:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-context-switcher__sheet-layer{position:relative;display:flex;flex-direction:column;justify-content:flex-end;width:100%;height:100%}.sd-layout-context-switcher__sheet-backdrop{position:absolute;inset:0;background:var(--sd-overlay-backdrop, color-mix(in srgb, var(--sd-text) 40%, transparent))}.sd-layout-context-switcher__sheet{position:relative;display:flex;flex-direction:column;box-sizing:border-box;max-height:85dvh;padding:var(--sd-space-8, 8px) var(--sd-space-8, 8px) calc(28px + env(safe-area-inset-bottom,0px));border-radius:28px 28px 0 0;background:var(--sd-surface);color:var(--sd-text)}.sd-layout-context-switcher__sheet .sd-layout-context-switcher__search{flex:none;margin:0 var(--sd-space-8, 8px) var(--sd-space-8, 8px)}.sd-layout-context-switcher__sheet .sd-layout-context-switcher__list{flex:1 1 auto;min-height:0;max-height:none}.sd-layout-context-switcher__handle{flex:none;align-self:center;width:32px;height:4px;margin:var(--sd-space-4, 4px) 0 var(--sd-space-8, 8px);border-radius:var(--sd-radius-2, 2px);background:var(--sd-border)}.sd-layout-context-switcher__sheet-header{display:flex;flex:none;align-items:center;min-height:48px;padding:0 var(--sd-space-4, 4px) 0 var(--sd-space-16, 16px)}.sd-layout-context-switcher__sheet-title{flex:1;min-width:0;margin:0;overflow:hidden;color:var(--sd-text);font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-24, 24px);text-overflow:ellipsis;white-space:nowrap}.sd-layout-context-switcher__close{display:inline-flex;flex:none;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-text-secondary);cursor:pointer}.sd-layout-context-switcher__close:hover{background:var(--sd-layout-context-switcher-hover-bg)}.sd-layout-context-switcher__close:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}@media(pointer:coarse){.sd-layout-context-switcher__trigger--header,.sd-layout-context-switcher__notice-action{min-height:44px}.sd-layout-context-switcher__trigger--rail{width:44px;height:44px;margin:-8px;border-radius:var(--sd-radius-16, 16px)}.sd-layout-context-switcher__trigger--rail:focus-visible{outline-offset:-6px}.sd-layout-context-switcher__search{height:44px}}@media(prefers-reduced-motion:reduce){.sd-layout-context-switcher__trigger,.sd-layout-context-switcher__row{transition:none}.sd-layout-context-switcher__spinner{animation:none}}\n"], dependencies: [{ kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1501
+ }
1502
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdLayoutContextSwitcher, decorators: [{
1503
+ type: Component,
1504
+ args: [{ selector: 'sd-layout-context-switcher', standalone: true, imports: [CdkConnectedOverlay, CdkOverlayOrigin, CdkTrapFocus, NgTemplateOutlet, SdIcon, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
1505
+ class: 'sd-layout-context-switcher',
1506
+ '[class.sd-layout-context-switcher--header]': 'appearance() === "header"',
1507
+ '[class.sd-layout-context-switcher--rail]': 'appearance() === "rail"',
1508
+ '[class.sd-layout-context-switcher--sheet]': 'appearance() === "sheet"',
1509
+ }, template: "@let _items = items();\n@let _appearance = appearance();\n@let _active = activeItem();\n@let _open = isOpen();\n@let _label = customLabel() ?? ('core.module.layout.context.default-label' | sdTranslate);\n@let _chooseTitle = 'core.module.layout.context.choose-title' | sdTranslate: { label: _label };\n@let _triggerName = (_active?.title ?? '') + ', ' + ('core.module.layout.context.trigger' | sdTranslate: { label: _label });\n@if (_items.length) {\n @if (!canOpen()) {\n @if (_appearance === 'rail') {\n <span\n data-context-static\n class=\"sd-layout-context-switcher__rail-avatar\"\n role=\"img\"\n [attr.title]=\"_active?.title\"\n [attr.aria-label]=\"_active?.title\">\n <ng-container\n [ngTemplateOutlet]=\"avatar\"\n [ngTemplateOutletContext]=\"{ $implicit: _active, initial: activeInitial(), active: true }\" />\n @if (changedElsewhere()) {\n <span data-context-dot class=\"sd-layout-context-switcher__dot\" aria-hidden=\"true\"></span>\n }\n </span>\n } @else {\n <span\n data-context-static\n class=\"sd-layout-context-switcher__static\"\n [class.sd-layout-context-switcher__static--sheet]=\"_appearance === 'sheet'\">\n {{ _active?.title }}\n </span>\n }\n } @else if (_appearance === 'sheet') {\n <button\n #trigger\n data-context-trigger\n type=\"button\"\n class=\"sd-layout-context-switcher__trigger sd-layout-context-switcher__trigger--sheet\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"_open\"\n [attr.aria-label]=\"_triggerName\"\n (click)=\"toggle()\">\n <span class=\"sd-layout-context-switcher__trigger-title\">{{ _active?.title }}</span>\n <sd-icon name=\"unfold_more\" size=\"20px\"></sd-icon>\n </button>\n } @else {\n <button\n #trigger\n data-context-trigger\n cdkOverlayOrigin\n #origin=\"cdkOverlayOrigin\"\n type=\"button\"\n class=\"sd-layout-context-switcher__trigger\"\n [class.sd-layout-context-switcher__trigger--header]=\"_appearance === 'header'\"\n [class.sd-layout-context-switcher__trigger--rail]=\"_appearance === 'rail'\"\n [class.sd-layout-context-switcher__trigger--open]=\"_open\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"_open\"\n [attr.aria-label]=\"_triggerName\"\n [attr.title]=\"_appearance === 'rail' ? _active?.title : null\"\n (click)=\"toggle()\">\n @if (_appearance === 'rail') {\n <span class=\"sd-layout-context-switcher__rail-avatar\">\n <ng-container\n [ngTemplateOutlet]=\"avatar\"\n [ngTemplateOutletContext]=\"{ $implicit: _active, initial: activeInitial(), active: true }\" />\n @if (changedElsewhere()) {\n <span data-context-dot class=\"sd-layout-context-switcher__dot\" aria-hidden=\"true\"></span>\n }\n </span>\n } @else {\n <span class=\"sd-layout-context-switcher__trigger-title\">{{ _active?.title }}</span>\n <sd-icon [name]=\"_open ? openIcon : 'unfold_more'\" size=\"16px\"></sd-icon>\n }\n </button>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"popoverOrigin() ?? origin\"\n [cdkConnectedOverlayOpen]=\"_open\"\n [cdkConnectedOverlayPositions]=\"positions()\"\n [cdkConnectedOverlayViewportMargin]=\"8\"\n [cdkConnectedOverlayFlexibleDimensions]=\"false\"\n [cdkConnectedOverlayPush]=\"true\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"close(false)\">\n <div\n data-context-popover\n class=\"sd-layout-context-switcher__popover\"\n [class.sd-layout-context-switcher__popover--rail]=\"_appearance === 'rail'\"\n role=\"dialog\"\n [attr.aria-label]=\"_chooseTitle\"\n [style.--sd-layout-context-switcher-popover-width]=\"popoverWidth()\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onPanelKeydown($event)\">\n @if (_appearance === 'rail' && changedElsewhere()) {\n <ng-container [ngTemplateOutlet]=\"notice\" />\n }\n <ng-container [ngTemplateOutlet]=\"list\" [ngTemplateOutletContext]=\"{ $implicit: 'popover' }\" />\n </div>\n </ng-template>\n }\n\n @if (_appearance !== 'rail' && changedElsewhere()) {\n <ng-container [ngTemplateOutlet]=\"notice\" />\n }\n}\n\n<ng-template #sheet>\n <div class=\"sd-layout-context-switcher__sheet-layer\">\n <div class=\"sd-layout-context-switcher__sheet-backdrop\" aria-hidden=\"true\" (click)=\"close()\"></div>\n <div\n data-context-sheet\n class=\"sd-layout-context-switcher__sheet\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"sheetTitleId\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onPanelKeydown($event)\">\n <span class=\"sd-layout-context-switcher__handle\" aria-hidden=\"true\"></span>\n <div class=\"sd-layout-context-switcher__sheet-header\">\n <h2 class=\"sd-layout-context-switcher__sheet-title\" [id]=\"sheetTitleId\">{{ _chooseTitle }}</h2>\n <button\n data-context-close\n type=\"button\"\n class=\"sd-layout-context-switcher__close\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"close()\">\n <sd-icon name=\"close\" size=\"22px\"></sd-icon>\n </button>\n </div>\n <ng-container [ngTemplateOutlet]=\"list\" [ngTemplateOutletContext]=\"{ $implicit: 'sheet' }\" />\n </div>\n </div>\n</ng-template>\n\n<ng-template #list let-variant>\n @let _sheet = variant === 'sheet';\n @let _switching = isSwitching();\n @if (searchable()) {\n @let _placeholder = 'core.module.layout.context.search-placeholder' | sdTranslate: { label: _label };\n <label data-context-search class=\"sd-layout-context-switcher__search\">\n <sd-icon name=\"search\" size=\"20px\"></sd-icon>\n <input\n type=\"search\"\n class=\"sd-layout-context-switcher__search-input\"\n cdkFocusInitial\n autocomplete=\"off\"\n [value]=\"query()\"\n [attr.placeholder]=\"_placeholder\"\n [attr.aria-label]=\"_placeholder\"\n (input)=\"onSearch($event)\" />\n </label>\n }\n @if (!_sheet) {\n <div data-context-label class=\"sd-layout-context-switcher__label\">{{ _label }} \u00B7 {{ _items.length }}</div>\n }\n @if (switchFailed()) {\n <div data-context-error class=\"sd-layout-context-switcher__error\" role=\"alert\">\n {{ 'core.module.layout.context.switch-failed' | sdTranslate }}\n </div>\n }\n <div class=\"sd-layout-context-switcher__list\">\n @for (row of rows(); track row.item.id) {\n @let _highlighted = row.busy || (row.active && !_switching);\n <button\n data-context-row\n type=\"button\"\n class=\"sd-layout-context-switcher__row\"\n [class.sd-layout-context-switcher__row--sheet]=\"_sheet\"\n [class.sd-layout-context-switcher__row--active]=\"row.active && !_switching\"\n [class.sd-layout-context-switcher__row--busy]=\"row.busy\"\n [attr.aria-current]=\"row.active ? 'true' : null\"\n [attr.aria-busy]=\"row.busy ? 'true' : null\"\n [attr.cdkFocusInitial]=\"row.active && !searchable() ? '' : null\"\n [disabled]=\"row.disabled\"\n (click)=\"select(row)\">\n <ng-container\n [ngTemplateOutlet]=\"avatar\"\n [ngTemplateOutletContext]=\"{ $implicit: row.item, initial: row.initial, active: _highlighted, large: _sheet }\" />\n <span class=\"sd-layout-context-switcher__row-text\">\n <span data-context-row-title class=\"sd-layout-context-switcher__row-title\">{{ row.item.title }}</span>\n @if (row.busy) {\n <span data-context-row-subtitle class=\"sd-layout-context-switcher__row-subtitle\">\n {{ 'core.module.layout.context.switching' | sdTranslate }}\n </span>\n } @else if (row.item.subtitle) {\n <span data-context-row-subtitle class=\"sd-layout-context-switcher__row-subtitle\">{{ row.item.subtitle }}</span>\n }\n </span>\n @if (row.busy) {\n <sd-icon\n class=\"sd-layout-context-switcher__row-icon sd-layout-context-switcher__spinner\"\n name=\"refresh\"\n [size]=\"_sheet ? '22px' : '20px'\"></sd-icon>\n } @else if (row.active && !_switching) {\n <sd-icon class=\"sd-layout-context-switcher__row-icon\" name=\"check\" [size]=\"_sheet ? '22px' : '20px'\"></sd-icon>\n }\n </button>\n }\n </div>\n</ng-template>\n\n<ng-template #avatar let-item let-initial=\"initial\" let-active=\"active\" let-large=\"large\">\n <span\n data-context-avatar\n class=\"sd-layout-context-switcher__avatar\"\n [class.sd-layout-context-switcher__avatar--active]=\"active\"\n [class.sd-layout-context-switcher__avatar--large]=\"large\"\n aria-hidden=\"true\">\n @if (showAvatarImage(item)) {\n <img [src]=\"item.avatar\" alt=\"\" (error)=\"onAvatarError(item.avatar)\" />\n } @else {\n {{ initial }}\n }\n </span>\n</ng-template>\n\n<ng-template #notice>\n <div data-context-notice class=\"sd-layout-context-switcher__notice\" role=\"status\">\n <span class=\"sd-layout-context-switcher__notice-text\">{{ 'core.module.layout.context.changed-elsewhere' | sdTranslate }}</span>\n <button data-context-reload type=\"button\" class=\"sd-layout-context-switcher__notice-action\" (click)=\"reload()\">\n {{ 'core.common.reload' | sdTranslate }}\n </button>\n </div>\n</ng-template>\n", styles: [":host{--sd-layout-context-switcher-hover-bg: color-mix(in srgb, var(--sd-text) 6%, transparent);--sd-layout-context-switcher-muted-ink: color-mix(in srgb, var(--sd-text) 60%, transparent);display:block;min-width:0;color:var(--sd-text)}:host(.sd-layout-context-switcher--rail){display:flex;justify-content:center}.sd-layout-context-switcher__popover,.sd-layout-context-switcher__sheet{--sd-layout-context-switcher-hover-bg: color-mix(in srgb, var(--sd-text) 6%, transparent);--sd-layout-context-switcher-muted-ink: color-mix(in srgb, var(--sd-text) 60%, transparent)}.sd-layout-context-switcher__trigger{display:inline-flex;align-items:center;max-width:100%;min-width:0;margin:0;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-layout-context-switcher__trigger:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-context-switcher__trigger--header{gap:2px;margin-inline-start:-6px;padding:2px 4px 2px 6px;border-radius:var(--sd-radius-12, 12px);color:var(--sd-text-secondary);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__trigger--header:hover,.sd-layout-context-switcher__trigger--header.sd-layout-context-switcher__trigger--open{background:var(--sd-layout-context-switcher-hover-bg)}.sd-layout-context-switcher__trigger--sheet{justify-content:space-between;gap:var(--sd-space-8, 8px);width:100%;min-height:44px;padding:0 var(--sd-space-12, 12px);border-radius:var(--sd-radius-999, 999px);color:var(--sd-text-secondary);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.sd-layout-context-switcher__trigger--sheet:hover{background:var(--sd-layout-context-switcher-hover-bg)}.sd-layout-context-switcher__trigger-title,.sd-layout-context-switcher__static{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-layout-context-switcher__static{display:block;color:var(--sd-text-secondary);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__static--sheet{display:flex;align-items:center;min-height:44px;padding:0 var(--sd-space-12, 12px);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.sd-layout-context-switcher__trigger--rail{flex:none;justify-content:center;width:28px;max-width:none;height:28px;border-radius:var(--sd-radius-8, 8px)}.sd-layout-context-switcher__trigger--rail:focus-visible{outline:2px solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px;box-shadow:none}.sd-layout-context-switcher__rail-avatar{position:relative;display:inline-flex}.sd-layout-context-switcher__dot{position:absolute;top:-3px;right:-3px;width:8px;height:8px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-primary);box-shadow:0 0 0 2px var(--sd-layout-context-switcher-dot-ring-color, var(--sd-surface))}.sd-layout-context-switcher__avatar{display:inline-flex;flex:none;align-items:center;justify-content:center;width:28px;height:28px;overflow:hidden;border-radius:var(--sd-radius-8, 8px);background:color-mix(in srgb,var(--sd-text) 10%,var(--sd-surface));color:var(--sd-text-secondary);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:1}.sd-layout-context-switcher__avatar img{display:block;width:100%;height:100%;object-fit:cover}.sd-layout-context-switcher__avatar--active{background:var(--sd-primary);color:var(--sd-primary-contrast)}.sd-layout-context-switcher__avatar--large{width:32px;height:32px;font-size:var(--sd-font-size-12, 12px)}.sd-layout-context-switcher__popover{box-sizing:border-box;width:var(--sd-layout-context-switcher-popover-width, min(256px, 100vw - 32px));padding:var(--sd-space-8, 8px);border:1px solid color-mix(in srgb,var(--sd-border) 45%,var(--sd-surface));border-radius:var(--sd-radius-16, 16px);background:var(--sd-surface);color:var(--sd-text);box-shadow:0 6px 24px color-mix(in srgb,var(--sd-text) 14%,transparent)}.sd-layout-context-switcher__popover--rail{width:232px}.sd-layout-context-switcher__search{display:flex;align-items:center;gap:var(--sd-space-8, 8px);height:36px;padding:0 var(--sd-space-12, 12px);border-radius:var(--sd-radius-999, 999px);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--sd-border) 55%,var(--sd-surface));color:var(--sd-text-secondary);cursor:text}.sd-layout-context-switcher__search:focus-within{box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-context-switcher__search-input{flex:1;min-width:0;padding:0;border:0;background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-13, 13px);appearance:none}.sd-layout-context-switcher__search-input::-webkit-search-decoration{appearance:none}.sd-layout-context-switcher__search-input::placeholder{color:var(--sd-layout-context-switcher-muted-ink)}.sd-layout-context-switcher__search-input:focus,.sd-layout-context-switcher__search-input:focus-visible{outline:none}.sd-layout-context-switcher__label{padding:10px var(--sd-space-12, 12px) var(--sd-space-4, 4px);color:var(--sd-text-secondary);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px}.sd-layout-context-switcher__label:first-child{padding-top:var(--sd-space-6, 6px)}.sd-layout-context-switcher__error{margin:var(--sd-space-4, 4px) var(--sd-space-12, 12px);color:var(--sd-error);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__list{display:flex;flex-direction:column;max-height:336px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.sd-layout-context-switcher__row{display:flex;flex:none;align-items:center;gap:var(--sd-space-12, 12px);width:100%;min-height:48px;margin:0;padding:0 var(--sd-space-12, 12px);border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-text);font:inherit;text-align:left;cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-layout-context-switcher__row:hover:not(:disabled){background:var(--sd-layout-context-switcher-hover-bg)}.sd-layout-context-switcher__row:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-context-switcher__row:disabled{color:var(--sd-layout-context-switcher-muted-ink);cursor:default}.sd-layout-context-switcher__row:disabled .sd-layout-context-switcher__avatar{background:color-mix(in srgb,var(--sd-text) 6%,var(--sd-surface));color:var(--sd-layout-context-switcher-muted-ink)}.sd-layout-context-switcher__row:disabled .sd-layout-context-switcher__row-subtitle{color:inherit}.sd-layout-context-switcher__row--active,.sd-layout-context-switcher__row--active:hover:not(:disabled),.sd-layout-context-switcher__row--busy,.sd-layout-context-switcher__row--busy:hover:not(:disabled){background:var(--sd-primary-light)}.sd-layout-context-switcher__row--active .sd-layout-context-switcher__row-title,.sd-layout-context-switcher__row--busy .sd-layout-context-switcher__row-title{color:var(--sd-primary);font-weight:var(--sd-font-weight-medium, 500)}.sd-layout-context-switcher__row--busy{cursor:progress}.sd-layout-context-switcher__row-text{display:flex;flex:1;flex-direction:column;min-width:0}.sd-layout-context-switcher__row-title,.sd-layout-context-switcher__row-subtitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-layout-context-switcher__row-title{font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px)}.sd-layout-context-switcher__row-subtitle{color:var(--sd-text-secondary);font-size:11.5px;line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__row-icon{color:var(--sd-primary)}.sd-layout-context-switcher__spinner{animation:sd-layout-context-switcher-spin 1s linear infinite}@keyframes sd-layout-context-switcher-spin{to{transform:rotate(360deg)}}.sd-layout-context-switcher__row--sheet{gap:14px;min-height:56px;padding:0 var(--sd-space-16, 16px)}.sd-layout-context-switcher__row--sheet .sd-layout-context-switcher__row-title{font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.sd-layout-context-switcher__row--sheet .sd-layout-context-switcher__row-subtitle{font-size:var(--sd-font-size-12, 12px)}.sd-layout-context-switcher__notice{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sd-space-4, 4px) var(--sd-space-8, 8px);margin-top:var(--sd-space-6, 6px);padding:var(--sd-space-6, 6px) var(--sd-space-6, 6px) var(--sd-space-6, 6px) var(--sd-space-10, 10px);border-radius:var(--sd-radius-12, 12px);background:var(--sd-primary-light);color:var(--sd-text);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__popover>.sd-layout-context-switcher__notice:first-child{margin:0 0 var(--sd-space-6, 6px)}.sd-layout-context-switcher__notice-text{flex:1 1 auto;min-width:0}.sd-layout-context-switcher__notice-action{min-height:28px;padding:0 var(--sd-space-10, 10px);border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-primary);font:inherit;font-weight:var(--sd-font-weight-medium, 500);cursor:pointer}.sd-layout-context-switcher__notice-action:hover{background:color-mix(in srgb,var(--sd-primary) 10%,transparent)}.sd-layout-context-switcher__notice-action:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-context-switcher__sheet-layer{position:relative;display:flex;flex-direction:column;justify-content:flex-end;width:100%;height:100%}.sd-layout-context-switcher__sheet-backdrop{position:absolute;inset:0;background:var(--sd-overlay-backdrop, color-mix(in srgb, var(--sd-text) 40%, transparent))}.sd-layout-context-switcher__sheet{position:relative;display:flex;flex-direction:column;box-sizing:border-box;max-height:85dvh;padding:var(--sd-space-8, 8px) var(--sd-space-8, 8px) calc(28px + env(safe-area-inset-bottom,0px));border-radius:28px 28px 0 0;background:var(--sd-surface);color:var(--sd-text)}.sd-layout-context-switcher__sheet .sd-layout-context-switcher__search{flex:none;margin:0 var(--sd-space-8, 8px) var(--sd-space-8, 8px)}.sd-layout-context-switcher__sheet .sd-layout-context-switcher__list{flex:1 1 auto;min-height:0;max-height:none}.sd-layout-context-switcher__handle{flex:none;align-self:center;width:32px;height:4px;margin:var(--sd-space-4, 4px) 0 var(--sd-space-8, 8px);border-radius:var(--sd-radius-2, 2px);background:var(--sd-border)}.sd-layout-context-switcher__sheet-header{display:flex;flex:none;align-items:center;min-height:48px;padding:0 var(--sd-space-4, 4px) 0 var(--sd-space-16, 16px)}.sd-layout-context-switcher__sheet-title{flex:1;min-width:0;margin:0;overflow:hidden;color:var(--sd-text);font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-24, 24px);text-overflow:ellipsis;white-space:nowrap}.sd-layout-context-switcher__close{display:inline-flex;flex:none;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-text-secondary);cursor:pointer}.sd-layout-context-switcher__close:hover{background:var(--sd-layout-context-switcher-hover-bg)}.sd-layout-context-switcher__close:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}@media(pointer:coarse){.sd-layout-context-switcher__trigger--header,.sd-layout-context-switcher__notice-action{min-height:44px}.sd-layout-context-switcher__trigger--rail{width:44px;height:44px;margin:-8px;border-radius:var(--sd-radius-16, 16px)}.sd-layout-context-switcher__trigger--rail:focus-visible{outline-offset:-6px}.sd-layout-context-switcher__search{height:44px}}@media(prefers-reduced-motion:reduce){.sd-layout-context-switcher__trigger,.sd-layout-context-switcher__row{transition:none}.sd-layout-context-switcher__spinner{animation:none}}\n"] }]
1510
+ }], ctorParameters: () => [], propDecorators: { trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], sheetTemplate: [{ type: i0.ViewChild, args: ['sheet', { isSignal: true }] }], configuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "configuration", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], anchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "anchor", required: false }] }] } });
1511
+ function initialOf(title) {
1512
+ const first = Array.from(title?.trim() ?? '')[0];
1513
+ return first ? first.toLocaleUpperCase() : '';
1514
+ }
1515
+
824
1516
  class SdLayoutUserMenuComponent {
825
1517
  #configuration = inject(SD_LAYOUT_CONFIGURATION, { optional: true });
826
1518
  #destroyRef = inject(DestroyRef);
@@ -966,11 +1658,11 @@ class SdLayoutUserMenuComponent {
966
1658
  return Number.isFinite(value) && Number(value) > 0 ? Math.floor(Number(value)) : 0;
967
1659
  }
968
1660
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdLayoutUserMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
969
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdLayoutUserMenuComponent, isStandalone: true, selector: "sd-layout-user-menu", inputs: { userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, signout: { classPropertyName: "signout", publicName: "signout", isSignal: true, isRequired: false, transformFunction: null }, changePassword: { classPropertyName: "changePassword", publicName: "changePassword", isSignal: true, isRequired: false, transformFunction: null }, updateProfile: { classPropertyName: "updateProfile", publicName: "updateProfile", isSignal: true, isRequired: false, transformFunction: null }, setting: { classPropertyName: "setting", publicName: "setting", isSignal: true, isRequired: false, transformFunction: null }, notification: { classPropertyName: "notification", publicName: "notification", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, presentation: { classPropertyName: "presentation", publicName: "presentation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "opened", closed: "closed" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "menu", first: true, predicate: ["menu"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _presentation = presentation();\n@let _role = role();\n@let _notificationBadge = notificationBadge();\n<div class=\"sd-layout-user-menu position-relative\">\n @if (_presentation !== 'disclosure') {\n <div class=\"sd-layout-user-menu__mobile d-flex flex-column gap-8\">\n <div\n data-mobile-account-row\n class=\"sd-layout-user-menu__mobile-row sd-layout-user-menu__mobile--inline d-flex align-items-center gap-8\">\n <div data-user-summary class=\"sd-layout-user-menu__summary d-flex align-items-center gap-8 flex-1\">\n <sd-avatar [src]=\"avatar()\" [size]=\"40\"></sd-avatar>\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n @if (_role) {\n <span\n data-user-role\n class=\"sd-layout-user-menu__role d-flex align-items-center gap-4 T12R text-ellipsis\"\n [style.color]=\"_role.color\">\n @if (_role.icon) {\n <sd-icon [name]=\"_role.icon\"></sd-icon>\n }\n {{ _role.text }}\n </span>\n }\n </span>\n </div>\n @if (signoutAction()) {\n <button\n type=\"button\"\n data-user-action=\"signout\"\n class=\"sd-layout-user-menu__action sd-layout-user-menu__signout d-flex align-items-center gap-8 px-8 py-8 T14R text-left text-error\"\n (click)=\"runSignout()\">\n <sd-icon name=\"logout\"></sd-icon>\n {{ 'core.module.layout.user.logout' | sdTranslate }}\n </button>\n }\n </div>\n\n @if (updateProfileAction() || settingAction() || notificationAction() || changePasswordAction()) {\n <div data-mobile-account-actions class=\"sd-layout-user-menu__mobile-actions d-flex flex-column gap-4\">\n @if (updateProfileAction()) {\n <button\n type=\"button\"\n data-user-action=\"update-profile\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runUpdateProfile()\">\n <sd-icon name=\"edit\"></sd-icon>\n {{ 'core.module.layout.user.update-profile' | sdTranslate }}\n </button>\n }\n @if (settingAction()) {\n <button\n type=\"button\"\n data-user-action=\"setting\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runSetting()\">\n <sd-icon name=\"settings\"></sd-icon>\n {{ 'core.module.layout.user.setting' | sdTranslate }}\n </button>\n }\n @if (notificationAction()) {\n <button\n type=\"button\"\n data-user-action=\"notification\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runNotification()\">\n <sd-icon name=\"notifications\"></sd-icon>\n <span class=\"flex-1\">{{ 'core.module.layout.user.notification' | sdTranslate }}</span>\n @if (_notificationBadge) {\n <span data-notification-badge class=\"sd-layout-user-menu__badge\">{{ _notificationBadge }}</span>\n }\n </button>\n }\n @if (changePasswordAction()) {\n <button\n type=\"button\"\n data-user-action=\"change-password\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runChangePassword()\">\n <sd-icon name=\"lock\"></sd-icon>\n {{ 'core.module.layout.user.change-password' | sdTranslate }}\n </button>\n }\n </div>\n }\n </div>\n } @else {\n <button\n #trigger\n type=\"button\"\n data-user-trigger\n class=\"sd-layout-user-menu__trigger d-flex align-items-center text-left\"\n [class.sd-layout-user-menu__trigger--compact]=\"compact()\"\n [class.w-full]=\"!compact()\"\n [class.gap-8]=\"!compact()\"\n [class.w-56]=\"compact()\"\n [class.gap-0]=\"compact()\"\n aria-haspopup=\"menu\"\n [attr.aria-label]=\"compact() ? displayName() : null\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\">\n <sd-avatar [src]=\"avatar()\" [size]=\"compact() ? 32 : 40\"></sd-avatar>\n @if (!compact()) {\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n </span>\n <sd-icon [name]=\"isOpen() ? 'expand_less' : 'expand_more'\"></sd-icon>\n }\n </button>\n\n @if (isOpen()) {\n <div\n #menu\n data-user-menu\n class=\"sd-layout-user-menu__popup d-flex flex-column gap-4 p-8 bg-white border border-black200 rounded-8 mat-elevation-z4\"\n role=\"menu\"\n tabindex=\"-1\"\n (keydown)=\"onMenuKeydown($event)\">\n <div data-user-identity class=\"sd-layout-user-menu__identity d-flex align-items-center gap-8 px-8 py-4\">\n <sd-avatar [src]=\"avatar()\" [size]=\"40\"></sd-avatar>\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n @if (_role) {\n <span\n data-user-role\n class=\"sd-layout-user-menu__role d-flex align-items-center gap-4 T12R text-ellipsis\"\n [style.color]=\"_role.color\">\n @if (_role.icon) {\n <sd-icon [name]=\"_role.icon\"></sd-icon>\n }\n {{ _role.text }}\n </span>\n }\n </span>\n </div>\n @if (updateProfileAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"update-profile\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runUpdateProfile()\">\n <sd-icon name=\"edit\"></sd-icon>\n {{ 'core.module.layout.user.update-profile' | sdTranslate }}\n </button>\n }\n @if (settingAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"setting\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runSetting()\">\n <sd-icon name=\"settings\"></sd-icon>\n {{ 'core.module.layout.user.setting' | sdTranslate }}\n </button>\n }\n @if (notificationAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"notification\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runNotification()\">\n <sd-icon name=\"notifications\"></sd-icon>\n <span class=\"flex-1\">{{ 'core.module.layout.user.notification' | sdTranslate }}</span>\n @if (_notificationBadge) {\n <span data-notification-badge class=\"sd-layout-user-menu__badge\">{{ _notificationBadge }}</span>\n }\n </button>\n }\n @if (changePasswordAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"change-password\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runChangePassword()\">\n <sd-icon name=\"lock\"></sd-icon>\n {{ 'core.module.layout.user.change-password' | sdTranslate }}\n </button>\n }\n @if (signoutAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"signout\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left text-error\"\n (click)=\"runSignout()\">\n <sd-icon name=\"logout\"></sd-icon>\n {{ 'core.module.layout.user.logout' | sdTranslate }}\n </button>\n }\n </div>\n }\n }\n</div>\n", styles: [".sd-layout-user-menu__trigger,.sd-layout-user-menu__action{border:0;background:transparent;color:var(--sd-black500, var(--sd-text, #1a1b1f));cursor:pointer;border-radius:var(--sd-radius-8, 8px);transition:background-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.sd-layout-user-menu__trigger:hover,.sd-layout-user-menu__action:hover{background:var(--sd-black100, var(--sd-surface-muted, #f3f3f3))}.sd-layout-user-menu__trigger:focus-visible,.sd-layout-user-menu__action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-layout-user-menu__trigger--compact{width:56px;min-height:52px;justify-content:center;gap:0;padding:0}.sd-layout-user-menu__popup{position:absolute;z-index:var(--sd-z-popover, 40);left:0;bottom:calc(100% + 8px);width:272px}.sd-layout-user-menu__popup .sd-layout-user-menu__action,.sd-layout-user-menu__mobile-actions .sd-layout-user-menu__action{width:100%}.sd-layout-user-menu__summary{min-width:0;padding:0 8px}.sd-layout-user-menu__identity{min-width:0}.sd-layout-user-menu__signout{width:auto;flex:0 0 auto;min-height:40px;white-space:nowrap}.sd-layout-user-menu__role sd-icon{width:14px;height:14px;font-size:var(--sd-font-size-14, 14px);flex:0 0 auto}.sd-layout-user-menu__badge{min-width:20px;padding:1px 6px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-error, #ba1a1a);color:var(--sd-white, #ffffff);font-size:var(--sd-font-size-11, 11px);line-height:var(--sd-line-height-18, 18px);text-align:center}.sd-layout-user-menu__signout:hover{background:var(--sd-error-light, #ffdad6);color:var(--sd-error-dark, var(--sd-error, #ba1a1a))}@media(prefers-reduced-motion:reduce){.sd-layout-user-menu__trigger,.sd-layout-user-menu__action{transition:none}}\n"], dependencies: [{ kind: "component", type: SdAvatar, selector: "sd-avatar", inputs: ["src", "size"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1661
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdLayoutUserMenuComponent, isStandalone: true, selector: "sd-layout-user-menu", inputs: { userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, signout: { classPropertyName: "signout", publicName: "signout", isSignal: true, isRequired: false, transformFunction: null }, changePassword: { classPropertyName: "changePassword", publicName: "changePassword", isSignal: true, isRequired: false, transformFunction: null }, updateProfile: { classPropertyName: "updateProfile", publicName: "updateProfile", isSignal: true, isRequired: false, transformFunction: null }, setting: { classPropertyName: "setting", publicName: "setting", isSignal: true, isRequired: false, transformFunction: null }, notification: { classPropertyName: "notification", publicName: "notification", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, presentation: { classPropertyName: "presentation", publicName: "presentation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "opened", closed: "closed" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "menu", first: true, predicate: ["menu"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _presentation = presentation();\n@let _role = role();\n@let _notificationBadge = notificationBadge();\n<div class=\"sd-layout-user-menu position-relative\">\n @if (_presentation !== 'disclosure') {\n <div class=\"sd-layout-user-menu__mobile d-flex flex-column gap-8\">\n <div\n data-mobile-account-row\n class=\"sd-layout-user-menu__mobile-row sd-layout-user-menu__mobile--inline d-flex align-items-center gap-8\">\n <div data-user-summary class=\"sd-layout-user-menu__summary d-flex align-items-center gap-8 flex-1\">\n <sd-avatar aria-hidden=\"true\" [src]=\"avatar()\" [size]=\"40\"></sd-avatar>\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n @if (_role) {\n <span\n data-user-role\n class=\"sd-layout-user-menu__role d-flex align-items-center gap-4 T12R text-ellipsis\"\n [style.color]=\"_role.color\">\n @if (_role.icon) {\n <sd-icon [name]=\"_role.icon\"></sd-icon>\n }\n {{ _role.text }}\n </span>\n }\n </span>\n </div>\n @if (signoutAction()) {\n <button\n type=\"button\"\n data-user-action=\"signout\"\n class=\"sd-layout-user-menu__action sd-layout-user-menu__signout d-flex align-items-center gap-8 px-8 py-8 T14R text-left text-error\"\n (click)=\"runSignout()\">\n <sd-icon name=\"logout\"></sd-icon>\n {{ 'core.module.layout.user.logout' | sdTranslate }}\n </button>\n }\n </div>\n\n @if (updateProfileAction() || settingAction() || notificationAction() || changePasswordAction()) {\n <div data-mobile-account-actions class=\"sd-layout-user-menu__mobile-actions d-flex flex-column gap-4\">\n @if (updateProfileAction()) {\n <button\n type=\"button\"\n data-user-action=\"update-profile\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runUpdateProfile()\">\n <sd-icon name=\"edit\"></sd-icon>\n {{ 'core.module.layout.user.update-profile' | sdTranslate }}\n </button>\n }\n @if (settingAction()) {\n <button\n type=\"button\"\n data-user-action=\"setting\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runSetting()\">\n <sd-icon name=\"settings\"></sd-icon>\n {{ 'core.module.layout.user.setting' | sdTranslate }}\n </button>\n }\n @if (notificationAction()) {\n <button\n type=\"button\"\n data-user-action=\"notification\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runNotification()\">\n <sd-icon name=\"notifications\"></sd-icon>\n <span class=\"flex-1\">{{ 'core.module.layout.user.notification' | sdTranslate }}</span>\n @if (_notificationBadge) {\n <span data-notification-badge class=\"sd-layout-user-menu__badge\">{{ _notificationBadge }}</span>\n }\n </button>\n }\n @if (changePasswordAction()) {\n <button\n type=\"button\"\n data-user-action=\"change-password\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runChangePassword()\">\n <sd-icon name=\"lock\"></sd-icon>\n {{ 'core.module.layout.user.change-password' | sdTranslate }}\n </button>\n }\n </div>\n }\n </div>\n } @else {\n <button\n #trigger\n type=\"button\"\n data-user-trigger\n class=\"sd-layout-user-menu__trigger d-flex align-items-center text-left\"\n [class.sd-layout-user-menu__trigger--compact]=\"compact()\"\n [class.w-full]=\"!compact()\"\n [class.gap-8]=\"!compact()\"\n [class.w-56]=\"compact()\"\n [class.gap-0]=\"compact()\"\n aria-haspopup=\"menu\"\n [attr.aria-label]=\"compact() ? displayName() : null\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\">\n <sd-avatar aria-hidden=\"true\" [src]=\"avatar()\" [size]=\"compact() ? 32 : 40\"></sd-avatar>\n @if (!compact()) {\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n </span>\n <sd-icon [name]=\"isOpen() ? 'expand_less' : 'expand_more'\"></sd-icon>\n }\n </button>\n\n @if (isOpen()) {\n <div\n #menu\n data-user-menu\n class=\"sd-layout-user-menu__popup d-flex flex-column gap-4 p-8 bg-white border border-black200 rounded-8 mat-elevation-z4\"\n role=\"menu\"\n tabindex=\"-1\"\n (keydown)=\"onMenuKeydown($event)\">\n <div data-user-identity class=\"sd-layout-user-menu__identity d-flex align-items-center gap-8 px-8 py-4\">\n <sd-avatar aria-hidden=\"true\" [src]=\"avatar()\" [size]=\"40\"></sd-avatar>\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n @if (_role) {\n <span\n data-user-role\n class=\"sd-layout-user-menu__role d-flex align-items-center gap-4 T12R text-ellipsis\"\n [style.color]=\"_role.color\">\n @if (_role.icon) {\n <sd-icon [name]=\"_role.icon\"></sd-icon>\n }\n {{ _role.text }}\n </span>\n }\n </span>\n </div>\n @if (updateProfileAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"update-profile\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runUpdateProfile()\">\n <sd-icon name=\"edit\"></sd-icon>\n {{ 'core.module.layout.user.update-profile' | sdTranslate }}\n </button>\n }\n @if (settingAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"setting\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runSetting()\">\n <sd-icon name=\"settings\"></sd-icon>\n {{ 'core.module.layout.user.setting' | sdTranslate }}\n </button>\n }\n @if (notificationAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"notification\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runNotification()\">\n <sd-icon name=\"notifications\"></sd-icon>\n <span class=\"flex-1\">{{ 'core.module.layout.user.notification' | sdTranslate }}</span>\n @if (_notificationBadge) {\n <span data-notification-badge class=\"sd-layout-user-menu__badge\">{{ _notificationBadge }}</span>\n }\n </button>\n }\n @if (changePasswordAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"change-password\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runChangePassword()\">\n <sd-icon name=\"lock\"></sd-icon>\n {{ 'core.module.layout.user.change-password' | sdTranslate }}\n </button>\n }\n @if (signoutAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"signout\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left text-error\"\n (click)=\"runSignout()\">\n <sd-icon name=\"logout\"></sd-icon>\n {{ 'core.module.layout.user.logout' | sdTranslate }}\n </button>\n }\n </div>\n }\n }\n</div>\n", styles: [".sd-layout-user-menu__trigger,.sd-layout-user-menu__action{border:0;background:transparent;color:var(--sd-black500, var(--sd-text, #1a1b1f));cursor:pointer;border-radius:var(--sd-radius-8, 8px);transition:background-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.sd-layout-user-menu__trigger:hover,.sd-layout-user-menu__action:hover{background:var(--sd-black100, var(--sd-surface-muted, #f3f3f3))}.sd-layout-user-menu__trigger:focus-visible,.sd-layout-user-menu__action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-layout-user-menu__trigger--compact{width:56px;min-height:52px;justify-content:center;gap:0;padding:0}.sd-layout-user-menu__popup{position:absolute;z-index:var(--sd-z-popover, 40);left:0;bottom:calc(100% + 8px);width:272px}.sd-layout-user-menu__popup .sd-layout-user-menu__action,.sd-layout-user-menu__mobile-actions .sd-layout-user-menu__action{width:100%}.sd-layout-user-menu__summary{min-width:0;padding:0 8px}.sd-layout-user-menu__identity{min-width:0}.sd-layout-user-menu__signout{width:auto;flex:0 0 auto;min-height:40px;white-space:nowrap}.sd-layout-user-menu__role sd-icon{width:14px;height:14px;font-size:var(--sd-font-size-14, 14px);flex:0 0 auto}.sd-layout-user-menu__badge{min-width:20px;padding:1px 6px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-error, #ba1a1a);color:var(--sd-white, #ffffff);font-size:var(--sd-font-size-11, 11px);line-height:var(--sd-line-height-18, 18px);text-align:center}.sd-layout-user-menu__signout:hover{background:var(--sd-error-light, #ffdad6);color:var(--sd-error-dark, var(--sd-error, #ba1a1a))}@media(prefers-reduced-motion:reduce){.sd-layout-user-menu__trigger,.sd-layout-user-menu__action{transition:none}}\n"], dependencies: [{ kind: "component", type: SdAvatar, selector: "sd-avatar", inputs: ["src", "size", "name", "status", "statusLabel", "statusPulse", "tooltip"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
970
1662
  }
971
1663
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdLayoutUserMenuComponent, decorators: [{
972
1664
  type: Component,
973
- args: [{ selector: 'sd-layout-user-menu', standalone: true, imports: [SdAvatar, SdIcon, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let _presentation = presentation();\n@let _role = role();\n@let _notificationBadge = notificationBadge();\n<div class=\"sd-layout-user-menu position-relative\">\n @if (_presentation !== 'disclosure') {\n <div class=\"sd-layout-user-menu__mobile d-flex flex-column gap-8\">\n <div\n data-mobile-account-row\n class=\"sd-layout-user-menu__mobile-row sd-layout-user-menu__mobile--inline d-flex align-items-center gap-8\">\n <div data-user-summary class=\"sd-layout-user-menu__summary d-flex align-items-center gap-8 flex-1\">\n <sd-avatar [src]=\"avatar()\" [size]=\"40\"></sd-avatar>\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n @if (_role) {\n <span\n data-user-role\n class=\"sd-layout-user-menu__role d-flex align-items-center gap-4 T12R text-ellipsis\"\n [style.color]=\"_role.color\">\n @if (_role.icon) {\n <sd-icon [name]=\"_role.icon\"></sd-icon>\n }\n {{ _role.text }}\n </span>\n }\n </span>\n </div>\n @if (signoutAction()) {\n <button\n type=\"button\"\n data-user-action=\"signout\"\n class=\"sd-layout-user-menu__action sd-layout-user-menu__signout d-flex align-items-center gap-8 px-8 py-8 T14R text-left text-error\"\n (click)=\"runSignout()\">\n <sd-icon name=\"logout\"></sd-icon>\n {{ 'core.module.layout.user.logout' | sdTranslate }}\n </button>\n }\n </div>\n\n @if (updateProfileAction() || settingAction() || notificationAction() || changePasswordAction()) {\n <div data-mobile-account-actions class=\"sd-layout-user-menu__mobile-actions d-flex flex-column gap-4\">\n @if (updateProfileAction()) {\n <button\n type=\"button\"\n data-user-action=\"update-profile\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runUpdateProfile()\">\n <sd-icon name=\"edit\"></sd-icon>\n {{ 'core.module.layout.user.update-profile' | sdTranslate }}\n </button>\n }\n @if (settingAction()) {\n <button\n type=\"button\"\n data-user-action=\"setting\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runSetting()\">\n <sd-icon name=\"settings\"></sd-icon>\n {{ 'core.module.layout.user.setting' | sdTranslate }}\n </button>\n }\n @if (notificationAction()) {\n <button\n type=\"button\"\n data-user-action=\"notification\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runNotification()\">\n <sd-icon name=\"notifications\"></sd-icon>\n <span class=\"flex-1\">{{ 'core.module.layout.user.notification' | sdTranslate }}</span>\n @if (_notificationBadge) {\n <span data-notification-badge class=\"sd-layout-user-menu__badge\">{{ _notificationBadge }}</span>\n }\n </button>\n }\n @if (changePasswordAction()) {\n <button\n type=\"button\"\n data-user-action=\"change-password\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runChangePassword()\">\n <sd-icon name=\"lock\"></sd-icon>\n {{ 'core.module.layout.user.change-password' | sdTranslate }}\n </button>\n }\n </div>\n }\n </div>\n } @else {\n <button\n #trigger\n type=\"button\"\n data-user-trigger\n class=\"sd-layout-user-menu__trigger d-flex align-items-center text-left\"\n [class.sd-layout-user-menu__trigger--compact]=\"compact()\"\n [class.w-full]=\"!compact()\"\n [class.gap-8]=\"!compact()\"\n [class.w-56]=\"compact()\"\n [class.gap-0]=\"compact()\"\n aria-haspopup=\"menu\"\n [attr.aria-label]=\"compact() ? displayName() : null\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\">\n <sd-avatar [src]=\"avatar()\" [size]=\"compact() ? 32 : 40\"></sd-avatar>\n @if (!compact()) {\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n </span>\n <sd-icon [name]=\"isOpen() ? 'expand_less' : 'expand_more'\"></sd-icon>\n }\n </button>\n\n @if (isOpen()) {\n <div\n #menu\n data-user-menu\n class=\"sd-layout-user-menu__popup d-flex flex-column gap-4 p-8 bg-white border border-black200 rounded-8 mat-elevation-z4\"\n role=\"menu\"\n tabindex=\"-1\"\n (keydown)=\"onMenuKeydown($event)\">\n <div data-user-identity class=\"sd-layout-user-menu__identity d-flex align-items-center gap-8 px-8 py-4\">\n <sd-avatar [src]=\"avatar()\" [size]=\"40\"></sd-avatar>\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n @if (_role) {\n <span\n data-user-role\n class=\"sd-layout-user-menu__role d-flex align-items-center gap-4 T12R text-ellipsis\"\n [style.color]=\"_role.color\">\n @if (_role.icon) {\n <sd-icon [name]=\"_role.icon\"></sd-icon>\n }\n {{ _role.text }}\n </span>\n }\n </span>\n </div>\n @if (updateProfileAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"update-profile\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runUpdateProfile()\">\n <sd-icon name=\"edit\"></sd-icon>\n {{ 'core.module.layout.user.update-profile' | sdTranslate }}\n </button>\n }\n @if (settingAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"setting\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runSetting()\">\n <sd-icon name=\"settings\"></sd-icon>\n {{ 'core.module.layout.user.setting' | sdTranslate }}\n </button>\n }\n @if (notificationAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"notification\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runNotification()\">\n <sd-icon name=\"notifications\"></sd-icon>\n <span class=\"flex-1\">{{ 'core.module.layout.user.notification' | sdTranslate }}</span>\n @if (_notificationBadge) {\n <span data-notification-badge class=\"sd-layout-user-menu__badge\">{{ _notificationBadge }}</span>\n }\n </button>\n }\n @if (changePasswordAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"change-password\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runChangePassword()\">\n <sd-icon name=\"lock\"></sd-icon>\n {{ 'core.module.layout.user.change-password' | sdTranslate }}\n </button>\n }\n @if (signoutAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"signout\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left text-error\"\n (click)=\"runSignout()\">\n <sd-icon name=\"logout\"></sd-icon>\n {{ 'core.module.layout.user.logout' | sdTranslate }}\n </button>\n }\n </div>\n }\n }\n</div>\n", styles: [".sd-layout-user-menu__trigger,.sd-layout-user-menu__action{border:0;background:transparent;color:var(--sd-black500, var(--sd-text, #1a1b1f));cursor:pointer;border-radius:var(--sd-radius-8, 8px);transition:background-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.sd-layout-user-menu__trigger:hover,.sd-layout-user-menu__action:hover{background:var(--sd-black100, var(--sd-surface-muted, #f3f3f3))}.sd-layout-user-menu__trigger:focus-visible,.sd-layout-user-menu__action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-layout-user-menu__trigger--compact{width:56px;min-height:52px;justify-content:center;gap:0;padding:0}.sd-layout-user-menu__popup{position:absolute;z-index:var(--sd-z-popover, 40);left:0;bottom:calc(100% + 8px);width:272px}.sd-layout-user-menu__popup .sd-layout-user-menu__action,.sd-layout-user-menu__mobile-actions .sd-layout-user-menu__action{width:100%}.sd-layout-user-menu__summary{min-width:0;padding:0 8px}.sd-layout-user-menu__identity{min-width:0}.sd-layout-user-menu__signout{width:auto;flex:0 0 auto;min-height:40px;white-space:nowrap}.sd-layout-user-menu__role sd-icon{width:14px;height:14px;font-size:var(--sd-font-size-14, 14px);flex:0 0 auto}.sd-layout-user-menu__badge{min-width:20px;padding:1px 6px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-error, #ba1a1a);color:var(--sd-white, #ffffff);font-size:var(--sd-font-size-11, 11px);line-height:var(--sd-line-height-18, 18px);text-align:center}.sd-layout-user-menu__signout:hover{background:var(--sd-error-light, #ffdad6);color:var(--sd-error-dark, var(--sd-error, #ba1a1a))}@media(prefers-reduced-motion:reduce){.sd-layout-user-menu__trigger,.sd-layout-user-menu__action{transition:none}}\n"] }]
1665
+ args: [{ selector: 'sd-layout-user-menu', standalone: true, imports: [SdAvatar, SdIcon, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let _presentation = presentation();\n@let _role = role();\n@let _notificationBadge = notificationBadge();\n<div class=\"sd-layout-user-menu position-relative\">\n @if (_presentation !== 'disclosure') {\n <div class=\"sd-layout-user-menu__mobile d-flex flex-column gap-8\">\n <div\n data-mobile-account-row\n class=\"sd-layout-user-menu__mobile-row sd-layout-user-menu__mobile--inline d-flex align-items-center gap-8\">\n <div data-user-summary class=\"sd-layout-user-menu__summary d-flex align-items-center gap-8 flex-1\">\n <sd-avatar aria-hidden=\"true\" [src]=\"avatar()\" [size]=\"40\"></sd-avatar>\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n @if (_role) {\n <span\n data-user-role\n class=\"sd-layout-user-menu__role d-flex align-items-center gap-4 T12R text-ellipsis\"\n [style.color]=\"_role.color\">\n @if (_role.icon) {\n <sd-icon [name]=\"_role.icon\"></sd-icon>\n }\n {{ _role.text }}\n </span>\n }\n </span>\n </div>\n @if (signoutAction()) {\n <button\n type=\"button\"\n data-user-action=\"signout\"\n class=\"sd-layout-user-menu__action sd-layout-user-menu__signout d-flex align-items-center gap-8 px-8 py-8 T14R text-left text-error\"\n (click)=\"runSignout()\">\n <sd-icon name=\"logout\"></sd-icon>\n {{ 'core.module.layout.user.logout' | sdTranslate }}\n </button>\n }\n </div>\n\n @if (updateProfileAction() || settingAction() || notificationAction() || changePasswordAction()) {\n <div data-mobile-account-actions class=\"sd-layout-user-menu__mobile-actions d-flex flex-column gap-4\">\n @if (updateProfileAction()) {\n <button\n type=\"button\"\n data-user-action=\"update-profile\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runUpdateProfile()\">\n <sd-icon name=\"edit\"></sd-icon>\n {{ 'core.module.layout.user.update-profile' | sdTranslate }}\n </button>\n }\n @if (settingAction()) {\n <button\n type=\"button\"\n data-user-action=\"setting\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runSetting()\">\n <sd-icon name=\"settings\"></sd-icon>\n {{ 'core.module.layout.user.setting' | sdTranslate }}\n </button>\n }\n @if (notificationAction()) {\n <button\n type=\"button\"\n data-user-action=\"notification\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runNotification()\">\n <sd-icon name=\"notifications\"></sd-icon>\n <span class=\"flex-1\">{{ 'core.module.layout.user.notification' | sdTranslate }}</span>\n @if (_notificationBadge) {\n <span data-notification-badge class=\"sd-layout-user-menu__badge\">{{ _notificationBadge }}</span>\n }\n </button>\n }\n @if (changePasswordAction()) {\n <button\n type=\"button\"\n data-user-action=\"change-password\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runChangePassword()\">\n <sd-icon name=\"lock\"></sd-icon>\n {{ 'core.module.layout.user.change-password' | sdTranslate }}\n </button>\n }\n </div>\n }\n </div>\n } @else {\n <button\n #trigger\n type=\"button\"\n data-user-trigger\n class=\"sd-layout-user-menu__trigger d-flex align-items-center text-left\"\n [class.sd-layout-user-menu__trigger--compact]=\"compact()\"\n [class.w-full]=\"!compact()\"\n [class.gap-8]=\"!compact()\"\n [class.w-56]=\"compact()\"\n [class.gap-0]=\"compact()\"\n aria-haspopup=\"menu\"\n [attr.aria-label]=\"compact() ? displayName() : null\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\">\n <sd-avatar aria-hidden=\"true\" [src]=\"avatar()\" [size]=\"compact() ? 32 : 40\"></sd-avatar>\n @if (!compact()) {\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n </span>\n <sd-icon [name]=\"isOpen() ? 'expand_less' : 'expand_more'\"></sd-icon>\n }\n </button>\n\n @if (isOpen()) {\n <div\n #menu\n data-user-menu\n class=\"sd-layout-user-menu__popup d-flex flex-column gap-4 p-8 bg-white border border-black200 rounded-8 mat-elevation-z4\"\n role=\"menu\"\n tabindex=\"-1\"\n (keydown)=\"onMenuKeydown($event)\">\n <div data-user-identity class=\"sd-layout-user-menu__identity d-flex align-items-center gap-8 px-8 py-4\">\n <sd-avatar aria-hidden=\"true\" [src]=\"avatar()\" [size]=\"40\"></sd-avatar>\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n @if (_role) {\n <span\n data-user-role\n class=\"sd-layout-user-menu__role d-flex align-items-center gap-4 T12R text-ellipsis\"\n [style.color]=\"_role.color\">\n @if (_role.icon) {\n <sd-icon [name]=\"_role.icon\"></sd-icon>\n }\n {{ _role.text }}\n </span>\n }\n </span>\n </div>\n @if (updateProfileAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"update-profile\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runUpdateProfile()\">\n <sd-icon name=\"edit\"></sd-icon>\n {{ 'core.module.layout.user.update-profile' | sdTranslate }}\n </button>\n }\n @if (settingAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"setting\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runSetting()\">\n <sd-icon name=\"settings\"></sd-icon>\n {{ 'core.module.layout.user.setting' | sdTranslate }}\n </button>\n }\n @if (notificationAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"notification\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runNotification()\">\n <sd-icon name=\"notifications\"></sd-icon>\n <span class=\"flex-1\">{{ 'core.module.layout.user.notification' | sdTranslate }}</span>\n @if (_notificationBadge) {\n <span data-notification-badge class=\"sd-layout-user-menu__badge\">{{ _notificationBadge }}</span>\n }\n </button>\n }\n @if (changePasswordAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"change-password\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runChangePassword()\">\n <sd-icon name=\"lock\"></sd-icon>\n {{ 'core.module.layout.user.change-password' | sdTranslate }}\n </button>\n }\n @if (signoutAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"signout\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left text-error\"\n (click)=\"runSignout()\">\n <sd-icon name=\"logout\"></sd-icon>\n {{ 'core.module.layout.user.logout' | sdTranslate }}\n </button>\n }\n </div>\n }\n }\n</div>\n", styles: [".sd-layout-user-menu__trigger,.sd-layout-user-menu__action{border:0;background:transparent;color:var(--sd-black500, var(--sd-text, #1a1b1f));cursor:pointer;border-radius:var(--sd-radius-8, 8px);transition:background-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.sd-layout-user-menu__trigger:hover,.sd-layout-user-menu__action:hover{background:var(--sd-black100, var(--sd-surface-muted, #f3f3f3))}.sd-layout-user-menu__trigger:focus-visible,.sd-layout-user-menu__action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-layout-user-menu__trigger--compact{width:56px;min-height:52px;justify-content:center;gap:0;padding:0}.sd-layout-user-menu__popup{position:absolute;z-index:var(--sd-z-popover, 40);left:0;bottom:calc(100% + 8px);width:272px}.sd-layout-user-menu__popup .sd-layout-user-menu__action,.sd-layout-user-menu__mobile-actions .sd-layout-user-menu__action{width:100%}.sd-layout-user-menu__summary{min-width:0;padding:0 8px}.sd-layout-user-menu__identity{min-width:0}.sd-layout-user-menu__signout{width:auto;flex:0 0 auto;min-height:40px;white-space:nowrap}.sd-layout-user-menu__role sd-icon{width:14px;height:14px;font-size:var(--sd-font-size-14, 14px);flex:0 0 auto}.sd-layout-user-menu__badge{min-width:20px;padding:1px 6px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-error, #ba1a1a);color:var(--sd-white, #ffffff);font-size:var(--sd-font-size-11, 11px);line-height:var(--sd-line-height-18, 18px);text-align:center}.sd-layout-user-menu__signout:hover{background:var(--sd-error-light, #ffdad6);color:var(--sd-error-dark, var(--sd-error, #ba1a1a))}@media(prefers-reduced-motion:reduce){.sd-layout-user-menu__trigger,.sd-layout-user-menu__action{transition:none}}\n"] }]
974
1666
  }], ctorParameters: () => [], propDecorators: { trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], menu: [{ type: i0.ViewChild, args: ['menu', { isSignal: true }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], signout: [{ type: i0.Input, args: [{ isSignal: true, alias: "signout", required: false }] }], changePassword: [{ type: i0.Input, args: [{ isSignal: true, alias: "changePassword", required: false }] }], updateProfile: [{ type: i0.Input, args: [{ isSignal: true, alias: "updateProfile", required: false }] }], setting: [{ type: i0.Input, args: [{ isSignal: true, alias: "setting", required: false }] }], notification: [{ type: i0.Input, args: [{ isSignal: true, alias: "notification", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], presentation: [{ type: i0.Input, args: [{ isSignal: true, alias: "presentation", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
975
1667
 
976
1668
  let LayoutUserComponent$1 = class LayoutUserComponent {
@@ -1022,6 +1714,11 @@ class SdSidebarV1Panel {
1022
1714
  popupUserMenuOpened = output();
1023
1715
  showSideBar = output();
1024
1716
  // ==========================================
1717
+ // CONTEXT SWITCHER (chỉ render khi cấu hình `sidebar.context`)
1718
+ // ==========================================
1719
+ headerContextSwitcher = viewChild('headerContextSwitcher', ...(ngDevMode ? [{ debugName: "headerContextSwitcher" }] : []));
1720
+ #isContextPopoverOpen = false;
1721
+ // ==========================================
1025
1722
  // STATE SIGNALS
1026
1723
  // ==========================================
1027
1724
  isMenuLock = signal(this.#layoutStorageService.menuLockStatus?.get() ?? true, ...(ngDevMode ? [{ debugName: "isMenuLock" }] : []));
@@ -1077,6 +1774,23 @@ class SdSidebarV1Panel {
1077
1774
  this.#isFirstBindingMenu.set(false);
1078
1775
  });
1079
1776
  });
1777
+ // why: popover context nằm trong overlay CDK có backdrop phủ màn hình — chuột rời sidenav thì main thu gọn
1778
+ // sidebar đang mở tạm (hover) và huỷ luôn switcher. Báo qua cặp output popup như menu người dùng để main giữ
1779
+ // sidebar mở. Chỉ bản header: báo từ rail sẽ làm main mở rộng sidebar và thay mất switcher rail đang mở.
1780
+ effect(() => {
1781
+ const isOpen = this.headerContextSwitcher()?.isOpen() ?? false;
1782
+ untracked(() => {
1783
+ if (isOpen === this.#isContextPopoverOpen)
1784
+ return;
1785
+ this.#isContextPopoverOpen = isOpen;
1786
+ if (isOpen) {
1787
+ this.popupUserMenuOpened.emit();
1788
+ }
1789
+ else {
1790
+ this.popupUserMenuClosed.emit();
1791
+ }
1792
+ });
1793
+ });
1080
1794
  }
1081
1795
  #setupSubscriptions() {
1082
1796
  this.#router.events.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(event => {
@@ -1562,7 +2276,7 @@ class SdSidebarV1Panel {
1562
2276
  return count;
1563
2277
  };
1564
2278
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarV1Panel, deps: [], target: i0.ɵɵFactoryTarget.Component });
1565
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSidebarV1Panel, isStandalone: true, selector: "sd-sidebar-v1-panel", inputs: { isShowSidebar: { classPropertyName: "isShowSidebar", publicName: "isShowSidebar", isSignal: true, isRequired: true, transformFunction: null }, menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: true, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null }, isMobile: { classPropertyName: "isMobile", publicName: "isMobile", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandSideBar: "expandSideBar", popupUserMenuClosed: "popupUserMenuClosed", popupUserMenuOpened: "popupUserMenuOpened", showSideBar: "showSideBar" }, ngImport: i0, template: "@let _userInfo = userInfo();\n@let _sidebar = sidebar();\n@let _isShowSidebar = isShowSidebar();\n@let _searchText = searchText();\n@let _currentPath = currentPath();\n@let _activeMenuPath = activeMenuPath();\n@let _idMenuGroupActive = idMenuGroupActive();\n@let _pinnedMenuGroup = pinnedMenuGroup();\n\n@if (_userInfo && _sidebar) {\n <div\n class=\"wrapper\"\n [style.--sidebar-accent]=\"_sidebar.brandColor || 'var(--sd-primary, #005cbb)'\"\n [style.height]=\"isMobile() ? '100dvh' : '100%'\">\n <div class=\"c-header\">\n <div class=\"c-logo\">\n <a\n href=\"/layout/home\"\n [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\"\n (click)=\"$event.preventDefault(); openHomePage()\">\n @if (logoUrl(); as _logoUrl) {\n <img alt=\"\" [src]=\"_logoUrl\" />\n } @else {\n <sd-icon fontSet=\"material-icons-outlined\" name=\"apps\"></sd-icon>\n }\n </a>\n </div>\n <div class=\"c-title-menu-group\" [class.d-none]=\"!_isShowSidebar\">\n <span>{{ titleMenuGroup() || _sidebar.defaultTitle || 'Back Office' }}</span>\n </div>\n </div>\n <div class=\"c-body\">\n <div class=\"c-menu\">\n <div class=\"c-menu-group\">\n @if (_sidebar?.pin?.enabled && _pinnedMenuGroup.children?.length) {\n <button\n type=\"button\"\n [attr.aria-label]=\"'core.module.layout.sidebar.pinned' | sdTranslate\"\n (mouseenter)=\"onMouseOverMenuGroupNode($event, _pinnedMenuGroup)\"\n (mouseleave)=\"onMouseLeaveMenuGroupNode($event, _pinnedMenuGroup)\"\n (click)=\"expandPinnedGroup()\"\n [matTooltip]=\"'core.module.layout.sidebar.pinned' | sdTranslate\"\n [matTooltipClass]=\"'c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140'\"\n [matTooltipPosition]=\"'right'\"\n style=\"padding: 0; margin: 0; border: none; background-color: transparent\">\n <sd-icon\n fontSet=\"material-icons-outlined\"\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n color: isPinnedMenuGroupActive()\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text-secondary, #44474f)',\n backgroundColor: isPinnedMenuGroupActive()\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\"\n name=\"push_pin\"></sd-icon>\n </button>\n }\n @for (nodeMenuGroup of menus(); track nodeMenuGroup.id) {\n <button\n type=\"button\"\n [attr.aria-label]=\"nodeMenuGroup.tooltipTitle || nodeMenuGroup.title\"\n (mouseenter)=\"onMouseOverMenuGroupNode($event, nodeMenuGroup)\"\n (mouseleave)=\"onMouseLeaveMenuGroupNode($event, nodeMenuGroup)\"\n (click)=\"expandMenuGroup(nodeMenuGroup)\"\n [matTooltip]=\"nodeMenuGroup.tooltipTitle || nodeMenuGroup.title\"\n [matTooltipClass]=\"'c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140'\"\n [matTooltipPosition]=\"'right'\"\n style=\"padding: 0; margin: 0; border: none; background-color: transparent\">\n @if (nodeMenuGroup.iconUrl) {\n <span\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n backgroundColor:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\">\n <img width=\"24px\" height=\"24px\" [src]=\"nodeMenuGroup.iconUrl\" [alt]=\"nodeMenuGroup.title\" />\n </span>\n } @else {\n <sd-icon\n fontSet=\"material-icons-outlined\"\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n color:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text-secondary, #44474f)',\n backgroundColor:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\"\n [name]=\"nodeMenuGroup.icon || 'widgets'\"></sd-icon>\n }\n </button>\n }\n </div>\n <div class=\"c-menu-tree\" [class.d-none]=\"!_isShowSidebar\" [attr.inert]=\"!_isShowSidebar ? '' : null\">\n @if (totalMenuInMenusByGroup() > 10) {\n <div class=\"c-menu-tree-search\">\n @let _searchLabel = 'core.module.layout.sidebar.search' | sdTranslate;\n <div class=\"c-menu-search-field\">\n <sd-icon\n class=\"c-menu-search-icon\"\n fontSet=\"material-icons-outlined\"\n name=\"search\"\n size=\"18px\"\n aria-hidden=\"true\"></sd-icon>\n <input\n #menuSearch\n class=\"c-menu-search-input\"\n type=\"search\"\n autocomplete=\"off\"\n [attr.aria-label]=\"_searchLabel\"\n [placeholder]=\"_searchLabel\"\n data-autoId=\"layout-v1-menu-search\"\n [ngModel]=\"_searchText\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onFilterSearchText($event)\" />\n @if (_searchText) {\n <button\n type=\"button\"\n class=\"c-menu-search-clear\"\n [attr.aria-label]=\"'core.module.layout.sidebar.clear-search' | sdTranslate\"\n (click)=\"onClearSearchText(); menuSearch.focus()\">\n <sd-icon fontSet=\"material-icons-outlined\" name=\"close\" size=\"18px\" aria-hidden=\"true\"></sd-icon>\n </button>\n }\n </div>\n </div>\n }\n <div class=\"c-menu-tree-container\">\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\" [style.backgroundColor]=\"'transparent'\">\n <mat-nested-tree-node *matTreeNodeDef=\"let node; when: !hasChild\">\n <div\n class=\"c-menu-node\"\n [class.is-active]=\"_currentPath | menuFocus: node : _activeMenuPath\"\n (mouseenter)=\"onMouseOverMenuNode($event, node)\"\n (mouseleave)=\"onMouseLeaveMenuNode($event, node)\"\n [ngStyle]=\"{\n backgroundColor:\n (_currentPath | menuFocus: node : _activeMenuPath)\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\">\n <div class=\"c-menu-node-description\" [class.d-none]=\"!_isShowSidebar\">\n <a\n class=\"c-menu-node-description-content\"\n [href]=\"menuNodeHref(node)\"\n [attr.aria-current]=\"(_currentPath | menuFocus: node : _activeMenuPath) ? 'page' : null\"\n (click)=\"onMenuNodeClick($event, node)\"\n [ngStyle]=\"{\n color:\n (_currentPath | menuFocus: node : _activeMenuPath)\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text, #1a1b1f)',\n }\">\n @if (node.iconUrl) {\n <img class=\"c-menu-node-icon\" [src]=\"node.iconUrl\" alt=\"\" />\n } @else if (node.icon) {\n <sd-icon class=\"c-menu-node-icon\" [name]=\"node.icon\" size=\"20px\" fontSet=\"material-icons-outlined\"></sd-icon>\n }\n <span class=\"c-menu-node-label\" [innerHTML]=\"node.title | highLightSearch: _searchText | sdSafeHtml\"></span>\n </a>\n\n <!-- why: n\u00FAt ghim tr\u01B0\u1EDBc \u0111\u00E2y l\u00E0 <sd-icon fontSet=\"material-icons-outlined\" (click)> \u2014 custom element kh\u00F4ng nh\u1EADn\n focus b\u00E0n ph\u00EDm v\u00E0 kh\u00F4ng c\u00F3 t\u00EAn kh\u1EA3 truy c\u1EADp, n\u00EAn kh\u00F4ng ghim \u0111\u01B0\u1EE3c b\u1EB1ng ph\u00EDm.\n \u0110\u1ED5i sang <button type=\"button\"> + aria-pressed, gi\u1ED1ng pattern \u0111\u00E3 d\u00F9ng \u1EDF\n `shared/menu-tree`. -->\n @if (_sidebar?.pin?.enabled) {\n <button\n type=\"button\"\n class=\"c-menu-node-description-icon-pin\"\n [style.opacity]=\"isPinnedNode(node) || isHoveredNode(node) ? '1' : null\"\n [style.color]=\"\n isPinnedNode(node) || isHoveredNode(node) ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)' : null\n \"\n [attr.aria-pressed]=\"isPinnedNode(node)\"\n [attr.aria-label]=\"\n (isPinnedNode(node) ? 'core.module.layout.menu.unpin' : 'core.module.layout.menu.pin')\n | sdTranslate: { title: node.title }\n \"\n (click)=\"onTogglePin($event, node)\">\n <sd-icon fontSet=\"material-icons-outlined\" size=\"18px\" name=\"push_pin\"></sd-icon>\n </button>\n }\n </div>\n </div>\n </mat-nested-tree-node>\n\n <mat-nested-tree-node\n *matTreeNodeDef=\"let node; when: hasChild\"\n [class]=\"{ expanded: treeControl.isExpanded(node), isfocus: _currentPath | menuFocus: node : _activeMenuPath }\">\n <div\n class=\"c-menu-node\"\n [class.is-ancestor]=\"_currentPath | menuFocus: node : _activeMenuPath\"\n (mouseenter)=\"onMouseOverMenuNode($event, node)\"\n (mouseleave)=\"onMouseLeaveMenuNode($event, node)\">\n <div class=\"d-flex align-items-center\" style=\"gap: 10px; width: 100%\">\n <button\n type=\"button\"\n [class.d-none]=\"!_isShowSidebar\"\n class=\"c-menu-node-description\"\n [attr.aria-expanded]=\"treeControl.isExpanded(node)\"\n (click)=\"onToggleMenuNode(node)\">\n <span class=\"c-menu-node-description-content\">\n @if (node.iconUrl) {\n <img class=\"c-menu-node-icon\" [src]=\"node.iconUrl\" alt=\"\" />\n } @else if (node.icon) {\n <sd-icon class=\"c-menu-node-icon\" [name]=\"node.icon\" size=\"20px\" fontSet=\"material-icons-outlined\"></sd-icon>\n }\n <span class=\"c-menu-node-label\" [innerHTML]=\"node.title | highLightSearch: _searchText | sdSafeHtml\"></span>\n </span>\n <sd-icon\n fontSet=\"material-icons-outlined\"\n aria-hidden=\"true\"\n size=\"18px\"\n class=\"c-menu-node-description-icon-expand\"\n [name]=\"treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'\"></sd-icon>\n </button>\n </div>\n </div>\n <div class=\"c-menu-node-group\" role=\"group\" [class.d-none]=\"!treeControl.isExpanded(node)\">\n <ng-container matTreeNodeOutlet></ng-container>\n </div>\n </mat-nested-tree-node>\n </mat-tree>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"c-footer\">\n <lib-layout-user\n [userInfo]=\"_userInfo\"\n [isMobileOrTablet]=\"isMobile()\"\n (menuOpened)=\"onUserMenuOpened()\"\n (menuClosed)=\"onUserMenuClosed()\"\n [isShowSidebar]=\"_isShowSidebar\"\n (toggleMenuLock)=\"toggleMenuLock($event)\">\n </lib-layout-user>\n </div>\n </div>\n}\n", styles: ["::ng-deep .mat-mdc-tooltip-panel:has(.c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140){pointer-events:none}:host{display:block;height:100%}.wrapper{--sidebar-surface: var(--sd-white, #fff);--sidebar-rail: color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 35%, var(--sidebar-surface));--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);position:relative;display:flex;flex-direction:column;width:min(304px,100vw);color:var(--sidebar-ink);background:linear-gradient(to right,var(--sidebar-rail) 56px,var(--sidebar-surface) 56px)}.wrapper,.wrapper *{box-sizing:border-box}.wrapper:before{content:\"\";position:absolute;inset:0 auto 0 55px;width:1px;background:var(--sidebar-line);pointer-events:none}.c-header{flex:0 0 auto;display:grid;grid-template-columns:56px minmax(0,1fr);min-height:42px}.c-logo{grid-column:1;display:grid;place-items:center;height:42px}.c-logo a{display:grid;place-items:center;width:38px;height:40px;border-radius:9px;color:var(--sidebar-muted)}.c-logo img{width:30px;height:30px;object-fit:contain}.c-title-menu-group{grid-column:2;display:flex;align-items:center;min-width:0;padding:10px 14px 12px;color:var(--sidebar-ink);font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-bold, 700);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px;overflow-wrap:anywhere}.c-body{flex:1;min-height:0;overflow:hidden}.c-menu{display:flex;height:100%}.c-menu-group{display:flex;flex:0 0 56px;flex-direction:column;align-items:center;gap:10px;width:56px;min-height:0;margin-bottom:86px;padding:5px 0 8px;overflow-y:auto;scrollbar-width:none}.c-menu-group>button{flex:0 0 auto;border-radius:9px}.c-menu-group .c-menu-group-icon{display:flex;align-items:center;justify-content:center;width:38px;height:40px;min-height:40px;border-radius:9px;font-size:var(--sd-font-size-22, 22px)}.c-menu-group .c-menu-group-icon img{width:22px;height:22px;object-fit:contain}.c-menu-tree{display:flex;flex:1;flex-direction:column;min-width:0;min-height:0}.c-menu-tree-search{flex:0 0 auto;padding:0 14px 12px;border-bottom:1px solid var(--sidebar-line)}.c-menu-search-field{display:flex;align-items:center;gap:8px;height:36px;padding:0 9px;border:1px solid var(--sidebar-line);border-radius:7px;background:var(--sidebar-rail);color:var(--sidebar-muted)}.c-menu-search-field:hover{border-color:color-mix(in srgb,var(--sidebar-muted) 35%,var(--sidebar-surface))}.c-menu-search-field:focus-within{border-color:color-mix(in srgb,var(--sidebar-accent, var(--sd-primary, #005cbb)) 75%,var(--sidebar-surface));background:var(--sidebar-surface)}.c-menu-search-icon{flex:0 0 18px;width:18px;height:18px;font-size:var(--sd-font-size-18, 18px);pointer-events:none}.c-menu-search-input{flex:1 1 0;width:0;min-width:0;height:100%;margin:0;padding:0;border:0;border-radius:0;outline:none;box-shadow:none;appearance:none;background:transparent;color:var(--sidebar-ink);font:inherit;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-20, 20px)}.c-menu-search-input:focus,.c-menu-search-input:focus-visible{outline:none;box-shadow:none}.c-menu-search-input::placeholder{color:var(--sidebar-muted);opacity:1}.c-menu-search-input::-webkit-search-decoration,.c-menu-search-input::-webkit-search-cancel-button{appearance:none}.c-menu-search-clear{display:grid;flex:0 0 24px;place-items:center;width:24px;min-width:24px;height:24px;margin:0;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sidebar-muted);cursor:pointer}.c-menu-search-clear sd-icon,.c-menu-search-clear mat-icon{width:18px;height:18px;font-size:var(--sd-font-size-18, 18px)}.c-menu-search-clear:hover{background:color-mix(in srgb,var(--sidebar-ink) 7%,transparent);color:var(--sidebar-ink)}.c-menu-search-clear:focus-visible{outline:1px solid var(--sidebar-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.c-menu-tree-container{flex:1;min-height:0;padding:10px 8px 14px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent;overscroll-behavior:contain}.c-menu-node{position:relative;display:flex;align-items:center;width:100%;min-height:40px;margin:2px 0;padding:0;border-radius:7px;cursor:pointer;color:var(--sidebar-ink);font-size:var(--sd-font-size-13, 13px);line-height:1.4}.c-menu-node-description{display:flex;flex:1;align-items:center;gap:6px;width:100%;min-width:0;min-height:40px;padding:0;border:0;border-radius:inherit;color:inherit;background:transparent;font:inherit;text-align:left;cursor:pointer}.c-menu-node-description-content{display:flex;flex:1;align-items:center;align-self:stretch;gap:9px;min-width:0;padding:8px;color:inherit;font:inherit;font-weight:var(--sd-font-weight-medium, 500);text-decoration:none}.c-menu-node-label{flex:1;min-width:0;white-space:normal;overflow-wrap:anywhere}.c-menu-node-icon{flex:0 0 20px;width:20px;height:20px;font-size:var(--sd-font-size-20, 20px);object-fit:contain;color:var(--sidebar-muted)}.c-menu-node-description-icon-expand,.c-menu-node-description-icon-pin{display:flex;flex:0 0 20px;align-items:center;justify-content:center;width:20px;height:24px;margin-right:6px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sidebar-muted);font-size:var(--sd-font-size-18, 18px);cursor:pointer}.c-menu-node-description-icon-pin{opacity:0}.c-menu-node-description-icon-pin:focus-visible{opacity:1!important}.c-menu-node.is-ancestor{color:var(--sidebar-accent)}.c-menu-node.is-ancestor .c-menu-node-description-content,.c-menu-node.is-ancestor .c-menu-node-icon,.c-menu-node.is-ancestor .c-menu-node-description-icon-expand{color:inherit}.c-menu-node.is-active{color:var(--sidebar-accent)}.c-menu-node.is-active .c-menu-node-icon{color:inherit}.c-menu-node.is-active:before{content:\"\";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:var(--sd-radius-2, 2px);background:var(--sidebar-accent)}.c-menu-node-group{position:relative;margin:0 0 7px 19px;padding:1px 0 1px 16px;border-left:1px solid var(--sidebar-line)}.c-menu-node-group .c-menu-node{min-height:34px;border-radius:var(--sd-radius-6, 6px)}.c-menu-node-group .c-menu-node-description-content{padding:7px 8px;font-weight:var(--sd-font-weight-regular, 400)}.c-menu-node-group .c-menu-node-description{min-height:34px}.c-menu-node-group .c-menu-node-icon{display:none}.c-menu-node-group .c-menu-node.is-active:before{left:-18px}.c-menu-node-group .c-menu-node.is-active .c-menu-node-description-content,.c-menu-node-group .c-menu-node.is-ancestor .c-menu-node-description-content{font-weight:var(--sd-font-weight-medium, 500)}.c-menu-node-group .c-menu-node-group{margin-left:8px;padding-left:7px}.c-menu-node-group .c-menu-node-group .c-menu-node.is-active:before{left:-9px}.c-footer{position:absolute;bottom:0;left:0;width:56px;height:86px;background:var(--sidebar-rail)}a:focus-visible,button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sidebar-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:-2px}@media(pointer:coarse){.c-menu-node,.c-menu-node-group .c-menu-node,.c-menu-node-description,.c-menu-node-group .c-menu-node-description{min-height:44px}}@media(prefers-reduced-motion:reduce){.c-menu-group-icon,.c-menu-node,.c-menu-node *{transition:none!important}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: MatTreeModule }, { kind: "directive", type: i3.MatNestedTreeNode, selector: "mat-nested-tree-node", inputs: ["matNestedTreeNode", "disabled", "tabIndex"], outputs: ["activation", "expandedChange"], exportAs: ["matNestedTreeNode"] }, { kind: "directive", type: i3.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "component", type: i3.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i3.MatTreeNodeOutlet, selector: "[matTreeNodeOutlet]" }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: LayoutUserComponent$1, selector: "lib-layout-user", inputs: ["isMobileOrTablet", "isMenuLock", "isShowSidebar", "userInfo"], outputs: ["menuClosed", "menuOpened", "toggleMenuLock"] }, { kind: "pipe", type: SdSafeHtmlPipe, name: "sdSafeHtml" }, { kind: "pipe", type: MenuFocusPipe, name: "menuFocus" }, { kind: "pipe", type: HighlightSearchPipe, name: "highLightSearch" }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2279
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSidebarV1Panel, isStandalone: true, selector: "sd-sidebar-v1-panel", inputs: { isShowSidebar: { classPropertyName: "isShowSidebar", publicName: "isShowSidebar", isSignal: true, isRequired: true, transformFunction: null }, menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: true, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null }, isMobile: { classPropertyName: "isMobile", publicName: "isMobile", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandSideBar: "expandSideBar", popupUserMenuClosed: "popupUserMenuClosed", popupUserMenuOpened: "popupUserMenuOpened", showSideBar: "showSideBar" }, viewQueries: [{ propertyName: "headerContextSwitcher", first: true, predicate: ["headerContextSwitcher"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _userInfo = userInfo();\n@let _sidebar = sidebar();\n@let _isShowSidebar = isShowSidebar();\n@let _searchText = searchText();\n@let _currentPath = currentPath();\n@let _activeMenuPath = activeMenuPath();\n@let _idMenuGroupActive = idMenuGroupActive();\n@let _pinnedMenuGroup = pinnedMenuGroup();\n\n@if (_userInfo && _sidebar) {\n <div\n class=\"wrapper\"\n [style.--sidebar-accent]=\"_sidebar.brandColor || 'var(--sd-primary, #005cbb)'\"\n [style.height]=\"isMobile() ? '100dvh' : '100%'\">\n <div #headerElement class=\"c-header\">\n <div #logoElement class=\"c-logo\">\n <a\n href=\"/layout/home\"\n [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\"\n (click)=\"$event.preventDefault(); openHomePage()\">\n @if (logoUrl(); as _logoUrl) {\n <img alt=\"\" [src]=\"_logoUrl\" />\n } @else {\n <sd-icon fontSet=\"material-icons-outlined\" name=\"apps\"></sd-icon>\n }\n </a>\n </div>\n <!-- Context switcher (D-010): avatar ngay d\u01B0\u1EDBi logo khi thu g\u1ECDn v\u1EC1 rail, d\u00F2ng ph\u1EE5 d\u01B0\u1EDBi ti\u00EAu \u0111\u1EC1 khi m\u1EDF. -->\n @if (_sidebar.context && !_isShowSidebar) {\n <sd-layout-context-switcher class=\"c-rail-context\" appearance=\"rail\" [configuration]=\"_sidebar.context\" [anchor]=\"logoElement\" />\n }\n <div class=\"c-title-menu-group\" [class.d-none]=\"!_isShowSidebar\" [class.c-title-menu-group--context]=\"!!_sidebar.context\">\n <span>{{ titleMenuGroup() || _sidebar.defaultTitle || 'Back Office' }}</span>\n @if (_sidebar.context && _isShowSidebar) {\n <sd-layout-context-switcher\n #headerContextSwitcher\n class=\"c-header-context\"\n appearance=\"header\"\n [configuration]=\"_sidebar.context\"\n [anchor]=\"headerElement\" />\n }\n </div>\n </div>\n <div class=\"c-body\">\n <div class=\"c-menu\">\n <div class=\"c-menu-group\">\n @if (_sidebar?.pin?.enabled && _pinnedMenuGroup.children?.length) {\n <button\n type=\"button\"\n [attr.aria-label]=\"'core.module.layout.sidebar.pinned' | sdTranslate\"\n (mouseenter)=\"onMouseOverMenuGroupNode($event, _pinnedMenuGroup)\"\n (mouseleave)=\"onMouseLeaveMenuGroupNode($event, _pinnedMenuGroup)\"\n (click)=\"expandPinnedGroup()\"\n [matTooltip]=\"'core.module.layout.sidebar.pinned' | sdTranslate\"\n [matTooltipClass]=\"'c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140'\"\n [matTooltipPosition]=\"'right'\"\n style=\"padding: 0; margin: 0; border: none; background-color: transparent\">\n <sd-icon\n fontSet=\"material-icons-outlined\"\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n color: isPinnedMenuGroupActive()\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text-secondary, #44474f)',\n backgroundColor: isPinnedMenuGroupActive()\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\"\n name=\"push_pin\"></sd-icon>\n </button>\n }\n @for (nodeMenuGroup of menus(); track nodeMenuGroup.id) {\n <button\n type=\"button\"\n [attr.aria-label]=\"nodeMenuGroup.tooltipTitle || nodeMenuGroup.title\"\n (mouseenter)=\"onMouseOverMenuGroupNode($event, nodeMenuGroup)\"\n (mouseleave)=\"onMouseLeaveMenuGroupNode($event, nodeMenuGroup)\"\n (click)=\"expandMenuGroup(nodeMenuGroup)\"\n [matTooltip]=\"nodeMenuGroup.tooltipTitle || nodeMenuGroup.title\"\n [matTooltipClass]=\"'c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140'\"\n [matTooltipPosition]=\"'right'\"\n style=\"padding: 0; margin: 0; border: none; background-color: transparent\">\n @if (nodeMenuGroup.iconUrl) {\n <span\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n backgroundColor:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\">\n <img width=\"24px\" height=\"24px\" [src]=\"nodeMenuGroup.iconUrl\" [alt]=\"nodeMenuGroup.title\" />\n </span>\n } @else {\n <sd-icon\n fontSet=\"material-icons-outlined\"\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n color:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text-secondary, #44474f)',\n backgroundColor:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\"\n [name]=\"nodeMenuGroup.icon || 'widgets'\"></sd-icon>\n }\n </button>\n }\n </div>\n <div class=\"c-menu-tree\" [class.d-none]=\"!_isShowSidebar\" [attr.inert]=\"!_isShowSidebar ? '' : null\">\n @if (totalMenuInMenusByGroup() > 10) {\n <div class=\"c-menu-tree-search\">\n @let _searchLabel = 'core.module.layout.sidebar.search' | sdTranslate;\n <div class=\"c-menu-search-field\">\n <sd-icon\n class=\"c-menu-search-icon\"\n fontSet=\"material-icons-outlined\"\n name=\"search\"\n size=\"18px\"\n aria-hidden=\"true\"></sd-icon>\n <input\n #menuSearch\n class=\"c-menu-search-input\"\n type=\"search\"\n autocomplete=\"off\"\n [attr.aria-label]=\"_searchLabel\"\n [placeholder]=\"_searchLabel\"\n data-autoId=\"layout-v1-menu-search\"\n [ngModel]=\"_searchText\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onFilterSearchText($event)\" />\n @if (_searchText) {\n <button\n type=\"button\"\n class=\"c-menu-search-clear\"\n [attr.aria-label]=\"'core.module.layout.sidebar.clear-search' | sdTranslate\"\n (click)=\"onClearSearchText(); menuSearch.focus()\">\n <sd-icon fontSet=\"material-icons-outlined\" name=\"close\" size=\"18px\" aria-hidden=\"true\"></sd-icon>\n </button>\n }\n </div>\n </div>\n }\n <div class=\"c-menu-tree-container\">\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\" [style.backgroundColor]=\"'transparent'\">\n <mat-nested-tree-node *matTreeNodeDef=\"let node; when: !hasChild\">\n <div\n class=\"c-menu-node\"\n [class.is-active]=\"_currentPath | menuFocus: node : _activeMenuPath\"\n (mouseenter)=\"onMouseOverMenuNode($event, node)\"\n (mouseleave)=\"onMouseLeaveMenuNode($event, node)\"\n [ngStyle]=\"{\n backgroundColor:\n (_currentPath | menuFocus: node : _activeMenuPath)\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\">\n <div class=\"c-menu-node-description\" [class.d-none]=\"!_isShowSidebar\">\n <a\n class=\"c-menu-node-description-content\"\n [href]=\"menuNodeHref(node)\"\n [attr.aria-current]=\"(_currentPath | menuFocus: node : _activeMenuPath) ? 'page' : null\"\n (click)=\"onMenuNodeClick($event, node)\"\n [ngStyle]=\"{\n color:\n (_currentPath | menuFocus: node : _activeMenuPath)\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text, #1a1b1f)',\n }\">\n @if (node.iconUrl) {\n <img class=\"c-menu-node-icon\" [src]=\"node.iconUrl\" alt=\"\" />\n } @else if (node.icon) {\n <sd-icon class=\"c-menu-node-icon\" [name]=\"node.icon\" size=\"20px\" fontSet=\"material-icons-outlined\"></sd-icon>\n }\n <span class=\"c-menu-node-label\" [innerHTML]=\"node.title | highLightSearch: _searchText | sdSafeHtml\"></span>\n </a>\n\n <!-- why: n\u00FAt ghim tr\u01B0\u1EDBc \u0111\u00E2y l\u00E0 <sd-icon fontSet=\"material-icons-outlined\" (click)> \u2014 custom element kh\u00F4ng nh\u1EADn\n focus b\u00E0n ph\u00EDm v\u00E0 kh\u00F4ng c\u00F3 t\u00EAn kh\u1EA3 truy c\u1EADp, n\u00EAn kh\u00F4ng ghim \u0111\u01B0\u1EE3c b\u1EB1ng ph\u00EDm.\n \u0110\u1ED5i sang <button type=\"button\"> + aria-pressed, gi\u1ED1ng pattern \u0111\u00E3 d\u00F9ng \u1EDF\n `shared/menu-tree`. -->\n @if (_sidebar?.pin?.enabled) {\n <button\n type=\"button\"\n class=\"c-menu-node-description-icon-pin\"\n [style.opacity]=\"isPinnedNode(node) || isHoveredNode(node) ? '1' : null\"\n [style.color]=\"\n isPinnedNode(node) || isHoveredNode(node) ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)' : null\n \"\n [attr.aria-pressed]=\"isPinnedNode(node)\"\n [attr.aria-label]=\"\n (isPinnedNode(node) ? 'core.module.layout.menu.unpin' : 'core.module.layout.menu.pin')\n | sdTranslate: { title: node.title }\n \"\n (click)=\"onTogglePin($event, node)\">\n <sd-icon fontSet=\"material-icons-outlined\" size=\"18px\" name=\"push_pin\"></sd-icon>\n </button>\n }\n </div>\n </div>\n </mat-nested-tree-node>\n\n <mat-nested-tree-node\n *matTreeNodeDef=\"let node; when: hasChild\"\n [class]=\"{ expanded: treeControl.isExpanded(node), isfocus: _currentPath | menuFocus: node : _activeMenuPath }\">\n <div\n class=\"c-menu-node\"\n [class.is-ancestor]=\"_currentPath | menuFocus: node : _activeMenuPath\"\n (mouseenter)=\"onMouseOverMenuNode($event, node)\"\n (mouseleave)=\"onMouseLeaveMenuNode($event, node)\">\n <div class=\"d-flex align-items-center\" style=\"gap: 10px; width: 100%\">\n <button\n type=\"button\"\n [class.d-none]=\"!_isShowSidebar\"\n class=\"c-menu-node-description\"\n [attr.aria-expanded]=\"treeControl.isExpanded(node)\"\n (click)=\"onToggleMenuNode(node)\">\n <span class=\"c-menu-node-description-content\">\n @if (node.iconUrl) {\n <img class=\"c-menu-node-icon\" [src]=\"node.iconUrl\" alt=\"\" />\n } @else if (node.icon) {\n <sd-icon class=\"c-menu-node-icon\" [name]=\"node.icon\" size=\"20px\" fontSet=\"material-icons-outlined\"></sd-icon>\n }\n <span class=\"c-menu-node-label\" [innerHTML]=\"node.title | highLightSearch: _searchText | sdSafeHtml\"></span>\n </span>\n <sd-icon\n fontSet=\"material-icons-outlined\"\n aria-hidden=\"true\"\n size=\"18px\"\n class=\"c-menu-node-description-icon-expand\"\n [name]=\"treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'\"></sd-icon>\n </button>\n </div>\n </div>\n <div class=\"c-menu-node-group\" role=\"group\" [class.d-none]=\"!treeControl.isExpanded(node)\">\n <ng-container matTreeNodeOutlet></ng-container>\n </div>\n </mat-nested-tree-node>\n </mat-tree>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"c-footer\">\n <lib-layout-user\n [userInfo]=\"_userInfo\"\n [isMobileOrTablet]=\"isMobile()\"\n (menuOpened)=\"onUserMenuOpened()\"\n (menuClosed)=\"onUserMenuClosed()\"\n [isShowSidebar]=\"_isShowSidebar\"\n (toggleMenuLock)=\"toggleMenuLock($event)\">\n </lib-layout-user>\n </div>\n </div>\n}\n", styles: ["::ng-deep .mat-mdc-tooltip-panel:has(.c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140){pointer-events:none}:host{display:block;height:100%}.wrapper{--sidebar-surface: var(--sd-white, #fff);--sidebar-rail: color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 35%, var(--sidebar-surface));--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);position:relative;display:flex;flex-direction:column;width:min(304px,100vw);color:var(--sidebar-ink);background:linear-gradient(to right,var(--sidebar-rail) 56px,var(--sidebar-surface) 56px)}.wrapper,.wrapper *{box-sizing:border-box}.wrapper:before{content:\"\";position:absolute;inset:0 auto 0 55px;width:1px;background:var(--sidebar-line);pointer-events:none}.c-header{flex:0 0 auto;display:grid;grid-template-columns:56px minmax(0,1fr);min-height:42px}.c-logo{grid-column:1;display:grid;place-items:center;height:42px}.c-logo a{display:grid;place-items:center;width:38px;height:40px;border-radius:9px;color:var(--sidebar-muted)}.c-logo img{width:30px;height:30px;object-fit:contain}.c-title-menu-group{grid-column:2;display:flex;align-items:center;min-width:0;padding:10px 14px 12px;color:var(--sidebar-ink);font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-bold, 700);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px;overflow-wrap:anywhere}.c-title-menu-group--context{--sd-layout-context-switcher-popover-width: calc(min(304px, 100vw) - 24px) ;flex-direction:column;align-items:stretch;justify-content:center}.c-header-context{font-weight:var(--sd-font-weight-regular, 400);letter-spacing:normal}.c-rail-context{grid-column:1;grid-row:2}.c-rail-context:not(:empty){margin:4px 0 6px}@media(pointer:coarse){.c-rail-context:not(:empty){margin-top:8px}}.c-body{flex:1;min-height:0;overflow:hidden}.c-menu{display:flex;height:100%}.c-menu-group{display:flex;flex:0 0 56px;flex-direction:column;align-items:center;gap:10px;width:56px;min-height:0;margin-bottom:86px;padding:5px 0 8px;overflow-y:auto;scrollbar-width:none}.c-menu-group>button{flex:0 0 auto;border-radius:9px}.c-menu-group .c-menu-group-icon{display:flex;align-items:center;justify-content:center;width:38px;height:40px;min-height:40px;border-radius:9px;font-size:var(--sd-font-size-22, 22px)}.c-menu-group .c-menu-group-icon img{width:22px;height:22px;object-fit:contain}.c-menu-tree{display:flex;flex:1;flex-direction:column;min-width:0;min-height:0}.c-menu-tree-search{flex:0 0 auto;padding:0 14px 12px;border-bottom:1px solid var(--sidebar-line)}.c-menu-search-field{display:flex;align-items:center;gap:8px;height:36px;padding:0 9px;border:1px solid var(--sidebar-line);border-radius:7px;background:var(--sidebar-rail);color:var(--sidebar-muted)}.c-menu-search-field:hover{border-color:color-mix(in srgb,var(--sidebar-muted) 35%,var(--sidebar-surface))}.c-menu-search-field:focus-within{border-color:color-mix(in srgb,var(--sidebar-accent, var(--sd-primary, #005cbb)) 75%,var(--sidebar-surface));background:var(--sidebar-surface)}.c-menu-search-icon{flex:0 0 18px;width:18px;height:18px;font-size:var(--sd-font-size-18, 18px);pointer-events:none}.c-menu-search-input{flex:1 1 0;width:0;min-width:0;height:100%;margin:0;padding:0;border:0;border-radius:0;outline:none;box-shadow:none;appearance:none;background:transparent;color:var(--sidebar-ink);font:inherit;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-20, 20px)}.c-menu-search-input:focus,.c-menu-search-input:focus-visible{outline:none;box-shadow:none}.c-menu-search-input::placeholder{color:var(--sidebar-muted);opacity:1}.c-menu-search-input::-webkit-search-decoration,.c-menu-search-input::-webkit-search-cancel-button{appearance:none}.c-menu-search-clear{display:grid;flex:0 0 24px;place-items:center;width:24px;min-width:24px;height:24px;margin:0;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sidebar-muted);cursor:pointer}.c-menu-search-clear sd-icon,.c-menu-search-clear mat-icon{width:18px;height:18px;font-size:var(--sd-font-size-18, 18px)}.c-menu-search-clear:hover{background:color-mix(in srgb,var(--sidebar-ink) 7%,transparent);color:var(--sidebar-ink)}.c-menu-search-clear:focus-visible{outline:1px solid var(--sidebar-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.c-menu-tree-container{flex:1;min-height:0;padding:10px 8px 14px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent;overscroll-behavior:contain}.c-menu-node{position:relative;display:flex;align-items:center;width:100%;min-height:40px;margin:2px 0;padding:0;border-radius:7px;cursor:pointer;color:var(--sidebar-ink);font-size:var(--sd-font-size-13, 13px);line-height:1.4}.c-menu-node-description{display:flex;flex:1;align-items:center;gap:6px;width:100%;min-width:0;min-height:40px;padding:0;border:0;border-radius:inherit;color:inherit;background:transparent;font:inherit;text-align:left;cursor:pointer}.c-menu-node-description-content{display:flex;flex:1;align-items:center;align-self:stretch;gap:9px;min-width:0;padding:8px;color:inherit;font:inherit;font-weight:var(--sd-font-weight-medium, 500);text-decoration:none}.c-menu-node-label{flex:1;min-width:0;white-space:normal;overflow-wrap:anywhere}.c-menu-node-icon{flex:0 0 20px;width:20px;height:20px;font-size:var(--sd-font-size-20, 20px);object-fit:contain;color:var(--sidebar-muted)}.c-menu-node-description-icon-expand,.c-menu-node-description-icon-pin{display:flex;flex:0 0 20px;align-items:center;justify-content:center;width:20px;height:24px;margin-right:6px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sidebar-muted);font-size:var(--sd-font-size-18, 18px);cursor:pointer}.c-menu-node-description-icon-pin{opacity:0}.c-menu-node-description-icon-pin:focus-visible{opacity:1!important}.c-menu-node.is-ancestor{color:var(--sidebar-accent)}.c-menu-node.is-ancestor .c-menu-node-description-content,.c-menu-node.is-ancestor .c-menu-node-icon,.c-menu-node.is-ancestor .c-menu-node-description-icon-expand{color:inherit}.c-menu-node.is-active{color:var(--sidebar-accent)}.c-menu-node.is-active .c-menu-node-icon{color:inherit}.c-menu-node.is-active:before{content:\"\";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:var(--sd-radius-2, 2px);background:var(--sidebar-accent)}.c-menu-node-group{position:relative;margin:0 0 7px 19px;padding:1px 0 1px 16px;border-left:1px solid var(--sidebar-line)}.c-menu-node-group .c-menu-node{min-height:34px;border-radius:var(--sd-radius-6, 6px)}.c-menu-node-group .c-menu-node-description-content{padding:7px 8px;font-weight:var(--sd-font-weight-regular, 400)}.c-menu-node-group .c-menu-node-description{min-height:34px}.c-menu-node-group .c-menu-node-icon{display:none}.c-menu-node-group .c-menu-node.is-active:before{left:-18px}.c-menu-node-group .c-menu-node.is-active .c-menu-node-description-content,.c-menu-node-group .c-menu-node.is-ancestor .c-menu-node-description-content{font-weight:var(--sd-font-weight-medium, 500)}.c-menu-node-group .c-menu-node-group{margin-left:8px;padding-left:7px}.c-menu-node-group .c-menu-node-group .c-menu-node.is-active:before{left:-9px}.c-footer{position:absolute;bottom:0;left:0;width:56px;height:86px;background:var(--sidebar-rail)}a:focus-visible,button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sidebar-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:-2px}@media(pointer:coarse){.c-menu-node,.c-menu-node-group .c-menu-node,.c-menu-node-description,.c-menu-node-group .c-menu-node-description{min-height:44px}}@media(prefers-reduced-motion:reduce){.c-menu-group-icon,.c-menu-node,.c-menu-node *{transition:none!important}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: MatTreeModule }, { kind: "directive", type: i3.MatNestedTreeNode, selector: "mat-nested-tree-node", inputs: ["matNestedTreeNode", "disabled", "tabIndex"], outputs: ["activation", "expandedChange"], exportAs: ["matNestedTreeNode"] }, { kind: "directive", type: i3.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "component", type: i3.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i3.MatTreeNodeOutlet, selector: "[matTreeNodeOutlet]" }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: LayoutUserComponent$1, selector: "lib-layout-user", inputs: ["isMobileOrTablet", "isMenuLock", "isShowSidebar", "userInfo"], outputs: ["menuClosed", "menuOpened", "toggleMenuLock"] }, { kind: "component", type: SdLayoutContextSwitcher, selector: "sd-layout-context-switcher", inputs: ["configuration", "appearance", "placement", "anchor"] }, { kind: "pipe", type: SdSafeHtmlPipe, name: "sdSafeHtml" }, { kind: "pipe", type: MenuFocusPipe, name: "menuFocus" }, { kind: "pipe", type: HighlightSearchPipe, name: "highLightSearch" }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1566
2280
  }
1567
2281
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarV1Panel, decorators: [{
1568
2282
  type: Component,
@@ -1578,8 +2292,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
1578
2292
  HighlightSearchPipe,
1579
2293
  LayoutUserComponent$1,
1580
2294
  SdTranslatePipe,
1581
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let _userInfo = userInfo();\n@let _sidebar = sidebar();\n@let _isShowSidebar = isShowSidebar();\n@let _searchText = searchText();\n@let _currentPath = currentPath();\n@let _activeMenuPath = activeMenuPath();\n@let _idMenuGroupActive = idMenuGroupActive();\n@let _pinnedMenuGroup = pinnedMenuGroup();\n\n@if (_userInfo && _sidebar) {\n <div\n class=\"wrapper\"\n [style.--sidebar-accent]=\"_sidebar.brandColor || 'var(--sd-primary, #005cbb)'\"\n [style.height]=\"isMobile() ? '100dvh' : '100%'\">\n <div class=\"c-header\">\n <div class=\"c-logo\">\n <a\n href=\"/layout/home\"\n [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\"\n (click)=\"$event.preventDefault(); openHomePage()\">\n @if (logoUrl(); as _logoUrl) {\n <img alt=\"\" [src]=\"_logoUrl\" />\n } @else {\n <sd-icon fontSet=\"material-icons-outlined\" name=\"apps\"></sd-icon>\n }\n </a>\n </div>\n <div class=\"c-title-menu-group\" [class.d-none]=\"!_isShowSidebar\">\n <span>{{ titleMenuGroup() || _sidebar.defaultTitle || 'Back Office' }}</span>\n </div>\n </div>\n <div class=\"c-body\">\n <div class=\"c-menu\">\n <div class=\"c-menu-group\">\n @if (_sidebar?.pin?.enabled && _pinnedMenuGroup.children?.length) {\n <button\n type=\"button\"\n [attr.aria-label]=\"'core.module.layout.sidebar.pinned' | sdTranslate\"\n (mouseenter)=\"onMouseOverMenuGroupNode($event, _pinnedMenuGroup)\"\n (mouseleave)=\"onMouseLeaveMenuGroupNode($event, _pinnedMenuGroup)\"\n (click)=\"expandPinnedGroup()\"\n [matTooltip]=\"'core.module.layout.sidebar.pinned' | sdTranslate\"\n [matTooltipClass]=\"'c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140'\"\n [matTooltipPosition]=\"'right'\"\n style=\"padding: 0; margin: 0; border: none; background-color: transparent\">\n <sd-icon\n fontSet=\"material-icons-outlined\"\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n color: isPinnedMenuGroupActive()\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text-secondary, #44474f)',\n backgroundColor: isPinnedMenuGroupActive()\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\"\n name=\"push_pin\"></sd-icon>\n </button>\n }\n @for (nodeMenuGroup of menus(); track nodeMenuGroup.id) {\n <button\n type=\"button\"\n [attr.aria-label]=\"nodeMenuGroup.tooltipTitle || nodeMenuGroup.title\"\n (mouseenter)=\"onMouseOverMenuGroupNode($event, nodeMenuGroup)\"\n (mouseleave)=\"onMouseLeaveMenuGroupNode($event, nodeMenuGroup)\"\n (click)=\"expandMenuGroup(nodeMenuGroup)\"\n [matTooltip]=\"nodeMenuGroup.tooltipTitle || nodeMenuGroup.title\"\n [matTooltipClass]=\"'c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140'\"\n [matTooltipPosition]=\"'right'\"\n style=\"padding: 0; margin: 0; border: none; background-color: transparent\">\n @if (nodeMenuGroup.iconUrl) {\n <span\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n backgroundColor:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\">\n <img width=\"24px\" height=\"24px\" [src]=\"nodeMenuGroup.iconUrl\" [alt]=\"nodeMenuGroup.title\" />\n </span>\n } @else {\n <sd-icon\n fontSet=\"material-icons-outlined\"\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n color:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text-secondary, #44474f)',\n backgroundColor:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\"\n [name]=\"nodeMenuGroup.icon || 'widgets'\"></sd-icon>\n }\n </button>\n }\n </div>\n <div class=\"c-menu-tree\" [class.d-none]=\"!_isShowSidebar\" [attr.inert]=\"!_isShowSidebar ? '' : null\">\n @if (totalMenuInMenusByGroup() > 10) {\n <div class=\"c-menu-tree-search\">\n @let _searchLabel = 'core.module.layout.sidebar.search' | sdTranslate;\n <div class=\"c-menu-search-field\">\n <sd-icon\n class=\"c-menu-search-icon\"\n fontSet=\"material-icons-outlined\"\n name=\"search\"\n size=\"18px\"\n aria-hidden=\"true\"></sd-icon>\n <input\n #menuSearch\n class=\"c-menu-search-input\"\n type=\"search\"\n autocomplete=\"off\"\n [attr.aria-label]=\"_searchLabel\"\n [placeholder]=\"_searchLabel\"\n data-autoId=\"layout-v1-menu-search\"\n [ngModel]=\"_searchText\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onFilterSearchText($event)\" />\n @if (_searchText) {\n <button\n type=\"button\"\n class=\"c-menu-search-clear\"\n [attr.aria-label]=\"'core.module.layout.sidebar.clear-search' | sdTranslate\"\n (click)=\"onClearSearchText(); menuSearch.focus()\">\n <sd-icon fontSet=\"material-icons-outlined\" name=\"close\" size=\"18px\" aria-hidden=\"true\"></sd-icon>\n </button>\n }\n </div>\n </div>\n }\n <div class=\"c-menu-tree-container\">\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\" [style.backgroundColor]=\"'transparent'\">\n <mat-nested-tree-node *matTreeNodeDef=\"let node; when: !hasChild\">\n <div\n class=\"c-menu-node\"\n [class.is-active]=\"_currentPath | menuFocus: node : _activeMenuPath\"\n (mouseenter)=\"onMouseOverMenuNode($event, node)\"\n (mouseleave)=\"onMouseLeaveMenuNode($event, node)\"\n [ngStyle]=\"{\n backgroundColor:\n (_currentPath | menuFocus: node : _activeMenuPath)\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\">\n <div class=\"c-menu-node-description\" [class.d-none]=\"!_isShowSidebar\">\n <a\n class=\"c-menu-node-description-content\"\n [href]=\"menuNodeHref(node)\"\n [attr.aria-current]=\"(_currentPath | menuFocus: node : _activeMenuPath) ? 'page' : null\"\n (click)=\"onMenuNodeClick($event, node)\"\n [ngStyle]=\"{\n color:\n (_currentPath | menuFocus: node : _activeMenuPath)\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text, #1a1b1f)',\n }\">\n @if (node.iconUrl) {\n <img class=\"c-menu-node-icon\" [src]=\"node.iconUrl\" alt=\"\" />\n } @else if (node.icon) {\n <sd-icon class=\"c-menu-node-icon\" [name]=\"node.icon\" size=\"20px\" fontSet=\"material-icons-outlined\"></sd-icon>\n }\n <span class=\"c-menu-node-label\" [innerHTML]=\"node.title | highLightSearch: _searchText | sdSafeHtml\"></span>\n </a>\n\n <!-- why: n\u00FAt ghim tr\u01B0\u1EDBc \u0111\u00E2y l\u00E0 <sd-icon fontSet=\"material-icons-outlined\" (click)> \u2014 custom element kh\u00F4ng nh\u1EADn\n focus b\u00E0n ph\u00EDm v\u00E0 kh\u00F4ng c\u00F3 t\u00EAn kh\u1EA3 truy c\u1EADp, n\u00EAn kh\u00F4ng ghim \u0111\u01B0\u1EE3c b\u1EB1ng ph\u00EDm.\n \u0110\u1ED5i sang <button type=\"button\"> + aria-pressed, gi\u1ED1ng pattern \u0111\u00E3 d\u00F9ng \u1EDF\n `shared/menu-tree`. -->\n @if (_sidebar?.pin?.enabled) {\n <button\n type=\"button\"\n class=\"c-menu-node-description-icon-pin\"\n [style.opacity]=\"isPinnedNode(node) || isHoveredNode(node) ? '1' : null\"\n [style.color]=\"\n isPinnedNode(node) || isHoveredNode(node) ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)' : null\n \"\n [attr.aria-pressed]=\"isPinnedNode(node)\"\n [attr.aria-label]=\"\n (isPinnedNode(node) ? 'core.module.layout.menu.unpin' : 'core.module.layout.menu.pin')\n | sdTranslate: { title: node.title }\n \"\n (click)=\"onTogglePin($event, node)\">\n <sd-icon fontSet=\"material-icons-outlined\" size=\"18px\" name=\"push_pin\"></sd-icon>\n </button>\n }\n </div>\n </div>\n </mat-nested-tree-node>\n\n <mat-nested-tree-node\n *matTreeNodeDef=\"let node; when: hasChild\"\n [class]=\"{ expanded: treeControl.isExpanded(node), isfocus: _currentPath | menuFocus: node : _activeMenuPath }\">\n <div\n class=\"c-menu-node\"\n [class.is-ancestor]=\"_currentPath | menuFocus: node : _activeMenuPath\"\n (mouseenter)=\"onMouseOverMenuNode($event, node)\"\n (mouseleave)=\"onMouseLeaveMenuNode($event, node)\">\n <div class=\"d-flex align-items-center\" style=\"gap: 10px; width: 100%\">\n <button\n type=\"button\"\n [class.d-none]=\"!_isShowSidebar\"\n class=\"c-menu-node-description\"\n [attr.aria-expanded]=\"treeControl.isExpanded(node)\"\n (click)=\"onToggleMenuNode(node)\">\n <span class=\"c-menu-node-description-content\">\n @if (node.iconUrl) {\n <img class=\"c-menu-node-icon\" [src]=\"node.iconUrl\" alt=\"\" />\n } @else if (node.icon) {\n <sd-icon class=\"c-menu-node-icon\" [name]=\"node.icon\" size=\"20px\" fontSet=\"material-icons-outlined\"></sd-icon>\n }\n <span class=\"c-menu-node-label\" [innerHTML]=\"node.title | highLightSearch: _searchText | sdSafeHtml\"></span>\n </span>\n <sd-icon\n fontSet=\"material-icons-outlined\"\n aria-hidden=\"true\"\n size=\"18px\"\n class=\"c-menu-node-description-icon-expand\"\n [name]=\"treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'\"></sd-icon>\n </button>\n </div>\n </div>\n <div class=\"c-menu-node-group\" role=\"group\" [class.d-none]=\"!treeControl.isExpanded(node)\">\n <ng-container matTreeNodeOutlet></ng-container>\n </div>\n </mat-nested-tree-node>\n </mat-tree>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"c-footer\">\n <lib-layout-user\n [userInfo]=\"_userInfo\"\n [isMobileOrTablet]=\"isMobile()\"\n (menuOpened)=\"onUserMenuOpened()\"\n (menuClosed)=\"onUserMenuClosed()\"\n [isShowSidebar]=\"_isShowSidebar\"\n (toggleMenuLock)=\"toggleMenuLock($event)\">\n </lib-layout-user>\n </div>\n </div>\n}\n", styles: ["::ng-deep .mat-mdc-tooltip-panel:has(.c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140){pointer-events:none}:host{display:block;height:100%}.wrapper{--sidebar-surface: var(--sd-white, #fff);--sidebar-rail: color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 35%, var(--sidebar-surface));--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);position:relative;display:flex;flex-direction:column;width:min(304px,100vw);color:var(--sidebar-ink);background:linear-gradient(to right,var(--sidebar-rail) 56px,var(--sidebar-surface) 56px)}.wrapper,.wrapper *{box-sizing:border-box}.wrapper:before{content:\"\";position:absolute;inset:0 auto 0 55px;width:1px;background:var(--sidebar-line);pointer-events:none}.c-header{flex:0 0 auto;display:grid;grid-template-columns:56px minmax(0,1fr);min-height:42px}.c-logo{grid-column:1;display:grid;place-items:center;height:42px}.c-logo a{display:grid;place-items:center;width:38px;height:40px;border-radius:9px;color:var(--sidebar-muted)}.c-logo img{width:30px;height:30px;object-fit:contain}.c-title-menu-group{grid-column:2;display:flex;align-items:center;min-width:0;padding:10px 14px 12px;color:var(--sidebar-ink);font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-bold, 700);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px;overflow-wrap:anywhere}.c-body{flex:1;min-height:0;overflow:hidden}.c-menu{display:flex;height:100%}.c-menu-group{display:flex;flex:0 0 56px;flex-direction:column;align-items:center;gap:10px;width:56px;min-height:0;margin-bottom:86px;padding:5px 0 8px;overflow-y:auto;scrollbar-width:none}.c-menu-group>button{flex:0 0 auto;border-radius:9px}.c-menu-group .c-menu-group-icon{display:flex;align-items:center;justify-content:center;width:38px;height:40px;min-height:40px;border-radius:9px;font-size:var(--sd-font-size-22, 22px)}.c-menu-group .c-menu-group-icon img{width:22px;height:22px;object-fit:contain}.c-menu-tree{display:flex;flex:1;flex-direction:column;min-width:0;min-height:0}.c-menu-tree-search{flex:0 0 auto;padding:0 14px 12px;border-bottom:1px solid var(--sidebar-line)}.c-menu-search-field{display:flex;align-items:center;gap:8px;height:36px;padding:0 9px;border:1px solid var(--sidebar-line);border-radius:7px;background:var(--sidebar-rail);color:var(--sidebar-muted)}.c-menu-search-field:hover{border-color:color-mix(in srgb,var(--sidebar-muted) 35%,var(--sidebar-surface))}.c-menu-search-field:focus-within{border-color:color-mix(in srgb,var(--sidebar-accent, var(--sd-primary, #005cbb)) 75%,var(--sidebar-surface));background:var(--sidebar-surface)}.c-menu-search-icon{flex:0 0 18px;width:18px;height:18px;font-size:var(--sd-font-size-18, 18px);pointer-events:none}.c-menu-search-input{flex:1 1 0;width:0;min-width:0;height:100%;margin:0;padding:0;border:0;border-radius:0;outline:none;box-shadow:none;appearance:none;background:transparent;color:var(--sidebar-ink);font:inherit;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-20, 20px)}.c-menu-search-input:focus,.c-menu-search-input:focus-visible{outline:none;box-shadow:none}.c-menu-search-input::placeholder{color:var(--sidebar-muted);opacity:1}.c-menu-search-input::-webkit-search-decoration,.c-menu-search-input::-webkit-search-cancel-button{appearance:none}.c-menu-search-clear{display:grid;flex:0 0 24px;place-items:center;width:24px;min-width:24px;height:24px;margin:0;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sidebar-muted);cursor:pointer}.c-menu-search-clear sd-icon,.c-menu-search-clear mat-icon{width:18px;height:18px;font-size:var(--sd-font-size-18, 18px)}.c-menu-search-clear:hover{background:color-mix(in srgb,var(--sidebar-ink) 7%,transparent);color:var(--sidebar-ink)}.c-menu-search-clear:focus-visible{outline:1px solid var(--sidebar-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.c-menu-tree-container{flex:1;min-height:0;padding:10px 8px 14px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent;overscroll-behavior:contain}.c-menu-node{position:relative;display:flex;align-items:center;width:100%;min-height:40px;margin:2px 0;padding:0;border-radius:7px;cursor:pointer;color:var(--sidebar-ink);font-size:var(--sd-font-size-13, 13px);line-height:1.4}.c-menu-node-description{display:flex;flex:1;align-items:center;gap:6px;width:100%;min-width:0;min-height:40px;padding:0;border:0;border-radius:inherit;color:inherit;background:transparent;font:inherit;text-align:left;cursor:pointer}.c-menu-node-description-content{display:flex;flex:1;align-items:center;align-self:stretch;gap:9px;min-width:0;padding:8px;color:inherit;font:inherit;font-weight:var(--sd-font-weight-medium, 500);text-decoration:none}.c-menu-node-label{flex:1;min-width:0;white-space:normal;overflow-wrap:anywhere}.c-menu-node-icon{flex:0 0 20px;width:20px;height:20px;font-size:var(--sd-font-size-20, 20px);object-fit:contain;color:var(--sidebar-muted)}.c-menu-node-description-icon-expand,.c-menu-node-description-icon-pin{display:flex;flex:0 0 20px;align-items:center;justify-content:center;width:20px;height:24px;margin-right:6px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sidebar-muted);font-size:var(--sd-font-size-18, 18px);cursor:pointer}.c-menu-node-description-icon-pin{opacity:0}.c-menu-node-description-icon-pin:focus-visible{opacity:1!important}.c-menu-node.is-ancestor{color:var(--sidebar-accent)}.c-menu-node.is-ancestor .c-menu-node-description-content,.c-menu-node.is-ancestor .c-menu-node-icon,.c-menu-node.is-ancestor .c-menu-node-description-icon-expand{color:inherit}.c-menu-node.is-active{color:var(--sidebar-accent)}.c-menu-node.is-active .c-menu-node-icon{color:inherit}.c-menu-node.is-active:before{content:\"\";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:var(--sd-radius-2, 2px);background:var(--sidebar-accent)}.c-menu-node-group{position:relative;margin:0 0 7px 19px;padding:1px 0 1px 16px;border-left:1px solid var(--sidebar-line)}.c-menu-node-group .c-menu-node{min-height:34px;border-radius:var(--sd-radius-6, 6px)}.c-menu-node-group .c-menu-node-description-content{padding:7px 8px;font-weight:var(--sd-font-weight-regular, 400)}.c-menu-node-group .c-menu-node-description{min-height:34px}.c-menu-node-group .c-menu-node-icon{display:none}.c-menu-node-group .c-menu-node.is-active:before{left:-18px}.c-menu-node-group .c-menu-node.is-active .c-menu-node-description-content,.c-menu-node-group .c-menu-node.is-ancestor .c-menu-node-description-content{font-weight:var(--sd-font-weight-medium, 500)}.c-menu-node-group .c-menu-node-group{margin-left:8px;padding-left:7px}.c-menu-node-group .c-menu-node-group .c-menu-node.is-active:before{left:-9px}.c-footer{position:absolute;bottom:0;left:0;width:56px;height:86px;background:var(--sidebar-rail)}a:focus-visible,button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sidebar-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:-2px}@media(pointer:coarse){.c-menu-node,.c-menu-node-group .c-menu-node,.c-menu-node-description,.c-menu-node-group .c-menu-node-description{min-height:44px}}@media(prefers-reduced-motion:reduce){.c-menu-group-icon,.c-menu-node,.c-menu-node *{transition:none!important}}\n"] }]
1582
- }], ctorParameters: () => [], propDecorators: { isShowSidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "isShowSidebar", required: true }] }], menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: true }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }], isMobile: [{ type: i0.Input, args: [{ isSignal: true, alias: "isMobile", required: false }] }], expandSideBar: [{ type: i0.Output, args: ["expandSideBar"] }], popupUserMenuClosed: [{ type: i0.Output, args: ["popupUserMenuClosed"] }], popupUserMenuOpened: [{ type: i0.Output, args: ["popupUserMenuOpened"] }], showSideBar: [{ type: i0.Output, args: ["showSideBar"] }] } });
2295
+ SdLayoutContextSwitcher,
2296
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let _userInfo = userInfo();\n@let _sidebar = sidebar();\n@let _isShowSidebar = isShowSidebar();\n@let _searchText = searchText();\n@let _currentPath = currentPath();\n@let _activeMenuPath = activeMenuPath();\n@let _idMenuGroupActive = idMenuGroupActive();\n@let _pinnedMenuGroup = pinnedMenuGroup();\n\n@if (_userInfo && _sidebar) {\n <div\n class=\"wrapper\"\n [style.--sidebar-accent]=\"_sidebar.brandColor || 'var(--sd-primary, #005cbb)'\"\n [style.height]=\"isMobile() ? '100dvh' : '100%'\">\n <div #headerElement class=\"c-header\">\n <div #logoElement class=\"c-logo\">\n <a\n href=\"/layout/home\"\n [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\"\n (click)=\"$event.preventDefault(); openHomePage()\">\n @if (logoUrl(); as _logoUrl) {\n <img alt=\"\" [src]=\"_logoUrl\" />\n } @else {\n <sd-icon fontSet=\"material-icons-outlined\" name=\"apps\"></sd-icon>\n }\n </a>\n </div>\n <!-- Context switcher (D-010): avatar ngay d\u01B0\u1EDBi logo khi thu g\u1ECDn v\u1EC1 rail, d\u00F2ng ph\u1EE5 d\u01B0\u1EDBi ti\u00EAu \u0111\u1EC1 khi m\u1EDF. -->\n @if (_sidebar.context && !_isShowSidebar) {\n <sd-layout-context-switcher class=\"c-rail-context\" appearance=\"rail\" [configuration]=\"_sidebar.context\" [anchor]=\"logoElement\" />\n }\n <div class=\"c-title-menu-group\" [class.d-none]=\"!_isShowSidebar\" [class.c-title-menu-group--context]=\"!!_sidebar.context\">\n <span>{{ titleMenuGroup() || _sidebar.defaultTitle || 'Back Office' }}</span>\n @if (_sidebar.context && _isShowSidebar) {\n <sd-layout-context-switcher\n #headerContextSwitcher\n class=\"c-header-context\"\n appearance=\"header\"\n [configuration]=\"_sidebar.context\"\n [anchor]=\"headerElement\" />\n }\n </div>\n </div>\n <div class=\"c-body\">\n <div class=\"c-menu\">\n <div class=\"c-menu-group\">\n @if (_sidebar?.pin?.enabled && _pinnedMenuGroup.children?.length) {\n <button\n type=\"button\"\n [attr.aria-label]=\"'core.module.layout.sidebar.pinned' | sdTranslate\"\n (mouseenter)=\"onMouseOverMenuGroupNode($event, _pinnedMenuGroup)\"\n (mouseleave)=\"onMouseLeaveMenuGroupNode($event, _pinnedMenuGroup)\"\n (click)=\"expandPinnedGroup()\"\n [matTooltip]=\"'core.module.layout.sidebar.pinned' | sdTranslate\"\n [matTooltipClass]=\"'c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140'\"\n [matTooltipPosition]=\"'right'\"\n style=\"padding: 0; margin: 0; border: none; background-color: transparent\">\n <sd-icon\n fontSet=\"material-icons-outlined\"\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n color: isPinnedMenuGroupActive()\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text-secondary, #44474f)',\n backgroundColor: isPinnedMenuGroupActive()\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\"\n name=\"push_pin\"></sd-icon>\n </button>\n }\n @for (nodeMenuGroup of menus(); track nodeMenuGroup.id) {\n <button\n type=\"button\"\n [attr.aria-label]=\"nodeMenuGroup.tooltipTitle || nodeMenuGroup.title\"\n (mouseenter)=\"onMouseOverMenuGroupNode($event, nodeMenuGroup)\"\n (mouseleave)=\"onMouseLeaveMenuGroupNode($event, nodeMenuGroup)\"\n (click)=\"expandMenuGroup(nodeMenuGroup)\"\n [matTooltip]=\"nodeMenuGroup.tooltipTitle || nodeMenuGroup.title\"\n [matTooltipClass]=\"'c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140'\"\n [matTooltipPosition]=\"'right'\"\n style=\"padding: 0; margin: 0; border: none; background-color: transparent\">\n @if (nodeMenuGroup.iconUrl) {\n <span\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n backgroundColor:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\">\n <img width=\"24px\" height=\"24px\" [src]=\"nodeMenuGroup.iconUrl\" [alt]=\"nodeMenuGroup.title\" />\n </span>\n } @else {\n <sd-icon\n fontSet=\"material-icons-outlined\"\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n color:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text-secondary, #44474f)',\n backgroundColor:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\"\n [name]=\"nodeMenuGroup.icon || 'widgets'\"></sd-icon>\n }\n </button>\n }\n </div>\n <div class=\"c-menu-tree\" [class.d-none]=\"!_isShowSidebar\" [attr.inert]=\"!_isShowSidebar ? '' : null\">\n @if (totalMenuInMenusByGroup() > 10) {\n <div class=\"c-menu-tree-search\">\n @let _searchLabel = 'core.module.layout.sidebar.search' | sdTranslate;\n <div class=\"c-menu-search-field\">\n <sd-icon\n class=\"c-menu-search-icon\"\n fontSet=\"material-icons-outlined\"\n name=\"search\"\n size=\"18px\"\n aria-hidden=\"true\"></sd-icon>\n <input\n #menuSearch\n class=\"c-menu-search-input\"\n type=\"search\"\n autocomplete=\"off\"\n [attr.aria-label]=\"_searchLabel\"\n [placeholder]=\"_searchLabel\"\n data-autoId=\"layout-v1-menu-search\"\n [ngModel]=\"_searchText\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onFilterSearchText($event)\" />\n @if (_searchText) {\n <button\n type=\"button\"\n class=\"c-menu-search-clear\"\n [attr.aria-label]=\"'core.module.layout.sidebar.clear-search' | sdTranslate\"\n (click)=\"onClearSearchText(); menuSearch.focus()\">\n <sd-icon fontSet=\"material-icons-outlined\" name=\"close\" size=\"18px\" aria-hidden=\"true\"></sd-icon>\n </button>\n }\n </div>\n </div>\n }\n <div class=\"c-menu-tree-container\">\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\" [style.backgroundColor]=\"'transparent'\">\n <mat-nested-tree-node *matTreeNodeDef=\"let node; when: !hasChild\">\n <div\n class=\"c-menu-node\"\n [class.is-active]=\"_currentPath | menuFocus: node : _activeMenuPath\"\n (mouseenter)=\"onMouseOverMenuNode($event, node)\"\n (mouseleave)=\"onMouseLeaveMenuNode($event, node)\"\n [ngStyle]=\"{\n backgroundColor:\n (_currentPath | menuFocus: node : _activeMenuPath)\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\">\n <div class=\"c-menu-node-description\" [class.d-none]=\"!_isShowSidebar\">\n <a\n class=\"c-menu-node-description-content\"\n [href]=\"menuNodeHref(node)\"\n [attr.aria-current]=\"(_currentPath | menuFocus: node : _activeMenuPath) ? 'page' : null\"\n (click)=\"onMenuNodeClick($event, node)\"\n [ngStyle]=\"{\n color:\n (_currentPath | menuFocus: node : _activeMenuPath)\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text, #1a1b1f)',\n }\">\n @if (node.iconUrl) {\n <img class=\"c-menu-node-icon\" [src]=\"node.iconUrl\" alt=\"\" />\n } @else if (node.icon) {\n <sd-icon class=\"c-menu-node-icon\" [name]=\"node.icon\" size=\"20px\" fontSet=\"material-icons-outlined\"></sd-icon>\n }\n <span class=\"c-menu-node-label\" [innerHTML]=\"node.title | highLightSearch: _searchText | sdSafeHtml\"></span>\n </a>\n\n <!-- why: n\u00FAt ghim tr\u01B0\u1EDBc \u0111\u00E2y l\u00E0 <sd-icon fontSet=\"material-icons-outlined\" (click)> \u2014 custom element kh\u00F4ng nh\u1EADn\n focus b\u00E0n ph\u00EDm v\u00E0 kh\u00F4ng c\u00F3 t\u00EAn kh\u1EA3 truy c\u1EADp, n\u00EAn kh\u00F4ng ghim \u0111\u01B0\u1EE3c b\u1EB1ng ph\u00EDm.\n \u0110\u1ED5i sang <button type=\"button\"> + aria-pressed, gi\u1ED1ng pattern \u0111\u00E3 d\u00F9ng \u1EDF\n `shared/menu-tree`. -->\n @if (_sidebar?.pin?.enabled) {\n <button\n type=\"button\"\n class=\"c-menu-node-description-icon-pin\"\n [style.opacity]=\"isPinnedNode(node) || isHoveredNode(node) ? '1' : null\"\n [style.color]=\"\n isPinnedNode(node) || isHoveredNode(node) ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)' : null\n \"\n [attr.aria-pressed]=\"isPinnedNode(node)\"\n [attr.aria-label]=\"\n (isPinnedNode(node) ? 'core.module.layout.menu.unpin' : 'core.module.layout.menu.pin')\n | sdTranslate: { title: node.title }\n \"\n (click)=\"onTogglePin($event, node)\">\n <sd-icon fontSet=\"material-icons-outlined\" size=\"18px\" name=\"push_pin\"></sd-icon>\n </button>\n }\n </div>\n </div>\n </mat-nested-tree-node>\n\n <mat-nested-tree-node\n *matTreeNodeDef=\"let node; when: hasChild\"\n [class]=\"{ expanded: treeControl.isExpanded(node), isfocus: _currentPath | menuFocus: node : _activeMenuPath }\">\n <div\n class=\"c-menu-node\"\n [class.is-ancestor]=\"_currentPath | menuFocus: node : _activeMenuPath\"\n (mouseenter)=\"onMouseOverMenuNode($event, node)\"\n (mouseleave)=\"onMouseLeaveMenuNode($event, node)\">\n <div class=\"d-flex align-items-center\" style=\"gap: 10px; width: 100%\">\n <button\n type=\"button\"\n [class.d-none]=\"!_isShowSidebar\"\n class=\"c-menu-node-description\"\n [attr.aria-expanded]=\"treeControl.isExpanded(node)\"\n (click)=\"onToggleMenuNode(node)\">\n <span class=\"c-menu-node-description-content\">\n @if (node.iconUrl) {\n <img class=\"c-menu-node-icon\" [src]=\"node.iconUrl\" alt=\"\" />\n } @else if (node.icon) {\n <sd-icon class=\"c-menu-node-icon\" [name]=\"node.icon\" size=\"20px\" fontSet=\"material-icons-outlined\"></sd-icon>\n }\n <span class=\"c-menu-node-label\" [innerHTML]=\"node.title | highLightSearch: _searchText | sdSafeHtml\"></span>\n </span>\n <sd-icon\n fontSet=\"material-icons-outlined\"\n aria-hidden=\"true\"\n size=\"18px\"\n class=\"c-menu-node-description-icon-expand\"\n [name]=\"treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'\"></sd-icon>\n </button>\n </div>\n </div>\n <div class=\"c-menu-node-group\" role=\"group\" [class.d-none]=\"!treeControl.isExpanded(node)\">\n <ng-container matTreeNodeOutlet></ng-container>\n </div>\n </mat-nested-tree-node>\n </mat-tree>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"c-footer\">\n <lib-layout-user\n [userInfo]=\"_userInfo\"\n [isMobileOrTablet]=\"isMobile()\"\n (menuOpened)=\"onUserMenuOpened()\"\n (menuClosed)=\"onUserMenuClosed()\"\n [isShowSidebar]=\"_isShowSidebar\"\n (toggleMenuLock)=\"toggleMenuLock($event)\">\n </lib-layout-user>\n </div>\n </div>\n}\n", styles: ["::ng-deep .mat-mdc-tooltip-panel:has(.c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140){pointer-events:none}:host{display:block;height:100%}.wrapper{--sidebar-surface: var(--sd-white, #fff);--sidebar-rail: color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 35%, var(--sidebar-surface));--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);position:relative;display:flex;flex-direction:column;width:min(304px,100vw);color:var(--sidebar-ink);background:linear-gradient(to right,var(--sidebar-rail) 56px,var(--sidebar-surface) 56px)}.wrapper,.wrapper *{box-sizing:border-box}.wrapper:before{content:\"\";position:absolute;inset:0 auto 0 55px;width:1px;background:var(--sidebar-line);pointer-events:none}.c-header{flex:0 0 auto;display:grid;grid-template-columns:56px minmax(0,1fr);min-height:42px}.c-logo{grid-column:1;display:grid;place-items:center;height:42px}.c-logo a{display:grid;place-items:center;width:38px;height:40px;border-radius:9px;color:var(--sidebar-muted)}.c-logo img{width:30px;height:30px;object-fit:contain}.c-title-menu-group{grid-column:2;display:flex;align-items:center;min-width:0;padding:10px 14px 12px;color:var(--sidebar-ink);font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-bold, 700);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px;overflow-wrap:anywhere}.c-title-menu-group--context{--sd-layout-context-switcher-popover-width: calc(min(304px, 100vw) - 24px) ;flex-direction:column;align-items:stretch;justify-content:center}.c-header-context{font-weight:var(--sd-font-weight-regular, 400);letter-spacing:normal}.c-rail-context{grid-column:1;grid-row:2}.c-rail-context:not(:empty){margin:4px 0 6px}@media(pointer:coarse){.c-rail-context:not(:empty){margin-top:8px}}.c-body{flex:1;min-height:0;overflow:hidden}.c-menu{display:flex;height:100%}.c-menu-group{display:flex;flex:0 0 56px;flex-direction:column;align-items:center;gap:10px;width:56px;min-height:0;margin-bottom:86px;padding:5px 0 8px;overflow-y:auto;scrollbar-width:none}.c-menu-group>button{flex:0 0 auto;border-radius:9px}.c-menu-group .c-menu-group-icon{display:flex;align-items:center;justify-content:center;width:38px;height:40px;min-height:40px;border-radius:9px;font-size:var(--sd-font-size-22, 22px)}.c-menu-group .c-menu-group-icon img{width:22px;height:22px;object-fit:contain}.c-menu-tree{display:flex;flex:1;flex-direction:column;min-width:0;min-height:0}.c-menu-tree-search{flex:0 0 auto;padding:0 14px 12px;border-bottom:1px solid var(--sidebar-line)}.c-menu-search-field{display:flex;align-items:center;gap:8px;height:36px;padding:0 9px;border:1px solid var(--sidebar-line);border-radius:7px;background:var(--sidebar-rail);color:var(--sidebar-muted)}.c-menu-search-field:hover{border-color:color-mix(in srgb,var(--sidebar-muted) 35%,var(--sidebar-surface))}.c-menu-search-field:focus-within{border-color:color-mix(in srgb,var(--sidebar-accent, var(--sd-primary, #005cbb)) 75%,var(--sidebar-surface));background:var(--sidebar-surface)}.c-menu-search-icon{flex:0 0 18px;width:18px;height:18px;font-size:var(--sd-font-size-18, 18px);pointer-events:none}.c-menu-search-input{flex:1 1 0;width:0;min-width:0;height:100%;margin:0;padding:0;border:0;border-radius:0;outline:none;box-shadow:none;appearance:none;background:transparent;color:var(--sidebar-ink);font:inherit;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-20, 20px)}.c-menu-search-input:focus,.c-menu-search-input:focus-visible{outline:none;box-shadow:none}.c-menu-search-input::placeholder{color:var(--sidebar-muted);opacity:1}.c-menu-search-input::-webkit-search-decoration,.c-menu-search-input::-webkit-search-cancel-button{appearance:none}.c-menu-search-clear{display:grid;flex:0 0 24px;place-items:center;width:24px;min-width:24px;height:24px;margin:0;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sidebar-muted);cursor:pointer}.c-menu-search-clear sd-icon,.c-menu-search-clear mat-icon{width:18px;height:18px;font-size:var(--sd-font-size-18, 18px)}.c-menu-search-clear:hover{background:color-mix(in srgb,var(--sidebar-ink) 7%,transparent);color:var(--sidebar-ink)}.c-menu-search-clear:focus-visible{outline:1px solid var(--sidebar-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.c-menu-tree-container{flex:1;min-height:0;padding:10px 8px 14px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent;overscroll-behavior:contain}.c-menu-node{position:relative;display:flex;align-items:center;width:100%;min-height:40px;margin:2px 0;padding:0;border-radius:7px;cursor:pointer;color:var(--sidebar-ink);font-size:var(--sd-font-size-13, 13px);line-height:1.4}.c-menu-node-description{display:flex;flex:1;align-items:center;gap:6px;width:100%;min-width:0;min-height:40px;padding:0;border:0;border-radius:inherit;color:inherit;background:transparent;font:inherit;text-align:left;cursor:pointer}.c-menu-node-description-content{display:flex;flex:1;align-items:center;align-self:stretch;gap:9px;min-width:0;padding:8px;color:inherit;font:inherit;font-weight:var(--sd-font-weight-medium, 500);text-decoration:none}.c-menu-node-label{flex:1;min-width:0;white-space:normal;overflow-wrap:anywhere}.c-menu-node-icon{flex:0 0 20px;width:20px;height:20px;font-size:var(--sd-font-size-20, 20px);object-fit:contain;color:var(--sidebar-muted)}.c-menu-node-description-icon-expand,.c-menu-node-description-icon-pin{display:flex;flex:0 0 20px;align-items:center;justify-content:center;width:20px;height:24px;margin-right:6px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sidebar-muted);font-size:var(--sd-font-size-18, 18px);cursor:pointer}.c-menu-node-description-icon-pin{opacity:0}.c-menu-node-description-icon-pin:focus-visible{opacity:1!important}.c-menu-node.is-ancestor{color:var(--sidebar-accent)}.c-menu-node.is-ancestor .c-menu-node-description-content,.c-menu-node.is-ancestor .c-menu-node-icon,.c-menu-node.is-ancestor .c-menu-node-description-icon-expand{color:inherit}.c-menu-node.is-active{color:var(--sidebar-accent)}.c-menu-node.is-active .c-menu-node-icon{color:inherit}.c-menu-node.is-active:before{content:\"\";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:var(--sd-radius-2, 2px);background:var(--sidebar-accent)}.c-menu-node-group{position:relative;margin:0 0 7px 19px;padding:1px 0 1px 16px;border-left:1px solid var(--sidebar-line)}.c-menu-node-group .c-menu-node{min-height:34px;border-radius:var(--sd-radius-6, 6px)}.c-menu-node-group .c-menu-node-description-content{padding:7px 8px;font-weight:var(--sd-font-weight-regular, 400)}.c-menu-node-group .c-menu-node-description{min-height:34px}.c-menu-node-group .c-menu-node-icon{display:none}.c-menu-node-group .c-menu-node.is-active:before{left:-18px}.c-menu-node-group .c-menu-node.is-active .c-menu-node-description-content,.c-menu-node-group .c-menu-node.is-ancestor .c-menu-node-description-content{font-weight:var(--sd-font-weight-medium, 500)}.c-menu-node-group .c-menu-node-group{margin-left:8px;padding-left:7px}.c-menu-node-group .c-menu-node-group .c-menu-node.is-active:before{left:-9px}.c-footer{position:absolute;bottom:0;left:0;width:56px;height:86px;background:var(--sidebar-rail)}a:focus-visible,button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sidebar-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:-2px}@media(pointer:coarse){.c-menu-node,.c-menu-node-group .c-menu-node,.c-menu-node-description,.c-menu-node-group .c-menu-node-description{min-height:44px}}@media(prefers-reduced-motion:reduce){.c-menu-group-icon,.c-menu-node,.c-menu-node *{transition:none!important}}\n"] }]
2297
+ }], ctorParameters: () => [], propDecorators: { isShowSidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "isShowSidebar", required: true }] }], menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: true }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }], isMobile: [{ type: i0.Input, args: [{ isSignal: true, alias: "isMobile", required: false }] }], expandSideBar: [{ type: i0.Output, args: ["expandSideBar"] }], popupUserMenuClosed: [{ type: i0.Output, args: ["popupUserMenuClosed"] }], popupUserMenuOpened: [{ type: i0.Output, args: ["popupUserMenuOpened"] }], showSideBar: [{ type: i0.Output, args: ["showSideBar"] }], headerContextSwitcher: [{ type: i0.ViewChild, args: ['headerContextSwitcher', { isSignal: true }] }] } });
1583
2298
 
1584
2299
  class SdSidebarV1 {
1585
2300
  // ==========================================
@@ -1895,11 +2610,11 @@ class SdSidebarMobileOverlay {
1895
2610
  return null;
1896
2611
  };
1897
2612
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarMobileOverlay, deps: [], target: i0.ɵɵFactoryTarget.Component });
1898
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSidebarMobileOverlay, isStandalone: true, selector: "sd-sidebar-mobile-overlay", inputs: { isShowSidebar: { classPropertyName: "isShowSidebar", publicName: "isShowSidebar", isSignal: true, isRequired: false, transformFunction: null }, menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: true, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { showSideBar: "showSideBar", expandSideBar: "expandSideBar", popupUserMenuOpened: "popupUserMenuOpened", popupUserMenuClosed: "popupUserMenuClosed", titleMenuGroupChanged: "titleMenuGroupChanged" }, ngImport: i0, template: "@let _userInfo = userInfo();\n@let _sidebar = sidebar();\n\n@if (_userInfo && _sidebar) {\n <div\n class=\"m-backdrop\"\n [class.m-backdrop--visible]=\"isShowSidebar()\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onClose()\"\n (keydown.escape)=\"onClose()\">\n </div>\n\n <div class=\"m-wrapper\" [class.m-wrapper--open]=\"isShowSidebar()\">\n <div class=\"m-header\">\n <div class=\"m-title-group\">\n @if (_sidebar.logoUrl) {\n <img class=\"m-logo\" alt=\"logo\" [src]=\"_sidebar.logoUrl\" />\n }\n <span class=\"m-title\">{{ titleMenuGroup() || _sidebar.defaultTitle || 'Back Office' }}</span>\n </div>\n <button class=\"m-close-btn\" (click)=\"onClose()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </div>\n\n <div class=\"m-user-section\">\n <lib-layout-user\n [userInfo]=\"_userInfo\"\n [isMobileOrTablet]=\"true\"\n (menuOpened)=\"onUserMenuOpened()\"\n (menuClosed)=\"onUserMenuClosed()\">\n </lib-layout-user>\n </div>\n\n <div class=\"m-menu-list\">\n @for (group of menus(); track group.id) {\n <div class=\"m-menu-card\">\n <button class=\"m-card-header\" (click)=\"toggleMobileGroup(group.id)\">\n <div class=\"m-card-header-left\">\n @if (group.iconUrl) {\n <img class=\"m-group-icon\" [src]=\"group.iconUrl\" [alt]=\"group.title\" />\n } @else {\n <sd-icon class=\"m-group-icon\" [name]=\"group.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"m-group-title\">{{ group.title }}</span>\n </div>\n <sd-icon class=\"m-expand-icon\" [name]=\"expandedMobileGroups().has(group.id ?? '') ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></sd-icon>\n </button>\n\n @if (expandedMobileGroups().has(group.id ?? '') && hasChildren(group)) {\n <div class=\"m-card-body\">\n @for (child of getChildren(group); track child.id) {\n @if (hasChildren(child)) {\n <div class=\"m-sub-group\">\n <button class=\"m-sub-group-header\" (click)=\"toggleMobileGroup(child.id)\">\n <div class=\"m-item-left\">\n @if (child.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"child.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"child.icon || 'folder'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ child.title }}</span>\n </div>\n <sd-icon class=\"m-expand-icon\" [name]=\"expandedMobileGroups().has(child.id ?? '') ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></sd-icon>\n </button>\n @if (expandedMobileGroups().has(child.id ?? '')) {\n @for (subChild of getChildren(child); track subChild.id) {\n <button class=\"m-menu-item m-menu-item--indented\"\n (click)=\"navigate({ path: getPath(subChild), queryParams: getQueryParams(subChild) })\">\n <div class=\"m-item-left\">\n @if (subChild.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"subChild.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"subChild.icon || 'insert_drive_file'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ subChild.title }}</span>\n </div>\n <sd-icon class=\"m-nav-icon\" name=\"chevron_right\"></sd-icon>\n </button>\n }\n }\n </div>\n } @else {\n <button class=\"m-menu-item\" (click)=\"navigate({ path: getPath(child), queryParams: getQueryParams(child) })\">\n <div class=\"m-item-left\">\n @if (child.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"child.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"child.icon || 'insert_drive_file'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ child.title }}</span>\n </div>\n <sd-icon class=\"m-nav-icon\" name=\"chevron_right\"></sd-icon>\n </button>\n }\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n}\n", styles: [":host{display:block;position:fixed;inset:0;z-index:var(--sd-z-dropdown, 1000);pointer-events:none}.m-backdrop{position:absolute;inset:0;background:#0006;opacity:0;pointer-events:none;transition:opacity var(--sd-duration-slow, .3s) ease;cursor:pointer;outline:none}.m-backdrop--visible{opacity:1;pointer-events:auto}.m-wrapper{display:flex;flex-direction:column;position:absolute;inset:0;background-color:var(--sd-sidebar-mobile-bg, #f2f2f6);padding:16px;box-sizing:border-box;overflow-y:auto;pointer-events:none;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));transform:translate(-100%);transition:transform var(--sd-duration-slow, .3s) var(--sd-ease-standard, cubic-bezier(.4, 0, .2, 1))}.m-wrapper--open{transform:translate(0);pointer-events:auto}.m-wrapper .m-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.m-wrapper .m-header .m-title-group{display:flex;align-items:center;gap:12px}.m-wrapper .m-header .m-title-group .m-logo{width:32px;height:32px;object-fit:contain}.m-wrapper .m-header .m-title-group .m-title{font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-sidebar-mobile-text, #1f1f1f)}.m-wrapper .m-header .m-close-btn{background:transparent;border:none;padding:0;color:var(--sd-sidebar-mobile-text, #1f1f1f);display:flex;align-items:center;justify-content:center;cursor:pointer}.m-wrapper .m-header .m-close-btn sd-icon{font-size:var(--sd-font-size-28, 28px);width:28px;height:28px}.m-wrapper .m-user-section{background-color:var(--sd-sidebar-mobile-card-bg, #ffffff);border-radius:var(--sd-radius-12, 12px);padding:12px 16px;margin-bottom:24px;box-shadow:0 1px 2px #00000005;border:1px solid var(--sd-sidebar-mobile-border, #ebebeb)}.m-wrapper .m-user-section lib-layout-user{display:block;width:100%}.m-wrapper .m-menu-list{display:flex;flex-direction:column;gap:16px}.m-wrapper .m-menu-card{background-color:var(--sd-sidebar-mobile-card-bg, #ffffff);border-radius:var(--sd-radius-12, 12px);border:1px solid var(--sd-sidebar-mobile-border, #ebebeb);overflow:hidden}.m-wrapper .m-menu-card .m-card-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:16px;cursor:pointer;-webkit-user-select:none;user-select:none;border:none;background:transparent;-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-header .m-card-header-left{display:flex;align-items:center;gap:16px}.m-wrapper .m-menu-card .m-card-header .m-card-header-left .m-group-icon{font-size:var(--sd-font-size-24, 24px);width:24px;height:24px;color:var(--sd-sidebar-mobile-text, #1f1f1f);object-fit:contain}.m-wrapper .m-menu-card .m-card-header .m-card-header-left .m-group-title{font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-sidebar-mobile-text, #1f1f1f)}.m-wrapper .m-menu-card .m-card-header .m-expand-icon{color:var(--sd-sidebar-mobile-text, #1f1f1f);transition:transform var(--sd-duration-base, .2s) ease}.m-wrapper .m-menu-card .m-card-body{display:flex;flex-direction:column;padding-bottom:8px}.m-wrapper .m-menu-card .m-card-body .m-menu-item{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px 12px 24px;cursor:pointer;border:none;background:transparent;transition:background-color var(--sd-duration-base, .2s);-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-body .m-menu-item:active{background-color:var(--sd-sidebar-mobile-item-active-bg, #f5f5f5)}.m-wrapper .m-menu-card .m-card-body .m-menu-item--indented{padding-left:48px}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left{display:flex;align-items:center;gap:12px}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-icon{font-size:var(--sd-font-size-20, 20px);width:20px;height:20px;color:var(--sd-sidebar-mobile-icon, #8c8c8c)}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-icon-img{width:20px;height:20px;object-fit:contain;opacity:.7}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-title{font-size:var(--sd-font-size-15, 15px);color:var(--sd-sidebar-mobile-text-secondary, #333333)}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-nav-icon{color:var(--sd-sidebar-mobile-icon, #8c8c8c);font-size:var(--sd-font-size-20, 20px);width:20px;height:20px}.m-wrapper .m-menu-card .m-card-body .m-sub-group{border-top:1px solid var(--sd-sidebar-mobile-border, #ebebeb)}.m-wrapper .m-menu-card .m-card-body .m-sub-group:first-child{border-top:none}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px 12px 24px;cursor:pointer;border:none;background:var(--sd-sidebar-mobile-hover-bg, #fafafa);-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header:active{background-color:var(--sd-sidebar-mobile-pressed-bg, #f0f0f0)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left{display:flex;align-items:center;gap:12px}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-icon{font-size:var(--sd-font-size-20, 20px);width:20px;height:20px;color:var(--sd-sidebar-mobile-icon, #8c8c8c)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-icon-img{width:20px;height:20px;object-fit:contain;opacity:.7}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-title{font-size:var(--sd-font-size-15, 15px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-sidebar-mobile-text-secondary, #333333)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-expand-icon{color:var(--sd-sidebar-mobile-icon, #8c8c8c);font-size:var(--sd-font-size-20, 20px);width:20px;height:20px}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "component", type: LayoutUserComponent, selector: "lib-layout-user", inputs: ["isMobileOrTablet", "isMenuLock", "isShowSidebar", "userInfo"], outputs: ["menuClosed", "menuOpened", "toggleMenuLock"] }] });
2613
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSidebarMobileOverlay, isStandalone: true, selector: "sd-sidebar-mobile-overlay", inputs: { isShowSidebar: { classPropertyName: "isShowSidebar", publicName: "isShowSidebar", isSignal: true, isRequired: false, transformFunction: null }, menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: true, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { showSideBar: "showSideBar", expandSideBar: "expandSideBar", popupUserMenuOpened: "popupUserMenuOpened", popupUserMenuClosed: "popupUserMenuClosed", titleMenuGroupChanged: "titleMenuGroupChanged" }, ngImport: i0, template: "@let _userInfo = userInfo();\n@let _sidebar = sidebar();\n\n@if (_userInfo && _sidebar) {\n <div\n class=\"m-backdrop\"\n [class.m-backdrop--visible]=\"isShowSidebar()\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onClose()\"\n (keydown.escape)=\"onClose()\">\n </div>\n\n <div class=\"m-wrapper\" [class.m-wrapper--open]=\"isShowSidebar()\">\n <div #headerElement class=\"m-header\" [class.m-header--context]=\"!!_sidebar.context\">\n <div class=\"m-title-group\">\n @if (_sidebar.logoUrl) {\n <img class=\"m-logo\" alt=\"logo\" [src]=\"_sidebar.logoUrl\" />\n }\n <span class=\"m-title\">{{ titleMenuGroup() || _sidebar.defaultTitle || 'Back Office' }}</span>\n </div>\n <button class=\"m-close-btn\" (click)=\"onClose()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n <!-- Context switcher (D-010): h\u00E0ng ri\u00EAng d\u01B0\u1EDBi ti\u00EAu \u0111\u1EC1, m\u1EDF bottom sheet. -->\n @if (_sidebar.context) {\n <sd-layout-context-switcher class=\"m-header-context\" appearance=\"sheet\" [configuration]=\"_sidebar.context\" [anchor]=\"headerElement\" />\n }\n </div>\n\n <div class=\"m-user-section\">\n <lib-layout-user\n [userInfo]=\"_userInfo\"\n [isMobileOrTablet]=\"true\"\n (menuOpened)=\"onUserMenuOpened()\"\n (menuClosed)=\"onUserMenuClosed()\">\n </lib-layout-user>\n </div>\n\n <div class=\"m-menu-list\">\n @for (group of menus(); track group.id) {\n <div class=\"m-menu-card\">\n <button class=\"m-card-header\" (click)=\"toggleMobileGroup(group.id)\">\n <div class=\"m-card-header-left\">\n @if (group.iconUrl) {\n <img class=\"m-group-icon\" [src]=\"group.iconUrl\" [alt]=\"group.title\" />\n } @else {\n <sd-icon class=\"m-group-icon\" [name]=\"group.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"m-group-title\">{{ group.title }}</span>\n </div>\n <sd-icon class=\"m-expand-icon\" [name]=\"expandedMobileGroups().has(group.id ?? '') ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></sd-icon>\n </button>\n\n @if (expandedMobileGroups().has(group.id ?? '') && hasChildren(group)) {\n <div class=\"m-card-body\">\n @for (child of getChildren(group); track child.id) {\n @if (hasChildren(child)) {\n <div class=\"m-sub-group\">\n <button class=\"m-sub-group-header\" (click)=\"toggleMobileGroup(child.id)\">\n <div class=\"m-item-left\">\n @if (child.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"child.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"child.icon || 'folder'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ child.title }}</span>\n </div>\n <sd-icon class=\"m-expand-icon\" [name]=\"expandedMobileGroups().has(child.id ?? '') ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></sd-icon>\n </button>\n @if (expandedMobileGroups().has(child.id ?? '')) {\n @for (subChild of getChildren(child); track subChild.id) {\n <button class=\"m-menu-item m-menu-item--indented\"\n (click)=\"navigate({ path: getPath(subChild), queryParams: getQueryParams(subChild) })\">\n <div class=\"m-item-left\">\n @if (subChild.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"subChild.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"subChild.icon || 'insert_drive_file'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ subChild.title }}</span>\n </div>\n <sd-icon class=\"m-nav-icon\" name=\"chevron_right\"></sd-icon>\n </button>\n }\n }\n </div>\n } @else {\n <button class=\"m-menu-item\" (click)=\"navigate({ path: getPath(child), queryParams: getQueryParams(child) })\">\n <div class=\"m-item-left\">\n @if (child.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"child.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"child.icon || 'insert_drive_file'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ child.title }}</span>\n </div>\n <sd-icon class=\"m-nav-icon\" name=\"chevron_right\"></sd-icon>\n </button>\n }\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n}\n", styles: [":host{display:block;position:fixed;inset:0;z-index:var(--sd-z-dropdown, 1000);pointer-events:none}.m-backdrop{position:absolute;inset:0;background:#0006;opacity:0;pointer-events:none;transition:opacity var(--sd-duration-slow, .3s) ease;cursor:pointer;outline:none}.m-backdrop--visible{opacity:1;pointer-events:auto}.m-wrapper{display:flex;flex-direction:column;position:absolute;inset:0;background-color:var(--sd-sidebar-mobile-bg, #f2f2f6);padding:16px;box-sizing:border-box;overflow-y:auto;pointer-events:none;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));transform:translate(-100%);transition:transform var(--sd-duration-slow, .3s) var(--sd-ease-standard, cubic-bezier(.4, 0, .2, 1))}.m-wrapper--open{transform:translate(0);pointer-events:auto}.m-wrapper .m-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.m-wrapper .m-header .m-title-group{display:flex;align-items:center;gap:12px}.m-wrapper .m-header .m-title-group .m-logo{width:32px;height:32px;object-fit:contain}.m-wrapper .m-header .m-title-group .m-title{font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-sidebar-mobile-text, #1f1f1f)}.m-wrapper .m-header.m-header--context{flex-wrap:wrap}.m-wrapper .m-header .m-header-context{flex:0 0 100%;min-width:0}.m-wrapper .m-header .m-header-context:not(:empty){margin-top:12px}.m-wrapper .m-header .m-close-btn{background:transparent;border:none;padding:0;color:var(--sd-sidebar-mobile-text, #1f1f1f);display:flex;align-items:center;justify-content:center;cursor:pointer}.m-wrapper .m-header .m-close-btn sd-icon{font-size:var(--sd-font-size-28, 28px);width:28px;height:28px}.m-wrapper .m-user-section{background-color:var(--sd-sidebar-mobile-card-bg, #ffffff);border-radius:var(--sd-radius-12, 12px);padding:12px 16px;margin-bottom:24px;box-shadow:0 1px 2px #00000005;border:1px solid var(--sd-sidebar-mobile-border, #ebebeb)}.m-wrapper .m-user-section lib-layout-user{display:block;width:100%}.m-wrapper .m-menu-list{display:flex;flex-direction:column;gap:16px}.m-wrapper .m-menu-card{background-color:var(--sd-sidebar-mobile-card-bg, #ffffff);border-radius:var(--sd-radius-12, 12px);border:1px solid var(--sd-sidebar-mobile-border, #ebebeb);overflow:hidden}.m-wrapper .m-menu-card .m-card-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:16px;cursor:pointer;-webkit-user-select:none;user-select:none;border:none;background:transparent;-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-header .m-card-header-left{display:flex;align-items:center;gap:16px}.m-wrapper .m-menu-card .m-card-header .m-card-header-left .m-group-icon{font-size:var(--sd-font-size-24, 24px);width:24px;height:24px;color:var(--sd-sidebar-mobile-text, #1f1f1f);object-fit:contain}.m-wrapper .m-menu-card .m-card-header .m-card-header-left .m-group-title{font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-sidebar-mobile-text, #1f1f1f)}.m-wrapper .m-menu-card .m-card-header .m-expand-icon{color:var(--sd-sidebar-mobile-text, #1f1f1f);transition:transform var(--sd-duration-base, .2s) ease}.m-wrapper .m-menu-card .m-card-body{display:flex;flex-direction:column;padding-bottom:8px}.m-wrapper .m-menu-card .m-card-body .m-menu-item{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px 12px 24px;cursor:pointer;border:none;background:transparent;transition:background-color var(--sd-duration-base, .2s);-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-body .m-menu-item:active{background-color:var(--sd-sidebar-mobile-item-active-bg, #f5f5f5)}.m-wrapper .m-menu-card .m-card-body .m-menu-item--indented{padding-left:48px}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left{display:flex;align-items:center;gap:12px}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-icon{font-size:var(--sd-font-size-20, 20px);width:20px;height:20px;color:var(--sd-sidebar-mobile-icon, #8c8c8c)}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-icon-img{width:20px;height:20px;object-fit:contain;opacity:.7}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-title{font-size:var(--sd-font-size-15, 15px);color:var(--sd-sidebar-mobile-text-secondary, #333333)}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-nav-icon{color:var(--sd-sidebar-mobile-icon, #8c8c8c);font-size:var(--sd-font-size-20, 20px);width:20px;height:20px}.m-wrapper .m-menu-card .m-card-body .m-sub-group{border-top:1px solid var(--sd-sidebar-mobile-border, #ebebeb)}.m-wrapper .m-menu-card .m-card-body .m-sub-group:first-child{border-top:none}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px 12px 24px;cursor:pointer;border:none;background:var(--sd-sidebar-mobile-hover-bg, #fafafa);-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header:active{background-color:var(--sd-sidebar-mobile-pressed-bg, #f0f0f0)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left{display:flex;align-items:center;gap:12px}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-icon{font-size:var(--sd-font-size-20, 20px);width:20px;height:20px;color:var(--sd-sidebar-mobile-icon, #8c8c8c)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-icon-img{width:20px;height:20px;object-fit:contain;opacity:.7}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-title{font-size:var(--sd-font-size-15, 15px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-sidebar-mobile-text-secondary, #333333)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-expand-icon{color:var(--sd-sidebar-mobile-icon, #8c8c8c);font-size:var(--sd-font-size-20, 20px);width:20px;height:20px}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "component", type: LayoutUserComponent, selector: "lib-layout-user", inputs: ["isMobileOrTablet", "isMenuLock", "isShowSidebar", "userInfo"], outputs: ["menuClosed", "menuOpened", "toggleMenuLock"] }, { kind: "component", type: SdLayoutContextSwitcher, selector: "sd-layout-context-switcher", inputs: ["configuration", "appearance", "placement", "anchor"] }] });
1899
2614
  }
1900
2615
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarMobileOverlay, decorators: [{
1901
2616
  type: Component,
1902
- args: [{ selector: 'sd-sidebar-mobile-overlay', standalone: true, imports: [SdIcon, CommonModule, RouterModule, LayoutUserComponent], template: "@let _userInfo = userInfo();\n@let _sidebar = sidebar();\n\n@if (_userInfo && _sidebar) {\n <div\n class=\"m-backdrop\"\n [class.m-backdrop--visible]=\"isShowSidebar()\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onClose()\"\n (keydown.escape)=\"onClose()\">\n </div>\n\n <div class=\"m-wrapper\" [class.m-wrapper--open]=\"isShowSidebar()\">\n <div class=\"m-header\">\n <div class=\"m-title-group\">\n @if (_sidebar.logoUrl) {\n <img class=\"m-logo\" alt=\"logo\" [src]=\"_sidebar.logoUrl\" />\n }\n <span class=\"m-title\">{{ titleMenuGroup() || _sidebar.defaultTitle || 'Back Office' }}</span>\n </div>\n <button class=\"m-close-btn\" (click)=\"onClose()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </div>\n\n <div class=\"m-user-section\">\n <lib-layout-user\n [userInfo]=\"_userInfo\"\n [isMobileOrTablet]=\"true\"\n (menuOpened)=\"onUserMenuOpened()\"\n (menuClosed)=\"onUserMenuClosed()\">\n </lib-layout-user>\n </div>\n\n <div class=\"m-menu-list\">\n @for (group of menus(); track group.id) {\n <div class=\"m-menu-card\">\n <button class=\"m-card-header\" (click)=\"toggleMobileGroup(group.id)\">\n <div class=\"m-card-header-left\">\n @if (group.iconUrl) {\n <img class=\"m-group-icon\" [src]=\"group.iconUrl\" [alt]=\"group.title\" />\n } @else {\n <sd-icon class=\"m-group-icon\" [name]=\"group.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"m-group-title\">{{ group.title }}</span>\n </div>\n <sd-icon class=\"m-expand-icon\" [name]=\"expandedMobileGroups().has(group.id ?? '') ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></sd-icon>\n </button>\n\n @if (expandedMobileGroups().has(group.id ?? '') && hasChildren(group)) {\n <div class=\"m-card-body\">\n @for (child of getChildren(group); track child.id) {\n @if (hasChildren(child)) {\n <div class=\"m-sub-group\">\n <button class=\"m-sub-group-header\" (click)=\"toggleMobileGroup(child.id)\">\n <div class=\"m-item-left\">\n @if (child.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"child.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"child.icon || 'folder'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ child.title }}</span>\n </div>\n <sd-icon class=\"m-expand-icon\" [name]=\"expandedMobileGroups().has(child.id ?? '') ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></sd-icon>\n </button>\n @if (expandedMobileGroups().has(child.id ?? '')) {\n @for (subChild of getChildren(child); track subChild.id) {\n <button class=\"m-menu-item m-menu-item--indented\"\n (click)=\"navigate({ path: getPath(subChild), queryParams: getQueryParams(subChild) })\">\n <div class=\"m-item-left\">\n @if (subChild.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"subChild.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"subChild.icon || 'insert_drive_file'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ subChild.title }}</span>\n </div>\n <sd-icon class=\"m-nav-icon\" name=\"chevron_right\"></sd-icon>\n </button>\n }\n }\n </div>\n } @else {\n <button class=\"m-menu-item\" (click)=\"navigate({ path: getPath(child), queryParams: getQueryParams(child) })\">\n <div class=\"m-item-left\">\n @if (child.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"child.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"child.icon || 'insert_drive_file'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ child.title }}</span>\n </div>\n <sd-icon class=\"m-nav-icon\" name=\"chevron_right\"></sd-icon>\n </button>\n }\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n}\n", styles: [":host{display:block;position:fixed;inset:0;z-index:var(--sd-z-dropdown, 1000);pointer-events:none}.m-backdrop{position:absolute;inset:0;background:#0006;opacity:0;pointer-events:none;transition:opacity var(--sd-duration-slow, .3s) ease;cursor:pointer;outline:none}.m-backdrop--visible{opacity:1;pointer-events:auto}.m-wrapper{display:flex;flex-direction:column;position:absolute;inset:0;background-color:var(--sd-sidebar-mobile-bg, #f2f2f6);padding:16px;box-sizing:border-box;overflow-y:auto;pointer-events:none;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));transform:translate(-100%);transition:transform var(--sd-duration-slow, .3s) var(--sd-ease-standard, cubic-bezier(.4, 0, .2, 1))}.m-wrapper--open{transform:translate(0);pointer-events:auto}.m-wrapper .m-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.m-wrapper .m-header .m-title-group{display:flex;align-items:center;gap:12px}.m-wrapper .m-header .m-title-group .m-logo{width:32px;height:32px;object-fit:contain}.m-wrapper .m-header .m-title-group .m-title{font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-sidebar-mobile-text, #1f1f1f)}.m-wrapper .m-header .m-close-btn{background:transparent;border:none;padding:0;color:var(--sd-sidebar-mobile-text, #1f1f1f);display:flex;align-items:center;justify-content:center;cursor:pointer}.m-wrapper .m-header .m-close-btn sd-icon{font-size:var(--sd-font-size-28, 28px);width:28px;height:28px}.m-wrapper .m-user-section{background-color:var(--sd-sidebar-mobile-card-bg, #ffffff);border-radius:var(--sd-radius-12, 12px);padding:12px 16px;margin-bottom:24px;box-shadow:0 1px 2px #00000005;border:1px solid var(--sd-sidebar-mobile-border, #ebebeb)}.m-wrapper .m-user-section lib-layout-user{display:block;width:100%}.m-wrapper .m-menu-list{display:flex;flex-direction:column;gap:16px}.m-wrapper .m-menu-card{background-color:var(--sd-sidebar-mobile-card-bg, #ffffff);border-radius:var(--sd-radius-12, 12px);border:1px solid var(--sd-sidebar-mobile-border, #ebebeb);overflow:hidden}.m-wrapper .m-menu-card .m-card-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:16px;cursor:pointer;-webkit-user-select:none;user-select:none;border:none;background:transparent;-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-header .m-card-header-left{display:flex;align-items:center;gap:16px}.m-wrapper .m-menu-card .m-card-header .m-card-header-left .m-group-icon{font-size:var(--sd-font-size-24, 24px);width:24px;height:24px;color:var(--sd-sidebar-mobile-text, #1f1f1f);object-fit:contain}.m-wrapper .m-menu-card .m-card-header .m-card-header-left .m-group-title{font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-sidebar-mobile-text, #1f1f1f)}.m-wrapper .m-menu-card .m-card-header .m-expand-icon{color:var(--sd-sidebar-mobile-text, #1f1f1f);transition:transform var(--sd-duration-base, .2s) ease}.m-wrapper .m-menu-card .m-card-body{display:flex;flex-direction:column;padding-bottom:8px}.m-wrapper .m-menu-card .m-card-body .m-menu-item{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px 12px 24px;cursor:pointer;border:none;background:transparent;transition:background-color var(--sd-duration-base, .2s);-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-body .m-menu-item:active{background-color:var(--sd-sidebar-mobile-item-active-bg, #f5f5f5)}.m-wrapper .m-menu-card .m-card-body .m-menu-item--indented{padding-left:48px}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left{display:flex;align-items:center;gap:12px}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-icon{font-size:var(--sd-font-size-20, 20px);width:20px;height:20px;color:var(--sd-sidebar-mobile-icon, #8c8c8c)}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-icon-img{width:20px;height:20px;object-fit:contain;opacity:.7}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-title{font-size:var(--sd-font-size-15, 15px);color:var(--sd-sidebar-mobile-text-secondary, #333333)}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-nav-icon{color:var(--sd-sidebar-mobile-icon, #8c8c8c);font-size:var(--sd-font-size-20, 20px);width:20px;height:20px}.m-wrapper .m-menu-card .m-card-body .m-sub-group{border-top:1px solid var(--sd-sidebar-mobile-border, #ebebeb)}.m-wrapper .m-menu-card .m-card-body .m-sub-group:first-child{border-top:none}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px 12px 24px;cursor:pointer;border:none;background:var(--sd-sidebar-mobile-hover-bg, #fafafa);-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header:active{background-color:var(--sd-sidebar-mobile-pressed-bg, #f0f0f0)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left{display:flex;align-items:center;gap:12px}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-icon{font-size:var(--sd-font-size-20, 20px);width:20px;height:20px;color:var(--sd-sidebar-mobile-icon, #8c8c8c)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-icon-img{width:20px;height:20px;object-fit:contain;opacity:.7}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-title{font-size:var(--sd-font-size-15, 15px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-sidebar-mobile-text-secondary, #333333)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-expand-icon{color:var(--sd-sidebar-mobile-icon, #8c8c8c);font-size:var(--sd-font-size-20, 20px);width:20px;height:20px}\n"] }]
2617
+ args: [{ selector: 'sd-sidebar-mobile-overlay', standalone: true, imports: [SdIcon, CommonModule, RouterModule, LayoutUserComponent, SdLayoutContextSwitcher], template: "@let _userInfo = userInfo();\n@let _sidebar = sidebar();\n\n@if (_userInfo && _sidebar) {\n <div\n class=\"m-backdrop\"\n [class.m-backdrop--visible]=\"isShowSidebar()\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onClose()\"\n (keydown.escape)=\"onClose()\">\n </div>\n\n <div class=\"m-wrapper\" [class.m-wrapper--open]=\"isShowSidebar()\">\n <div #headerElement class=\"m-header\" [class.m-header--context]=\"!!_sidebar.context\">\n <div class=\"m-title-group\">\n @if (_sidebar.logoUrl) {\n <img class=\"m-logo\" alt=\"logo\" [src]=\"_sidebar.logoUrl\" />\n }\n <span class=\"m-title\">{{ titleMenuGroup() || _sidebar.defaultTitle || 'Back Office' }}</span>\n </div>\n <button class=\"m-close-btn\" (click)=\"onClose()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n <!-- Context switcher (D-010): h\u00E0ng ri\u00EAng d\u01B0\u1EDBi ti\u00EAu \u0111\u1EC1, m\u1EDF bottom sheet. -->\n @if (_sidebar.context) {\n <sd-layout-context-switcher class=\"m-header-context\" appearance=\"sheet\" [configuration]=\"_sidebar.context\" [anchor]=\"headerElement\" />\n }\n </div>\n\n <div class=\"m-user-section\">\n <lib-layout-user\n [userInfo]=\"_userInfo\"\n [isMobileOrTablet]=\"true\"\n (menuOpened)=\"onUserMenuOpened()\"\n (menuClosed)=\"onUserMenuClosed()\">\n </lib-layout-user>\n </div>\n\n <div class=\"m-menu-list\">\n @for (group of menus(); track group.id) {\n <div class=\"m-menu-card\">\n <button class=\"m-card-header\" (click)=\"toggleMobileGroup(group.id)\">\n <div class=\"m-card-header-left\">\n @if (group.iconUrl) {\n <img class=\"m-group-icon\" [src]=\"group.iconUrl\" [alt]=\"group.title\" />\n } @else {\n <sd-icon class=\"m-group-icon\" [name]=\"group.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"m-group-title\">{{ group.title }}</span>\n </div>\n <sd-icon class=\"m-expand-icon\" [name]=\"expandedMobileGroups().has(group.id ?? '') ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></sd-icon>\n </button>\n\n @if (expandedMobileGroups().has(group.id ?? '') && hasChildren(group)) {\n <div class=\"m-card-body\">\n @for (child of getChildren(group); track child.id) {\n @if (hasChildren(child)) {\n <div class=\"m-sub-group\">\n <button class=\"m-sub-group-header\" (click)=\"toggleMobileGroup(child.id)\">\n <div class=\"m-item-left\">\n @if (child.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"child.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"child.icon || 'folder'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ child.title }}</span>\n </div>\n <sd-icon class=\"m-expand-icon\" [name]=\"expandedMobileGroups().has(child.id ?? '') ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></sd-icon>\n </button>\n @if (expandedMobileGroups().has(child.id ?? '')) {\n @for (subChild of getChildren(child); track subChild.id) {\n <button class=\"m-menu-item m-menu-item--indented\"\n (click)=\"navigate({ path: getPath(subChild), queryParams: getQueryParams(subChild) })\">\n <div class=\"m-item-left\">\n @if (subChild.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"subChild.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"subChild.icon || 'insert_drive_file'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ subChild.title }}</span>\n </div>\n <sd-icon class=\"m-nav-icon\" name=\"chevron_right\"></sd-icon>\n </button>\n }\n }\n </div>\n } @else {\n <button class=\"m-menu-item\" (click)=\"navigate({ path: getPath(child), queryParams: getQueryParams(child) })\">\n <div class=\"m-item-left\">\n @if (child.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"child.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"child.icon || 'insert_drive_file'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ child.title }}</span>\n </div>\n <sd-icon class=\"m-nav-icon\" name=\"chevron_right\"></sd-icon>\n </button>\n }\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n}\n", styles: [":host{display:block;position:fixed;inset:0;z-index:var(--sd-z-dropdown, 1000);pointer-events:none}.m-backdrop{position:absolute;inset:0;background:#0006;opacity:0;pointer-events:none;transition:opacity var(--sd-duration-slow, .3s) ease;cursor:pointer;outline:none}.m-backdrop--visible{opacity:1;pointer-events:auto}.m-wrapper{display:flex;flex-direction:column;position:absolute;inset:0;background-color:var(--sd-sidebar-mobile-bg, #f2f2f6);padding:16px;box-sizing:border-box;overflow-y:auto;pointer-events:none;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));transform:translate(-100%);transition:transform var(--sd-duration-slow, .3s) var(--sd-ease-standard, cubic-bezier(.4, 0, .2, 1))}.m-wrapper--open{transform:translate(0);pointer-events:auto}.m-wrapper .m-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.m-wrapper .m-header .m-title-group{display:flex;align-items:center;gap:12px}.m-wrapper .m-header .m-title-group .m-logo{width:32px;height:32px;object-fit:contain}.m-wrapper .m-header .m-title-group .m-title{font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-sidebar-mobile-text, #1f1f1f)}.m-wrapper .m-header.m-header--context{flex-wrap:wrap}.m-wrapper .m-header .m-header-context{flex:0 0 100%;min-width:0}.m-wrapper .m-header .m-header-context:not(:empty){margin-top:12px}.m-wrapper .m-header .m-close-btn{background:transparent;border:none;padding:0;color:var(--sd-sidebar-mobile-text, #1f1f1f);display:flex;align-items:center;justify-content:center;cursor:pointer}.m-wrapper .m-header .m-close-btn sd-icon{font-size:var(--sd-font-size-28, 28px);width:28px;height:28px}.m-wrapper .m-user-section{background-color:var(--sd-sidebar-mobile-card-bg, #ffffff);border-radius:var(--sd-radius-12, 12px);padding:12px 16px;margin-bottom:24px;box-shadow:0 1px 2px #00000005;border:1px solid var(--sd-sidebar-mobile-border, #ebebeb)}.m-wrapper .m-user-section lib-layout-user{display:block;width:100%}.m-wrapper .m-menu-list{display:flex;flex-direction:column;gap:16px}.m-wrapper .m-menu-card{background-color:var(--sd-sidebar-mobile-card-bg, #ffffff);border-radius:var(--sd-radius-12, 12px);border:1px solid var(--sd-sidebar-mobile-border, #ebebeb);overflow:hidden}.m-wrapper .m-menu-card .m-card-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:16px;cursor:pointer;-webkit-user-select:none;user-select:none;border:none;background:transparent;-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-header .m-card-header-left{display:flex;align-items:center;gap:16px}.m-wrapper .m-menu-card .m-card-header .m-card-header-left .m-group-icon{font-size:var(--sd-font-size-24, 24px);width:24px;height:24px;color:var(--sd-sidebar-mobile-text, #1f1f1f);object-fit:contain}.m-wrapper .m-menu-card .m-card-header .m-card-header-left .m-group-title{font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-sidebar-mobile-text, #1f1f1f)}.m-wrapper .m-menu-card .m-card-header .m-expand-icon{color:var(--sd-sidebar-mobile-text, #1f1f1f);transition:transform var(--sd-duration-base, .2s) ease}.m-wrapper .m-menu-card .m-card-body{display:flex;flex-direction:column;padding-bottom:8px}.m-wrapper .m-menu-card .m-card-body .m-menu-item{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px 12px 24px;cursor:pointer;border:none;background:transparent;transition:background-color var(--sd-duration-base, .2s);-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-body .m-menu-item:active{background-color:var(--sd-sidebar-mobile-item-active-bg, #f5f5f5)}.m-wrapper .m-menu-card .m-card-body .m-menu-item--indented{padding-left:48px}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left{display:flex;align-items:center;gap:12px}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-icon{font-size:var(--sd-font-size-20, 20px);width:20px;height:20px;color:var(--sd-sidebar-mobile-icon, #8c8c8c)}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-icon-img{width:20px;height:20px;object-fit:contain;opacity:.7}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-title{font-size:var(--sd-font-size-15, 15px);color:var(--sd-sidebar-mobile-text-secondary, #333333)}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-nav-icon{color:var(--sd-sidebar-mobile-icon, #8c8c8c);font-size:var(--sd-font-size-20, 20px);width:20px;height:20px}.m-wrapper .m-menu-card .m-card-body .m-sub-group{border-top:1px solid var(--sd-sidebar-mobile-border, #ebebeb)}.m-wrapper .m-menu-card .m-card-body .m-sub-group:first-child{border-top:none}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px 12px 24px;cursor:pointer;border:none;background:var(--sd-sidebar-mobile-hover-bg, #fafafa);-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header:active{background-color:var(--sd-sidebar-mobile-pressed-bg, #f0f0f0)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left{display:flex;align-items:center;gap:12px}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-icon{font-size:var(--sd-font-size-20, 20px);width:20px;height:20px;color:var(--sd-sidebar-mobile-icon, #8c8c8c)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-icon-img{width:20px;height:20px;object-fit:contain;opacity:.7}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-title{font-size:var(--sd-font-size-15, 15px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-sidebar-mobile-text-secondary, #333333)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-expand-icon{color:var(--sd-sidebar-mobile-icon, #8c8c8c);font-size:var(--sd-font-size-20, 20px);width:20px;height:20px}\n"] }]
1903
2618
  }], ctorParameters: () => [], propDecorators: { isShowSidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "isShowSidebar", required: false }] }], menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: true }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }], showSideBar: [{ type: i0.Output, args: ["showSideBar"] }], expandSideBar: [{ type: i0.Output, args: ["expandSideBar"] }], popupUserMenuOpened: [{ type: i0.Output, args: ["popupUserMenuOpened"] }], popupUserMenuClosed: [{ type: i0.Output, args: ["popupUserMenuClosed"] }], titleMenuGroupChanged: [{ type: i0.Output, args: ["titleMenuGroupChanged"] }] } });
1904
2619
 
1905
2620
  class SdSidebarMobileV1 {
@@ -2058,11 +2773,11 @@ class SdLayoutSearchFieldComponent {
2058
2773
  appearance = input('pill', ...(ngDevMode ? [{ debugName: "appearance" }] : []));
2059
2774
  sdChange = output();
2060
2775
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdLayoutSearchFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2061
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.25", type: SdLayoutSearchFieldComponent, isStandalone: true, selector: "sd-layout-search-field", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: true, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: true, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdChange: "sdChange" }, ngImport: i0, template: "<div\n data-layout-search\n class=\"sd-layout-search-field d-flex align-items-center gap-8\"\n [class.sd-layout-search-field--soft-pill]=\"appearance() === 'pill'\"\n [class.sd-layout-search-field--compact]=\"appearance() === 'compact'\">\n <sd-icon class=\"sd-layout-search-field__icon\" name=\"search\"></sd-icon>\n <sd-input\n class=\"sd-layout-search-field__control\"\n size=\"sm\"\n hideInlineError\n [placeholder]=\"placeholder()\"\n [autoId]=\"autoId()\"\n [model]=\"model()\"\n (sdChange)=\"sdChange.emit($event)\">\n </sd-input>\n</div>\n", styles: [":host{display:block;min-width:0}.sd-layout-search-field{min-height:38px;padding:0 12px;border:0;border-radius:9999px;outline:1px solid transparent;outline-offset:1px;background:var(--sd-black100, var(--sd-surface-muted));color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field:focus-within{outline-color:var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-search-field__icon{flex:0 0 auto;color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field__control{flex:1;min-width:0;--sd-border: transparent;--mdc-outlined-text-field-outline-color: transparent;--mdc-outlined-text-field-hover-outline-color: transparent;--mdc-outlined-text-field-focus-outline-color: transparent;--mdc-outlined-text-field-input-text-placeholder-color: var(--sd-black400, var(--sd-text-muted));--mdc-outlined-text-field-container-shape: 0px}:host ::ng-deep .sd-layout-search-field__control input:focus-visible{outline:0}.sd-layout-search-field--compact{min-height:36px;padding:0 9px;border:1px solid color-mix(in srgb,var(--sd-border, #c4c6d0) 45%,var(--sd-white, #fff));border-radius:7px;background:color-mix(in srgb,var(--sd-surface-muted, #e7e8ed) 35%,var(--sd-white, #fff));color:var(--sd-text-secondary, #6b7280);outline:0;--mat-form-field-container-height: 34px;--mat-form-field-container-vertical-padding: 6px;--mat-form-field-container-text-size: 13px}.sd-layout-search-field--compact:focus-within{border-color:color-mix(in srgb,var(--sd-primary, #005cbb) 75%,var(--sd-white, #fff))}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "labelPlacement", "size", "form", "label", "helperText", "placeholder", "type", "mask", "inputmode", "autocomplete", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2776
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.25", type: SdLayoutSearchFieldComponent, isStandalone: true, selector: "sd-layout-search-field", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: true, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: true, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdChange: "sdChange" }, ngImport: i0, template: "<div\n data-layout-search\n class=\"sd-layout-search-field d-flex align-items-center gap-8\"\n [class.sd-layout-search-field--soft-pill]=\"appearance() === 'pill'\"\n [class.sd-layout-search-field--compact]=\"appearance() === 'compact'\">\n <sd-icon class=\"sd-layout-search-field__icon\" name=\"search\"></sd-icon>\n <sd-input\n class=\"sd-layout-search-field__control\"\n size=\"sm\"\n hideInlineError\n [placeholder]=\"placeholder()\"\n [autoId]=\"autoId()\"\n [model]=\"model()\"\n (sdChange)=\"sdChange.emit($event)\">\n </sd-input>\n</div>\n", styles: [":host{display:block;min-width:0}.sd-layout-search-field{min-height:38px;padding:0 12px;border:0;border-radius:9999px;outline:1px solid transparent;outline-offset:1px;background:var(--sd-black100, var(--sd-surface-muted));color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field:focus-within{outline-color:var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-search-field__icon{flex:0 0 auto;color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field__control{flex:1;min-width:0;--sd-border: transparent;--mdc-outlined-text-field-outline-color: transparent;--mdc-outlined-text-field-hover-outline-color: transparent;--mdc-outlined-text-field-focus-outline-color: transparent;--mat-form-field-outlined-outline-color: transparent;--mat-form-field-outlined-hover-outline-color: transparent;--mat-form-field-outlined-focus-outline-color: transparent;--mdc-outlined-text-field-input-text-placeholder-color: var(--sd-black400, var(--sd-text-muted));--mdc-outlined-text-field-container-shape: 0px;--mat-form-field-outlined-input-text-placeholder-color: var(--sd-black400, var(--sd-text-muted));--mat-form-field-outlined-container-shape: 0px}:host ::ng-deep .sd-layout-search-field__control input:focus-visible{outline:0}.sd-layout-search-field--compact{min-height:36px;padding:0 9px;border:1px solid color-mix(in srgb,var(--sd-border, #c4c6d0) 45%,var(--sd-white, #fff));border-radius:7px;background:color-mix(in srgb,var(--sd-surface-muted, #e7e8ed) 35%,var(--sd-white, #fff));color:var(--sd-text-secondary, #6b7280);outline:0;--mat-form-field-container-height: 34px;--mat-form-field-container-vertical-padding: 6px;--mat-form-field-container-text-size: 13px}.sd-layout-search-field--compact:focus-within{border-color:color-mix(in srgb,var(--sd-primary, #005cbb) 75%,var(--sd-white, #fff))}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "labelPlacement", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "type", "mask", "inputmode", "autocomplete", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2062
2777
  }
2063
2778
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdLayoutSearchFieldComponent, decorators: [{
2064
2779
  type: Component,
2065
- args: [{ selector: 'sd-layout-search-field', standalone: true, imports: [SdIcon, SdInput], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n data-layout-search\n class=\"sd-layout-search-field d-flex align-items-center gap-8\"\n [class.sd-layout-search-field--soft-pill]=\"appearance() === 'pill'\"\n [class.sd-layout-search-field--compact]=\"appearance() === 'compact'\">\n <sd-icon class=\"sd-layout-search-field__icon\" name=\"search\"></sd-icon>\n <sd-input\n class=\"sd-layout-search-field__control\"\n size=\"sm\"\n hideInlineError\n [placeholder]=\"placeholder()\"\n [autoId]=\"autoId()\"\n [model]=\"model()\"\n (sdChange)=\"sdChange.emit($event)\">\n </sd-input>\n</div>\n", styles: [":host{display:block;min-width:0}.sd-layout-search-field{min-height:38px;padding:0 12px;border:0;border-radius:9999px;outline:1px solid transparent;outline-offset:1px;background:var(--sd-black100, var(--sd-surface-muted));color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field:focus-within{outline-color:var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-search-field__icon{flex:0 0 auto;color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field__control{flex:1;min-width:0;--sd-border: transparent;--mdc-outlined-text-field-outline-color: transparent;--mdc-outlined-text-field-hover-outline-color: transparent;--mdc-outlined-text-field-focus-outline-color: transparent;--mdc-outlined-text-field-input-text-placeholder-color: var(--sd-black400, var(--sd-text-muted));--mdc-outlined-text-field-container-shape: 0px}:host ::ng-deep .sd-layout-search-field__control input:focus-visible{outline:0}.sd-layout-search-field--compact{min-height:36px;padding:0 9px;border:1px solid color-mix(in srgb,var(--sd-border, #c4c6d0) 45%,var(--sd-white, #fff));border-radius:7px;background:color-mix(in srgb,var(--sd-surface-muted, #e7e8ed) 35%,var(--sd-white, #fff));color:var(--sd-text-secondary, #6b7280);outline:0;--mat-form-field-container-height: 34px;--mat-form-field-container-vertical-padding: 6px;--mat-form-field-container-text-size: 13px}.sd-layout-search-field--compact:focus-within{border-color:color-mix(in srgb,var(--sd-primary, #005cbb) 75%,var(--sd-white, #fff))}\n"] }]
2780
+ args: [{ selector: 'sd-layout-search-field', standalone: true, imports: [SdIcon, SdInput], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n data-layout-search\n class=\"sd-layout-search-field d-flex align-items-center gap-8\"\n [class.sd-layout-search-field--soft-pill]=\"appearance() === 'pill'\"\n [class.sd-layout-search-field--compact]=\"appearance() === 'compact'\">\n <sd-icon class=\"sd-layout-search-field__icon\" name=\"search\"></sd-icon>\n <sd-input\n class=\"sd-layout-search-field__control\"\n size=\"sm\"\n hideInlineError\n [placeholder]=\"placeholder()\"\n [autoId]=\"autoId()\"\n [model]=\"model()\"\n (sdChange)=\"sdChange.emit($event)\">\n </sd-input>\n</div>\n", styles: [":host{display:block;min-width:0}.sd-layout-search-field{min-height:38px;padding:0 12px;border:0;border-radius:9999px;outline:1px solid transparent;outline-offset:1px;background:var(--sd-black100, var(--sd-surface-muted));color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field:focus-within{outline-color:var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-search-field__icon{flex:0 0 auto;color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field__control{flex:1;min-width:0;--sd-border: transparent;--mdc-outlined-text-field-outline-color: transparent;--mdc-outlined-text-field-hover-outline-color: transparent;--mdc-outlined-text-field-focus-outline-color: transparent;--mat-form-field-outlined-outline-color: transparent;--mat-form-field-outlined-hover-outline-color: transparent;--mat-form-field-outlined-focus-outline-color: transparent;--mdc-outlined-text-field-input-text-placeholder-color: var(--sd-black400, var(--sd-text-muted));--mdc-outlined-text-field-container-shape: 0px;--mat-form-field-outlined-input-text-placeholder-color: var(--sd-black400, var(--sd-text-muted));--mat-form-field-outlined-container-shape: 0px}:host ::ng-deep .sd-layout-search-field__control input:focus-visible{outline:0}.sd-layout-search-field--compact{min-height:36px;padding:0 9px;border:1px solid color-mix(in srgb,var(--sd-border, #c4c6d0) 45%,var(--sd-white, #fff));border-radius:7px;background:color-mix(in srgb,var(--sd-surface-muted, #e7e8ed) 35%,var(--sd-white, #fff));color:var(--sd-text-secondary, #6b7280);outline:0;--mat-form-field-container-height: 34px;--mat-form-field-container-vertical-padding: 6px;--mat-form-field-container-text-size: 13px}.sd-layout-search-field--compact:focus-within{border-color:color-mix(in srgb,var(--sd-primary, #005cbb) 75%,var(--sd-white, #fff))}\n"] }]
2066
2781
  }], propDecorators: { model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: true }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: true }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], sdChange: [{ type: i0.Output, args: ["sdChange"] }] } });
2067
2782
 
2068
2783
  class SdSidebarV2 {
@@ -2179,13 +2894,20 @@ class SdSidebarV2 {
2179
2894
  this.#navigationState.patchVersionState(2, { locked: false });
2180
2895
  }
2181
2896
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarV2, deps: [], target: i0.ɵɵFactoryTarget.Component });
2182
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSidebarV2, isStandalone: true, selector: "sd-sidebar-v2", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "keydown.escape": "closeFromEscape()" } }, ngImport: i0, template: "<!-- why: `(keydown.escape)` \u0111\u01B0\u1EE3c gom l\u00EAn HOST c\u1EE7a component (xem `host` trong main.component.ts).\n Tr\u01B0\u1EDBc \u0111\u00E2y n\u00F3 n\u1EB1m tr\u00EAn div b\u1ECDc v\u00E0 tr\u00EAn <section> flyout \u2014 c\u1EA3 hai \u0111\u1EC1u KH\u00D4NG focusable n\u00EAn ch\u1EC9\n \"ch\u1EA1y nh\u1EDD\" event n\u1ED5i b\u1ECDt t\u1EEB con, \u0111\u1ED3ng th\u1EDDi khi\u1EBFn markup khai b\u00E1o interaction handler tr\u00EAn\n ph\u1EA7n t\u1EED kh\u00F4ng nh\u1EADn \u0111\u01B0\u1EE3c focus. Host l\u00E0 t\u1ED5 ti\u00EAn c\u1EE7a t\u1EA5t c\u1EA3 n\u00EAn h\u00E0nh vi gi\u1EEF nguy\u00EAn. -->\n<div class=\"sd-sidebar-v2\">\n <aside class=\"sd-sidebar-v2__rail d-flex flex-column align-items-center gap-8 py-12 bg-white border-right border-black200\">\n <button type=\"button\" class=\"sd-sidebar-v2__brand d-flex align-items-center justify-content-center\" [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-v2__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\"></sd-icon>\n }\n </button>\n\n <nav class=\"d-flex flex-column align-items-center gap-4 flex-1\" [attr.aria-label]=\"'core.module.layout.sidebar.menu-groups' | sdTranslate\">\n @for (item of railItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__rail-action d-flex flex-column align-items-center justify-content-center gap-4\"\n [attr.data-v2-group-key]=\"item.key\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-expanded]=\"activeGroupKey() === item.key && isFlyoutOpen()\"\n [class.sd-sidebar-v2__rail-action--active]=\"activeGroupKey() === item.key\"\n (click)=\"selectGroup(item.menu)\"\n (mouseenter)=\"previewGroup(item.menu)\"\n (focus)=\"previewGroup(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v2__rail-icon\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-v2__rail-label text-ellipsis\">{{ item.title }}</span>\n </button>\n }\n </nav>\n\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"true\"></sd-layout-user-menu>\n </aside>\n\n @if (isFlyoutOpen()) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__backdrop\"\n [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\"\n (click)=\"closeFromBackdrop()\"\n (keydown.escape)=\"closeFromEscape()\"></button>\n <section\n class=\"sd-sidebar-v2__flyout d-flex flex-column bg-white border-right border-black200 mat-elevation-z4\"\n role=\"region\"\n [attr.aria-label]=\"activeGroup()?.title || 'Menu'\"\n (mouseleave)=\"leaveFlyout()\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ activeGroup()?.title || sidebar().defaultTitle || 'Menu' }}</span>\n @if (isFlyoutLocked()) {\n <sd-icon name=\"lock\"></sd-icon>\n }\n </header>\n <div class=\"p-12\">\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-group' | sdTranslate\"\n [autoId]=\"'layout-v2-context-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"flex-1 overflow-auto px-8 pb-12\">\n <sd-layout-menu-tree\n [menus]=\"contextMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n\n <main class=\"sd-sidebar-v2__content\" data-v2-content data-content-offset=\"rail\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v2{min-height:100vh;background:var(--sd-light)}.sd-sidebar-v2__rail{position:fixed;z-index:var(--sd-z-header, 30);inset:0 auto 0 0;width:72px}.sd-sidebar-v2__brand,.sd-sidebar-v2__rail-action{width:56px;min-height:52px;border:0;border-radius:var(--sd-radius-10, 10px);background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-v2__rail-action:hover,.sd-sidebar-v2__rail-action--active{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v2__brand:focus-visible,.sd-sidebar-v2__rail-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-v2__rail-label{width:52px;font-size:var(--sd-font-size-10, 10px);line-height:12px;text-align:center}.sd-sidebar-v2__logo,.sd-sidebar-v2__rail-icon{width:24px;height:24px;object-fit:contain}.sd-sidebar-v2__backdrop{position:fixed;z-index:10;inset:0;border:0;background:transparent}.sd-sidebar-v2__flyout{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 72px;width:320px}.sd-sidebar-v2__content{min-height:100vh;margin-left:72px}@media(prefers-reduced-motion:reduce){.sd-sidebar-v2__flyout{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2897
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSidebarV2, isStandalone: true, selector: "sd-sidebar-v2", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "keydown.escape": "closeFromEscape()" } }, ngImport: i0, template: "<!-- why: `(keydown.escape)` \u0111\u01B0\u1EE3c gom l\u00EAn HOST c\u1EE7a component (xem `host` trong main.component.ts).\n Tr\u01B0\u1EDBc \u0111\u00E2y n\u00F3 n\u1EB1m tr\u00EAn div b\u1ECDc v\u00E0 tr\u00EAn <section> flyout \u2014 c\u1EA3 hai \u0111\u1EC1u KH\u00D4NG focusable n\u00EAn ch\u1EC9\n \"ch\u1EA1y nh\u1EDD\" event n\u1ED5i b\u1ECDt t\u1EEB con, \u0111\u1ED3ng th\u1EDDi khi\u1EBFn markup khai b\u00E1o interaction handler tr\u00EAn\n ph\u1EA7n t\u1EED kh\u00F4ng nh\u1EADn \u0111\u01B0\u1EE3c focus. Host l\u00E0 t\u1ED5 ti\u00EAn c\u1EE7a t\u1EA5t c\u1EA3 n\u00EAn h\u00E0nh vi gi\u1EEF nguy\u00EAn. -->\n<div class=\"sd-sidebar-v2\">\n <aside #railElement class=\"sd-sidebar-v2__rail d-flex flex-column align-items-center gap-8 py-12 bg-white border-right border-black200\">\n <button type=\"button\" class=\"sd-sidebar-v2__brand d-flex align-items-center justify-content-center\" [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-v2__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\"></sd-icon>\n }\n </button>\n\n <!-- Context switcher (D-010): avatar context ngay d\u01B0\u1EDBi n\u00FAt brand; popover m\u1EDF sang ph\u1EA3i t\u1EEB m\u00E9p rail.\n N\u1EB1m ngo\u00E0i <nav> nh\u00F3m n\u00EAn kh\u00F4ng c\u00F3 mouseenter/focus preview flyout. -->\n @if (sidebar().context; as context) {\n <sd-layout-context-switcher class=\"sd-sidebar-v2__rail-context\" appearance=\"rail\" [configuration]=\"context\" [anchor]=\"railElement\" />\n }\n\n <nav class=\"d-flex flex-column align-items-center gap-4 flex-1\" [attr.aria-label]=\"'core.module.layout.sidebar.menu-groups' | sdTranslate\">\n @for (item of railItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__rail-action d-flex flex-column align-items-center justify-content-center gap-4\"\n [attr.data-v2-group-key]=\"item.key\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-expanded]=\"activeGroupKey() === item.key && isFlyoutOpen()\"\n [class.sd-sidebar-v2__rail-action--active]=\"activeGroupKey() === item.key\"\n (click)=\"selectGroup(item.menu)\"\n (mouseenter)=\"previewGroup(item.menu)\"\n (focus)=\"previewGroup(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v2__rail-icon\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-v2__rail-label text-ellipsis\">{{ item.title }}</span>\n </button>\n }\n </nav>\n\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"true\"></sd-layout-user-menu>\n </aside>\n\n @if (isFlyoutOpen()) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__backdrop\"\n [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\"\n (click)=\"closeFromBackdrop()\"\n (keydown.escape)=\"closeFromEscape()\"></button>\n <section\n class=\"sd-sidebar-v2__flyout d-flex flex-column bg-white border-right border-black200 mat-elevation-z4\"\n role=\"region\"\n [attr.aria-label]=\"activeGroup()?.title || 'Menu'\"\n (mouseleave)=\"leaveFlyout()\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ activeGroup()?.title || sidebar().defaultTitle || 'Menu' }}</span>\n @if (isFlyoutLocked()) {\n <sd-icon name=\"lock\"></sd-icon>\n }\n </header>\n <div class=\"p-12\">\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-group' | sdTranslate\"\n [autoId]=\"'layout-v2-context-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"flex-1 overflow-auto px-8 pb-12\">\n <sd-layout-menu-tree\n [menus]=\"contextMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n\n <main class=\"sd-sidebar-v2__content\" data-v2-content data-content-offset=\"rail\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v2{min-height:100vh;background:var(--sd-light)}.sd-sidebar-v2__rail{position:fixed;z-index:var(--sd-z-header, 30);inset:0 auto 0 0;width:72px}.sd-sidebar-v2__brand,.sd-sidebar-v2__rail-action{width:56px;min-height:52px;border:0;border-radius:var(--sd-radius-10, 10px);background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-v2__rail-action:hover,.sd-sidebar-v2__rail-action--active{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v2__brand:focus-visible,.sd-sidebar-v2__rail-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-v2__rail-context:empty{display:none}.sd-sidebar-v2__rail-label{width:52px;font-size:var(--sd-font-size-10, 10px);line-height:12px;text-align:center}.sd-sidebar-v2__logo,.sd-sidebar-v2__rail-icon{width:24px;height:24px;object-fit:contain}.sd-sidebar-v2__backdrop{position:fixed;z-index:10;inset:0;border:0;background:transparent}.sd-sidebar-v2__flyout{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 72px;width:320px}.sd-sidebar-v2__content{min-height:100vh;margin-left:72px}@media(prefers-reduced-motion:reduce){.sd-sidebar-v2__flyout{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "component", type: SdLayoutContextSwitcher, selector: "sd-layout-context-switcher", inputs: ["configuration", "appearance", "placement", "anchor"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2183
2898
  }
2184
2899
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarV2, decorators: [{
2185
2900
  type: Component,
2186
- args: [{ selector: 'sd-sidebar-v2', standalone: true, imports: [SdIcon, SdLayoutSearchFieldComponent, SdLayoutMenuTreeComponent, SdLayoutUserMenuComponent, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
2901
+ args: [{ selector: 'sd-sidebar-v2', standalone: true, imports: [
2902
+ SdIcon,
2903
+ SdLayoutSearchFieldComponent,
2904
+ SdLayoutMenuTreeComponent,
2905
+ SdLayoutUserMenuComponent,
2906
+ SdLayoutContextSwitcher,
2907
+ SdTranslatePipe,
2908
+ ], changeDetection: ChangeDetectionStrategy.OnPush, host: {
2187
2909
  '(keydown.escape)': 'closeFromEscape()',
2188
- }, template: "<!-- why: `(keydown.escape)` \u0111\u01B0\u1EE3c gom l\u00EAn HOST c\u1EE7a component (xem `host` trong main.component.ts).\n Tr\u01B0\u1EDBc \u0111\u00E2y n\u00F3 n\u1EB1m tr\u00EAn div b\u1ECDc v\u00E0 tr\u00EAn <section> flyout \u2014 c\u1EA3 hai \u0111\u1EC1u KH\u00D4NG focusable n\u00EAn ch\u1EC9\n \"ch\u1EA1y nh\u1EDD\" event n\u1ED5i b\u1ECDt t\u1EEB con, \u0111\u1ED3ng th\u1EDDi khi\u1EBFn markup khai b\u00E1o interaction handler tr\u00EAn\n ph\u1EA7n t\u1EED kh\u00F4ng nh\u1EADn \u0111\u01B0\u1EE3c focus. Host l\u00E0 t\u1ED5 ti\u00EAn c\u1EE7a t\u1EA5t c\u1EA3 n\u00EAn h\u00E0nh vi gi\u1EEF nguy\u00EAn. -->\n<div class=\"sd-sidebar-v2\">\n <aside class=\"sd-sidebar-v2__rail d-flex flex-column align-items-center gap-8 py-12 bg-white border-right border-black200\">\n <button type=\"button\" class=\"sd-sidebar-v2__brand d-flex align-items-center justify-content-center\" [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-v2__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\"></sd-icon>\n }\n </button>\n\n <nav class=\"d-flex flex-column align-items-center gap-4 flex-1\" [attr.aria-label]=\"'core.module.layout.sidebar.menu-groups' | sdTranslate\">\n @for (item of railItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__rail-action d-flex flex-column align-items-center justify-content-center gap-4\"\n [attr.data-v2-group-key]=\"item.key\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-expanded]=\"activeGroupKey() === item.key && isFlyoutOpen()\"\n [class.sd-sidebar-v2__rail-action--active]=\"activeGroupKey() === item.key\"\n (click)=\"selectGroup(item.menu)\"\n (mouseenter)=\"previewGroup(item.menu)\"\n (focus)=\"previewGroup(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v2__rail-icon\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-v2__rail-label text-ellipsis\">{{ item.title }}</span>\n </button>\n }\n </nav>\n\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"true\"></sd-layout-user-menu>\n </aside>\n\n @if (isFlyoutOpen()) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__backdrop\"\n [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\"\n (click)=\"closeFromBackdrop()\"\n (keydown.escape)=\"closeFromEscape()\"></button>\n <section\n class=\"sd-sidebar-v2__flyout d-flex flex-column bg-white border-right border-black200 mat-elevation-z4\"\n role=\"region\"\n [attr.aria-label]=\"activeGroup()?.title || 'Menu'\"\n (mouseleave)=\"leaveFlyout()\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ activeGroup()?.title || sidebar().defaultTitle || 'Menu' }}</span>\n @if (isFlyoutLocked()) {\n <sd-icon name=\"lock\"></sd-icon>\n }\n </header>\n <div class=\"p-12\">\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-group' | sdTranslate\"\n [autoId]=\"'layout-v2-context-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"flex-1 overflow-auto px-8 pb-12\">\n <sd-layout-menu-tree\n [menus]=\"contextMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n\n <main class=\"sd-sidebar-v2__content\" data-v2-content data-content-offset=\"rail\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v2{min-height:100vh;background:var(--sd-light)}.sd-sidebar-v2__rail{position:fixed;z-index:var(--sd-z-header, 30);inset:0 auto 0 0;width:72px}.sd-sidebar-v2__brand,.sd-sidebar-v2__rail-action{width:56px;min-height:52px;border:0;border-radius:var(--sd-radius-10, 10px);background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-v2__rail-action:hover,.sd-sidebar-v2__rail-action--active{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v2__brand:focus-visible,.sd-sidebar-v2__rail-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-v2__rail-label{width:52px;font-size:var(--sd-font-size-10, 10px);line-height:12px;text-align:center}.sd-sidebar-v2__logo,.sd-sidebar-v2__rail-icon{width:24px;height:24px;object-fit:contain}.sd-sidebar-v2__backdrop{position:fixed;z-index:10;inset:0;border:0;background:transparent}.sd-sidebar-v2__flyout{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 72px;width:320px}.sd-sidebar-v2__content{min-height:100vh;margin-left:72px}@media(prefers-reduced-motion:reduce){.sd-sidebar-v2__flyout{transition:none}}\n"] }]
2910
+ }, template: "<!-- why: `(keydown.escape)` \u0111\u01B0\u1EE3c gom l\u00EAn HOST c\u1EE7a component (xem `host` trong main.component.ts).\n Tr\u01B0\u1EDBc \u0111\u00E2y n\u00F3 n\u1EB1m tr\u00EAn div b\u1ECDc v\u00E0 tr\u00EAn <section> flyout \u2014 c\u1EA3 hai \u0111\u1EC1u KH\u00D4NG focusable n\u00EAn ch\u1EC9\n \"ch\u1EA1y nh\u1EDD\" event n\u1ED5i b\u1ECDt t\u1EEB con, \u0111\u1ED3ng th\u1EDDi khi\u1EBFn markup khai b\u00E1o interaction handler tr\u00EAn\n ph\u1EA7n t\u1EED kh\u00F4ng nh\u1EADn \u0111\u01B0\u1EE3c focus. Host l\u00E0 t\u1ED5 ti\u00EAn c\u1EE7a t\u1EA5t c\u1EA3 n\u00EAn h\u00E0nh vi gi\u1EEF nguy\u00EAn. -->\n<div class=\"sd-sidebar-v2\">\n <aside #railElement class=\"sd-sidebar-v2__rail d-flex flex-column align-items-center gap-8 py-12 bg-white border-right border-black200\">\n <button type=\"button\" class=\"sd-sidebar-v2__brand d-flex align-items-center justify-content-center\" [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-v2__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\"></sd-icon>\n }\n </button>\n\n <!-- Context switcher (D-010): avatar context ngay d\u01B0\u1EDBi n\u00FAt brand; popover m\u1EDF sang ph\u1EA3i t\u1EEB m\u00E9p rail.\n N\u1EB1m ngo\u00E0i <nav> nh\u00F3m n\u00EAn kh\u00F4ng c\u00F3 mouseenter/focus preview flyout. -->\n @if (sidebar().context; as context) {\n <sd-layout-context-switcher class=\"sd-sidebar-v2__rail-context\" appearance=\"rail\" [configuration]=\"context\" [anchor]=\"railElement\" />\n }\n\n <nav class=\"d-flex flex-column align-items-center gap-4 flex-1\" [attr.aria-label]=\"'core.module.layout.sidebar.menu-groups' | sdTranslate\">\n @for (item of railItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__rail-action d-flex flex-column align-items-center justify-content-center gap-4\"\n [attr.data-v2-group-key]=\"item.key\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-expanded]=\"activeGroupKey() === item.key && isFlyoutOpen()\"\n [class.sd-sidebar-v2__rail-action--active]=\"activeGroupKey() === item.key\"\n (click)=\"selectGroup(item.menu)\"\n (mouseenter)=\"previewGroup(item.menu)\"\n (focus)=\"previewGroup(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v2__rail-icon\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-v2__rail-label text-ellipsis\">{{ item.title }}</span>\n </button>\n }\n </nav>\n\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"true\"></sd-layout-user-menu>\n </aside>\n\n @if (isFlyoutOpen()) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__backdrop\"\n [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\"\n (click)=\"closeFromBackdrop()\"\n (keydown.escape)=\"closeFromEscape()\"></button>\n <section\n class=\"sd-sidebar-v2__flyout d-flex flex-column bg-white border-right border-black200 mat-elevation-z4\"\n role=\"region\"\n [attr.aria-label]=\"activeGroup()?.title || 'Menu'\"\n (mouseleave)=\"leaveFlyout()\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ activeGroup()?.title || sidebar().defaultTitle || 'Menu' }}</span>\n @if (isFlyoutLocked()) {\n <sd-icon name=\"lock\"></sd-icon>\n }\n </header>\n <div class=\"p-12\">\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-group' | sdTranslate\"\n [autoId]=\"'layout-v2-context-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"flex-1 overflow-auto px-8 pb-12\">\n <sd-layout-menu-tree\n [menus]=\"contextMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n\n <main class=\"sd-sidebar-v2__content\" data-v2-content data-content-offset=\"rail\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v2{min-height:100vh;background:var(--sd-light)}.sd-sidebar-v2__rail{position:fixed;z-index:var(--sd-z-header, 30);inset:0 auto 0 0;width:72px}.sd-sidebar-v2__brand,.sd-sidebar-v2__rail-action{width:56px;min-height:52px;border:0;border-radius:var(--sd-radius-10, 10px);background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-v2__rail-action:hover,.sd-sidebar-v2__rail-action--active{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v2__brand:focus-visible,.sd-sidebar-v2__rail-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-v2__rail-context:empty{display:none}.sd-sidebar-v2__rail-label{width:52px;font-size:var(--sd-font-size-10, 10px);line-height:12px;text-align:center}.sd-sidebar-v2__logo,.sd-sidebar-v2__rail-icon{width:24px;height:24px;object-fit:contain}.sd-sidebar-v2__backdrop{position:fixed;z-index:10;inset:0;border:0;background:transparent}.sd-sidebar-v2__flyout{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 72px;width:320px}.sd-sidebar-v2__content{min-height:100vh;margin-left:72px}@media(prefers-reduced-motion:reduce){.sd-sidebar-v2__flyout{transition:none}}\n"] }]
2189
2911
  }], ctorParameters: () => [], propDecorators: { menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }] } });
2190
2912
 
2191
2913
  class SdSidebarMobileV2 {
@@ -2193,6 +2915,7 @@ class SdSidebarMobileV2 {
2193
2915
  #i18n = inject(I18nService);
2194
2916
  #document = inject(DOCUMENT);
2195
2917
  #destroyRef = inject(DestroyRef);
2918
+ #injector = inject(Injector);
2196
2919
  #navigationState = inject(SdLayoutNavigationStateService);
2197
2920
  #restoreFocusElement = null;
2198
2921
  #previousBodyOverflow = '';
@@ -2216,6 +2939,16 @@ class SdSidebarMobileV2 {
2216
2939
  const menus = this.menus();
2217
2940
  untracked(() => this.#navigationState.hydrate(menus));
2218
2941
  });
2942
+ // why: switcher chỉ mount trong sheet menu (render khi mở) — đối chiếu context ngay lúc khởi tạo (EXEC-D1, D-021)
2943
+ // để listener nhiều tab chạy từ đầu và lần chạm đầu vào menu không kích reload đối chiếu. Không có `context` thì
2944
+ // không lấy service: app không cấu hình context không tạo service lẫn listener.
2945
+ effect(() => {
2946
+ const context = this.sidebar().context;
2947
+ if (!context)
2948
+ return;
2949
+ const items = context.items;
2950
+ untracked(() => this.#injector.get(SdLayoutContextService).syncItems(items));
2951
+ });
2219
2952
  this.#router.events.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(event => {
2220
2953
  if (!(event instanceof NavigationEnd))
2221
2954
  return;
@@ -2290,17 +3023,26 @@ class SdSidebarMobileV2 {
2290
3023
  this.#document.body.style.overflow = this.#previousBodyOverflow;
2291
3024
  }
2292
3025
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarMobileV2, deps: [], target: i0.ɵɵFactoryTarget.Component });
2293
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSidebarMobileV2, isStandalone: true, selector: "sd-sidebar-mobile-v2", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"sd-sidebar-mobile-v2 d-flex flex-column\">\n <main class=\"sd-sidebar-mobile-v2__content flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n <nav class=\"sd-sidebar-mobile-v2__bar d-flex align-items-stretch bg-white border-top border-black200\" [attr.aria-label]=\"'core.module.layout.sidebar.primary-nav' | sdTranslate\">\n @for (menu of primaryMenus(); track menu.id || menu.title) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.data-mobile-menu-key]=\"menu.id ? 'id:' + menu.id : null\"\n [attr.aria-label]=\"menu.tooltipTitle || menu.title || 'Menu'\"\n [attr.aria-expanded]=\"sheetGroupKey() === (menu.id ? 'id:' + menu.id : '') && isSheetOpen()\"\n (click)=\"activateMenu(menu, $event.currentTarget)\">\n @if (menu.iconUrl) {\n <img class=\"sd-sidebar-mobile-v2__icon\" [src]=\"menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-mobile-v2__label text-ellipsis\">{{ menu.tooltipTitle || menu.title }}</span>\n </button>\n }\n @if (overflowMenus().length) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.aria-label]=\"'core.module.layout.sidebar.more-menu' | sdTranslate\"\n [attr.aria-expanded]=\"sheetGroupKey() === 'more' && isSheetOpen()\"\n (click)=\"openMore($event.currentTarget)\">\n <sd-icon name=\"more_horiz\"></sd-icon>\n <span class=\"sd-sidebar-mobile-v2__label\">{{ 'core.module.layout.sidebar.more' | sdTranslate }}</span>\n </button>\n }\n </nav>\n\n @if (isSheetOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v2__backdrop\" [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\" (click)=\"closeSheet()\"></button>\n <section\n data-v2-sheet\n class=\"sd-sidebar-mobile-v2__sheet d-flex flex-column bg-white rounded-top-16 mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"sheetTitle()\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onSheetKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ sheetTitle() }}</span>\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__close d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"closeSheet()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"d-flex flex-column gap-12 p-12 overflow-auto\">\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-menu' | sdTranslate\"\n [autoId]=\"'layout-v2-mobile-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n <sd-layout-menu-tree\n [menus]=\"sheetMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v2{min-height:100dvh;padding-bottom:calc(64px + env(safe-area-inset-bottom));background:var(--sd-light)}.sd-sidebar-mobile-v2__bar{position:fixed;z-index:var(--sd-z-header, 30);inset:auto 0 0;min-height:64px;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v2__bar-action,.sd-sidebar-mobile-v2__close{min-width:0;min-height:48px;border:0;background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-mobile-v2__bar-action:hover,.sd-sidebar-mobile-v2__close:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v2__bar-action:focus-visible,.sd-sidebar-mobile-v2__close:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.sd-sidebar-mobile-v2__label{max-width:72px;font-size:var(--sd-font-size-11, 11px);line-height:14px}.sd-sidebar-mobile-v2__icon{width:22px;height:22px;object-fit:contain}.sd-sidebar-mobile-v2__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v2__sheet{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:auto 0 0;max-height:min(78dvh,720px);padding-bottom:env(safe-area-inset-bottom);overflow:hidden}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v2__sheet{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3026
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSidebarMobileV2, isStandalone: true, selector: "sd-sidebar-mobile-v2", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"sd-sidebar-mobile-v2 d-flex flex-column\">\n <main class=\"sd-sidebar-mobile-v2__content flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n <nav class=\"sd-sidebar-mobile-v2__bar d-flex align-items-stretch bg-white border-top border-black200\" [attr.aria-label]=\"'core.module.layout.sidebar.primary-nav' | sdTranslate\">\n @for (menu of primaryMenus(); track menu.id || menu.title) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.data-mobile-menu-key]=\"menu.id ? 'id:' + menu.id : null\"\n [attr.aria-label]=\"menu.tooltipTitle || menu.title || 'Menu'\"\n [attr.aria-expanded]=\"sheetGroupKey() === (menu.id ? 'id:' + menu.id : '') && isSheetOpen()\"\n (click)=\"activateMenu(menu, $event.currentTarget)\">\n @if (menu.iconUrl) {\n <img class=\"sd-sidebar-mobile-v2__icon\" [src]=\"menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-mobile-v2__label text-ellipsis\">{{ menu.tooltipTitle || menu.title }}</span>\n </button>\n }\n @if (overflowMenus().length) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.aria-label]=\"'core.module.layout.sidebar.more-menu' | sdTranslate\"\n [attr.aria-expanded]=\"sheetGroupKey() === 'more' && isSheetOpen()\"\n (click)=\"openMore($event.currentTarget)\">\n <sd-icon name=\"more_horiz\"></sd-icon>\n <span class=\"sd-sidebar-mobile-v2__label\">{{ 'core.module.layout.sidebar.more' | sdTranslate }}</span>\n </button>\n }\n </nav>\n\n @if (isSheetOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v2__backdrop\" [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\" (click)=\"closeSheet()\"></button>\n <section\n data-v2-sheet\n class=\"sd-sidebar-mobile-v2__sheet d-flex flex-column bg-white rounded-top-16 mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"sheetTitle()\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onSheetKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ sheetTitle() }}</span>\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__close d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"closeSheet()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"d-flex flex-column gap-12 p-12 overflow-auto\">\n <!-- Context switcher (D-027): mobile V2 kh\u00F4ng c\u00F3 drawer n\u00EAn trigger l\u00E0 d\u00F2ng \u0111\u1EA7u c\u1EE7a sheet menu; sheet ch\u1ECDn\n context m\u1EDF trong overlay CDK, ch\u1ED3ng l\u00EAn sheet n\u00E0y v\u00E0 t\u1EF1 gi\u1EEF Esc (kh\u00F4ng \u0111\u00F3ng sheet menu). -->\n @if (sidebar().context; as context) {\n <sd-layout-context-switcher class=\"sd-sidebar-mobile-v2__context\" appearance=\"sheet\" [configuration]=\"context\" />\n }\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-menu' | sdTranslate\"\n [autoId]=\"'layout-v2-mobile-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n <sd-layout-menu-tree\n [menus]=\"sheetMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v2{min-height:100dvh;padding-bottom:calc(64px + env(safe-area-inset-bottom));background:var(--sd-light)}.sd-sidebar-mobile-v2__bar{position:fixed;z-index:var(--sd-z-header, 30);inset:auto 0 0;min-height:64px;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v2__bar-action,.sd-sidebar-mobile-v2__close{min-width:0;min-height:48px;border:0;background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-mobile-v2__bar-action:hover,.sd-sidebar-mobile-v2__close:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v2__bar-action:focus-visible,.sd-sidebar-mobile-v2__close:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.sd-sidebar-mobile-v2__label{max-width:72px;font-size:var(--sd-font-size-11, 11px);line-height:14px}.sd-sidebar-mobile-v2__icon{width:22px;height:22px;object-fit:contain}.sd-sidebar-mobile-v2__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v2__sheet{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:auto 0 0;max-height:min(78dvh,720px);padding-bottom:env(safe-area-inset-bottom);overflow:hidden}.sd-sidebar-mobile-v2__context:empty{display:none}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v2__sheet{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "component", type: SdLayoutContextSwitcher, selector: "sd-layout-context-switcher", inputs: ["configuration", "appearance", "placement", "anchor"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2294
3027
  }
2295
3028
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarMobileV2, decorators: [{
2296
3029
  type: Component,
2297
- args: [{ selector: 'sd-sidebar-mobile-v2', standalone: true, imports: [A11yModule, SdIcon, SdLayoutSearchFieldComponent, SdLayoutMenuTreeComponent, SdLayoutUserMenuComponent, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sd-sidebar-mobile-v2 d-flex flex-column\">\n <main class=\"sd-sidebar-mobile-v2__content flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n <nav class=\"sd-sidebar-mobile-v2__bar d-flex align-items-stretch bg-white border-top border-black200\" [attr.aria-label]=\"'core.module.layout.sidebar.primary-nav' | sdTranslate\">\n @for (menu of primaryMenus(); track menu.id || menu.title) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.data-mobile-menu-key]=\"menu.id ? 'id:' + menu.id : null\"\n [attr.aria-label]=\"menu.tooltipTitle || menu.title || 'Menu'\"\n [attr.aria-expanded]=\"sheetGroupKey() === (menu.id ? 'id:' + menu.id : '') && isSheetOpen()\"\n (click)=\"activateMenu(menu, $event.currentTarget)\">\n @if (menu.iconUrl) {\n <img class=\"sd-sidebar-mobile-v2__icon\" [src]=\"menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-mobile-v2__label text-ellipsis\">{{ menu.tooltipTitle || menu.title }}</span>\n </button>\n }\n @if (overflowMenus().length) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.aria-label]=\"'core.module.layout.sidebar.more-menu' | sdTranslate\"\n [attr.aria-expanded]=\"sheetGroupKey() === 'more' && isSheetOpen()\"\n (click)=\"openMore($event.currentTarget)\">\n <sd-icon name=\"more_horiz\"></sd-icon>\n <span class=\"sd-sidebar-mobile-v2__label\">{{ 'core.module.layout.sidebar.more' | sdTranslate }}</span>\n </button>\n }\n </nav>\n\n @if (isSheetOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v2__backdrop\" [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\" (click)=\"closeSheet()\"></button>\n <section\n data-v2-sheet\n class=\"sd-sidebar-mobile-v2__sheet d-flex flex-column bg-white rounded-top-16 mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"sheetTitle()\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onSheetKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ sheetTitle() }}</span>\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__close d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"closeSheet()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"d-flex flex-column gap-12 p-12 overflow-auto\">\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-menu' | sdTranslate\"\n [autoId]=\"'layout-v2-mobile-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n <sd-layout-menu-tree\n [menus]=\"sheetMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v2{min-height:100dvh;padding-bottom:calc(64px + env(safe-area-inset-bottom));background:var(--sd-light)}.sd-sidebar-mobile-v2__bar{position:fixed;z-index:var(--sd-z-header, 30);inset:auto 0 0;min-height:64px;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v2__bar-action,.sd-sidebar-mobile-v2__close{min-width:0;min-height:48px;border:0;background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-mobile-v2__bar-action:hover,.sd-sidebar-mobile-v2__close:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v2__bar-action:focus-visible,.sd-sidebar-mobile-v2__close:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.sd-sidebar-mobile-v2__label{max-width:72px;font-size:var(--sd-font-size-11, 11px);line-height:14px}.sd-sidebar-mobile-v2__icon{width:22px;height:22px;object-fit:contain}.sd-sidebar-mobile-v2__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v2__sheet{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:auto 0 0;max-height:min(78dvh,720px);padding-bottom:env(safe-area-inset-bottom);overflow:hidden}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v2__sheet{transition:none}}\n"] }]
3030
+ args: [{ selector: 'sd-sidebar-mobile-v2', standalone: true, imports: [
3031
+ A11yModule,
3032
+ SdIcon,
3033
+ SdLayoutSearchFieldComponent,
3034
+ SdLayoutMenuTreeComponent,
3035
+ SdLayoutUserMenuComponent,
3036
+ SdLayoutContextSwitcher,
3037
+ SdTranslatePipe,
3038
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sd-sidebar-mobile-v2 d-flex flex-column\">\n <main class=\"sd-sidebar-mobile-v2__content flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n <nav class=\"sd-sidebar-mobile-v2__bar d-flex align-items-stretch bg-white border-top border-black200\" [attr.aria-label]=\"'core.module.layout.sidebar.primary-nav' | sdTranslate\">\n @for (menu of primaryMenus(); track menu.id || menu.title) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.data-mobile-menu-key]=\"menu.id ? 'id:' + menu.id : null\"\n [attr.aria-label]=\"menu.tooltipTitle || menu.title || 'Menu'\"\n [attr.aria-expanded]=\"sheetGroupKey() === (menu.id ? 'id:' + menu.id : '') && isSheetOpen()\"\n (click)=\"activateMenu(menu, $event.currentTarget)\">\n @if (menu.iconUrl) {\n <img class=\"sd-sidebar-mobile-v2__icon\" [src]=\"menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-mobile-v2__label text-ellipsis\">{{ menu.tooltipTitle || menu.title }}</span>\n </button>\n }\n @if (overflowMenus().length) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.aria-label]=\"'core.module.layout.sidebar.more-menu' | sdTranslate\"\n [attr.aria-expanded]=\"sheetGroupKey() === 'more' && isSheetOpen()\"\n (click)=\"openMore($event.currentTarget)\">\n <sd-icon name=\"more_horiz\"></sd-icon>\n <span class=\"sd-sidebar-mobile-v2__label\">{{ 'core.module.layout.sidebar.more' | sdTranslate }}</span>\n </button>\n }\n </nav>\n\n @if (isSheetOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v2__backdrop\" [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\" (click)=\"closeSheet()\"></button>\n <section\n data-v2-sheet\n class=\"sd-sidebar-mobile-v2__sheet d-flex flex-column bg-white rounded-top-16 mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"sheetTitle()\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onSheetKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ sheetTitle() }}</span>\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__close d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"closeSheet()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"d-flex flex-column gap-12 p-12 overflow-auto\">\n <!-- Context switcher (D-027): mobile V2 kh\u00F4ng c\u00F3 drawer n\u00EAn trigger l\u00E0 d\u00F2ng \u0111\u1EA7u c\u1EE7a sheet menu; sheet ch\u1ECDn\n context m\u1EDF trong overlay CDK, ch\u1ED3ng l\u00EAn sheet n\u00E0y v\u00E0 t\u1EF1 gi\u1EEF Esc (kh\u00F4ng \u0111\u00F3ng sheet menu). -->\n @if (sidebar().context; as context) {\n <sd-layout-context-switcher class=\"sd-sidebar-mobile-v2__context\" appearance=\"sheet\" [configuration]=\"context\" />\n }\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-menu' | sdTranslate\"\n [autoId]=\"'layout-v2-mobile-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n <sd-layout-menu-tree\n [menus]=\"sheetMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v2{min-height:100dvh;padding-bottom:calc(64px + env(safe-area-inset-bottom));background:var(--sd-light)}.sd-sidebar-mobile-v2__bar{position:fixed;z-index:var(--sd-z-header, 30);inset:auto 0 0;min-height:64px;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v2__bar-action,.sd-sidebar-mobile-v2__close{min-width:0;min-height:48px;border:0;background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-mobile-v2__bar-action:hover,.sd-sidebar-mobile-v2__close:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v2__bar-action:focus-visible,.sd-sidebar-mobile-v2__close:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.sd-sidebar-mobile-v2__label{max-width:72px;font-size:var(--sd-font-size-11, 11px);line-height:14px}.sd-sidebar-mobile-v2__icon{width:22px;height:22px;object-fit:contain}.sd-sidebar-mobile-v2__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v2__sheet{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:auto 0 0;max-height:min(78dvh,720px);padding-bottom:env(safe-area-inset-bottom);overflow:hidden}.sd-sidebar-mobile-v2__context:empty{display:none}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v2__sheet{transition:none}}\n"] }]
2298
3039
  }], ctorParameters: () => [], propDecorators: { menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }] } });
2299
3040
 
2300
3041
  class SdSidebarV3 {
2301
3042
  #router = inject(Router);
2302
3043
  #destroyRef = inject(DestroyRef);
2303
3044
  #navigationState = inject(SdLayoutNavigationStateService);
3045
+ headerSwitcher = viewChild('headerSwitcher', ...(ngDevMode ? [{ debugName: "headerSwitcher" }] : []));
2304
3046
  #initialized = false;
2305
3047
  menus = input([], ...(ngDevMode ? [{ debugName: "menus" }] : []));
2306
3048
  userInfo = input.required(...(ngDevMode ? [{ debugName: "userInfo" }] : []));
@@ -2315,6 +3057,8 @@ class SdSidebarV3 {
2315
3057
  pinnedMenus = this.#navigationState.pinnedMenus;
2316
3058
  recentMenus = this.#navigationState.recentMenus;
2317
3059
  collapsedItems = computed(() => this.menus().map(menu => ({ menu, key: getMenuStableKey(menu), title: menu.tooltipTitle || menu.title || 'Menu' })), ...(ngDevMode ? [{ debugName: "collapsedItems" }] : []));
3060
+ /** The header Context Switcher popover is open; the whole header then takes the hover background (README CS1). */
3061
+ contextOpen = computed(() => this.headerSwitcher()?.isOpen() ?? false, ...(ngDevMode ? [{ debugName: "contextOpen" }] : []));
2318
3062
  constructor() {
2319
3063
  effect(() => {
2320
3064
  const menus = this.menus();
@@ -2385,17 +3129,25 @@ class SdSidebarV3 {
2385
3129
  this.#navigationState.togglePinned(menu);
2386
3130
  }
2387
3131
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarV3, deps: [], target: i0.ɵɵFactoryTarget.Component });
2388
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSidebarV3, isStandalone: true, selector: "sd-sidebar-v3", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@let collapsed = isCollapsed();\n@let configuration = sidebar();\n@let pinned = pinnedMenus();\n@let recent = recentMenus();\n<div class=\"sd-sidebar-v3\" [class.sd-sidebar-v3--collapsed]=\"collapsed\">\n <aside class=\"sd-sidebar-v3__drawer d-flex flex-column\" data-v3-sidebar [attr.data-collapsed]=\"collapsed\">\n <header\n data-v3-header\n class=\"sd-sidebar-v3__header d-flex align-items-center gap-8 p-12\"\n [class.sd-sidebar-v3__header--collapsed]=\"collapsed\"\n [class.justify-content-between]=\"!collapsed\"\n [class.justify-content-center]=\"collapsed\">\n @if (!collapsed) {\n <div data-v3-brand class=\"d-flex align-items-center gap-8 overflow-hidden\">\n @if (configuration.logoUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"configuration.logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n <span class=\"sd-sidebar-v3__title text-ellipsis\">{{ configuration.defaultTitle || 'Back Office' }}</span>\n </div>\n }\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__icon-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"collapsed ? 'M\u1EDF r\u1ED9ng sidebar' : 'Thu g\u1ECDn sidebar'\"\n [attr.aria-expanded]=\"!collapsed\"\n (click)=\"toggleCollapsed()\">\n <sd-icon [name]=\"collapsed ? 'chevron_right' : 'chevron_left'\" size=\"20px\"></sd-icon>\n </button>\n </header>\n\n @if (collapsed) {\n <nav class=\"sd-sidebar-v3__navigation d-flex flex-column align-items-center gap-4 p-8 flex-1 overflow-auto\" aria-label=\"Menu thu g\u1ECDn\">\n @for (item of collapsedItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__collapsed-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"item.title\"\n [attr.title]=\"item.title\"\n (click)=\"activateCollapsedMenu(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n </button>\n }\n </nav>\n } @else {\n <div class=\"sd-sidebar-v3__search px-12 pb-12\">\n <sd-layout-search-field\n appearance=\"compact\"\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"sd-sidebar-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto px-8 pb-12\">\n @if (pinned.length) {\n <section data-v3-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"pinned\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recent.length) {\n <section data-v3-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"recent\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section data-v3-all class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"hierarchy\"\n [collapsible]=\"true\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n }\n\n <div data-v3-footer class=\"sd-sidebar-v3__footer p-8\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"collapsed\"></sd-layout-user-menu>\n </div>\n </aside>\n\n <main class=\"sd-sidebar-v3__content\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v3{--sidebar-surface: var(--sd-white, #fff);--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);min-height:100vh;background:var(--sd-light)}.sd-sidebar-v3__drawer{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 0;width:304px;box-sizing:border-box;background:var(--sidebar-surface);border-right:1px solid var(--sidebar-line);color:var(--sidebar-ink);transition:width .16s ease}.sd-sidebar-v3__header{flex-shrink:0;min-height:64px;box-sizing:border-box}.sd-sidebar-v3__title{font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px}.sd-sidebar-v3__search{flex-shrink:0}.sd-sidebar-v3__navigation{min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}.sd-sidebar-v3__navigation section{flex-shrink:0}.sd-sidebar-v3__section-title{padding:4px 10px;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px;color:var(--sidebar-muted)}.sd-sidebar-v3__footer{flex-shrink:0;border-top:1px solid var(--sidebar-line);background:var(--sidebar-surface)}.sd-sidebar-v3--collapsed .sd-sidebar-v3__drawer{width:72px}.sd-sidebar-v3__content{min-height:100vh;margin-left:304px;transition:margin-left .16s ease}.sd-sidebar-v3--collapsed .sd-sidebar-v3__content{margin-left:72px}.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:40px;flex-shrink:0;height:40px;border:0;border-radius:7px;background:transparent;color:var(--sidebar-muted);cursor:pointer}@media(pointer:coarse){.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:44px;height:44px}}.sd-sidebar-v3__icon-action:hover,.sd-sidebar-v3__collapsed-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v3__icon-action:focus-visible,.sd-sidebar-v3__collapsed-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-v3__logo{width:28px;height:28px;object-fit:contain}@media(prefers-reduced-motion:reduce){.sd-sidebar-v3__drawer,.sd-sidebar-v3__content{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3132
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSidebarV3, isStandalone: true, selector: "sd-sidebar-v3", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "headerSwitcher", first: true, predicate: ["headerSwitcher"], descendants: true, isSignal: true }], ngImport: i0, template: "@let collapsed = isCollapsed();\n@let configuration = sidebar();\n@let pinned = pinnedMenus();\n@let recent = recentMenus();\n@let title = configuration.defaultTitle || 'Back Office';\n<div class=\"sd-sidebar-v3\" [class.sd-sidebar-v3--collapsed]=\"collapsed\">\n <aside #asideElement class=\"sd-sidebar-v3__drawer d-flex flex-column\" data-v3-sidebar [attr.data-collapsed]=\"collapsed\">\n <header\n #headerElement\n data-v3-header\n class=\"sd-sidebar-v3__header d-flex align-items-center gap-8 p-12\"\n [class.sd-sidebar-v3__header--collapsed]=\"collapsed\"\n [class.sd-sidebar-v3__header--context-open]=\"!collapsed && contextOpen()\"\n [class.justify-content-between]=\"!collapsed\"\n [class.justify-content-center]=\"collapsed\">\n @if (!collapsed) {\n <!-- why: 12px gi\u1EEFa icon v\u00E0 t\u00EAn (nh\u01B0 V4) \u2014 8px tr\u00F4ng d\u00EDnh v\u00E0o kh\u1ED1i t\u00EAn hai d\u00F2ng khi c\u00F3 context. -->\n <div data-v3-brand class=\"d-flex align-items-center gap-12 overflow-hidden\">\n @if (configuration.logoUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"configuration.logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n @if (configuration.context; as context) {\n <!-- Context switcher (R-008, D-010): d\u00F2ng ph\u1EE5 ngay d\u01B0\u1EDBi t\u00EAn app; popover n\u1EB1m d\u01B0\u1EDBi header, th\u1EE5t 12px m\u1ED7i b\u00EAn. -->\n <div class=\"sd-sidebar-v3__brand-text\">\n <span class=\"sd-sidebar-v3__title text-ellipsis\">{{ title }}</span>\n <sd-layout-context-switcher #headerSwitcher appearance=\"header\" [configuration]=\"context\" [anchor]=\"headerElement\" />\n </div>\n } @else {\n <span class=\"sd-sidebar-v3__title text-ellipsis\">{{ title }}</span>\n }\n </div>\n }\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__icon-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"collapsed ? 'M\u1EDF r\u1ED9ng sidebar' : 'Thu g\u1ECDn sidebar'\"\n [attr.aria-expanded]=\"!collapsed\"\n (click)=\"toggleCollapsed()\">\n <sd-icon [name]=\"collapsed ? 'chevron_right' : 'chevron_left'\" size=\"20px\"></sd-icon>\n </button>\n </header>\n\n @if (collapsed) {\n @if (configuration.context; as context) {\n <!-- Rail thu g\u1ECDn (D-010): avatar context \u1EDF \u0111\u1EA7u rail, d\u01B0\u1EDBi n\u00FAt m\u1EDF r\u1ED9ng; popover m\u1EDF sang ph\u1EA3i t\u1EEB m\u00E9p drawer. -->\n <sd-layout-context-switcher\n class=\"sd-sidebar-v3__rail-context\"\n appearance=\"rail\"\n [configuration]=\"context\"\n [anchor]=\"asideElement\" />\n }\n <nav class=\"sd-sidebar-v3__navigation d-flex flex-column align-items-center gap-4 p-8 flex-1 overflow-auto\" aria-label=\"Menu thu g\u1ECDn\">\n @for (item of collapsedItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__collapsed-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"item.title\"\n [attr.title]=\"item.title\"\n (click)=\"activateCollapsedMenu(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n </button>\n }\n </nav>\n } @else {\n <div class=\"sd-sidebar-v3__search px-12 pb-12\">\n <sd-layout-search-field\n appearance=\"compact\"\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"sd-sidebar-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto px-8 pb-12\">\n @if (pinned.length) {\n <section data-v3-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"pinned\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recent.length) {\n <section data-v3-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"recent\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section data-v3-all class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"hierarchy\"\n [collapsible]=\"true\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n }\n\n <div data-v3-footer class=\"sd-sidebar-v3__footer p-8\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"collapsed\"></sd-layout-user-menu>\n </div>\n </aside>\n\n <main class=\"sd-sidebar-v3__content\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v3{--sidebar-surface: var(--sd-white, #fff);--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);min-height:100vh;background:var(--sd-light)}.sd-sidebar-v3__drawer{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 0;width:304px;box-sizing:border-box;background:var(--sidebar-surface);border-right:1px solid var(--sidebar-line);color:var(--sidebar-ink);transition:width .16s ease}.sd-sidebar-v3__header{flex-shrink:0;min-height:64px;box-sizing:border-box}.sd-sidebar-v3__title{font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px}.sd-sidebar-v3__brand-text{--sd-layout-context-switcher-popover-width: 280px ;display:flex;flex-direction:column;min-width:0}.sd-sidebar-v3__header--context-open{border-radius:var(--sd-radius-12, 12px);background:color-mix(in srgb,var(--sd-text) 6%,transparent)}.sd-sidebar-v3__header--context-open ::ng-deep .sd-layout-context-switcher__trigger.sd-layout-context-switcher__trigger--header{background:transparent}.sd-sidebar-v3__rail-context{flex:none}.sd-sidebar-v3__rail-context:not(:empty){margin-bottom:4px}.sd-sidebar-v3__search{flex-shrink:0}.sd-sidebar-v3__navigation{min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}.sd-sidebar-v3__navigation section{flex-shrink:0}.sd-sidebar-v3__section-title{padding:4px 10px;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px;color:var(--sidebar-muted)}.sd-sidebar-v3__footer{flex-shrink:0;border-top:1px solid var(--sidebar-line);background:var(--sidebar-surface)}.sd-sidebar-v3--collapsed .sd-sidebar-v3__drawer{width:72px}.sd-sidebar-v3__content{min-height:100vh;margin-left:304px;transition:margin-left .16s ease}.sd-sidebar-v3--collapsed .sd-sidebar-v3__content{margin-left:72px}.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:40px;flex-shrink:0;height:40px;border:0;border-radius:7px;background:transparent;color:var(--sidebar-muted);cursor:pointer}@media(pointer:coarse){.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:44px;height:44px}}.sd-sidebar-v3__icon-action:hover,.sd-sidebar-v3__collapsed-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v3__icon-action:focus-visible,.sd-sidebar-v3__collapsed-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-v3__logo{width:28px;height:28px;object-fit:contain}@media(prefers-reduced-motion:reduce){.sd-sidebar-v3__drawer,.sd-sidebar-v3__content{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutContextSwitcher, selector: "sd-layout-context-switcher", inputs: ["configuration", "appearance", "placement", "anchor"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2389
3133
  }
2390
3134
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarV3, decorators: [{
2391
3135
  type: Component,
2392
- args: [{ selector: 'sd-sidebar-v3', standalone: true, imports: [SdIcon, SdLayoutSearchFieldComponent, SdLayoutMenuTreeComponent, SdLayoutUserMenuComponent, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let collapsed = isCollapsed();\n@let configuration = sidebar();\n@let pinned = pinnedMenus();\n@let recent = recentMenus();\n<div class=\"sd-sidebar-v3\" [class.sd-sidebar-v3--collapsed]=\"collapsed\">\n <aside class=\"sd-sidebar-v3__drawer d-flex flex-column\" data-v3-sidebar [attr.data-collapsed]=\"collapsed\">\n <header\n data-v3-header\n class=\"sd-sidebar-v3__header d-flex align-items-center gap-8 p-12\"\n [class.sd-sidebar-v3__header--collapsed]=\"collapsed\"\n [class.justify-content-between]=\"!collapsed\"\n [class.justify-content-center]=\"collapsed\">\n @if (!collapsed) {\n <div data-v3-brand class=\"d-flex align-items-center gap-8 overflow-hidden\">\n @if (configuration.logoUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"configuration.logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n <span class=\"sd-sidebar-v3__title text-ellipsis\">{{ configuration.defaultTitle || 'Back Office' }}</span>\n </div>\n }\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__icon-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"collapsed ? 'M\u1EDF r\u1ED9ng sidebar' : 'Thu g\u1ECDn sidebar'\"\n [attr.aria-expanded]=\"!collapsed\"\n (click)=\"toggleCollapsed()\">\n <sd-icon [name]=\"collapsed ? 'chevron_right' : 'chevron_left'\" size=\"20px\"></sd-icon>\n </button>\n </header>\n\n @if (collapsed) {\n <nav class=\"sd-sidebar-v3__navigation d-flex flex-column align-items-center gap-4 p-8 flex-1 overflow-auto\" aria-label=\"Menu thu g\u1ECDn\">\n @for (item of collapsedItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__collapsed-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"item.title\"\n [attr.title]=\"item.title\"\n (click)=\"activateCollapsedMenu(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n </button>\n }\n </nav>\n } @else {\n <div class=\"sd-sidebar-v3__search px-12 pb-12\">\n <sd-layout-search-field\n appearance=\"compact\"\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"sd-sidebar-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto px-8 pb-12\">\n @if (pinned.length) {\n <section data-v3-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"pinned\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recent.length) {\n <section data-v3-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"recent\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section data-v3-all class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"hierarchy\"\n [collapsible]=\"true\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n }\n\n <div data-v3-footer class=\"sd-sidebar-v3__footer p-8\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"collapsed\"></sd-layout-user-menu>\n </div>\n </aside>\n\n <main class=\"sd-sidebar-v3__content\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v3{--sidebar-surface: var(--sd-white, #fff);--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);min-height:100vh;background:var(--sd-light)}.sd-sidebar-v3__drawer{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 0;width:304px;box-sizing:border-box;background:var(--sidebar-surface);border-right:1px solid var(--sidebar-line);color:var(--sidebar-ink);transition:width .16s ease}.sd-sidebar-v3__header{flex-shrink:0;min-height:64px;box-sizing:border-box}.sd-sidebar-v3__title{font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px}.sd-sidebar-v3__search{flex-shrink:0}.sd-sidebar-v3__navigation{min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}.sd-sidebar-v3__navigation section{flex-shrink:0}.sd-sidebar-v3__section-title{padding:4px 10px;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px;color:var(--sidebar-muted)}.sd-sidebar-v3__footer{flex-shrink:0;border-top:1px solid var(--sidebar-line);background:var(--sidebar-surface)}.sd-sidebar-v3--collapsed .sd-sidebar-v3__drawer{width:72px}.sd-sidebar-v3__content{min-height:100vh;margin-left:304px;transition:margin-left .16s ease}.sd-sidebar-v3--collapsed .sd-sidebar-v3__content{margin-left:72px}.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:40px;flex-shrink:0;height:40px;border:0;border-radius:7px;background:transparent;color:var(--sidebar-muted);cursor:pointer}@media(pointer:coarse){.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:44px;height:44px}}.sd-sidebar-v3__icon-action:hover,.sd-sidebar-v3__collapsed-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v3__icon-action:focus-visible,.sd-sidebar-v3__collapsed-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-v3__logo{width:28px;height:28px;object-fit:contain}@media(prefers-reduced-motion:reduce){.sd-sidebar-v3__drawer,.sd-sidebar-v3__content{transition:none}}\n"] }]
2393
- }], ctorParameters: () => [], propDecorators: { menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }] } });
3136
+ args: [{ selector: 'sd-sidebar-v3', standalone: true, imports: [
3137
+ SdIcon,
3138
+ SdLayoutContextSwitcher,
3139
+ SdLayoutSearchFieldComponent,
3140
+ SdLayoutMenuTreeComponent,
3141
+ SdLayoutUserMenuComponent,
3142
+ SdTranslatePipe,
3143
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let collapsed = isCollapsed();\n@let configuration = sidebar();\n@let pinned = pinnedMenus();\n@let recent = recentMenus();\n@let title = configuration.defaultTitle || 'Back Office';\n<div class=\"sd-sidebar-v3\" [class.sd-sidebar-v3--collapsed]=\"collapsed\">\n <aside #asideElement class=\"sd-sidebar-v3__drawer d-flex flex-column\" data-v3-sidebar [attr.data-collapsed]=\"collapsed\">\n <header\n #headerElement\n data-v3-header\n class=\"sd-sidebar-v3__header d-flex align-items-center gap-8 p-12\"\n [class.sd-sidebar-v3__header--collapsed]=\"collapsed\"\n [class.sd-sidebar-v3__header--context-open]=\"!collapsed && contextOpen()\"\n [class.justify-content-between]=\"!collapsed\"\n [class.justify-content-center]=\"collapsed\">\n @if (!collapsed) {\n <!-- why: 12px gi\u1EEFa icon v\u00E0 t\u00EAn (nh\u01B0 V4) \u2014 8px tr\u00F4ng d\u00EDnh v\u00E0o kh\u1ED1i t\u00EAn hai d\u00F2ng khi c\u00F3 context. -->\n <div data-v3-brand class=\"d-flex align-items-center gap-12 overflow-hidden\">\n @if (configuration.logoUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"configuration.logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n @if (configuration.context; as context) {\n <!-- Context switcher (R-008, D-010): d\u00F2ng ph\u1EE5 ngay d\u01B0\u1EDBi t\u00EAn app; popover n\u1EB1m d\u01B0\u1EDBi header, th\u1EE5t 12px m\u1ED7i b\u00EAn. -->\n <div class=\"sd-sidebar-v3__brand-text\">\n <span class=\"sd-sidebar-v3__title text-ellipsis\">{{ title }}</span>\n <sd-layout-context-switcher #headerSwitcher appearance=\"header\" [configuration]=\"context\" [anchor]=\"headerElement\" />\n </div>\n } @else {\n <span class=\"sd-sidebar-v3__title text-ellipsis\">{{ title }}</span>\n }\n </div>\n }\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__icon-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"collapsed ? 'M\u1EDF r\u1ED9ng sidebar' : 'Thu g\u1ECDn sidebar'\"\n [attr.aria-expanded]=\"!collapsed\"\n (click)=\"toggleCollapsed()\">\n <sd-icon [name]=\"collapsed ? 'chevron_right' : 'chevron_left'\" size=\"20px\"></sd-icon>\n </button>\n </header>\n\n @if (collapsed) {\n @if (configuration.context; as context) {\n <!-- Rail thu g\u1ECDn (D-010): avatar context \u1EDF \u0111\u1EA7u rail, d\u01B0\u1EDBi n\u00FAt m\u1EDF r\u1ED9ng; popover m\u1EDF sang ph\u1EA3i t\u1EEB m\u00E9p drawer. -->\n <sd-layout-context-switcher\n class=\"sd-sidebar-v3__rail-context\"\n appearance=\"rail\"\n [configuration]=\"context\"\n [anchor]=\"asideElement\" />\n }\n <nav class=\"sd-sidebar-v3__navigation d-flex flex-column align-items-center gap-4 p-8 flex-1 overflow-auto\" aria-label=\"Menu thu g\u1ECDn\">\n @for (item of collapsedItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__collapsed-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"item.title\"\n [attr.title]=\"item.title\"\n (click)=\"activateCollapsedMenu(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n </button>\n }\n </nav>\n } @else {\n <div class=\"sd-sidebar-v3__search px-12 pb-12\">\n <sd-layout-search-field\n appearance=\"compact\"\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"sd-sidebar-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto px-8 pb-12\">\n @if (pinned.length) {\n <section data-v3-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"pinned\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recent.length) {\n <section data-v3-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"recent\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section data-v3-all class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"hierarchy\"\n [collapsible]=\"true\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n }\n\n <div data-v3-footer class=\"sd-sidebar-v3__footer p-8\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"collapsed\"></sd-layout-user-menu>\n </div>\n </aside>\n\n <main class=\"sd-sidebar-v3__content\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v3{--sidebar-surface: var(--sd-white, #fff);--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);min-height:100vh;background:var(--sd-light)}.sd-sidebar-v3__drawer{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 0;width:304px;box-sizing:border-box;background:var(--sidebar-surface);border-right:1px solid var(--sidebar-line);color:var(--sidebar-ink);transition:width .16s ease}.sd-sidebar-v3__header{flex-shrink:0;min-height:64px;box-sizing:border-box}.sd-sidebar-v3__title{font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px}.sd-sidebar-v3__brand-text{--sd-layout-context-switcher-popover-width: 280px ;display:flex;flex-direction:column;min-width:0}.sd-sidebar-v3__header--context-open{border-radius:var(--sd-radius-12, 12px);background:color-mix(in srgb,var(--sd-text) 6%,transparent)}.sd-sidebar-v3__header--context-open ::ng-deep .sd-layout-context-switcher__trigger.sd-layout-context-switcher__trigger--header{background:transparent}.sd-sidebar-v3__rail-context{flex:none}.sd-sidebar-v3__rail-context:not(:empty){margin-bottom:4px}.sd-sidebar-v3__search{flex-shrink:0}.sd-sidebar-v3__navigation{min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}.sd-sidebar-v3__navigation section{flex-shrink:0}.sd-sidebar-v3__section-title{padding:4px 10px;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px;color:var(--sidebar-muted)}.sd-sidebar-v3__footer{flex-shrink:0;border-top:1px solid var(--sidebar-line);background:var(--sidebar-surface)}.sd-sidebar-v3--collapsed .sd-sidebar-v3__drawer{width:72px}.sd-sidebar-v3__content{min-height:100vh;margin-left:304px;transition:margin-left .16s ease}.sd-sidebar-v3--collapsed .sd-sidebar-v3__content{margin-left:72px}.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:40px;flex-shrink:0;height:40px;border:0;border-radius:7px;background:transparent;color:var(--sidebar-muted);cursor:pointer}@media(pointer:coarse){.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:44px;height:44px}}.sd-sidebar-v3__icon-action:hover,.sd-sidebar-v3__collapsed-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v3__icon-action:focus-visible,.sd-sidebar-v3__collapsed-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-v3__logo{width:28px;height:28px;object-fit:contain}@media(prefers-reduced-motion:reduce){.sd-sidebar-v3__drawer,.sd-sidebar-v3__content{transition:none}}\n"] }]
3144
+ }], ctorParameters: () => [], propDecorators: { headerSwitcher: [{ type: i0.ViewChild, args: ['headerSwitcher', { isSignal: true }] }], menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }] } });
2394
3145
 
2395
3146
  class SdSidebarMobileV3 {
2396
3147
  #router = inject(Router);
2397
3148
  #document = inject(DOCUMENT);
2398
3149
  #destroyRef = inject(DestroyRef);
3150
+ #injector = inject(Injector);
2399
3151
  #navigationState = inject(SdLayoutNavigationStateService);
2400
3152
  trigger = viewChild('trigger', ...(ngDevMode ? [{ debugName: "trigger" }] : []));
2401
3153
  #restoreFocusElement = null;
@@ -2417,6 +3169,16 @@ class SdSidebarMobileV3 {
2417
3169
  const maximum = resolveSidebarV3Recent(this.sidebar()).maxItems;
2418
3170
  untracked(() => this.#navigationState.hydrate(menus, maximum));
2419
3171
  });
3172
+ // why: switcher chỉ mount khi drawer mở — đối chiếu context ngay lúc khởi tạo (EXEC-D1, D-021) để listener nhiều tab
3173
+ // chạy từ đầu và lần chạm đầu vào menu không kích reload đối chiếu. Không có `context` thì không lấy service: app
3174
+ // không cấu hình context không tạo service lẫn listener.
3175
+ effect(() => {
3176
+ const context = this.sidebar().context;
3177
+ if (!context)
3178
+ return;
3179
+ const items = context.items;
3180
+ untracked(() => this.#injector.get(SdLayoutContextService).syncItems(items));
3181
+ });
2420
3182
  this.#router.events.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(event => {
2421
3183
  if (!(event instanceof NavigationEnd))
2422
3184
  return;
@@ -2487,51 +3249,1052 @@ class SdSidebarMobileV3 {
2487
3249
  this.#document.body.style.overflow = this.#previousBodyOverflow;
2488
3250
  }
2489
3251
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarMobileV3, deps: [], target: i0.ɵɵFactoryTarget.Component });
2490
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSidebarMobileV3, isStandalone: true, selector: "sd-sidebar-mobile-v3", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"sd-sidebar-mobile-v3 d-flex flex-column\">\n <header\n class=\"sd-sidebar-mobile-v3__topbar d-flex align-items-center justify-content-between gap-8 px-16 bg-white border-bottom border-black200\">\n <div class=\"d-flex align-items-center gap-8 overflow-hidden\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-mobile-v3__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n }\n <span class=\"T16M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n </div>\n <button\n #trigger\n type=\"button\"\n data-v3-mobile-trigger\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"M\u1EDF menu\"\n [attr.aria-expanded]=\"isDrawerOpen()\"\n (click)=\"openDrawer($event.currentTarget)\">\n <sd-icon name=\"menu\"></sd-icon>\n </button>\n </header>\n\n <main class=\"flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n @if (isDrawerOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v3__backdrop\" aria-label=\"\u0110\u00F3ng menu\" (click)=\"closeFromBackdrop()\"></button>\n <aside\n class=\"sd-sidebar-mobile-v3__drawer d-flex flex-column bg-white mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Menu ch\u00EDnh\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onDrawerKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T18M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"\u0110\u00F3ng menu\"\n (click)=\"closeFromBackdrop()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"sd-sidebar-mobile-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto p-12\">\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <div class=\"sd-sidebar-mobile-v3__search bg-white\">\n <sd-layout-search-field\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-mobile-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n @if (pinnedMenus().length) {\n <section data-v3-mobile-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"pinnedMenus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recentMenus().length) {\n <section data-v3-mobile-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree [menus]=\"recentMenus()\" [activePath]=\"activePath()\" [showPin]=\"false\" (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n </aside>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v3{min-height:100dvh;background:var(--sd-light)}.sd-sidebar-mobile-v3__topbar{min-height:56px}.sd-sidebar-mobile-v3__icon-action{width:40px;height:40px;border:0;border-radius:var(--sd-radius-8, 8px);background:transparent;color:var(--sd-black500);cursor:pointer}.sd-sidebar-mobile-v3__icon-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v3__icon-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-mobile-v3__logo{width:28px;height:28px;object-fit:contain}.sd-sidebar-mobile-v3__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v3__drawer{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:0 auto 0 0;width:min(88vw,360px);max-width:100%;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v3__search{position:sticky;z-index:2;top:-12px;margin:-12px;padding:12px;background:var(--sd-white, #fff)}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v3__drawer{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3252
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSidebarMobileV3, isStandalone: true, selector: "sd-sidebar-mobile-v3", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"sd-sidebar-mobile-v3 d-flex flex-column\">\n <header\n class=\"sd-sidebar-mobile-v3__topbar d-flex align-items-center justify-content-between gap-8 px-16 bg-white border-bottom border-black200\">\n <div class=\"d-flex align-items-center gap-8 overflow-hidden\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-mobile-v3__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n }\n <span class=\"T16M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n </div>\n <button\n #trigger\n type=\"button\"\n data-v3-mobile-trigger\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"M\u1EDF menu\"\n [attr.aria-expanded]=\"isDrawerOpen()\"\n (click)=\"openDrawer($event.currentTarget)\">\n <sd-icon name=\"menu\"></sd-icon>\n </button>\n </header>\n\n <main class=\"flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n @if (isDrawerOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v3__backdrop\" aria-label=\"\u0110\u00F3ng menu\" (click)=\"closeFromBackdrop()\"></button>\n <aside\n class=\"sd-sidebar-mobile-v3__drawer d-flex flex-column bg-white mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Menu ch\u00EDnh\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onDrawerKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n @if (sidebar().context; as context) {\n <!-- Context switcher (R-008, D-027): trigger ngay d\u01B0\u1EDBi t\u00EAn app; sheet ch\u1ECDn context m\u1EDF trong overlay CDK, ch\u1ED3ng l\u00EAn\n drawer v\u00E0 t\u1EF1 gi\u1EEF Esc (kh\u00F4ng \u0111\u00F3ng drawer). -->\n <div class=\"sd-sidebar-mobile-v3__brand\">\n <span class=\"T18M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n <sd-layout-context-switcher appearance=\"sheet\" [configuration]=\"context\" />\n </div>\n } @else {\n <span class=\"T18M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n }\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"\u0110\u00F3ng menu\"\n (click)=\"closeFromBackdrop()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"sd-sidebar-mobile-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto p-12\">\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <div class=\"sd-sidebar-mobile-v3__search bg-white\">\n <sd-layout-search-field\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-mobile-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n @if (pinnedMenus().length) {\n <section data-v3-mobile-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"pinnedMenus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recentMenus().length) {\n <section data-v3-mobile-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree [menus]=\"recentMenus()\" [activePath]=\"activePath()\" [showPin]=\"false\" (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n </aside>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v3{min-height:100dvh;background:var(--sd-light)}.sd-sidebar-mobile-v3__topbar{min-height:56px}.sd-sidebar-mobile-v3__icon-action{width:40px;height:40px;border:0;border-radius:var(--sd-radius-8, 8px);background:transparent;color:var(--sd-black500);cursor:pointer}.sd-sidebar-mobile-v3__icon-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v3__icon-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-mobile-v3__logo{width:28px;height:28px;object-fit:contain}.sd-sidebar-mobile-v3__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v3__drawer{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:0 auto 0 0;width:min(88vw,360px);max-width:100%;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v3__brand{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.sd-sidebar-mobile-v3__search{position:sticky;z-index:2;top:-12px;margin:-12px;padding:12px;background:var(--sd-white, #fff)}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v3__drawer{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutContextSwitcher, selector: "sd-layout-context-switcher", inputs: ["configuration", "appearance", "placement", "anchor"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2491
3253
  }
2492
3254
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarMobileV3, decorators: [{
2493
3255
  type: Component,
2494
- args: [{ selector: 'sd-sidebar-mobile-v3', standalone: true, imports: [A11yModule, SdIcon, SdLayoutSearchFieldComponent, SdLayoutMenuTreeComponent, SdLayoutUserMenuComponent, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sd-sidebar-mobile-v3 d-flex flex-column\">\n <header\n class=\"sd-sidebar-mobile-v3__topbar d-flex align-items-center justify-content-between gap-8 px-16 bg-white border-bottom border-black200\">\n <div class=\"d-flex align-items-center gap-8 overflow-hidden\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-mobile-v3__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n }\n <span class=\"T16M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n </div>\n <button\n #trigger\n type=\"button\"\n data-v3-mobile-trigger\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"M\u1EDF menu\"\n [attr.aria-expanded]=\"isDrawerOpen()\"\n (click)=\"openDrawer($event.currentTarget)\">\n <sd-icon name=\"menu\"></sd-icon>\n </button>\n </header>\n\n <main class=\"flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n @if (isDrawerOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v3__backdrop\" aria-label=\"\u0110\u00F3ng menu\" (click)=\"closeFromBackdrop()\"></button>\n <aside\n class=\"sd-sidebar-mobile-v3__drawer d-flex flex-column bg-white mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Menu ch\u00EDnh\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onDrawerKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T18M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"\u0110\u00F3ng menu\"\n (click)=\"closeFromBackdrop()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"sd-sidebar-mobile-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto p-12\">\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <div class=\"sd-sidebar-mobile-v3__search bg-white\">\n <sd-layout-search-field\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-mobile-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n @if (pinnedMenus().length) {\n <section data-v3-mobile-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"pinnedMenus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recentMenus().length) {\n <section data-v3-mobile-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree [menus]=\"recentMenus()\" [activePath]=\"activePath()\" [showPin]=\"false\" (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n </aside>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v3{min-height:100dvh;background:var(--sd-light)}.sd-sidebar-mobile-v3__topbar{min-height:56px}.sd-sidebar-mobile-v3__icon-action{width:40px;height:40px;border:0;border-radius:var(--sd-radius-8, 8px);background:transparent;color:var(--sd-black500);cursor:pointer}.sd-sidebar-mobile-v3__icon-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v3__icon-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-mobile-v3__logo{width:28px;height:28px;object-fit:contain}.sd-sidebar-mobile-v3__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v3__drawer{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:0 auto 0 0;width:min(88vw,360px);max-width:100%;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v3__search{position:sticky;z-index:2;top:-12px;margin:-12px;padding:12px;background:var(--sd-white, #fff)}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v3__drawer{transition:none}}\n"] }]
3256
+ args: [{ selector: 'sd-sidebar-mobile-v3', standalone: true, imports: [
3257
+ A11yModule,
3258
+ SdIcon,
3259
+ SdLayoutContextSwitcher,
3260
+ SdLayoutSearchFieldComponent,
3261
+ SdLayoutMenuTreeComponent,
3262
+ SdLayoutUserMenuComponent,
3263
+ SdTranslatePipe,
3264
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sd-sidebar-mobile-v3 d-flex flex-column\">\n <header\n class=\"sd-sidebar-mobile-v3__topbar d-flex align-items-center justify-content-between gap-8 px-16 bg-white border-bottom border-black200\">\n <div class=\"d-flex align-items-center gap-8 overflow-hidden\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-mobile-v3__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n }\n <span class=\"T16M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n </div>\n <button\n #trigger\n type=\"button\"\n data-v3-mobile-trigger\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"M\u1EDF menu\"\n [attr.aria-expanded]=\"isDrawerOpen()\"\n (click)=\"openDrawer($event.currentTarget)\">\n <sd-icon name=\"menu\"></sd-icon>\n </button>\n </header>\n\n <main class=\"flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n @if (isDrawerOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v3__backdrop\" aria-label=\"\u0110\u00F3ng menu\" (click)=\"closeFromBackdrop()\"></button>\n <aside\n class=\"sd-sidebar-mobile-v3__drawer d-flex flex-column bg-white mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Menu ch\u00EDnh\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onDrawerKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n @if (sidebar().context; as context) {\n <!-- Context switcher (R-008, D-027): trigger ngay d\u01B0\u1EDBi t\u00EAn app; sheet ch\u1ECDn context m\u1EDF trong overlay CDK, ch\u1ED3ng l\u00EAn\n drawer v\u00E0 t\u1EF1 gi\u1EEF Esc (kh\u00F4ng \u0111\u00F3ng drawer). -->\n <div class=\"sd-sidebar-mobile-v3__brand\">\n <span class=\"T18M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n <sd-layout-context-switcher appearance=\"sheet\" [configuration]=\"context\" />\n </div>\n } @else {\n <span class=\"T18M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n }\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"\u0110\u00F3ng menu\"\n (click)=\"closeFromBackdrop()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"sd-sidebar-mobile-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto p-12\">\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <div class=\"sd-sidebar-mobile-v3__search bg-white\">\n <sd-layout-search-field\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-mobile-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n @if (pinnedMenus().length) {\n <section data-v3-mobile-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"pinnedMenus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recentMenus().length) {\n <section data-v3-mobile-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree [menus]=\"recentMenus()\" [activePath]=\"activePath()\" [showPin]=\"false\" (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n </aside>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v3{min-height:100dvh;background:var(--sd-light)}.sd-sidebar-mobile-v3__topbar{min-height:56px}.sd-sidebar-mobile-v3__icon-action{width:40px;height:40px;border:0;border-radius:var(--sd-radius-8, 8px);background:transparent;color:var(--sd-black500);cursor:pointer}.sd-sidebar-mobile-v3__icon-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v3__icon-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-mobile-v3__logo{width:28px;height:28px;object-fit:contain}.sd-sidebar-mobile-v3__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v3__drawer{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:0 auto 0 0;width:min(88vw,360px);max-width:100%;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v3__brand{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.sd-sidebar-mobile-v3__search{position:sticky;z-index:2;top:-12px;margin:-12px;padding:12px;background:var(--sd-white, #fff)}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v3__drawer{transition:none}}\n"] }]
2495
3265
  }], ctorParameters: () => [], propDecorators: { trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }] } });
2496
3266
 
2497
- class SdLayoutComponent {
2498
- // ==========================================
2499
- // INJECT SERVICES
2500
- // ==========================================
2501
- #menuPipe = inject(MenuPipe);
2502
- #layoutService = inject(SdLayoutService);
2503
- #responsiveService = inject(SdLayoutResponsiveService);
2504
- #layoutConfiguration = inject(SD_LAYOUT_CONFIGURATION, { optional: true });
2505
- // ==========================================
2506
- // SIGNAL INPUTS
2507
- // ==========================================
2508
- menusInput = input([], ...(ngDevMode ? [{ debugName: "menusInput", alias: 'menus' }] : [{ alias: 'menus' }]));
2509
- menus = computed(() => this.#menuPipe.transform(this.menusInput() || []), ...(ngDevMode ? [{ debugName: "menus" }] : []));
2510
- // ==========================================
2511
- // CONSUME SHARED STATE
2512
- // ==========================================
2513
- userInfo = this.#layoutService.userInfo;
2514
- sidebar = this.#layoutService.sidebar;
2515
- sidebarV1 = computed(() => {
2516
- const sidebar = this.sidebar();
2517
- return sidebar?.version === 1 ? sidebar : undefined;
2518
- }, ...(ngDevMode ? [{ debugName: "sidebarV1" }] : []));
2519
- sidebarV2 = computed(() => {
2520
- const sidebar = this.sidebar();
2521
- return sidebar?.version === 2 ? sidebar : undefined;
2522
- }, ...(ngDevMode ? [{ debugName: "sidebarV2" }] : []));
2523
- sidebarV3 = computed(() => {
2524
- const sidebar = this.sidebar();
2525
- return sidebar?.version === 3 ? sidebar : undefined;
2526
- }, ...(ngDevMode ? [{ debugName: "sidebarV3" }] : []));
3267
+ /**
3268
+ * Accent-insensitive V4 search over `menus` (via `searchAvailableMenuLeaves`, so `comingSoon` items and everything under a
3269
+ * `comingSoon` group are left out) with the parent path of every hit. A blank query returns no rows.
3270
+ * The `results` presentation renders exactly this list, so a parent's keyboard index matches the rendered options.
3271
+ */
3272
+ function buildSidebarV4SearchResults(menus, query) {
3273
+ if (!query?.trim())
3274
+ return [];
3275
+ const paths = collectParentPaths(menus);
3276
+ return searchAvailableMenuLeaves(menus, query).map(menu => ({ key: getMenuStableKey(menu), menu, path: lookupParentPath(paths, menu) }));
3277
+ }
3278
+ const PIN_KEY = 'core.module.layout.menu.pin';
3279
+ const UNPIN_KEY = 'core.module.layout.menu.unpin';
3280
+ const BADGE_PENDING_KEY = 'core.module.layout.sidebar.badge-pending';
3281
+ const RESULT_COUNT_KEY = 'core.module.layout.sidebar.result-count';
3282
+ const NO_MATCH_KEY = 'core.module.layout.sidebar.no-match';
3283
+ const ITEM_RADIUS_VARIABLE = '--sd-sidebar-v4-item-radius';
3284
+ // Mock: panel ở left 58px / top -6px so với ô rail 48px → lệch 10px từ mép phải của nút.
3285
+ const FLYOUT_POSITIONS = [
3286
+ { originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top', offsetX: 10, offsetY: -6 },
3287
+ { originX: 'end', originY: 'bottom', overlayX: 'start', overlayY: 'bottom', offsetX: 10, offsetY: 6 },
3288
+ ];
3289
+ let nextTreeId = 0;
3290
+ /**
3291
+ * Private menu tree of sidebar V4 (D-014, D-023): imported only by `sd-sidebar-v4` and `sd-sidebar-mobile-v4`, never exported
3292
+ * from a public index. Navigation is the parent's job — the tree only emits.
3293
+ *
3294
+ * Inputs
3295
+ * - `menus`: what to render. `hierarchy`: the full tree; `shortcuts`: the pinned or recent menus; `results`: the full tree
3296
+ * searched with `query` (the rendered options are exactly `results()` / `buildSidebarV4SearchResults(menus, query)`).
3297
+ * - `pathSource`: full tree used for parent paths and the active route when `menus` is a subset (shortcuts); defaults to `menus`.
3298
+ * - `activePath`: current route path; the most exact matching menu is active (`resolveActiveMenuPath`).
3299
+ * - `presentation`: `hierarchy` (sections, groups, branch rails) | `shortcuts` (flat "title · path" rows) | `results` (search).
3300
+ * - `mode`: `expanded` | `collapsed` (72px rail; hierarchy only) | `mobile` (hierarchy with 44px fallbacks, pin always shown).
3301
+ * Row sizes come from `--sd-sidebar-v4-item-height`, `--sd-sidebar-v4-child-height` and `--sd-sidebar-v4-item-radius`
3302
+ * set by the parent (fallbacks 36px / 32px / 999px, or 44px in mobile mode).
3303
+ * - `collapsedGroupKeys` (two-way): stable keys of closed groups — same keys and semantics as the V3 tree.
3304
+ * - `pinnedKeys`, `showPin`: pin toggles on leaf rows (hierarchy) and the unpin toggle on shortcut rows.
3305
+ * - `collapsedGroup`: rail group click opens a flyout (`flyout`) or emits `expandGroup` (`expand`). The flyout closes on
3306
+ * navigation, Escape or a click outside it (that click still reaches its target, e.g. another rail item).
3307
+ * - `query`, `focusedIndex`: search text and the keyboard-selected option of the `results` presentation.
3308
+ *
3309
+ * Outputs: `navigate` (root/leaf rows, never `comingSoon`), `togglePinned`, `expandGroup`.
3310
+ * The host is not a landmark; the parent wraps the tree in its `<nav>`. It always holds a polite live region that announces
3311
+ * the result count (or the no-match message) while the `results` presentation has a query — keep the same tree instance
3312
+ * mounted while switching presentations so the change is announced.
3313
+ * The collapsed rail shows (and announces) only warning/error badges and live status dots; neutral counts stay off the rail.
3314
+ */
3315
+ class SdSidebarV4MenuTree {
3316
+ #i18n = inject(I18nService);
3317
+ #host = inject(ElementRef);
3318
+ #document = inject(DOCUMENT);
3319
+ #id = `sd-sidebar-v4-menu-tree-${nextTreeId++}`;
3320
+ #flyoutKey = signal(null, ...(ngDevMode ? [{ debugName: "#flyoutKey" }] : []));
3321
+ #flyoutTrigger = null;
3322
+ /** Menus to render; see the class description for what each presentation expects. */
3323
+ menus = input([], ...(ngDevMode ? [{ debugName: "menus" }] : []));
3324
+ /** Full menu tree for parent paths and the active route when `menus` is a subset; empty means `menus`. */
3325
+ pathSource = input([], ...(ngDevMode ? [{ debugName: "pathSource" }] : []));
3326
+ /** Current route path without query or fragment. */
3327
+ activePath = input('', ...(ngDevMode ? [{ debugName: "activePath" }] : []));
3328
+ presentation = input('hierarchy', ...(ngDevMode ? [{ debugName: "presentation" }] : []));
3329
+ mode = input('expanded', ...(ngDevMode ? [{ debugName: "mode" }] : []));
3330
+ /** Stable keys of closed groups (default: every group open), shared two-way with the parent. */
3331
+ collapsedGroupKeys = model([], ...(ngDevMode ? [{ debugName: "collapsedGroupKeys" }] : []));
3332
+ pinnedKeys = input([], ...(ngDevMode ? [{ debugName: "pinnedKeys" }] : []));
3333
+ showPin = input(true, ...(ngDevMode ? [{ debugName: "showPin" }] : []));
3334
+ /** What a group click does on the collapsed rail. */
3335
+ collapsedGroup = input('flyout', ...(ngDevMode ? [{ debugName: "collapsedGroup" }] : []));
3336
+ /** Search text of the `results` presentation. */
3337
+ query = input('', ...(ngDevMode ? [{ debugName: "query" }] : []));
3338
+ /** Index in `results()` of the keyboard-selected option; -1 for none. */
3339
+ focusedIndex = input(-1, ...(ngDevMode ? [{ debugName: "focusedIndex" }] : []));
3340
+ /** A root or leaf row was activated (never a `comingSoon` item). */
3341
+ navigate = output();
3342
+ togglePinned = output();
3343
+ /** A rail group was clicked with `collapsedGroup: 'expand'`; the parent expands the sidebar and opens that group. */
3344
+ expandGroup = output();
3345
+ /** Id of the results listbox, for the parent's `aria-controls`. */
3346
+ resultsId = `${this.#id}-results`;
3347
+ resultCountId = `${this.#id}-result-count`;
3348
+ flyoutPositions = FLYOUT_POSITIONS;
3349
+ flyoutKey = this.#flyoutKey.asReadonly();
3350
+ flyoutRadius = signal(null, ...(ngDevMode ? [{ debugName: "flyoutRadius" }] : []));
3351
+ #treeSource = computed(() => (this.pathSource().length ? this.pathSource() : this.menus()), ...(ngDevMode ? [{ debugName: "#treeSource" }] : []));
3352
+ #activeMenuPath = computed(() => resolveActiveMenuPath(this.#treeSource(), this.activePath()), ...(ngDevMode ? [{ debugName: "#activeMenuPath" }] : []));
3353
+ isRail = computed(() => this.presentation() === 'hierarchy' && this.mode() === 'collapsed', ...(ngDevMode ? [{ debugName: "isRail" }] : []));
3354
+ /** Rows of the `results` presentation, in render order. */
3355
+ results = computed(() => buildSidebarV4SearchResults(this.menus(), this.query()), ...(ngDevMode ? [{ debugName: "results" }] : []));
3356
+ sections = computed(() => {
3357
+ const context = this.#nodeContext(new Set(this.collapsedGroupKeys()));
3358
+ return groupMenusBySection(this.menus()).map((group, index) => ({
3359
+ key: group.section === null ? `unsectioned-${index}` : `section-${group.section}`,
3360
+ label: group.section,
3361
+ labelId: `${this.#id}-section-${index}`,
3362
+ separated: group.section === null && index > 0,
3363
+ nodes: this.#collectNodes(group.menus, 0, [], context, []),
3364
+ }));
3365
+ }, ...(ngDevMode ? [{ debugName: "sections" }] : []));
3366
+ shortcuts = computed(() => {
3367
+ const paths = collectParentPaths(this.#treeSource());
3368
+ const activeMenuPath = this.#activeMenuPath();
3369
+ const pinnedKeys = new Set(this.pinnedKeys());
3370
+ return this.menus()
3371
+ .filter((menu) => !!menu && 'path' in menu && typeof menu.path === 'string' && !!menu.path)
3372
+ .map(menu => {
3373
+ const key = getMenuStableKey(menu);
3374
+ const title = menu.title ?? menu.tooltipTitle ?? '';
3375
+ const isPinned = pinnedKeys.has(key);
3376
+ return {
3377
+ menu,
3378
+ key,
3379
+ title,
3380
+ path: lookupParentPath(paths, menu),
3381
+ isActive: menu.path === activeMenuPath,
3382
+ disabled: menu.comingSoon === true,
3383
+ isPinned,
3384
+ pinLabel: this.#i18n.t(isPinned ? UNPIN_KEY : PIN_KEY, { title }),
3385
+ };
3386
+ });
3387
+ }, ...(ngDevMode ? [{ debugName: "shortcuts" }] : []));
3388
+ resultRows = computed(() => {
3389
+ const query = this.query();
3390
+ return this.results().map(result => ({ ...result, segments: highlightSegments(result.menu.title ?? '', query) }));
3391
+ }, ...(ngDevMode ? [{ debugName: "resultRows" }] : []));
3392
+ /** Text of the always-mounted polite live region: the result count, or the no-match message, while searching. */
3393
+ liveMessage = computed(() => {
3394
+ const query = this.query().trim();
3395
+ if (this.presentation() !== 'results' || !query)
3396
+ return '';
3397
+ const count = this.results().length;
3398
+ return count ? this.#i18n.t(RESULT_COUNT_KEY, { count }) : this.#i18n.t(NO_MATCH_KEY, { query });
3399
+ }, ...(ngDevMode ? [{ debugName: "liveMessage" }] : []));
3400
+ railGroups = computed(() => {
3401
+ const activeMenuPath = this.#activeMenuPath();
3402
+ return groupMenusBySection(this.menus()).map((group, groupIndex) => ({
3403
+ key: group.section === null ? `unsectioned-${groupIndex}` : `section-${group.section}`,
3404
+ items: group.menus
3405
+ .map((menu, index) => this.#toRailItem(menu, activeMenuPath, `${this.#id}-rail-${groupIndex}-${index}`))
3406
+ .filter((item) => !!item),
3407
+ }));
3408
+ }, ...(ngDevMode ? [{ debugName: "railGroups" }] : []));
3409
+ flyoutNodes = computed(() => {
3410
+ const key = this.#flyoutKey();
3411
+ if (!key)
3412
+ return [];
3413
+ const item = this.railGroups()
3414
+ .flatMap(group => group.items)
3415
+ .find(candidate => candidate.key === key);
3416
+ if (!item || !('children' in item.menu))
3417
+ return [];
3418
+ // why: flyout luôn bày hết các cấp (bỏ qua collapsedGroupKeys); nhóm lồng thành heading thụt lề.
3419
+ return this.#collectNodes(item.menu.children ?? [], 0, [item.menu.title ?? key], this.#nodeContext(null), []);
3420
+ }, ...(ngDevMode ? [{ debugName: "flyoutNodes" }] : []));
3421
+ constructor() {
3422
+ // why: đổi mode/presentation (vd mở rộng rail) hoặc route đổi từ nơi khác khi flyout đang mở thì đóng hẳn, tránh overlay
3423
+ // mồ côi; không trả focus vì người dùng không chủ động đóng.
3424
+ effect(() => {
3425
+ this.mode();
3426
+ this.presentation();
3427
+ this.collapsedGroup();
3428
+ this.activePath();
3429
+ untracked(() => this.closeFlyout(false));
3430
+ });
3431
+ // why: menus đổi làm group đang mở biến mất (hoặc thành comingSoon) thì bỏ key/trigger cũ thay vì giữ state treo.
3432
+ effect(() => {
3433
+ const key = this.#flyoutKey();
3434
+ if (!key)
3435
+ return;
3436
+ const present = this.railGroups().some(group => group.items.some(item => item.key === key && item.isGroup && !item.disabled));
3437
+ if (!present)
3438
+ untracked(() => this.closeFlyout(false));
3439
+ });
3440
+ }
3441
+ /** Id of the result option at `index`, for the parent's `aria-activedescendant`. */
3442
+ resultOptionId(index) {
3443
+ return `${this.#id}-result-${index}`;
3444
+ }
3445
+ /** Closes the collapsed-rail flyout; focus returns to its group button unless `restoreFocus` is false. */
3446
+ closeFlyout(restoreFocus = true) {
3447
+ if (!this.#flyoutKey())
3448
+ return;
3449
+ const trigger = this.#flyoutTrigger;
3450
+ this.#flyoutKey.set(null);
3451
+ this.#flyoutTrigger = null;
3452
+ if (restoreFocus)
3453
+ trigger?.focus();
3454
+ }
3455
+ onNavigate(menu) {
3456
+ if (menu.comingSoon === true || !('path' in menu))
3457
+ return;
3458
+ this.navigate.emit(menu);
3459
+ }
3460
+ onToggleGroup(node) {
3461
+ if (node.disabled)
3462
+ return;
3463
+ this.collapsedGroupKeys.update(keys => (keys.includes(node.key) ? keys.filter(key => key !== node.key) : [...keys, node.key]));
3464
+ }
3465
+ onTogglePinned(event, menu) {
3466
+ event.stopPropagation();
3467
+ this.togglePinned.emit(menu);
3468
+ }
3469
+ onRailGroup(item, trigger) {
3470
+ if (item.disabled)
3471
+ return;
3472
+ if (this.collapsedGroup() === 'expand') {
3473
+ this.expandGroup.emit(item.menu);
3474
+ return;
3475
+ }
3476
+ if (this.#flyoutKey() === item.key) {
3477
+ this.closeFlyout();
3478
+ return;
3479
+ }
3480
+ this.#flyoutTrigger = trigger;
3481
+ this.flyoutRadius.set(this.#readItemRadius());
3482
+ this.#flyoutKey.set(item.key);
3483
+ }
3484
+ onFlyoutNavigate(node) {
3485
+ if (node.disabled || !('path' in node.menu))
3486
+ return;
3487
+ this.navigate.emit(node.menu);
3488
+ this.closeFlyout();
3489
+ }
3490
+ onFlyoutAttach(overlay) {
3491
+ // why: không dùng cdkTrapFocusAutoCapture — nó nhớ phần tử được focus lúc mở (nút group) và focus lại phần tử đó khi
3492
+ // panel bị huỷ, giành focus của chỗ người dùng vừa click (vd ô input). Tự đưa focus vào panel tại đây; closeFlyout là
3493
+ // nơi duy nhất trả focus. (attach) phát sau khi portal đã render panel nên làm được đồng bộ.
3494
+ const panel = overlay.overlayRef?.overlayElement.querySelector('[data-v4-flyout]');
3495
+ if (!panel)
3496
+ return;
3497
+ (panel.querySelector('button') ?? panel).focus({ preventScroll: true });
3498
+ }
3499
+ onFlyoutKeydown(event) {
3500
+ if (event.key !== 'Escape')
3501
+ return;
3502
+ event.preventDefault();
3503
+ // why: Esc chỉ đóng flyout — không tới handler Esc của lớp ngoài (xoá search, đóng drawer mobile).
3504
+ event.stopPropagation();
3505
+ this.closeFlyout();
3506
+ }
3507
+ onFlyoutOutsideClick() {
3508
+ // why: không dùng backdrop nên click vẫn tới đích (vd mở group rail khác); CDK đã loại click lên chính nút group.
3509
+ // Chỉ trả focus về nút group khi click không trao focus cho phần tử khác (vd ô input trong trang).
3510
+ const active = this.#document.activeElement;
3511
+ const focusIsFree = !active || active === this.#document.body || !!active.closest('[data-v4-flyout]');
3512
+ this.closeFlyout(focusIsFree);
3513
+ }
3514
+ onFlyoutDetach(key) {
3515
+ // why: CDK tự detach (vd scroll strategy) thì đồng bộ lại state; không trả focus vì không do người dùng đóng.
3516
+ if (this.#flyoutKey() !== key)
3517
+ return;
3518
+ this.#flyoutKey.set(null);
3519
+ this.#flyoutTrigger = null;
3520
+ }
3521
+ #nodeContext(collapsedKeys) {
3522
+ return { activeMenuPath: this.#activeMenuPath(), collapsedKeys, pinnedKeys: new Set(this.pinnedKeys()), showPin: this.showPin() };
3523
+ }
3524
+ #collectNodes(menus, depth, ancestors, context, nodes) {
3525
+ for (const menu of menus ?? []) {
3526
+ if (!menu || typeof menu !== 'object')
3527
+ continue;
3528
+ const key = getMenuStableKey(menu, ancestors);
3529
+ if (!key)
3530
+ continue;
3531
+ const children = 'children' in menu && Array.isArray(menu.children) ? menu.children : [];
3532
+ const isGroup = children.length > 0;
3533
+ const path = 'path' in menu && typeof menu.path === 'string' ? menu.path : '';
3534
+ const disabled = menu.comingSoon === true;
3535
+ const title = menu.title ?? menu.tooltipTitle ?? '';
3536
+ const isExpanded = isGroup && !disabled && !context.collapsedKeys?.has(key);
3537
+ const holdsActive = isGroup && !!context.activeMenuPath && containsMenuPath(menu, context.activeMenuPath);
3538
+ const pinnable = context.showPin && !isGroup && !disabled && !!path;
3539
+ const isPinned = context.pinnedKeys.has(key);
3540
+ nodes.push({
3541
+ menu,
3542
+ key,
3543
+ title,
3544
+ depth,
3545
+ isGroup,
3546
+ isExpanded,
3547
+ isActive: !isGroup && !!path && path === context.activeMenuPath,
3548
+ showActiveDot: holdsActive && !isExpanded,
3549
+ disabled,
3550
+ trailing: resolveMenuTrailing(menu),
3551
+ paddingLeft: depth ? 32 + (depth - 1) * 16 : 0,
3552
+ branchOffsets: Array.from({ length: depth }, (_, index) => 21 + index * 16),
3553
+ markerLeft: 20 + Math.max(depth - 1, 0) * 16,
3554
+ pinnable,
3555
+ isPinned,
3556
+ pinLabel: pinnable ? this.#i18n.t(isPinned ? UNPIN_KEY : PIN_KEY, { title }) : '',
3557
+ });
3558
+ if (isExpanded)
3559
+ this.#collectNodes(children, depth + 1, [...ancestors, menu.title ?? key], context, nodes);
3560
+ }
3561
+ return nodes;
3562
+ }
3563
+ #toRailItem(menu, activeMenuPath, descriptionId) {
3564
+ if (!menu || typeof menu !== 'object')
3565
+ return null;
3566
+ const key = getMenuStableKey(menu);
3567
+ if (!key)
3568
+ return null;
3569
+ const isGroup = 'children' in menu && Array.isArray(menu.children) && menu.children.length > 0;
3570
+ const trailing = resolveMenuTrailing(menu);
3571
+ const badge = trailing?.kind === 'badge' ? { value: trailing.value, tone: trailing.tone } : null;
3572
+ const liveTone = trailing?.kind === 'status' && trailing.live ? trailing.tone : null;
3573
+ const description = badge
3574
+ ? this.#i18n.t(BADGE_PENDING_KEY, { count: badge.value })
3575
+ : trailing?.kind === 'status' && trailing.live
3576
+ ? trailing.label
3577
+ : '';
3578
+ return {
3579
+ menu,
3580
+ key,
3581
+ title: menu.tooltipTitle || menu.title || '',
3582
+ isGroup,
3583
+ isActive: !!activeMenuPath && containsMenuPath(menu, activeMenuPath),
3584
+ disabled: menu.comingSoon === true,
3585
+ badge,
3586
+ liveTone,
3587
+ descriptionId,
3588
+ description,
3589
+ };
3590
+ }
3591
+ #readItemRadius() {
3592
+ // why: flyout nằm trong overlay container của CDK, ngoài host — không thừa kế được biến radius parent khai trên host.
3593
+ const view = this.#document.defaultView;
3594
+ if (!view)
3595
+ return null;
3596
+ return view.getComputedStyle(this.#host.nativeElement).getPropertyValue(ITEM_RADIUS_VARIABLE).trim() || null;
3597
+ }
3598
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarV4MenuTree, deps: [], target: i0.ɵɵFactoryTarget.Component });
3599
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSidebarV4MenuTree, isStandalone: true, selector: "sd-sidebar-v4-menu-tree", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, pathSource: { classPropertyName: "pathSource", publicName: "pathSource", isSignal: true, isRequired: false, transformFunction: null }, activePath: { classPropertyName: "activePath", publicName: "activePath", isSignal: true, isRequired: false, transformFunction: null }, presentation: { classPropertyName: "presentation", publicName: "presentation", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, collapsedGroupKeys: { classPropertyName: "collapsedGroupKeys", publicName: "collapsedGroupKeys", isSignal: true, isRequired: false, transformFunction: null }, pinnedKeys: { classPropertyName: "pinnedKeys", publicName: "pinnedKeys", isSignal: true, isRequired: false, transformFunction: null }, showPin: { classPropertyName: "showPin", publicName: "showPin", isSignal: true, isRequired: false, transformFunction: null }, collapsedGroup: { classPropertyName: "collapsedGroup", publicName: "collapsedGroup", isSignal: true, isRequired: false, transformFunction: null }, query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: false, transformFunction: null }, focusedIndex: { classPropertyName: "focusedIndex", publicName: "focusedIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsedGroupKeys: "collapsedGroupKeysChange", navigate: "navigate", togglePinned: "togglePinned", expandGroup: "expandGroup" }, host: { properties: { "class.sd-sidebar-v4-menu-tree--mobile": "mode() === \"mobile\"", "class.sd-sidebar-v4-menu-tree--collapsed": "isRail()" }, classAttribute: "sd-sidebar-v4-menu-tree" }, ngImport: i0, template: "@let _presentation = presentation();\n<div data-v4-live class=\"sd-sidebar-v4-menu-tree__sr-only\" aria-live=\"polite\" aria-atomic=\"true\">{{ liveMessage() }}</div>\n@if (_presentation === 'results') {\n @let _query = query().trim();\n @if (_query) {\n @let _rows = resultRows();\n @let _focused = focusedIndex();\n <div data-v4-result-count class=\"sd-sidebar-v4-menu-tree__section-label\" [id]=\"resultCountId\">\n {{ 'core.module.layout.sidebar.result-count' | sdTranslate: { count: _rows.length } }}\n </div>\n @if (_rows.length) {\n <div data-v4-results class=\"sd-sidebar-v4-menu-tree__results\" role=\"listbox\" [id]=\"resultsId\" [attr.aria-labelledby]=\"resultCountId\">\n @for (row of _rows; track $index; let index = $index) {\n <!-- Options stay unfocusable: the parent's search input drives them via aria-activedescendant (Up/Down/Enter); click is the pointer path. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n data-v4-result\n class=\"sd-sidebar-v4-menu-tree__result\"\n role=\"option\"\n [id]=\"resultOptionId(index)\"\n [attr.data-menu-key]=\"row.key\"\n [attr.aria-selected]=\"index === _focused\"\n [class.sd-sidebar-v4-menu-tree__result--focused]=\"index === _focused\"\n (click)=\"onNavigate(row.menu)\">\n <span class=\"sd-sidebar-v4-menu-tree__result-title\">\n @for (segment of row.segments; track $index) {\n <span [class.sd-sidebar-v4-menu-tree__match]=\"segment.match\" [attr.data-v4-match]=\"segment.match ? '' : null\">{{\n segment.text\n }}</span>\n }\n </span>\n @if (row.path) {\n <span data-v4-result-path class=\"sd-sidebar-v4-menu-tree__result-path\">{{ row.path }}</span>\n }\n </div>\n }\n </div>\n } @else {\n <div data-v4-empty class=\"sd-sidebar-v4-menu-tree__empty\">\n {{ 'core.module.layout.sidebar.no-match' | sdTranslate: { query: _query } }}\n </div>\n }\n <div data-v4-search-hint class=\"sd-sidebar-v4-menu-tree__hint\">{{ 'core.module.layout.sidebar.search-hint' | sdTranslate }}</div>\n }\n} @else if (_presentation === 'shortcuts') {\n @for (row of shortcuts(); track row.key) {\n <div\n class=\"sd-sidebar-v4-menu-tree__item sd-sidebar-v4-menu-tree__item--shortcut\"\n [class.sd-sidebar-v4-menu-tree__item--pinnable]=\"showPin()\"\n [attr.data-v4-item]=\"row.key\">\n <button\n type=\"button\"\n data-v4-row=\"shortcut\"\n class=\"sd-sidebar-v4-menu-tree__row sd-sidebar-v4-menu-tree__row--shortcut\"\n [attr.data-menu-key]=\"row.key\"\n [attr.aria-current]=\"row.isActive ? 'page' : null\"\n [attr.aria-disabled]=\"row.disabled || null\"\n [class.sd-sidebar-v4-menu-tree__row--active]=\"row.isActive\"\n [class.sd-sidebar-v4-menu-tree__row--disabled]=\"row.disabled\"\n (click)=\"onNavigate(row.menu)\">\n <span class=\"sd-sidebar-v4-menu-tree__label\">\n {{ row.title }}\n @if (row.path) {\n <span data-v4-shortcut-path class=\"sd-sidebar-v4-menu-tree__shortcut-path\"> \u00B7 {{ row.path }}</span>\n }\n </span>\n @if (row.disabled) {\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: { kind: 'soon' } }\" />\n }\n </button>\n @if (showPin()) {\n <ng-container\n [ngTemplateOutlet]=\"pinTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: row.menu, key: row.key, pinned: row.isPinned, label: row.pinLabel }\" />\n }\n </div>\n }\n} @else if (isRail()) {\n @let _flyoutKey = flyoutKey();\n @let _flyoutMode = collapsedGroup() === 'flyout';\n <div data-v4-rail class=\"sd-sidebar-v4-menu-tree__rail\">\n @for (group of railGroups(); track group.key; let first = $first) {\n @if (!first) {\n <div data-v4-rail-separator class=\"sd-sidebar-v4-menu-tree__rail-separator\" aria-hidden=\"true\"></div>\n }\n @for (item of group.items; track item.key) {\n <div class=\"sd-sidebar-v4-menu-tree__rail-cell\" [attr.data-v4-rail-cell]=\"item.key\">\n @if (item.isGroup) {\n <button\n #railGroupButton\n cdkOverlayOrigin\n #flyoutOrigin=\"cdkOverlayOrigin\"\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__rail-item\"\n [attr.data-v4-rail-item]=\"item.key\"\n [attr.title]=\"item.title\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-describedby]=\"item.description ? item.descriptionId : null\"\n [attr.aria-haspopup]=\"_flyoutMode && !item.disabled ? 'dialog' : null\"\n [attr.aria-expanded]=\"_flyoutMode && !item.disabled ? _flyoutKey === item.key : null\"\n [attr.aria-disabled]=\"item.disabled || null\"\n [class.sd-sidebar-v4-menu-tree__rail-item--active]=\"item.isActive\"\n [class.sd-sidebar-v4-menu-tree__rail-item--open]=\"_flyoutKey === item.key\"\n [class.sd-sidebar-v4-menu-tree__rail-item--disabled]=\"item.disabled\"\n (click)=\"onRailGroup(item, railGroupButton)\">\n <ng-container [ngTemplateOutlet]=\"railContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </button>\n <ng-template\n cdkConnectedOverlay\n #flyoutOverlay=\"cdkConnectedOverlay\"\n [cdkConnectedOverlayOrigin]=\"flyoutOrigin\"\n [cdkConnectedOverlayOpen]=\"_flyoutKey === item.key\"\n [cdkConnectedOverlayPositions]=\"flyoutPositions\"\n [cdkConnectedOverlayViewportMargin]=\"8\"\n [cdkConnectedOverlayFlexibleDimensions]=\"false\"\n [cdkConnectedOverlayPush]=\"true\"\n [cdkConnectedOverlayHasBackdrop]=\"false\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n (overlayOutsideClick)=\"onFlyoutOutsideClick()\"\n (overlayKeydown)=\"onFlyoutKeydown($event)\"\n (attach)=\"onFlyoutAttach(flyoutOverlay)\"\n (detach)=\"onFlyoutDetach(item.key)\">\n <div\n data-v4-flyout\n class=\"sd-sidebar-v4-menu-tree__flyout\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-label]=\"item.title\"\n [style.--sd-sidebar-v4-item-radius]=\"flyoutRadius()\"\n cdkTrapFocus>\n <div data-v4-flyout-title class=\"sd-sidebar-v4-menu-tree__flyout-title\">{{ item.title }}</div>\n @for (node of flyoutNodes(); track node.key) {\n @if (node.isGroup) {\n <div\n data-v4-flyout-heading\n class=\"sd-sidebar-v4-menu-tree__flyout-heading\"\n [class.sd-sidebar-v4-menu-tree__flyout-heading--disabled]=\"node.disabled\"\n [style.padding-left.px]=\"12 + node.depth * 16\">\n <span class=\"sd-sidebar-v4-menu-tree__label\">{{ node.title }}</span>\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: node.trailing }\" />\n </div>\n } @else {\n <button\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__row sd-sidebar-v4-menu-tree__row--flyout\"\n [attr.data-v4-flyout-item]=\"node.key\"\n [attr.aria-current]=\"node.isActive ? 'page' : null\"\n [attr.aria-disabled]=\"node.disabled || null\"\n [class.sd-sidebar-v4-menu-tree__row--active]=\"node.isActive\"\n [class.sd-sidebar-v4-menu-tree__row--disabled]=\"node.disabled\"\n [style.padding-left.px]=\"12 + node.depth * 16\"\n (click)=\"onFlyoutNavigate(node)\">\n <span class=\"sd-sidebar-v4-menu-tree__label\">{{ node.title }}</span>\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: node.trailing }\" />\n </button>\n }\n }\n </div>\n </ng-template>\n } @else {\n <button\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__rail-item\"\n [attr.data-v4-rail-item]=\"item.key\"\n [attr.title]=\"item.title\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-describedby]=\"item.description ? item.descriptionId : null\"\n [attr.aria-current]=\"item.isActive ? 'page' : null\"\n [attr.aria-disabled]=\"item.disabled || null\"\n [class.sd-sidebar-v4-menu-tree__rail-item--active]=\"item.isActive\"\n [class.sd-sidebar-v4-menu-tree__rail-item--disabled]=\"item.disabled\"\n (click)=\"onNavigate(item.menu)\">\n <ng-container [ngTemplateOutlet]=\"railContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </button>\n }\n @if (item.description) {\n <span hidden [id]=\"item.descriptionId\">{{ item.description }}</span>\n }\n </div>\n }\n }\n </div>\n} @else {\n @for (section of sections(); track section.key) {\n <div\n class=\"sd-sidebar-v4-menu-tree__section\"\n [attr.data-v4-section]=\"section.label ?? ''\"\n [attr.role]=\"section.label ? 'group' : null\"\n [attr.aria-labelledby]=\"section.label ? section.labelId : null\"\n [class.sd-sidebar-v4-menu-tree__section--separated]=\"section.separated\">\n @if (section.label) {\n <div data-v4-section-label class=\"sd-sidebar-v4-menu-tree__section-label\" [id]=\"section.labelId\">{{ section.label }}</div>\n }\n @for (node of section.nodes; track node.key) {\n <div\n class=\"sd-sidebar-v4-menu-tree__item\"\n [class.sd-sidebar-v4-menu-tree__item--nested]=\"node.depth > 0\"\n [class.sd-sidebar-v4-menu-tree__item--pinnable]=\"node.pinnable\"\n [attr.data-v4-item]=\"node.key\"\n [style.padding-left.px]=\"node.depth ? node.paddingLeft : null\">\n @for (offset of node.branchOffsets; track offset) {\n <span data-menu-branch class=\"sd-sidebar-v4-menu-tree__branch\" [style.left.px]=\"offset\" aria-hidden=\"true\"></span>\n }\n @if (node.isActive && node.depth > 0) {\n <span data-v4-marker class=\"sd-sidebar-v4-menu-tree__marker\" [style.left.px]=\"node.markerLeft\" aria-hidden=\"true\"></span>\n }\n @if (node.isGroup) {\n <button\n type=\"button\"\n data-v4-row=\"group\"\n class=\"sd-sidebar-v4-menu-tree__row sd-sidebar-v4-menu-tree__row--group\"\n [class.sd-sidebar-v4-menu-tree__row--child]=\"node.depth > 0\"\n [class.sd-sidebar-v4-menu-tree__row--disabled]=\"node.disabled\"\n [attr.data-menu-group]=\"node.key\"\n [attr.aria-expanded]=\"node.disabled ? null : node.isExpanded\"\n [attr.aria-disabled]=\"node.disabled || null\"\n (click)=\"onToggleGroup(node)\">\n @if (node.depth === 0) {\n <ng-container\n [ngTemplateOutlet]=\"menuIcon\"\n [ngTemplateOutletContext]=\"{ $implicit: node.menu, filled: false, group: true }\" />\n }\n <span class=\"sd-sidebar-v4-menu-tree__label\">{{ node.title }}</span>\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: node.trailing }\" />\n @if (node.showActiveDot) {\n <span data-v4-active-dot class=\"sd-sidebar-v4-menu-tree__dot\" aria-hidden=\"true\"></span>\n }\n @if (!node.disabled) {\n <sd-icon\n data-v4-chevron\n class=\"sd-sidebar-v4-menu-tree__chevron\"\n [name]=\"node.isExpanded ? 'expand_less' : 'expand_more'\"\n size=\"20px\"></sd-icon>\n }\n </button>\n } @else {\n <button\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__row\"\n [class.sd-sidebar-v4-menu-tree__row--child]=\"node.depth > 0\"\n [class.sd-sidebar-v4-menu-tree__row--active]=\"node.isActive\"\n [class.sd-sidebar-v4-menu-tree__row--disabled]=\"node.disabled\"\n [attr.data-v4-row]=\"node.depth ? 'child' : 'root'\"\n [attr.data-menu-key]=\"node.key\"\n [attr.aria-current]=\"node.isActive ? 'page' : null\"\n [attr.aria-disabled]=\"node.disabled || null\"\n (click)=\"onNavigate(node.menu)\">\n @if (node.depth === 0) {\n <ng-container\n [ngTemplateOutlet]=\"menuIcon\"\n [ngTemplateOutletContext]=\"{ $implicit: node.menu, filled: node.isActive, group: false }\" />\n }\n <span class=\"sd-sidebar-v4-menu-tree__label\">{{ node.title }}</span>\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: node.trailing }\" />\n </button>\n @if (node.pinnable) {\n <ng-container\n [ngTemplateOutlet]=\"pinTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: node.menu, key: node.key, pinned: node.isPinned, label: node.pinLabel }\" />\n }\n }\n </div>\n }\n </div>\n }\n}\n\n<ng-template #menuIcon let-menu let-filled=\"filled\" let-group=\"group\">\n @if (menu.iconUrl) {\n <img data-menu-icon class=\"sd-sidebar-v4-menu-tree__icon-image\" [src]=\"menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon\n data-menu-icon\n class=\"sd-sidebar-v4-menu-tree__icon\"\n [name]=\"menu.icon || (group ? 'folder' : 'chevron_right')\"\n [fontSet]=\"filled ? 'material-icons' : 'material-icons-outlined'\"\n size=\"20px\"></sd-icon>\n }\n</ng-template>\n\n<ng-template #railContent let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuIcon\"\n [ngTemplateOutletContext]=\"{ $implicit: item.menu, filled: item.isActive, group: item.isGroup }\" />\n @if (item.badge) {\n <span\n data-v4-rail-badge\n class=\"sd-sidebar-v4-menu-tree__rail-badge\"\n [class.sd-sidebar-v4-menu-tree__badge--warning]=\"item.badge.tone === 'warning'\"\n [class.sd-sidebar-v4-menu-tree__badge--error]=\"item.badge.tone === 'error'\"\n aria-hidden=\"true\">\n {{ item.badge.value }}\n </span>\n } @else if (item.liveTone) {\n <span data-v4-rail-live class=\"sd-sidebar-v4-menu-tree__rail-live\" [attr.data-tone]=\"item.liveTone\" aria-hidden=\"true\"></span>\n }\n</ng-template>\n\n<ng-template #trailingTemplate let-trailing>\n @switch (trailing?.kind) {\n @case ('soon') {\n <span data-v4-trailing=\"soon\" class=\"sd-sidebar-v4-menu-tree__trailing sd-sidebar-v4-menu-tree__chip\">\n {{ 'core.module.layout.sidebar.coming-soon' | sdTranslate }}\n </span>\n }\n @case ('count') {\n <span data-v4-trailing=\"count\" class=\"sd-sidebar-v4-menu-tree__trailing sd-sidebar-v4-menu-tree__count\">{{ trailing.value }}</span>\n }\n @case ('badge') {\n <span\n data-v4-trailing=\"badge\"\n class=\"sd-sidebar-v4-menu-tree__trailing sd-sidebar-v4-menu-tree__badge\"\n [class.sd-sidebar-v4-menu-tree__badge--warning]=\"trailing.tone === 'warning'\"\n [class.sd-sidebar-v4-menu-tree__badge--error]=\"trailing.tone === 'error'\"\n role=\"img\"\n [attr.aria-label]=\"'core.module.layout.sidebar.badge-pending' | sdTranslate: { count: trailing.value }\">\n {{ trailing.value }}\n </span>\n }\n @case ('status') {\n <span\n data-v4-trailing=\"status\"\n class=\"sd-sidebar-v4-menu-tree__trailing sd-sidebar-v4-menu-tree__status\"\n [attr.data-tone]=\"trailing.tone\">\n <span\n data-v4-status-dot\n class=\"sd-sidebar-v4-menu-tree__status-dot\"\n [class.sd-sidebar-v4-menu-tree__status-dot--live]=\"trailing.live\"\n aria-hidden=\"true\"></span>\n {{ trailing.label }}\n </span>\n }\n }\n</ng-template>\n\n<ng-template #pinTemplate let-menu let-key=\"key\" let-pinned=\"pinned\" let-label=\"label\">\n <button\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__pin\"\n [attr.data-pin-key]=\"key\"\n [attr.aria-label]=\"label\"\n [attr.aria-pressed]=\"pinned\"\n (click)=\"onTogglePinned($event, menu)\">\n <sd-icon name=\"push_pin\" [fontSet]=\"pinned ? 'material-icons' : 'material-icons-outlined'\" size=\"18px\"></sd-icon>\n </button>\n</ng-template>\n", styles: [":host{--tree-hover-bg: var(--sd-sidebar-v4-hover-bg, color-mix(in srgb, var(--sd-text) 6%, transparent));--tree-active-bg: var(--sd-sidebar-v4-active-bg, var(--sd-primary-light));--tree-active-ink: var(--sd-sidebar-v4-active-ink, var(--sd-primary));--tree-active-shadow: var(--sd-sidebar-v4-active-shadow, none);--tree-bg: var(--sd-sidebar-v4-bg, color-mix(in srgb, var(--sd-text) 4%, var(--sd-surface)));--tree-line: var(--sd-sidebar-v4-line, color-mix(in srgb, var(--sd-border) 45%, var(--sd-surface)));--tree-branch: color-mix(in srgb, var(--sd-border) 60%, var(--sd-surface));--tree-attention: var(--sd-sidebar-v4-attention, var(--sd-warning));--tree-live: var(--sd-sidebar-v4-live, var(--sd-success));--tree-muted-ink: var(--sd-text-secondary);--tree-disabled-ink: var(--sd-disabled-text, color-mix(in srgb, var(--sd-text) 60%, transparent));--tree-focus-ring: inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary));--tree-radius: var(--sd-sidebar-v4-item-radius, var(--sd-radius-999, 999px));--tree-row-height: var(--sd-sidebar-v4-item-height, 36px);--tree-child-height: var(--sd-sidebar-v4-child-height, 32px);display:block;min-width:0;color:var(--sd-text)}:host(.sd-sidebar-v4-menu-tree--mobile){--tree-row-height: var(--sd-sidebar-v4-item-height, 44px);--tree-child-height: var(--sd-sidebar-v4-child-height, 44px)}:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__pin{position:static;flex:0 0 44px;align-self:center;width:44px;height:44px;transform:none;opacity:1;pointer-events:auto}:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row,:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row,:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable>.sd-sidebar-v4-menu-tree__row,:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row{padding-right:var(--sd-space-12, 12px)}:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing,:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing{visibility:visible}.sd-sidebar-v4-menu-tree__sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.sd-sidebar-v4-menu-tree__section--separated{margin-top:var(--sd-space-16, 16px)}.sd-sidebar-v4-menu-tree__section-label{padding:14px 12px 4px;color:var(--tree-muted-ink);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px}.sd-sidebar-v4-menu-tree__item{position:relative;display:flex;align-items:stretch;min-width:0}.sd-sidebar-v4-menu-tree__row{display:flex;flex:1 1 auto;align-items:center;gap:var(--sd-space-12, 12px);box-sizing:border-box;width:100%;min-width:0;min-height:var(--tree-row-height, 36px);margin:0;padding:0 var(--sd-space-12, 12px);border:0;border-radius:var(--tree-radius, 999px);background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-20, 20px);text-align:left;cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4-menu-tree__row:hover{background:var(--tree-hover-bg)}.sd-sidebar-v4-menu-tree__row--group{padding:0 var(--sd-space-8, 8px) 0 var(--sd-space-12, 12px)}.sd-sidebar-v4-menu-tree__row--child{gap:var(--sd-space-8, 8px);min-height:var(--tree-child-height, 32px)}.sd-sidebar-v4-menu-tree__row--active,.sd-sidebar-v4-menu-tree__row--active:hover{background:var(--tree-active-bg);box-shadow:var(--tree-active-shadow);color:var(--tree-active-ink);font-weight:var(--sd-font-weight-medium, 500)}.sd-sidebar-v4-menu-tree__row--disabled,.sd-sidebar-v4-menu-tree__row--disabled:hover{background:transparent;color:var(--tree-disabled-ink);cursor:not-allowed}.sd-sidebar-v4-menu-tree__row:focus-visible{outline:none;box-shadow:var(--tree-focus-ring)}.sd-sidebar-v4-menu-tree__label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-v4-menu-tree__icon,.sd-sidebar-v4-menu-tree__icon-image{flex:0 0 20px;width:20px;height:20px;color:var(--tree-muted-ink)}.sd-sidebar-v4-menu-tree__icon-image{object-fit:contain}.sd-sidebar-v4-menu-tree__row--active .sd-sidebar-v4-menu-tree__icon,.sd-sidebar-v4-menu-tree__rail-item--active .sd-sidebar-v4-menu-tree__icon,.sd-sidebar-v4-menu-tree__row--disabled .sd-sidebar-v4-menu-tree__icon,.sd-sidebar-v4-menu-tree__rail-item--disabled .sd-sidebar-v4-menu-tree__icon{color:inherit}.sd-sidebar-v4-menu-tree__row--disabled .sd-sidebar-v4-menu-tree__icon-image,.sd-sidebar-v4-menu-tree__rail-item--disabled .sd-sidebar-v4-menu-tree__icon-image{opacity:.6}.sd-sidebar-v4-menu-tree__chevron{flex:0 0 20px;color:var(--tree-muted-ink)}.sd-sidebar-v4-menu-tree__dot{flex:none;width:6px;height:6px;border-radius:3px;background:var(--sd-primary)}.sd-sidebar-v4-menu-tree__item--nested{min-height:var(--tree-child-height, 32px);animation:sd-sidebar-v4-expand-in .16s ease-out}@keyframes sd-sidebar-v4-expand-in{0%{opacity:0}}.sd-sidebar-v4-menu-tree__branch{position:absolute;top:0;bottom:0;width:1px;background:var(--tree-branch);pointer-events:none}.sd-sidebar-v4-menu-tree__marker{position:absolute;z-index:1;top:7px;bottom:7px;width:3px;border-radius:var(--sd-radius-2, 2px);background:var(--sd-primary);pointer-events:none}.sd-sidebar-v4-menu-tree__trailing{flex:none}.sd-sidebar-v4-menu-tree__count{color:var(--tree-muted-ink);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-regular, 400);line-height:var(--sd-line-height-16, 16px)}.sd-sidebar-v4-menu-tree__row--active .sd-sidebar-v4-menu-tree__count{color:inherit}.sd-sidebar-v4-menu-tree__badge,.sd-sidebar-v4-menu-tree__rail-badge{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;font-weight:var(--sd-font-weight-medium, 500);line-height:1}.sd-sidebar-v4-menu-tree__badge{min-width:20px;height:20px;padding:0 6px;border-radius:var(--sd-radius-10, 10px);font-size:11.5px}.sd-sidebar-v4-menu-tree__badge--warning{background:var(--tree-attention);color:var(--sd-warning-contrast)}.sd-sidebar-v4-menu-tree__badge--error{background:var(--sd-error);color:var(--sd-error-contrast)}.sd-sidebar-v4-menu-tree__status,.sd-sidebar-v4-menu-tree__rail-live{--tree-tone: var(--tree-live)}.sd-sidebar-v4-menu-tree__status[data-tone=warning],.sd-sidebar-v4-menu-tree__rail-live[data-tone=warning]{--tree-tone: var(--sd-warning)}.sd-sidebar-v4-menu-tree__status[data-tone=error],.sd-sidebar-v4-menu-tree__rail-live[data-tone=error]{--tree-tone: var(--sd-error)}.sd-sidebar-v4-menu-tree__status{display:inline-flex;align-items:center;gap:6px;color:var(--tree-tone);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-regular, 400);line-height:var(--sd-line-height-16, 16px)}.sd-sidebar-v4-menu-tree__status-dot{flex:none;width:6px;height:6px;border-radius:3px;background:var(--tree-tone)}.sd-sidebar-v4-menu-tree__status-dot--live{box-shadow:0 0 0 3px color-mix(in srgb,var(--tree-tone) 18%,transparent)}.sd-sidebar-v4-menu-tree__chip{padding:0 7px;border:1px solid var(--sd-border);border-radius:var(--sd-radius-999, 999px);color:var(--tree-muted-ink);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-18, 18px)}.sd-sidebar-v4-menu-tree__pin{position:absolute;top:50%;right:2px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;margin:0;padding:0;border:0;border-radius:var(--tree-radius, 999px);background:transparent;color:var(--tree-muted-ink);cursor:pointer;opacity:0;pointer-events:none;transform:translateY(-50%);transition:opacity var(--sd-duration-fast, .12s) ease,background-color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4-menu-tree__pin:hover{background:var(--tree-hover-bg)}.sd-sidebar-v4-menu-tree__pin:focus-visible{outline:none;box-shadow:var(--tree-focus-ring)}.sd-sidebar-v4-menu-tree__item:hover>.sd-sidebar-v4-menu-tree__pin,.sd-sidebar-v4-menu-tree__pin:focus-visible,.sd-sidebar-v4-menu-tree__item--shortcut>.sd-sidebar-v4-menu-tree__pin{opacity:1;pointer-events:auto}.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row{padding-right:40px}.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing,.sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing{visibility:hidden}.sd-sidebar-v4-menu-tree__row--shortcut{gap:var(--sd-space-8, 8px)}.sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row{padding-right:40px}.sd-sidebar-v4-menu-tree__shortcut-path{color:var(--tree-muted-ink);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-regular, 400)}.sd-sidebar-v4-menu-tree__results{display:flex;flex-direction:column}.sd-sidebar-v4-menu-tree__result{display:flex;flex-direction:column;justify-content:center;box-sizing:border-box;min-height:var(--tree-row-height, 36px);padding:6px var(--sd-space-12, 12px);border-radius:var(--sd-radius-16, 16px);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4-menu-tree__result:hover{background:var(--tree-hover-bg)}.sd-sidebar-v4-menu-tree__result--focused,.sd-sidebar-v4-menu-tree__result--focused:hover{background:var(--sd-surface);box-shadow:inset 0 0 0 2px var(--sd-primary)}.sd-sidebar-v4-menu-tree__result-title{color:var(--sd-text);font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);overflow-wrap:anywhere}.sd-sidebar-v4-menu-tree__match{border-radius:3px;background:var(--sd-primary-light);color:var(--sd-primary-dark);font-weight:var(--sd-font-weight-medium, 500)}.sd-sidebar-v4-menu-tree__result-path{margin-top:1px;color:var(--tree-muted-ink);font-size:11.5px;line-height:var(--sd-line-height-16, 16px);overflow-wrap:anywhere}.sd-sidebar-v4-menu-tree__empty{padding:var(--sd-space-16, 16px) var(--sd-space-12, 12px);color:var(--tree-muted-ink);font-size:var(--sd-font-size-13, 13px);overflow-wrap:anywhere}.sd-sidebar-v4-menu-tree__hint{padding:var(--sd-space-12, 12px) var(--sd-space-12, 12px) 0;color:var(--tree-muted-ink);font-size:11.5px;line-height:var(--sd-line-height-16, 16px)}.sd-sidebar-v4-menu-tree__rail{display:flex;flex-direction:column;align-items:center;gap:var(--sd-space-4, 4px)}.sd-sidebar-v4-menu-tree__rail-cell{position:relative;display:flex}.sd-sidebar-v4-menu-tree__rail-item{position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:48px;height:36px;margin:0;padding:0;border:0;border-radius:var(--tree-radius, 999px);background:transparent;color:var(--tree-muted-ink);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4-menu-tree__rail-item:hover,.sd-sidebar-v4-menu-tree__rail-item.sd-sidebar-v4-menu-tree__rail-item--open{background:var(--tree-hover-bg)}.sd-sidebar-v4-menu-tree__rail-item--active,.sd-sidebar-v4-menu-tree__rail-item--active:hover{background:var(--tree-active-bg);box-shadow:var(--tree-active-shadow);color:var(--tree-active-ink)}.sd-sidebar-v4-menu-tree__rail-item--disabled,.sd-sidebar-v4-menu-tree__rail-item--disabled:hover{background:transparent;color:var(--tree-disabled-ink);cursor:not-allowed}.sd-sidebar-v4-menu-tree__rail-item:focus-visible{outline:none;box-shadow:var(--tree-focus-ring)}.sd-sidebar-v4-menu-tree__rail-separator{flex:none;width:32px;height:1px;margin:5px 0;background:var(--tree-line)}.sd-sidebar-v4-menu-tree__rail-badge{position:absolute;top:0;right:2px;min-width:16px;height:16px;padding:0 4px;border-radius:var(--sd-radius-8, 8px);font-size:var(--sd-font-size-10, 10px);box-shadow:0 0 0 2px var(--tree-bg);pointer-events:none}.sd-sidebar-v4-menu-tree__rail-live{position:absolute;top:5px;right:9px;width:8px;height:8px;border-radius:var(--sd-radius-4, 4px);background:var(--tree-tone);box-shadow:0 0 0 2px var(--tree-bg);pointer-events:none}.sd-sidebar-v4-menu-tree__flyout{--tree-hover-bg: var(--sd-sidebar-v4-hover-bg, color-mix(in srgb, var(--sd-text) 6%, transparent));--tree-active-bg: var(--sd-sidebar-v4-active-bg, var(--sd-primary-light));--tree-active-ink: var(--sd-sidebar-v4-active-ink, var(--sd-primary));--tree-active-shadow: var(--sd-sidebar-v4-active-shadow, none);--tree-bg: var(--sd-sidebar-v4-bg, color-mix(in srgb, var(--sd-text) 4%, var(--sd-surface)));--tree-line: var(--sd-sidebar-v4-line, color-mix(in srgb, var(--sd-border) 45%, var(--sd-surface)));--tree-branch: color-mix(in srgb, var(--sd-border) 60%, var(--sd-surface));--tree-attention: var(--sd-sidebar-v4-attention, var(--sd-warning));--tree-live: var(--sd-sidebar-v4-live, var(--sd-success));--tree-muted-ink: var(--sd-text-secondary);--tree-disabled-ink: var(--sd-disabled-text, color-mix(in srgb, var(--sd-text) 60%, transparent));--tree-focus-ring: inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary));--tree-radius: var(--sd-sidebar-v4-item-radius, var(--sd-radius-999, 999px));--tree-row-height: var(--sd-sidebar-v4-item-height, 36px);--tree-child-height: var(--sd-sidebar-v4-child-height, 32px);box-sizing:border-box;width:232px;padding:var(--sd-space-8, 8px);border:1px solid var(--tree-line);border-radius:var(--sd-radius-16, 16px);background:var(--sd-surface);color:var(--sd-text);box-shadow:0 6px 24px color-mix(in srgb,var(--sd-text) 14%,transparent);animation:sd-sidebar-v4-flyout-in .14s ease-out}.sd-sidebar-v4-menu-tree__flyout:focus{outline:none}.sd-sidebar-v4-menu-tree__flyout-title{padding:6px var(--sd-space-12, 12px);font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-20, 20px)}.sd-sidebar-v4-menu-tree__flyout-heading{display:flex;align-items:center;gap:var(--sd-space-8, 8px);padding:6px var(--sd-space-12, 12px) 2px;color:var(--tree-muted-ink);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px)}.sd-sidebar-v4-menu-tree__flyout-heading--disabled{color:var(--tree-disabled-ink)}.sd-sidebar-v4-menu-tree__row--flyout{gap:var(--sd-space-8, 8px);height:32px;min-height:32px}@keyframes sd-sidebar-v4-flyout-in{0%{opacity:0;transform:translate(-4px)}}@media(pointer:coarse){.sd-sidebar-v4-menu-tree__row{min-height:max(44px,var(--tree-row-height, 36px))}.sd-sidebar-v4-menu-tree__row--child{min-height:max(44px,var(--tree-child-height, 32px))}.sd-sidebar-v4-menu-tree__result{min-height:max(44px,var(--tree-row-height, 36px))}.sd-sidebar-v4-menu-tree__row--flyout{height:auto;min-height:44px}.sd-sidebar-v4-menu-tree__rail-item{height:44px}.sd-sidebar-v4-menu-tree__pin{position:static;flex:0 0 44px;align-self:center;width:44px;height:44px;transform:none;opacity:1;pointer-events:auto}.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row{padding-right:var(--sd-space-12, 12px)}.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing,.sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing{visibility:visible}}@media(prefers-reduced-motion:reduce){.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__pin,.sd-sidebar-v4-menu-tree__result,.sd-sidebar-v4-menu-tree__rail-item{transition:none}.sd-sidebar-v4-menu-tree__flyout,.sd-sidebar-v4-menu-tree__item--nested{animation:none}}\n"], dependencies: [{ kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3600
+ }
3601
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarV4MenuTree, decorators: [{
3602
+ type: Component,
3603
+ args: [{ selector: 'sd-sidebar-v4-menu-tree', standalone: true, imports: [CdkConnectedOverlay, CdkOverlayOrigin, CdkTrapFocus, NgTemplateOutlet, SdIcon, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
3604
+ class: 'sd-sidebar-v4-menu-tree',
3605
+ '[class.sd-sidebar-v4-menu-tree--mobile]': 'mode() === "mobile"',
3606
+ '[class.sd-sidebar-v4-menu-tree--collapsed]': 'isRail()',
3607
+ }, template: "@let _presentation = presentation();\n<div data-v4-live class=\"sd-sidebar-v4-menu-tree__sr-only\" aria-live=\"polite\" aria-atomic=\"true\">{{ liveMessage() }}</div>\n@if (_presentation === 'results') {\n @let _query = query().trim();\n @if (_query) {\n @let _rows = resultRows();\n @let _focused = focusedIndex();\n <div data-v4-result-count class=\"sd-sidebar-v4-menu-tree__section-label\" [id]=\"resultCountId\">\n {{ 'core.module.layout.sidebar.result-count' | sdTranslate: { count: _rows.length } }}\n </div>\n @if (_rows.length) {\n <div data-v4-results class=\"sd-sidebar-v4-menu-tree__results\" role=\"listbox\" [id]=\"resultsId\" [attr.aria-labelledby]=\"resultCountId\">\n @for (row of _rows; track $index; let index = $index) {\n <!-- Options stay unfocusable: the parent's search input drives them via aria-activedescendant (Up/Down/Enter); click is the pointer path. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n data-v4-result\n class=\"sd-sidebar-v4-menu-tree__result\"\n role=\"option\"\n [id]=\"resultOptionId(index)\"\n [attr.data-menu-key]=\"row.key\"\n [attr.aria-selected]=\"index === _focused\"\n [class.sd-sidebar-v4-menu-tree__result--focused]=\"index === _focused\"\n (click)=\"onNavigate(row.menu)\">\n <span class=\"sd-sidebar-v4-menu-tree__result-title\">\n @for (segment of row.segments; track $index) {\n <span [class.sd-sidebar-v4-menu-tree__match]=\"segment.match\" [attr.data-v4-match]=\"segment.match ? '' : null\">{{\n segment.text\n }}</span>\n }\n </span>\n @if (row.path) {\n <span data-v4-result-path class=\"sd-sidebar-v4-menu-tree__result-path\">{{ row.path }}</span>\n }\n </div>\n }\n </div>\n } @else {\n <div data-v4-empty class=\"sd-sidebar-v4-menu-tree__empty\">\n {{ 'core.module.layout.sidebar.no-match' | sdTranslate: { query: _query } }}\n </div>\n }\n <div data-v4-search-hint class=\"sd-sidebar-v4-menu-tree__hint\">{{ 'core.module.layout.sidebar.search-hint' | sdTranslate }}</div>\n }\n} @else if (_presentation === 'shortcuts') {\n @for (row of shortcuts(); track row.key) {\n <div\n class=\"sd-sidebar-v4-menu-tree__item sd-sidebar-v4-menu-tree__item--shortcut\"\n [class.sd-sidebar-v4-menu-tree__item--pinnable]=\"showPin()\"\n [attr.data-v4-item]=\"row.key\">\n <button\n type=\"button\"\n data-v4-row=\"shortcut\"\n class=\"sd-sidebar-v4-menu-tree__row sd-sidebar-v4-menu-tree__row--shortcut\"\n [attr.data-menu-key]=\"row.key\"\n [attr.aria-current]=\"row.isActive ? 'page' : null\"\n [attr.aria-disabled]=\"row.disabled || null\"\n [class.sd-sidebar-v4-menu-tree__row--active]=\"row.isActive\"\n [class.sd-sidebar-v4-menu-tree__row--disabled]=\"row.disabled\"\n (click)=\"onNavigate(row.menu)\">\n <span class=\"sd-sidebar-v4-menu-tree__label\">\n {{ row.title }}\n @if (row.path) {\n <span data-v4-shortcut-path class=\"sd-sidebar-v4-menu-tree__shortcut-path\"> \u00B7 {{ row.path }}</span>\n }\n </span>\n @if (row.disabled) {\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: { kind: 'soon' } }\" />\n }\n </button>\n @if (showPin()) {\n <ng-container\n [ngTemplateOutlet]=\"pinTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: row.menu, key: row.key, pinned: row.isPinned, label: row.pinLabel }\" />\n }\n </div>\n }\n} @else if (isRail()) {\n @let _flyoutKey = flyoutKey();\n @let _flyoutMode = collapsedGroup() === 'flyout';\n <div data-v4-rail class=\"sd-sidebar-v4-menu-tree__rail\">\n @for (group of railGroups(); track group.key; let first = $first) {\n @if (!first) {\n <div data-v4-rail-separator class=\"sd-sidebar-v4-menu-tree__rail-separator\" aria-hidden=\"true\"></div>\n }\n @for (item of group.items; track item.key) {\n <div class=\"sd-sidebar-v4-menu-tree__rail-cell\" [attr.data-v4-rail-cell]=\"item.key\">\n @if (item.isGroup) {\n <button\n #railGroupButton\n cdkOverlayOrigin\n #flyoutOrigin=\"cdkOverlayOrigin\"\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__rail-item\"\n [attr.data-v4-rail-item]=\"item.key\"\n [attr.title]=\"item.title\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-describedby]=\"item.description ? item.descriptionId : null\"\n [attr.aria-haspopup]=\"_flyoutMode && !item.disabled ? 'dialog' : null\"\n [attr.aria-expanded]=\"_flyoutMode && !item.disabled ? _flyoutKey === item.key : null\"\n [attr.aria-disabled]=\"item.disabled || null\"\n [class.sd-sidebar-v4-menu-tree__rail-item--active]=\"item.isActive\"\n [class.sd-sidebar-v4-menu-tree__rail-item--open]=\"_flyoutKey === item.key\"\n [class.sd-sidebar-v4-menu-tree__rail-item--disabled]=\"item.disabled\"\n (click)=\"onRailGroup(item, railGroupButton)\">\n <ng-container [ngTemplateOutlet]=\"railContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </button>\n <ng-template\n cdkConnectedOverlay\n #flyoutOverlay=\"cdkConnectedOverlay\"\n [cdkConnectedOverlayOrigin]=\"flyoutOrigin\"\n [cdkConnectedOverlayOpen]=\"_flyoutKey === item.key\"\n [cdkConnectedOverlayPositions]=\"flyoutPositions\"\n [cdkConnectedOverlayViewportMargin]=\"8\"\n [cdkConnectedOverlayFlexibleDimensions]=\"false\"\n [cdkConnectedOverlayPush]=\"true\"\n [cdkConnectedOverlayHasBackdrop]=\"false\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n (overlayOutsideClick)=\"onFlyoutOutsideClick()\"\n (overlayKeydown)=\"onFlyoutKeydown($event)\"\n (attach)=\"onFlyoutAttach(flyoutOverlay)\"\n (detach)=\"onFlyoutDetach(item.key)\">\n <div\n data-v4-flyout\n class=\"sd-sidebar-v4-menu-tree__flyout\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-label]=\"item.title\"\n [style.--sd-sidebar-v4-item-radius]=\"flyoutRadius()\"\n cdkTrapFocus>\n <div data-v4-flyout-title class=\"sd-sidebar-v4-menu-tree__flyout-title\">{{ item.title }}</div>\n @for (node of flyoutNodes(); track node.key) {\n @if (node.isGroup) {\n <div\n data-v4-flyout-heading\n class=\"sd-sidebar-v4-menu-tree__flyout-heading\"\n [class.sd-sidebar-v4-menu-tree__flyout-heading--disabled]=\"node.disabled\"\n [style.padding-left.px]=\"12 + node.depth * 16\">\n <span class=\"sd-sidebar-v4-menu-tree__label\">{{ node.title }}</span>\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: node.trailing }\" />\n </div>\n } @else {\n <button\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__row sd-sidebar-v4-menu-tree__row--flyout\"\n [attr.data-v4-flyout-item]=\"node.key\"\n [attr.aria-current]=\"node.isActive ? 'page' : null\"\n [attr.aria-disabled]=\"node.disabled || null\"\n [class.sd-sidebar-v4-menu-tree__row--active]=\"node.isActive\"\n [class.sd-sidebar-v4-menu-tree__row--disabled]=\"node.disabled\"\n [style.padding-left.px]=\"12 + node.depth * 16\"\n (click)=\"onFlyoutNavigate(node)\">\n <span class=\"sd-sidebar-v4-menu-tree__label\">{{ node.title }}</span>\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: node.trailing }\" />\n </button>\n }\n }\n </div>\n </ng-template>\n } @else {\n <button\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__rail-item\"\n [attr.data-v4-rail-item]=\"item.key\"\n [attr.title]=\"item.title\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-describedby]=\"item.description ? item.descriptionId : null\"\n [attr.aria-current]=\"item.isActive ? 'page' : null\"\n [attr.aria-disabled]=\"item.disabled || null\"\n [class.sd-sidebar-v4-menu-tree__rail-item--active]=\"item.isActive\"\n [class.sd-sidebar-v4-menu-tree__rail-item--disabled]=\"item.disabled\"\n (click)=\"onNavigate(item.menu)\">\n <ng-container [ngTemplateOutlet]=\"railContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </button>\n }\n @if (item.description) {\n <span hidden [id]=\"item.descriptionId\">{{ item.description }}</span>\n }\n </div>\n }\n }\n </div>\n} @else {\n @for (section of sections(); track section.key) {\n <div\n class=\"sd-sidebar-v4-menu-tree__section\"\n [attr.data-v4-section]=\"section.label ?? ''\"\n [attr.role]=\"section.label ? 'group' : null\"\n [attr.aria-labelledby]=\"section.label ? section.labelId : null\"\n [class.sd-sidebar-v4-menu-tree__section--separated]=\"section.separated\">\n @if (section.label) {\n <div data-v4-section-label class=\"sd-sidebar-v4-menu-tree__section-label\" [id]=\"section.labelId\">{{ section.label }}</div>\n }\n @for (node of section.nodes; track node.key) {\n <div\n class=\"sd-sidebar-v4-menu-tree__item\"\n [class.sd-sidebar-v4-menu-tree__item--nested]=\"node.depth > 0\"\n [class.sd-sidebar-v4-menu-tree__item--pinnable]=\"node.pinnable\"\n [attr.data-v4-item]=\"node.key\"\n [style.padding-left.px]=\"node.depth ? node.paddingLeft : null\">\n @for (offset of node.branchOffsets; track offset) {\n <span data-menu-branch class=\"sd-sidebar-v4-menu-tree__branch\" [style.left.px]=\"offset\" aria-hidden=\"true\"></span>\n }\n @if (node.isActive && node.depth > 0) {\n <span data-v4-marker class=\"sd-sidebar-v4-menu-tree__marker\" [style.left.px]=\"node.markerLeft\" aria-hidden=\"true\"></span>\n }\n @if (node.isGroup) {\n <button\n type=\"button\"\n data-v4-row=\"group\"\n class=\"sd-sidebar-v4-menu-tree__row sd-sidebar-v4-menu-tree__row--group\"\n [class.sd-sidebar-v4-menu-tree__row--child]=\"node.depth > 0\"\n [class.sd-sidebar-v4-menu-tree__row--disabled]=\"node.disabled\"\n [attr.data-menu-group]=\"node.key\"\n [attr.aria-expanded]=\"node.disabled ? null : node.isExpanded\"\n [attr.aria-disabled]=\"node.disabled || null\"\n (click)=\"onToggleGroup(node)\">\n @if (node.depth === 0) {\n <ng-container\n [ngTemplateOutlet]=\"menuIcon\"\n [ngTemplateOutletContext]=\"{ $implicit: node.menu, filled: false, group: true }\" />\n }\n <span class=\"sd-sidebar-v4-menu-tree__label\">{{ node.title }}</span>\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: node.trailing }\" />\n @if (node.showActiveDot) {\n <span data-v4-active-dot class=\"sd-sidebar-v4-menu-tree__dot\" aria-hidden=\"true\"></span>\n }\n @if (!node.disabled) {\n <sd-icon\n data-v4-chevron\n class=\"sd-sidebar-v4-menu-tree__chevron\"\n [name]=\"node.isExpanded ? 'expand_less' : 'expand_more'\"\n size=\"20px\"></sd-icon>\n }\n </button>\n } @else {\n <button\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__row\"\n [class.sd-sidebar-v4-menu-tree__row--child]=\"node.depth > 0\"\n [class.sd-sidebar-v4-menu-tree__row--active]=\"node.isActive\"\n [class.sd-sidebar-v4-menu-tree__row--disabled]=\"node.disabled\"\n [attr.data-v4-row]=\"node.depth ? 'child' : 'root'\"\n [attr.data-menu-key]=\"node.key\"\n [attr.aria-current]=\"node.isActive ? 'page' : null\"\n [attr.aria-disabled]=\"node.disabled || null\"\n (click)=\"onNavigate(node.menu)\">\n @if (node.depth === 0) {\n <ng-container\n [ngTemplateOutlet]=\"menuIcon\"\n [ngTemplateOutletContext]=\"{ $implicit: node.menu, filled: node.isActive, group: false }\" />\n }\n <span class=\"sd-sidebar-v4-menu-tree__label\">{{ node.title }}</span>\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: node.trailing }\" />\n </button>\n @if (node.pinnable) {\n <ng-container\n [ngTemplateOutlet]=\"pinTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: node.menu, key: node.key, pinned: node.isPinned, label: node.pinLabel }\" />\n }\n }\n </div>\n }\n </div>\n }\n}\n\n<ng-template #menuIcon let-menu let-filled=\"filled\" let-group=\"group\">\n @if (menu.iconUrl) {\n <img data-menu-icon class=\"sd-sidebar-v4-menu-tree__icon-image\" [src]=\"menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon\n data-menu-icon\n class=\"sd-sidebar-v4-menu-tree__icon\"\n [name]=\"menu.icon || (group ? 'folder' : 'chevron_right')\"\n [fontSet]=\"filled ? 'material-icons' : 'material-icons-outlined'\"\n size=\"20px\"></sd-icon>\n }\n</ng-template>\n\n<ng-template #railContent let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuIcon\"\n [ngTemplateOutletContext]=\"{ $implicit: item.menu, filled: item.isActive, group: item.isGroup }\" />\n @if (item.badge) {\n <span\n data-v4-rail-badge\n class=\"sd-sidebar-v4-menu-tree__rail-badge\"\n [class.sd-sidebar-v4-menu-tree__badge--warning]=\"item.badge.tone === 'warning'\"\n [class.sd-sidebar-v4-menu-tree__badge--error]=\"item.badge.tone === 'error'\"\n aria-hidden=\"true\">\n {{ item.badge.value }}\n </span>\n } @else if (item.liveTone) {\n <span data-v4-rail-live class=\"sd-sidebar-v4-menu-tree__rail-live\" [attr.data-tone]=\"item.liveTone\" aria-hidden=\"true\"></span>\n }\n</ng-template>\n\n<ng-template #trailingTemplate let-trailing>\n @switch (trailing?.kind) {\n @case ('soon') {\n <span data-v4-trailing=\"soon\" class=\"sd-sidebar-v4-menu-tree__trailing sd-sidebar-v4-menu-tree__chip\">\n {{ 'core.module.layout.sidebar.coming-soon' | sdTranslate }}\n </span>\n }\n @case ('count') {\n <span data-v4-trailing=\"count\" class=\"sd-sidebar-v4-menu-tree__trailing sd-sidebar-v4-menu-tree__count\">{{ trailing.value }}</span>\n }\n @case ('badge') {\n <span\n data-v4-trailing=\"badge\"\n class=\"sd-sidebar-v4-menu-tree__trailing sd-sidebar-v4-menu-tree__badge\"\n [class.sd-sidebar-v4-menu-tree__badge--warning]=\"trailing.tone === 'warning'\"\n [class.sd-sidebar-v4-menu-tree__badge--error]=\"trailing.tone === 'error'\"\n role=\"img\"\n [attr.aria-label]=\"'core.module.layout.sidebar.badge-pending' | sdTranslate: { count: trailing.value }\">\n {{ trailing.value }}\n </span>\n }\n @case ('status') {\n <span\n data-v4-trailing=\"status\"\n class=\"sd-sidebar-v4-menu-tree__trailing sd-sidebar-v4-menu-tree__status\"\n [attr.data-tone]=\"trailing.tone\">\n <span\n data-v4-status-dot\n class=\"sd-sidebar-v4-menu-tree__status-dot\"\n [class.sd-sidebar-v4-menu-tree__status-dot--live]=\"trailing.live\"\n aria-hidden=\"true\"></span>\n {{ trailing.label }}\n </span>\n }\n }\n</ng-template>\n\n<ng-template #pinTemplate let-menu let-key=\"key\" let-pinned=\"pinned\" let-label=\"label\">\n <button\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__pin\"\n [attr.data-pin-key]=\"key\"\n [attr.aria-label]=\"label\"\n [attr.aria-pressed]=\"pinned\"\n (click)=\"onTogglePinned($event, menu)\">\n <sd-icon name=\"push_pin\" [fontSet]=\"pinned ? 'material-icons' : 'material-icons-outlined'\" size=\"18px\"></sd-icon>\n </button>\n</ng-template>\n", styles: [":host{--tree-hover-bg: var(--sd-sidebar-v4-hover-bg, color-mix(in srgb, var(--sd-text) 6%, transparent));--tree-active-bg: var(--sd-sidebar-v4-active-bg, var(--sd-primary-light));--tree-active-ink: var(--sd-sidebar-v4-active-ink, var(--sd-primary));--tree-active-shadow: var(--sd-sidebar-v4-active-shadow, none);--tree-bg: var(--sd-sidebar-v4-bg, color-mix(in srgb, var(--sd-text) 4%, var(--sd-surface)));--tree-line: var(--sd-sidebar-v4-line, color-mix(in srgb, var(--sd-border) 45%, var(--sd-surface)));--tree-branch: color-mix(in srgb, var(--sd-border) 60%, var(--sd-surface));--tree-attention: var(--sd-sidebar-v4-attention, var(--sd-warning));--tree-live: var(--sd-sidebar-v4-live, var(--sd-success));--tree-muted-ink: var(--sd-text-secondary);--tree-disabled-ink: var(--sd-disabled-text, color-mix(in srgb, var(--sd-text) 60%, transparent));--tree-focus-ring: inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary));--tree-radius: var(--sd-sidebar-v4-item-radius, var(--sd-radius-999, 999px));--tree-row-height: var(--sd-sidebar-v4-item-height, 36px);--tree-child-height: var(--sd-sidebar-v4-child-height, 32px);display:block;min-width:0;color:var(--sd-text)}:host(.sd-sidebar-v4-menu-tree--mobile){--tree-row-height: var(--sd-sidebar-v4-item-height, 44px);--tree-child-height: var(--sd-sidebar-v4-child-height, 44px)}:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__pin{position:static;flex:0 0 44px;align-self:center;width:44px;height:44px;transform:none;opacity:1;pointer-events:auto}:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row,:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row,:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable>.sd-sidebar-v4-menu-tree__row,:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row{padding-right:var(--sd-space-12, 12px)}:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing,:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing{visibility:visible}.sd-sidebar-v4-menu-tree__sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.sd-sidebar-v4-menu-tree__section--separated{margin-top:var(--sd-space-16, 16px)}.sd-sidebar-v4-menu-tree__section-label{padding:14px 12px 4px;color:var(--tree-muted-ink);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px}.sd-sidebar-v4-menu-tree__item{position:relative;display:flex;align-items:stretch;min-width:0}.sd-sidebar-v4-menu-tree__row{display:flex;flex:1 1 auto;align-items:center;gap:var(--sd-space-12, 12px);box-sizing:border-box;width:100%;min-width:0;min-height:var(--tree-row-height, 36px);margin:0;padding:0 var(--sd-space-12, 12px);border:0;border-radius:var(--tree-radius, 999px);background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-20, 20px);text-align:left;cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4-menu-tree__row:hover{background:var(--tree-hover-bg)}.sd-sidebar-v4-menu-tree__row--group{padding:0 var(--sd-space-8, 8px) 0 var(--sd-space-12, 12px)}.sd-sidebar-v4-menu-tree__row--child{gap:var(--sd-space-8, 8px);min-height:var(--tree-child-height, 32px)}.sd-sidebar-v4-menu-tree__row--active,.sd-sidebar-v4-menu-tree__row--active:hover{background:var(--tree-active-bg);box-shadow:var(--tree-active-shadow);color:var(--tree-active-ink);font-weight:var(--sd-font-weight-medium, 500)}.sd-sidebar-v4-menu-tree__row--disabled,.sd-sidebar-v4-menu-tree__row--disabled:hover{background:transparent;color:var(--tree-disabled-ink);cursor:not-allowed}.sd-sidebar-v4-menu-tree__row:focus-visible{outline:none;box-shadow:var(--tree-focus-ring)}.sd-sidebar-v4-menu-tree__label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-v4-menu-tree__icon,.sd-sidebar-v4-menu-tree__icon-image{flex:0 0 20px;width:20px;height:20px;color:var(--tree-muted-ink)}.sd-sidebar-v4-menu-tree__icon-image{object-fit:contain}.sd-sidebar-v4-menu-tree__row--active .sd-sidebar-v4-menu-tree__icon,.sd-sidebar-v4-menu-tree__rail-item--active .sd-sidebar-v4-menu-tree__icon,.sd-sidebar-v4-menu-tree__row--disabled .sd-sidebar-v4-menu-tree__icon,.sd-sidebar-v4-menu-tree__rail-item--disabled .sd-sidebar-v4-menu-tree__icon{color:inherit}.sd-sidebar-v4-menu-tree__row--disabled .sd-sidebar-v4-menu-tree__icon-image,.sd-sidebar-v4-menu-tree__rail-item--disabled .sd-sidebar-v4-menu-tree__icon-image{opacity:.6}.sd-sidebar-v4-menu-tree__chevron{flex:0 0 20px;color:var(--tree-muted-ink)}.sd-sidebar-v4-menu-tree__dot{flex:none;width:6px;height:6px;border-radius:3px;background:var(--sd-primary)}.sd-sidebar-v4-menu-tree__item--nested{min-height:var(--tree-child-height, 32px);animation:sd-sidebar-v4-expand-in .16s ease-out}@keyframes sd-sidebar-v4-expand-in{0%{opacity:0}}.sd-sidebar-v4-menu-tree__branch{position:absolute;top:0;bottom:0;width:1px;background:var(--tree-branch);pointer-events:none}.sd-sidebar-v4-menu-tree__marker{position:absolute;z-index:1;top:7px;bottom:7px;width:3px;border-radius:var(--sd-radius-2, 2px);background:var(--sd-primary);pointer-events:none}.sd-sidebar-v4-menu-tree__trailing{flex:none}.sd-sidebar-v4-menu-tree__count{color:var(--tree-muted-ink);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-regular, 400);line-height:var(--sd-line-height-16, 16px)}.sd-sidebar-v4-menu-tree__row--active .sd-sidebar-v4-menu-tree__count{color:inherit}.sd-sidebar-v4-menu-tree__badge,.sd-sidebar-v4-menu-tree__rail-badge{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;font-weight:var(--sd-font-weight-medium, 500);line-height:1}.sd-sidebar-v4-menu-tree__badge{min-width:20px;height:20px;padding:0 6px;border-radius:var(--sd-radius-10, 10px);font-size:11.5px}.sd-sidebar-v4-menu-tree__badge--warning{background:var(--tree-attention);color:var(--sd-warning-contrast)}.sd-sidebar-v4-menu-tree__badge--error{background:var(--sd-error);color:var(--sd-error-contrast)}.sd-sidebar-v4-menu-tree__status,.sd-sidebar-v4-menu-tree__rail-live{--tree-tone: var(--tree-live)}.sd-sidebar-v4-menu-tree__status[data-tone=warning],.sd-sidebar-v4-menu-tree__rail-live[data-tone=warning]{--tree-tone: var(--sd-warning)}.sd-sidebar-v4-menu-tree__status[data-tone=error],.sd-sidebar-v4-menu-tree__rail-live[data-tone=error]{--tree-tone: var(--sd-error)}.sd-sidebar-v4-menu-tree__status{display:inline-flex;align-items:center;gap:6px;color:var(--tree-tone);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-regular, 400);line-height:var(--sd-line-height-16, 16px)}.sd-sidebar-v4-menu-tree__status-dot{flex:none;width:6px;height:6px;border-radius:3px;background:var(--tree-tone)}.sd-sidebar-v4-menu-tree__status-dot--live{box-shadow:0 0 0 3px color-mix(in srgb,var(--tree-tone) 18%,transparent)}.sd-sidebar-v4-menu-tree__chip{padding:0 7px;border:1px solid var(--sd-border);border-radius:var(--sd-radius-999, 999px);color:var(--tree-muted-ink);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-18, 18px)}.sd-sidebar-v4-menu-tree__pin{position:absolute;top:50%;right:2px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;margin:0;padding:0;border:0;border-radius:var(--tree-radius, 999px);background:transparent;color:var(--tree-muted-ink);cursor:pointer;opacity:0;pointer-events:none;transform:translateY(-50%);transition:opacity var(--sd-duration-fast, .12s) ease,background-color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4-menu-tree__pin:hover{background:var(--tree-hover-bg)}.sd-sidebar-v4-menu-tree__pin:focus-visible{outline:none;box-shadow:var(--tree-focus-ring)}.sd-sidebar-v4-menu-tree__item:hover>.sd-sidebar-v4-menu-tree__pin,.sd-sidebar-v4-menu-tree__pin:focus-visible,.sd-sidebar-v4-menu-tree__item--shortcut>.sd-sidebar-v4-menu-tree__pin{opacity:1;pointer-events:auto}.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row{padding-right:40px}.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing,.sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing{visibility:hidden}.sd-sidebar-v4-menu-tree__row--shortcut{gap:var(--sd-space-8, 8px)}.sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row{padding-right:40px}.sd-sidebar-v4-menu-tree__shortcut-path{color:var(--tree-muted-ink);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-regular, 400)}.sd-sidebar-v4-menu-tree__results{display:flex;flex-direction:column}.sd-sidebar-v4-menu-tree__result{display:flex;flex-direction:column;justify-content:center;box-sizing:border-box;min-height:var(--tree-row-height, 36px);padding:6px var(--sd-space-12, 12px);border-radius:var(--sd-radius-16, 16px);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4-menu-tree__result:hover{background:var(--tree-hover-bg)}.sd-sidebar-v4-menu-tree__result--focused,.sd-sidebar-v4-menu-tree__result--focused:hover{background:var(--sd-surface);box-shadow:inset 0 0 0 2px var(--sd-primary)}.sd-sidebar-v4-menu-tree__result-title{color:var(--sd-text);font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);overflow-wrap:anywhere}.sd-sidebar-v4-menu-tree__match{border-radius:3px;background:var(--sd-primary-light);color:var(--sd-primary-dark);font-weight:var(--sd-font-weight-medium, 500)}.sd-sidebar-v4-menu-tree__result-path{margin-top:1px;color:var(--tree-muted-ink);font-size:11.5px;line-height:var(--sd-line-height-16, 16px);overflow-wrap:anywhere}.sd-sidebar-v4-menu-tree__empty{padding:var(--sd-space-16, 16px) var(--sd-space-12, 12px);color:var(--tree-muted-ink);font-size:var(--sd-font-size-13, 13px);overflow-wrap:anywhere}.sd-sidebar-v4-menu-tree__hint{padding:var(--sd-space-12, 12px) var(--sd-space-12, 12px) 0;color:var(--tree-muted-ink);font-size:11.5px;line-height:var(--sd-line-height-16, 16px)}.sd-sidebar-v4-menu-tree__rail{display:flex;flex-direction:column;align-items:center;gap:var(--sd-space-4, 4px)}.sd-sidebar-v4-menu-tree__rail-cell{position:relative;display:flex}.sd-sidebar-v4-menu-tree__rail-item{position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:48px;height:36px;margin:0;padding:0;border:0;border-radius:var(--tree-radius, 999px);background:transparent;color:var(--tree-muted-ink);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4-menu-tree__rail-item:hover,.sd-sidebar-v4-menu-tree__rail-item.sd-sidebar-v4-menu-tree__rail-item--open{background:var(--tree-hover-bg)}.sd-sidebar-v4-menu-tree__rail-item--active,.sd-sidebar-v4-menu-tree__rail-item--active:hover{background:var(--tree-active-bg);box-shadow:var(--tree-active-shadow);color:var(--tree-active-ink)}.sd-sidebar-v4-menu-tree__rail-item--disabled,.sd-sidebar-v4-menu-tree__rail-item--disabled:hover{background:transparent;color:var(--tree-disabled-ink);cursor:not-allowed}.sd-sidebar-v4-menu-tree__rail-item:focus-visible{outline:none;box-shadow:var(--tree-focus-ring)}.sd-sidebar-v4-menu-tree__rail-separator{flex:none;width:32px;height:1px;margin:5px 0;background:var(--tree-line)}.sd-sidebar-v4-menu-tree__rail-badge{position:absolute;top:0;right:2px;min-width:16px;height:16px;padding:0 4px;border-radius:var(--sd-radius-8, 8px);font-size:var(--sd-font-size-10, 10px);box-shadow:0 0 0 2px var(--tree-bg);pointer-events:none}.sd-sidebar-v4-menu-tree__rail-live{position:absolute;top:5px;right:9px;width:8px;height:8px;border-radius:var(--sd-radius-4, 4px);background:var(--tree-tone);box-shadow:0 0 0 2px var(--tree-bg);pointer-events:none}.sd-sidebar-v4-menu-tree__flyout{--tree-hover-bg: var(--sd-sidebar-v4-hover-bg, color-mix(in srgb, var(--sd-text) 6%, transparent));--tree-active-bg: var(--sd-sidebar-v4-active-bg, var(--sd-primary-light));--tree-active-ink: var(--sd-sidebar-v4-active-ink, var(--sd-primary));--tree-active-shadow: var(--sd-sidebar-v4-active-shadow, none);--tree-bg: var(--sd-sidebar-v4-bg, color-mix(in srgb, var(--sd-text) 4%, var(--sd-surface)));--tree-line: var(--sd-sidebar-v4-line, color-mix(in srgb, var(--sd-border) 45%, var(--sd-surface)));--tree-branch: color-mix(in srgb, var(--sd-border) 60%, var(--sd-surface));--tree-attention: var(--sd-sidebar-v4-attention, var(--sd-warning));--tree-live: var(--sd-sidebar-v4-live, var(--sd-success));--tree-muted-ink: var(--sd-text-secondary);--tree-disabled-ink: var(--sd-disabled-text, color-mix(in srgb, var(--sd-text) 60%, transparent));--tree-focus-ring: inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary));--tree-radius: var(--sd-sidebar-v4-item-radius, var(--sd-radius-999, 999px));--tree-row-height: var(--sd-sidebar-v4-item-height, 36px);--tree-child-height: var(--sd-sidebar-v4-child-height, 32px);box-sizing:border-box;width:232px;padding:var(--sd-space-8, 8px);border:1px solid var(--tree-line);border-radius:var(--sd-radius-16, 16px);background:var(--sd-surface);color:var(--sd-text);box-shadow:0 6px 24px color-mix(in srgb,var(--sd-text) 14%,transparent);animation:sd-sidebar-v4-flyout-in .14s ease-out}.sd-sidebar-v4-menu-tree__flyout:focus{outline:none}.sd-sidebar-v4-menu-tree__flyout-title{padding:6px var(--sd-space-12, 12px);font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-20, 20px)}.sd-sidebar-v4-menu-tree__flyout-heading{display:flex;align-items:center;gap:var(--sd-space-8, 8px);padding:6px var(--sd-space-12, 12px) 2px;color:var(--tree-muted-ink);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px)}.sd-sidebar-v4-menu-tree__flyout-heading--disabled{color:var(--tree-disabled-ink)}.sd-sidebar-v4-menu-tree__row--flyout{gap:var(--sd-space-8, 8px);height:32px;min-height:32px}@keyframes sd-sidebar-v4-flyout-in{0%{opacity:0;transform:translate(-4px)}}@media(pointer:coarse){.sd-sidebar-v4-menu-tree__row{min-height:max(44px,var(--tree-row-height, 36px))}.sd-sidebar-v4-menu-tree__row--child{min-height:max(44px,var(--tree-child-height, 32px))}.sd-sidebar-v4-menu-tree__result{min-height:max(44px,var(--tree-row-height, 36px))}.sd-sidebar-v4-menu-tree__row--flyout{height:auto;min-height:44px}.sd-sidebar-v4-menu-tree__rail-item{height:44px}.sd-sidebar-v4-menu-tree__pin{position:static;flex:0 0 44px;align-self:center;width:44px;height:44px;transform:none;opacity:1;pointer-events:auto}.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row{padding-right:var(--sd-space-12, 12px)}.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing,.sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing{visibility:visible}}@media(prefers-reduced-motion:reduce){.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__pin,.sd-sidebar-v4-menu-tree__result,.sd-sidebar-v4-menu-tree__rail-item{transition:none}.sd-sidebar-v4-menu-tree__flyout,.sd-sidebar-v4-menu-tree__item--nested{animation:none}}\n"] }]
3608
+ }], ctorParameters: () => [], propDecorators: { menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], pathSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "pathSource", required: false }] }], activePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "activePath", required: false }] }], presentation: [{ type: i0.Input, args: [{ isSignal: true, alias: "presentation", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], collapsedGroupKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedGroupKeys", required: false }] }, { type: i0.Output, args: ["collapsedGroupKeysChange"] }], pinnedKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinnedKeys", required: false }] }], showPin: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPin", required: false }] }], collapsedGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedGroup", required: false }] }], query: [{ type: i0.Input, args: [{ isSignal: true, alias: "query", required: false }] }], focusedIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusedIndex", required: false }] }], navigate: [{ type: i0.Output, args: ["navigate"] }], togglePinned: [{ type: i0.Output, args: ["togglePinned"] }], expandGroup: [{ type: i0.Output, args: ["expandGroup"] }] } });
3609
+ /** Parent path of every menu in the tree, keyed by object and by stable key (so equal menus from another array still resolve). */
3610
+ function collectParentPaths(menus) {
3611
+ const paths = new Map();
3612
+ const visit = (items, titles, section) => {
3613
+ for (const menu of items) {
3614
+ if (!menu || typeof menu !== 'object')
3615
+ continue;
3616
+ const path = titles.length ? titles.join(' / ') : section;
3617
+ if (!paths.has(menu))
3618
+ paths.set(menu, path);
3619
+ const key = getMenuStableKey(menu);
3620
+ if (key && !paths.has(key))
3621
+ paths.set(key, path);
3622
+ if ('children' in menu && Array.isArray(menu.children)) {
3623
+ const title = (menu.title ?? menu.tooltipTitle ?? '').trim();
3624
+ visit(menu.children, title ? [...titles, title] : titles, section);
3625
+ }
3626
+ }
3627
+ };
3628
+ for (const menu of menus ?? []) {
3629
+ if (!menu || typeof menu !== 'object')
3630
+ continue;
3631
+ visit([menu], [], typeof menu.section === 'string' ? menu.section.trim() : '');
3632
+ }
3633
+ return paths;
3634
+ }
3635
+ function lookupParentPath(paths, menu) {
3636
+ return paths.get(menu) ?? paths.get(getMenuStableKey(menu)) ?? '';
3637
+ }
3638
+ // Cùng bộ ký tự mà StringUtilities.changeAliasLowerCase thay bằng khoảng trắng.
3639
+ const PUNCTUATION = /[!@%^*()+=<>?/,.:;'"&#[\]~$_`\-{}|\\]/;
3640
+ const COMBINING_MARKS = /[\u0300-\u036f]/g;
3641
+ const D_STROKE = /\u0111/g;
3642
+ const WHITESPACE = /\s/;
3643
+ function foldCharacter(character) {
3644
+ if (PUNCTUATION.test(character))
3645
+ return ' ';
3646
+ return character.toLowerCase().normalize('NFD').replace(COMBINING_MARKS, '').replace(D_STROKE, 'd');
3647
+ }
3648
+ /** Folds like `aliasIncludes` (no case, no accents, punctuation as one space) and maps every folded character to its source index. */
3649
+ function foldText(text) {
3650
+ let folded = '';
3651
+ const sources = [];
3652
+ for (let index = 0; index < text.length; index++) {
3653
+ for (const character of foldCharacter(text[index])) {
3654
+ const isSpace = WHITESPACE.test(character);
3655
+ if (isSpace && (!folded || folded.endsWith(' ')))
3656
+ continue;
3657
+ folded += isSpace ? ' ' : character;
3658
+ sources.push(index);
3659
+ }
3660
+ }
3661
+ return { folded, sources };
3662
+ }
3663
+ /**
3664
+ * Splits `text` around the first accent-insensitive occurrence of `query`. The result is rendered through text
3665
+ * interpolation only, so neither the title nor the query can inject markup.
3666
+ */
3667
+ function highlightSegments(text, query) {
3668
+ const needle = foldText(query ?? '').folded.trim();
3669
+ if (!needle)
3670
+ return [{ text, match: false }];
3671
+ const { folded, sources } = foldText(text);
3672
+ const at = folded.indexOf(needle);
3673
+ if (at < 0)
3674
+ return [{ text, match: false }];
3675
+ const start = sources[at];
3676
+ let end = sources[at + needle.length - 1] + 1;
3677
+ // why: dấu tổ hợp (chuỗi NFD) đứng sau ký tự khớp cuối thuộc về ký tự đó — giữ trong phần highlight.
3678
+ while (end < text.length && !foldCharacter(text[end]))
3679
+ end++;
3680
+ return [
3681
+ { text: text.slice(0, start), match: false },
3682
+ { text: text.slice(start, end), match: true },
3683
+ { text: text.slice(end), match: false },
3684
+ ].filter(segment => !!segment.text);
3685
+ }
3686
+
3687
+ /**
3688
+ * Sidebar V4 desktop shell: a 280px drawer (72px rail when collapsed) with the brand header and Context Switcher,
3689
+ * a pill search (`Ctrl+K` / `⌘K`), Pinned and Recent shortcuts, the V4 menu tree and the account footer.
3690
+ * Routed content is projected into `<main>`.
3691
+ *
3692
+ * Routing, recent/pinned handling and the collapse preference behave like `sd-sidebar-v3`; the collapsed state is
3693
+ * stored in the same version 3 entry (D-004). Options are read only after `normalizeSidebarConfiguration` (INV-012);
3694
+ * `brandColor` / `brandLightColor` are ignored. Size tokens (`--sd-sidebar-v4-width`, `-rail-width`, `-item-height`,
3695
+ * `-child-height`, `-item-radius`) are declared on the host and follow `density`, `itemShape` and the pointer type.
3696
+ */
3697
+ class SdSidebarV4 {
3698
+ #router = inject(Router);
3699
+ #destroyRef = inject(DestroyRef);
3700
+ #changeDetector = inject(ChangeDetectorRef);
3701
+ #navigationState = inject(SdLayoutNavigationStateService);
3702
+ #document = inject(DOCUMENT);
3703
+ #applePlatform = isApplePlatform(this.#document.defaultView?.navigator);
3704
+ /** Requested result index; `focusedResultIndex` clamps it to the current results. */
3705
+ #focusRequest = signal(0, ...(ngDevMode ? [{ debugName: "#focusRequest" }] : []));
3706
+ #initialized = false;
3707
+ searchInput = viewChild('searchInput', ...(ngDevMode ? [{ debugName: "searchInput" }] : []));
3708
+ list = viewChild.required('list');
3709
+ mainTree = viewChild.required('mainTree');
3710
+ headerSwitcher = viewChild('headerSwitcher', ...(ngDevMode ? [{ debugName: "headerSwitcher" }] : []));
3711
+ menus = input([], ...(ngDevMode ? [{ debugName: "menus" }] : []));
3712
+ userInfo = input.required(...(ngDevMode ? [{ debugName: "userInfo" }] : []));
3713
+ sidebar = input.required(...(ngDevMode ? [{ debugName: "sidebar" }] : []));
3714
+ /** `sidebar()` with the V4 defaults filled by `normalizeSidebarConfiguration`, the only place they are resolved (INV-012). */
3715
+ configuration = computed(() => normalizeSidebarConfiguration(this.sidebar()), ...(ngDevMode ? [{ debugName: "configuration" }] : []));
3716
+ isCollapsed = signal(false, ...(ngDevMode ? [{ debugName: "isCollapsed" }] : []));
3717
+ collapsedGroupKeys = signal([], ...(ngDevMode ? [{ debugName: "collapsedGroupKeys" }] : []));
3718
+ searchText = signal('', ...(ngDevMode ? [{ debugName: "searchText" }] : []));
3719
+ activePath = signal(this.#router.url.split(/[?#]/, 1)[0] ?? '', ...(ngDevMode ? [{ debugName: "activePath" }] : []));
3720
+ /** Search results in the order the tree renders its options (accent-insensitive, without `comingSoon` items). */
3721
+ searchResults = computed(() => buildSidebarV4SearchResults(this.menus(), this.searchText()), ...(ngDevMode ? [{ debugName: "searchResults" }] : []));
3722
+ /** Index of the keyboard-selected result: the first one when results appear, -1 when there is none. */
3723
+ focusedResultIndex = computed(() => {
3724
+ const count = this.searchResults().length;
3725
+ return count ? Math.min(Math.max(this.#focusRequest(), 0), count - 1) : -1;
3726
+ }, ...(ngDevMode ? [{ debugName: "focusedResultIndex" }] : []));
3727
+ recentConfiguration = computed(() => this.configuration().recent, ...(ngDevMode ? [{ debugName: "recentConfiguration" }] : []));
3728
+ pinnedKeys = this.#navigationState.pinnedKeys;
3729
+ pinnedMenus = this.#navigationState.pinnedMenus;
3730
+ recentMenus = this.#navigationState.recentMenus;
3731
+ hasQuery = computed(() => !!this.searchText().trim(), ...(ngDevMode ? [{ debugName: "hasQuery" }] : []));
3732
+ title = computed(() => this.configuration().defaultTitle || 'Back Office', ...(ngDevMode ? [{ debugName: "title" }] : []));
3733
+ logoInitial = computed(() => Array.from(this.title().trim())[0]?.toLocaleUpperCase() ?? '', ...(ngDevMode ? [{ debugName: "logoInitial" }] : []));
3734
+ /** The hierarchy starts with items that have no section heading. */
3735
+ leadsWithUnsectioned = computed(() => groupMenusBySection(this.menus())[0]?.section === null, ...(ngDevMode ? [{ debugName: "leadsWithUnsectioned" }] : []));
3736
+ shortcutHint = this.#applePlatform ? '⌘K' : 'Ctrl K';
3737
+ shortcutKeys = this.#applePlatform ? 'Meta+K' : 'Control+K';
3738
+ /** The header Context Switcher popover is open; the whole header then takes the hover background (README CS1). */
3739
+ contextOpen = computed(() => this.headerSwitcher()?.isOpen() ?? false, ...(ngDevMode ? [{ debugName: "contextOpen" }] : []));
3740
+ constructor() {
3741
+ effect(() => {
3742
+ const menus = this.menus();
3743
+ const configuration = this.configuration();
3744
+ untracked(() => {
3745
+ this.#navigationState.hydrate(menus, configuration.recent.maxItems);
3746
+ if (this.#initialized)
3747
+ return;
3748
+ const persistedCollapsed = this.#navigationState.versionState(3).collapsed;
3749
+ this.isCollapsed.set(typeof persistedCollapsed === 'boolean' ? persistedCollapsed : configuration.defaultCollapsed);
3750
+ this.#initialized = true;
3751
+ });
3752
+ });
3753
+ this.#router.events.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(event => {
3754
+ if (event instanceof NavigationEnd)
3755
+ this.activePath.set(event.urlAfterRedirects.split(/[?#]/, 1)[0] ?? '');
3756
+ });
3757
+ effect(() => {
3758
+ const menus = this.menus();
3759
+ const activeMenuPath = resolveActiveMenuPath(menus, this.activePath());
3760
+ if (!activeMenuPath)
3761
+ return;
3762
+ const activeGroupKeys = new Set();
3763
+ const visit = (items, ancestors) => {
3764
+ for (const menu of items) {
3765
+ if (!('children' in menu) || !containsMenuPath(menu, activeMenuPath))
3766
+ continue;
3767
+ const key = getMenuStableKey(menu, ancestors);
3768
+ activeGroupKeys.add(key);
3769
+ visit(menu.children ?? [], [...ancestors, menu.title ?? key]);
3770
+ }
3771
+ };
3772
+ visit(menus, []);
3773
+ // why: Chỉ mở nhánh khi route/menu đổi; người dùng vẫn được đóng nhánh đang active.
3774
+ untracked(() => this.collapsedGroupKeys.update(keys => keys.filter(key => !activeGroupKeys.has(key))));
3775
+ });
3776
+ }
3777
+ /** Collapses or expands the drawer and stores the choice in the version 3 entry, like V3 (D-004). */
3778
+ toggleCollapsed() {
3779
+ this.#setCollapsed(!this.isCollapsed());
3780
+ }
3781
+ /** Expands a collapsed drawer, then moves focus to the menu search. */
3782
+ focusSearch() {
3783
+ if (this.isCollapsed()) {
3784
+ this.#setCollapsed(false);
3785
+ // why: ô search chỉ render khi drawer mở rộng — chạy change detection ngay để có phần tử mà focus.
3786
+ this.#changeDetector.detectChanges();
3787
+ }
3788
+ const field = this.searchInput()?.nativeElement;
3789
+ field?.focus();
3790
+ field?.select();
3791
+ }
3792
+ /** Collapsed rail: a leaf navigates; a group expands the drawer and opens that group, like V3. */
3793
+ activateCollapsedMenu(menu) {
3794
+ if ('path' in menu) {
3795
+ this.navigateMenu(menu);
3796
+ return;
3797
+ }
3798
+ const key = getMenuStableKey(menu);
3799
+ this.#setCollapsed(false);
3800
+ this.collapsedGroupKeys.update(keys => keys.filter(current => current !== key));
3801
+ }
3802
+ navigateMenu(menu) {
3803
+ if (!('path' in menu))
3804
+ return;
3805
+ this.#navigationState.recordRecent(menu, this.recentConfiguration());
3806
+ // why: `includes('http')` là substring test — `javascript:fetch(...)//http` lọt qua và chạy như
3807
+ // script trong origin của app. Parse URL thật rồi mới mở, kèm `noopener,noreferrer`.
3808
+ if (sdIsExternalHttpUrl(menu.path)) {
3809
+ sdOpenExternal(menu.path);
3810
+ return;
3811
+ }
3812
+ void this.#router.navigate([menu.path.split('?')[0]], {
3813
+ queryParams: menu.queryParams ?? {},
3814
+ state: { switchTab: true },
3815
+ });
3816
+ }
3817
+ onTogglePinned(menu) {
3818
+ this.#navigationState.togglePinned(menu);
3819
+ }
3820
+ onSearchInput(event) {
3821
+ const value = event.target.value;
3822
+ this.searchText.set(value);
3823
+ this.#focusRequest.set(0);
3824
+ // why: kết quả bắt đầu ở đầu list và kết quả đầu được chọn sẵn — bỏ vị trí cuộn cũ của cây để nó luôn thấy được.
3825
+ if (value.trim())
3826
+ this.list().nativeElement.scrollTop = 0;
3827
+ }
3828
+ clearSearch() {
3829
+ this.#clearQuery();
3830
+ this.searchInput()?.nativeElement.focus();
3831
+ }
3832
+ onSearchKeydown(event) {
3833
+ if (event.isComposing)
3834
+ return;
3835
+ switch (event.key) {
3836
+ case 'ArrowDown':
3837
+ case 'ArrowUp': {
3838
+ const count = this.searchResults().length;
3839
+ if (!count)
3840
+ return;
3841
+ event.preventDefault();
3842
+ const next = Math.min(Math.max(this.focusedResultIndex() + (event.key === 'ArrowDown' ? 1 : -1), 0), count - 1);
3843
+ this.#focusRequest.set(next);
3844
+ this.#revealResult(next);
3845
+ return;
3846
+ }
3847
+ case 'Enter': {
3848
+ const result = this.searchResults()[this.focusedResultIndex()];
3849
+ if (!result)
3850
+ return;
3851
+ event.preventDefault();
3852
+ this.navigateMenu(result.menu);
3853
+ return;
3854
+ }
3855
+ case 'Escape':
3856
+ if (!this.searchText())
3857
+ return;
3858
+ event.preventDefault();
3859
+ this.#clearQuery();
3860
+ }
3861
+ }
3862
+ onDocumentKeydown(event) {
3863
+ // why: phím tắt đã được phần khác xử lý (defaultPrevented) thì nhường; chỉ preventDefault khi V4 thật sự xử lý.
3864
+ if (event.defaultPrevented || !this.#isSearchShortcut(event) || this.#focusIsInOverlay())
3865
+ return;
3866
+ event.preventDefault();
3867
+ this.focusSearch();
3868
+ }
3869
+ /** Focus sits in a modal dialog or a CDK overlay (popover, flyout, menu); the shortcut must not pull it to the drawer behind. */
3870
+ #focusIsInOverlay() {
3871
+ return !!this.#document.activeElement?.closest('[aria-modal="true"], .cdk-overlay-container');
3872
+ }
3873
+ #revealResult(index) {
3874
+ // why: listbox cuộn trong nav — option được chọn phải luôn nằm trong vùng thấy được, nếu không Enter mở một mục người
3875
+ // dùng không thấy (WCAG 2.4.11). Option đã render sẵn nên cuộn ngay, không cần chờ render.
3876
+ this.#document.getElementById(this.mainTree().resultOptionId(index))?.scrollIntoView({ block: 'nearest' });
3877
+ }
3878
+ #isSearchShortcut(event) {
3879
+ // why: bàn phím không phải Latin (vd tiếng Nga) cho `key` khác 'k' — chỉ khi đó mới dựa vào phím vật lý KeyK; bố cục
3880
+ // Latin khác (Colemak, Dvorak) giữ nguyên chữ của nó, không chiếm Ctrl/⌘ + chữ đang nằm ở vị trí KeyK.
3881
+ const key = event.key ?? '';
3882
+ const isK = /^[a-z]$/i.test(key) ? key.toLowerCase() === 'k' : event.code === 'KeyK';
3883
+ if (!isK || event.altKey || event.shiftKey)
3884
+ return false;
3885
+ // why: Ctrl+K trên Mac là phím sửa dòng của ô nhập — chỉ nhận ⌘K ở đó, và Ctrl+K ở nền tảng khác.
3886
+ return this.#applePlatform ? event.metaKey && !event.ctrlKey : event.ctrlKey && !event.metaKey;
3887
+ }
3888
+ #clearQuery() {
3889
+ this.searchText.set('');
3890
+ this.#focusRequest.set(0);
3891
+ // why: cây hiện lại thay cho kết quả — bắt đầu từ đầu list thay vì giữ vị trí cuộn của danh sách kết quả.
3892
+ this.list().nativeElement.scrollTop = 0;
3893
+ }
3894
+ #setCollapsed(collapsed) {
3895
+ this.isCollapsed.set(collapsed);
3896
+ this.#navigationState.patchVersionState(3, { collapsed });
3897
+ }
3898
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarV4, deps: [], target: i0.ɵɵFactoryTarget.Component });
3899
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSidebarV4, isStandalone: true, selector: "sd-sidebar-v4", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "document:keydown": "onDocumentKeydown($event)" }, properties: { "class.sd-sidebar-v4--collapsed": "isCollapsed()", "class.sd-sidebar-v4--soft": "configuration().itemShape === \"soft\"", "class.sd-sidebar-v4--comfortable": "configuration().density === \"comfortable\"" }, classAttribute: "sd-sidebar-v4" }, viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "list", first: true, predicate: ["list"], descendants: true, isSignal: true }, { propertyName: "mainTree", first: true, predicate: ["mainTree"], descendants: true, isSignal: true }, { propertyName: "headerSwitcher", first: true, predicate: ["headerSwitcher"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _collapsed = isCollapsed();\n@let _configuration = configuration();\n@let _query = searchText();\n@let _hasQuery = hasQuery();\n@let _focused = focusedResultIndex();\n@let _hasResults = _focused >= 0;\n@let _pinned = pinnedMenus();\n@let _recent = recentMenus();\n@let _showShortcuts = !_collapsed && !_hasQuery;\n@let _showPinned = _showShortcuts && _pinned.length > 0;\n@let _showRecent = _showShortcuts && recentConfiguration().enabled && _recent.length > 0;\n@let _toggleLabel = (_collapsed ? 'core.module.layout.sidebar.expand' : 'core.module.layout.sidebar.collapse') | sdTranslate;\n@let _searchLabel = 'core.module.layout.sidebar.v4-search-placeholder' | sdTranslate;\n<aside #asideElement data-v4-sidebar class=\"sd-sidebar-v4__drawer\" [attr.data-collapsed]=\"_collapsed\">\n <header\n #headerElement\n data-v4-header\n class=\"sd-sidebar-v4__header\"\n [class.sd-sidebar-v4__header--context-open]=\"!_collapsed && contextOpen()\">\n <span data-v4-logo class=\"sd-sidebar-v4__logo\" [class.sd-sidebar-v4__logo--image]=\"!!_configuration.logoUrl\" aria-hidden=\"true\">\n @if (_configuration.logoUrl) {\n <img [src]=\"_configuration.logoUrl\" alt=\"\" />\n } @else {\n {{ logoInitial() }}\n }\n </span>\n @if (!_collapsed) {\n <div data-v4-brand class=\"sd-sidebar-v4__brand\">\n <span data-v4-title class=\"sd-sidebar-v4__title\">{{ title() }}</span>\n @if (_configuration.context) {\n <sd-layout-context-switcher\n #headerSwitcher\n appearance=\"header\"\n [configuration]=\"_configuration.context\"\n [anchor]=\"headerElement\" />\n }\n </div>\n } @else if (_configuration.context) {\n <sd-layout-context-switcher\n class=\"sd-sidebar-v4__rail-context\"\n appearance=\"rail\"\n [configuration]=\"_configuration.context\"\n [anchor]=\"asideElement\" />\n }\n <!-- The same button stays mounted in both modes so focus survives a toggle. -->\n <button\n type=\"button\"\n data-v4-toggle\n class=\"sd-sidebar-v4__icon-button\"\n [attr.aria-label]=\"_toggleLabel\"\n [attr.aria-expanded]=\"!_collapsed\"\n [attr.title]=\"_toggleLabel\"\n (click)=\"toggleCollapsed()\">\n <sd-icon [name]=\"_collapsed ? 'menu' : 'menu_open'\" size=\"20px\"></sd-icon>\n </button>\n @if (_collapsed) {\n <button\n type=\"button\"\n data-v4-rail-search\n class=\"sd-sidebar-v4__icon-button\"\n [attr.aria-label]=\"_searchLabel\"\n [attr.title]=\"_searchLabel\"\n (click)=\"focusSearch()\">\n <sd-icon name=\"search\" size=\"20px\"></sd-icon>\n </button>\n }\n </header>\n\n @if (!_collapsed) {\n <div data-v4-search class=\"sd-sidebar-v4__search\">\n <div data-v4-search-field class=\"sd-sidebar-v4__search-field\" [class.sd-sidebar-v4__search-field--filled]=\"!!_query\">\n <sd-icon class=\"sd-sidebar-v4__search-icon\" name=\"search\" size=\"20px\" aria-hidden=\"true\"></sd-icon>\n <input\n #searchInput\n data-v4-search-input\n class=\"sd-sidebar-v4__search-input\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n [attr.aria-label]=\"_searchLabel\"\n [attr.placeholder]=\"_searchLabel\"\n [attr.aria-keyshortcuts]=\"shortcutKeys\"\n [attr.aria-expanded]=\"_hasResults\"\n [attr.aria-controls]=\"_hasResults ? mainTree.resultsId : null\"\n [attr.aria-activedescendant]=\"_hasResults ? mainTree.resultOptionId(_focused) : null\"\n [value]=\"_query\"\n (input)=\"onSearchInput($event)\"\n (keydown)=\"onSearchKeydown($event)\" />\n @if (_query) {\n <button\n type=\"button\"\n data-v4-search-clear\n class=\"sd-sidebar-v4__search-clear\"\n [attr.aria-label]=\"'core.module.layout.sidebar.clear-search' | sdTranslate\"\n (click)=\"clearSearch()\">\n <sd-icon name=\"close\" size=\"18px\"></sd-icon>\n </button>\n } @else {\n <kbd data-v4-search-shortcut class=\"sd-sidebar-v4__search-shortcut\" aria-hidden=\"true\">{{ shortcutHint }}</kbd>\n }\n </div>\n </div>\n }\n\n <nav #list data-v4-nav class=\"sd-sidebar-v4__list\" [attr.aria-label]=\"'core.module.layout.sidebar.primary-nav' | sdTranslate\">\n @if (_showPinned) {\n <section data-v4-pinned class=\"sd-sidebar-v4__shortcuts\">\n <h2 class=\"sd-sidebar-v4__section-label\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-sidebar-v4-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"_pinned\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\" />\n </section>\n }\n @if (_showRecent) {\n <section data-v4-recent class=\"sd-sidebar-v4__shortcuts\">\n <h2 class=\"sd-sidebar-v4__section-label\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-sidebar-v4-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"_recent\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\" />\n </section>\n }\n <!-- One tree instance for hierarchy, results and rail: its live region must stay mounted to announce result counts. -->\n <sd-sidebar-v4-menu-tree\n #mainTree\n data-v4-tree\n [class.sd-sidebar-v4__tree--separated]=\"(_showPinned || _showRecent) && leadsWithUnsectioned()\"\n [menus]=\"menus()\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [presentation]=\"_hasQuery && !_collapsed ? 'results' : 'hierarchy'\"\n [mode]=\"_collapsed ? 'collapsed' : 'expanded'\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [pinnedKeys]=\"pinnedKeys()\"\n [collapsedGroup]=\"_configuration.collapsedGroup\"\n [query]=\"_query\"\n [focusedIndex]=\"_focused\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\"\n (expandGroup)=\"activateCollapsedMenu($event)\" />\n </nav>\n\n <div data-v4-footer class=\"sd-sidebar-v4__footer\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"_collapsed\"></sd-layout-user-menu>\n </div>\n</aside>\n\n<main data-v4-content class=\"sd-sidebar-v4__content\">\n <ng-content></ng-content>\n</main>\n", styles: [":host{--sd-sidebar-v4-width: 280px;--sd-sidebar-v4-rail-width: 72px;--sd-sidebar-v4-item-height: 36px;--sd-sidebar-v4-child-height: 32px;--sd-sidebar-v4-item-radius: 999px;--sd-layout-context-switcher-popover-width: calc(var(--sd-sidebar-v4-width) - 24px);--sidebar-bg: var(--sd-sidebar-v4-bg, color-mix(in srgb, var(--sd-text) 4%, var(--sd-surface)));--sd-layout-context-switcher-dot-ring-color: var(--sidebar-bg);--sidebar-line: var(--sd-sidebar-v4-line, color-mix(in srgb, var(--sd-border) 45%, var(--sd-surface)));--sidebar-hover-bg: var(--sd-sidebar-v4-hover-bg, color-mix(in srgb, var(--sd-text) 6%, transparent));--sidebar-muted-ink: var(--sd-text-secondary);--sidebar-focus-ring: inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary));display:block;min-height:100vh}:host(.sd-sidebar-v4--comfortable){--sd-sidebar-v4-item-height: 40px;--sd-sidebar-v4-child-height: 34px}:host(.sd-sidebar-v4--soft){--sd-sidebar-v4-item-radius: 8px}.sd-sidebar-v4__drawer{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 0;display:flex;flex-direction:column;box-sizing:border-box;width:var(--sd-sidebar-v4-width);border-right:1px solid var(--sidebar-line);background:var(--sidebar-bg);color:var(--sd-text);transition:width .16s ease}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__drawer{width:var(--sd-sidebar-v4-rail-width)}.sd-sidebar-v4__content{min-height:100vh;margin-left:var(--sd-sidebar-v4-width);transition:margin-left .16s ease}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__content{margin-left:var(--sd-sidebar-v4-rail-width)}.sd-sidebar-v4__header{display:flex;flex:none;align-items:center;gap:var(--sd-space-12, 12px);box-sizing:border-box;height:64px;padding:0 12px 0 16px}.sd-sidebar-v4__header--context-open{border-radius:var(--sd-radius-12, 12px);background:var(--sidebar-hover-bg)}.sd-sidebar-v4__header--context-open ::ng-deep .sd-layout-context-switcher__trigger.sd-layout-context-switcher__trigger--header{background:transparent}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__header{flex-direction:column;gap:0;height:auto;padding:18px 0 6px}.sd-sidebar-v4__logo{display:inline-flex;flex:none;align-items:center;justify-content:center;overflow:hidden;width:28px;height:28px;border-radius:var(--sd-radius-8, 8px);background:var(--sd-primary);color:var(--sd-primary-contrast);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-bold, 700);line-height:1}.sd-sidebar-v4__logo img{width:100%;height:100%;object-fit:contain}.sd-sidebar-v4__logo--image{background:transparent}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__logo{margin-bottom:18px}.sd-sidebar-v4__rail-context:not(:empty){margin:-6px 0 12px}.sd-sidebar-v4__brand{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.sd-sidebar-v4__title{overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px;text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-v4__icon-button,.sd-sidebar-v4__search-clear{display:inline-flex;flex:none;align-items:center;justify-content:center;box-sizing:border-box;margin:0;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sidebar-muted-ink);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4__icon-button:hover,.sd-sidebar-v4__search-clear:hover{background:var(--sidebar-hover-bg)}.sd-sidebar-v4__icon-button:focus-visible,.sd-sidebar-v4__search-clear:focus-visible{outline:none;box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-v4__icon-button{width:40px;height:40px}.sd-sidebar-v4__search{flex:none;padding:0 12px 6px}.sd-sidebar-v4__search-field{display:flex;align-items:center;gap:var(--sd-space-8, 8px);box-sizing:border-box;height:36px;padding:0 8px 0 12px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-surface);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--sd-border) 50%,var(--sd-surface));color:var(--sidebar-muted-ink)}.sd-sidebar-v4__search-field:focus-within{box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-v4__search-field--filled,.sd-sidebar-v4__search-field--filled:focus-within{box-shadow:inset 0 0 0 2px var(--sd-primary)}.sd-sidebar-v4__search-icon{flex:none}.sd-sidebar-v4__search-input{flex:1 1 auto;min-width:0;height:100%;margin:0;padding:0;border:0;outline:0;background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-13, 13px)}.sd-sidebar-v4__search-input::placeholder{color:var(--sidebar-muted-ink);opacity:1}.sd-sidebar-v4__search-clear{width:28px;height:28px}.sd-sidebar-v4__search-shortcut{flex:none;padding:1px 5px;border:1px solid color-mix(in srgb,var(--sd-border) 70%,var(--sd-surface));border-radius:var(--sd-radius-6, 6px);background:var(--sd-surface);color:var(--sidebar-muted-ink);font-family:Roboto Mono,ui-monospace,monospace;font-size:var(--sd-font-size-11, 11px);line-height:var(--sd-line-height-16, 16px);white-space:nowrap}.sd-sidebar-v4__list{flex:1 1 auto;min-height:0;box-sizing:border-box;padding:0 12px 12px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__list{padding:0 0 12px}.sd-sidebar-v4__section-label{margin:0;padding:14px 12px 4px;color:var(--sidebar-muted-ink);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px}.sd-sidebar-v4__tree--separated{margin-top:var(--sd-space-16, 16px)}.sd-sidebar-v4__footer{flex:none;box-sizing:border-box;padding:12px 8px 12px 16px;border-top:1px solid var(--sidebar-line)}:host(:not(.sd-sidebar-v4--collapsed)) .sd-sidebar-v4__footer ::ng-deep .sd-layout-user-menu__popup{box-sizing:border-box;left:-4px;width:calc(var(--sd-sidebar-v4-width) - 24px)}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__footer{display:flex;justify-content:center;padding:6px 0}@media(pointer:coarse){:host,:host(.sd-sidebar-v4--comfortable){--sd-sidebar-v4-item-height: 44px;--sd-sidebar-v4-child-height: 44px}.sd-sidebar-v4__icon-button,.sd-sidebar-v4__search-clear{width:44px;height:44px}.sd-sidebar-v4__search-field{height:44px;padding-right:0}.sd-sidebar-v4__search-shortcut{display:none}}@media(prefers-reduced-motion:reduce){.sd-sidebar-v4__drawer,.sd-sidebar-v4__content,.sd-sidebar-v4__icon-button,.sd-sidebar-v4__search-clear{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutContextSwitcher, selector: "sd-layout-context-switcher", inputs: ["configuration", "appearance", "placement", "anchor"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "component", type: SdSidebarV4MenuTree, selector: "sd-sidebar-v4-menu-tree", inputs: ["menus", "pathSource", "activePath", "presentation", "mode", "collapsedGroupKeys", "pinnedKeys", "showPin", "collapsedGroup", "query", "focusedIndex"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned", "expandGroup"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3900
+ }
3901
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarV4, decorators: [{
3902
+ type: Component,
3903
+ args: [{ selector: 'sd-sidebar-v4', standalone: true, imports: [SdIcon, SdLayoutContextSwitcher, SdLayoutUserMenuComponent, SdSidebarV4MenuTree, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
3904
+ class: 'sd-sidebar-v4',
3905
+ '[class.sd-sidebar-v4--collapsed]': 'isCollapsed()',
3906
+ '[class.sd-sidebar-v4--soft]': 'configuration().itemShape === "soft"',
3907
+ '[class.sd-sidebar-v4--comfortable]': 'configuration().density === "comfortable"',
3908
+ '(document:keydown)': 'onDocumentKeydown($event)',
3909
+ }, template: "@let _collapsed = isCollapsed();\n@let _configuration = configuration();\n@let _query = searchText();\n@let _hasQuery = hasQuery();\n@let _focused = focusedResultIndex();\n@let _hasResults = _focused >= 0;\n@let _pinned = pinnedMenus();\n@let _recent = recentMenus();\n@let _showShortcuts = !_collapsed && !_hasQuery;\n@let _showPinned = _showShortcuts && _pinned.length > 0;\n@let _showRecent = _showShortcuts && recentConfiguration().enabled && _recent.length > 0;\n@let _toggleLabel = (_collapsed ? 'core.module.layout.sidebar.expand' : 'core.module.layout.sidebar.collapse') | sdTranslate;\n@let _searchLabel = 'core.module.layout.sidebar.v4-search-placeholder' | sdTranslate;\n<aside #asideElement data-v4-sidebar class=\"sd-sidebar-v4__drawer\" [attr.data-collapsed]=\"_collapsed\">\n <header\n #headerElement\n data-v4-header\n class=\"sd-sidebar-v4__header\"\n [class.sd-sidebar-v4__header--context-open]=\"!_collapsed && contextOpen()\">\n <span data-v4-logo class=\"sd-sidebar-v4__logo\" [class.sd-sidebar-v4__logo--image]=\"!!_configuration.logoUrl\" aria-hidden=\"true\">\n @if (_configuration.logoUrl) {\n <img [src]=\"_configuration.logoUrl\" alt=\"\" />\n } @else {\n {{ logoInitial() }}\n }\n </span>\n @if (!_collapsed) {\n <div data-v4-brand class=\"sd-sidebar-v4__brand\">\n <span data-v4-title class=\"sd-sidebar-v4__title\">{{ title() }}</span>\n @if (_configuration.context) {\n <sd-layout-context-switcher\n #headerSwitcher\n appearance=\"header\"\n [configuration]=\"_configuration.context\"\n [anchor]=\"headerElement\" />\n }\n </div>\n } @else if (_configuration.context) {\n <sd-layout-context-switcher\n class=\"sd-sidebar-v4__rail-context\"\n appearance=\"rail\"\n [configuration]=\"_configuration.context\"\n [anchor]=\"asideElement\" />\n }\n <!-- The same button stays mounted in both modes so focus survives a toggle. -->\n <button\n type=\"button\"\n data-v4-toggle\n class=\"sd-sidebar-v4__icon-button\"\n [attr.aria-label]=\"_toggleLabel\"\n [attr.aria-expanded]=\"!_collapsed\"\n [attr.title]=\"_toggleLabel\"\n (click)=\"toggleCollapsed()\">\n <sd-icon [name]=\"_collapsed ? 'menu' : 'menu_open'\" size=\"20px\"></sd-icon>\n </button>\n @if (_collapsed) {\n <button\n type=\"button\"\n data-v4-rail-search\n class=\"sd-sidebar-v4__icon-button\"\n [attr.aria-label]=\"_searchLabel\"\n [attr.title]=\"_searchLabel\"\n (click)=\"focusSearch()\">\n <sd-icon name=\"search\" size=\"20px\"></sd-icon>\n </button>\n }\n </header>\n\n @if (!_collapsed) {\n <div data-v4-search class=\"sd-sidebar-v4__search\">\n <div data-v4-search-field class=\"sd-sidebar-v4__search-field\" [class.sd-sidebar-v4__search-field--filled]=\"!!_query\">\n <sd-icon class=\"sd-sidebar-v4__search-icon\" name=\"search\" size=\"20px\" aria-hidden=\"true\"></sd-icon>\n <input\n #searchInput\n data-v4-search-input\n class=\"sd-sidebar-v4__search-input\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n [attr.aria-label]=\"_searchLabel\"\n [attr.placeholder]=\"_searchLabel\"\n [attr.aria-keyshortcuts]=\"shortcutKeys\"\n [attr.aria-expanded]=\"_hasResults\"\n [attr.aria-controls]=\"_hasResults ? mainTree.resultsId : null\"\n [attr.aria-activedescendant]=\"_hasResults ? mainTree.resultOptionId(_focused) : null\"\n [value]=\"_query\"\n (input)=\"onSearchInput($event)\"\n (keydown)=\"onSearchKeydown($event)\" />\n @if (_query) {\n <button\n type=\"button\"\n data-v4-search-clear\n class=\"sd-sidebar-v4__search-clear\"\n [attr.aria-label]=\"'core.module.layout.sidebar.clear-search' | sdTranslate\"\n (click)=\"clearSearch()\">\n <sd-icon name=\"close\" size=\"18px\"></sd-icon>\n </button>\n } @else {\n <kbd data-v4-search-shortcut class=\"sd-sidebar-v4__search-shortcut\" aria-hidden=\"true\">{{ shortcutHint }}</kbd>\n }\n </div>\n </div>\n }\n\n <nav #list data-v4-nav class=\"sd-sidebar-v4__list\" [attr.aria-label]=\"'core.module.layout.sidebar.primary-nav' | sdTranslate\">\n @if (_showPinned) {\n <section data-v4-pinned class=\"sd-sidebar-v4__shortcuts\">\n <h2 class=\"sd-sidebar-v4__section-label\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-sidebar-v4-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"_pinned\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\" />\n </section>\n }\n @if (_showRecent) {\n <section data-v4-recent class=\"sd-sidebar-v4__shortcuts\">\n <h2 class=\"sd-sidebar-v4__section-label\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-sidebar-v4-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"_recent\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\" />\n </section>\n }\n <!-- One tree instance for hierarchy, results and rail: its live region must stay mounted to announce result counts. -->\n <sd-sidebar-v4-menu-tree\n #mainTree\n data-v4-tree\n [class.sd-sidebar-v4__tree--separated]=\"(_showPinned || _showRecent) && leadsWithUnsectioned()\"\n [menus]=\"menus()\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [presentation]=\"_hasQuery && !_collapsed ? 'results' : 'hierarchy'\"\n [mode]=\"_collapsed ? 'collapsed' : 'expanded'\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [pinnedKeys]=\"pinnedKeys()\"\n [collapsedGroup]=\"_configuration.collapsedGroup\"\n [query]=\"_query\"\n [focusedIndex]=\"_focused\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\"\n (expandGroup)=\"activateCollapsedMenu($event)\" />\n </nav>\n\n <div data-v4-footer class=\"sd-sidebar-v4__footer\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"_collapsed\"></sd-layout-user-menu>\n </div>\n</aside>\n\n<main data-v4-content class=\"sd-sidebar-v4__content\">\n <ng-content></ng-content>\n</main>\n", styles: [":host{--sd-sidebar-v4-width: 280px;--sd-sidebar-v4-rail-width: 72px;--sd-sidebar-v4-item-height: 36px;--sd-sidebar-v4-child-height: 32px;--sd-sidebar-v4-item-radius: 999px;--sd-layout-context-switcher-popover-width: calc(var(--sd-sidebar-v4-width) - 24px);--sidebar-bg: var(--sd-sidebar-v4-bg, color-mix(in srgb, var(--sd-text) 4%, var(--sd-surface)));--sd-layout-context-switcher-dot-ring-color: var(--sidebar-bg);--sidebar-line: var(--sd-sidebar-v4-line, color-mix(in srgb, var(--sd-border) 45%, var(--sd-surface)));--sidebar-hover-bg: var(--sd-sidebar-v4-hover-bg, color-mix(in srgb, var(--sd-text) 6%, transparent));--sidebar-muted-ink: var(--sd-text-secondary);--sidebar-focus-ring: inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary));display:block;min-height:100vh}:host(.sd-sidebar-v4--comfortable){--sd-sidebar-v4-item-height: 40px;--sd-sidebar-v4-child-height: 34px}:host(.sd-sidebar-v4--soft){--sd-sidebar-v4-item-radius: 8px}.sd-sidebar-v4__drawer{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 0;display:flex;flex-direction:column;box-sizing:border-box;width:var(--sd-sidebar-v4-width);border-right:1px solid var(--sidebar-line);background:var(--sidebar-bg);color:var(--sd-text);transition:width .16s ease}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__drawer{width:var(--sd-sidebar-v4-rail-width)}.sd-sidebar-v4__content{min-height:100vh;margin-left:var(--sd-sidebar-v4-width);transition:margin-left .16s ease}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__content{margin-left:var(--sd-sidebar-v4-rail-width)}.sd-sidebar-v4__header{display:flex;flex:none;align-items:center;gap:var(--sd-space-12, 12px);box-sizing:border-box;height:64px;padding:0 12px 0 16px}.sd-sidebar-v4__header--context-open{border-radius:var(--sd-radius-12, 12px);background:var(--sidebar-hover-bg)}.sd-sidebar-v4__header--context-open ::ng-deep .sd-layout-context-switcher__trigger.sd-layout-context-switcher__trigger--header{background:transparent}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__header{flex-direction:column;gap:0;height:auto;padding:18px 0 6px}.sd-sidebar-v4__logo{display:inline-flex;flex:none;align-items:center;justify-content:center;overflow:hidden;width:28px;height:28px;border-radius:var(--sd-radius-8, 8px);background:var(--sd-primary);color:var(--sd-primary-contrast);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-bold, 700);line-height:1}.sd-sidebar-v4__logo img{width:100%;height:100%;object-fit:contain}.sd-sidebar-v4__logo--image{background:transparent}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__logo{margin-bottom:18px}.sd-sidebar-v4__rail-context:not(:empty){margin:-6px 0 12px}.sd-sidebar-v4__brand{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.sd-sidebar-v4__title{overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px;text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-v4__icon-button,.sd-sidebar-v4__search-clear{display:inline-flex;flex:none;align-items:center;justify-content:center;box-sizing:border-box;margin:0;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sidebar-muted-ink);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4__icon-button:hover,.sd-sidebar-v4__search-clear:hover{background:var(--sidebar-hover-bg)}.sd-sidebar-v4__icon-button:focus-visible,.sd-sidebar-v4__search-clear:focus-visible{outline:none;box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-v4__icon-button{width:40px;height:40px}.sd-sidebar-v4__search{flex:none;padding:0 12px 6px}.sd-sidebar-v4__search-field{display:flex;align-items:center;gap:var(--sd-space-8, 8px);box-sizing:border-box;height:36px;padding:0 8px 0 12px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-surface);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--sd-border) 50%,var(--sd-surface));color:var(--sidebar-muted-ink)}.sd-sidebar-v4__search-field:focus-within{box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-v4__search-field--filled,.sd-sidebar-v4__search-field--filled:focus-within{box-shadow:inset 0 0 0 2px var(--sd-primary)}.sd-sidebar-v4__search-icon{flex:none}.sd-sidebar-v4__search-input{flex:1 1 auto;min-width:0;height:100%;margin:0;padding:0;border:0;outline:0;background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-13, 13px)}.sd-sidebar-v4__search-input::placeholder{color:var(--sidebar-muted-ink);opacity:1}.sd-sidebar-v4__search-clear{width:28px;height:28px}.sd-sidebar-v4__search-shortcut{flex:none;padding:1px 5px;border:1px solid color-mix(in srgb,var(--sd-border) 70%,var(--sd-surface));border-radius:var(--sd-radius-6, 6px);background:var(--sd-surface);color:var(--sidebar-muted-ink);font-family:Roboto Mono,ui-monospace,monospace;font-size:var(--sd-font-size-11, 11px);line-height:var(--sd-line-height-16, 16px);white-space:nowrap}.sd-sidebar-v4__list{flex:1 1 auto;min-height:0;box-sizing:border-box;padding:0 12px 12px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__list{padding:0 0 12px}.sd-sidebar-v4__section-label{margin:0;padding:14px 12px 4px;color:var(--sidebar-muted-ink);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px}.sd-sidebar-v4__tree--separated{margin-top:var(--sd-space-16, 16px)}.sd-sidebar-v4__footer{flex:none;box-sizing:border-box;padding:12px 8px 12px 16px;border-top:1px solid var(--sidebar-line)}:host(:not(.sd-sidebar-v4--collapsed)) .sd-sidebar-v4__footer ::ng-deep .sd-layout-user-menu__popup{box-sizing:border-box;left:-4px;width:calc(var(--sd-sidebar-v4-width) - 24px)}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__footer{display:flex;justify-content:center;padding:6px 0}@media(pointer:coarse){:host,:host(.sd-sidebar-v4--comfortable){--sd-sidebar-v4-item-height: 44px;--sd-sidebar-v4-child-height: 44px}.sd-sidebar-v4__icon-button,.sd-sidebar-v4__search-clear{width:44px;height:44px}.sd-sidebar-v4__search-field{height:44px;padding-right:0}.sd-sidebar-v4__search-shortcut{display:none}}@media(prefers-reduced-motion:reduce){.sd-sidebar-v4__drawer,.sd-sidebar-v4__content,.sd-sidebar-v4__icon-button,.sd-sidebar-v4__search-clear{transition:none}}\n"] }]
3910
+ }], ctorParameters: () => [], propDecorators: { searchInput: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], list: [{ type: i0.ViewChild, args: ['list', { isSignal: true }] }], mainTree: [{ type: i0.ViewChild, args: ['mainTree', { isSignal: true }] }], headerSwitcher: [{ type: i0.ViewChild, args: ['headerSwitcher', { isSignal: true }] }], menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }] } });
3911
+ function isApplePlatform(navigator) {
3912
+ const userAgentData = navigator?.userAgentData;
3913
+ return /mac|iphone|ipad|ipod/i.test(userAgentData?.platform || navigator?.platform || '');
3914
+ }
3915
+
3916
+ let nextMobileV4Id = 0;
3917
+ /**
3918
+ * Sidebar V4 mobile shell (README M1–M3): a 56px app bar, a `min(88vw, 360px)` modal drawer that hosts the V4 menu tree in
3919
+ * `mobile` mode (44px rows, combobox search, Pinned/Recent, account footer, Context Switcher bottom sheet) and an opt-in
3920
+ * bottom bar built from `mobile.bottomBar` (at most 4 menu ids plus "More"). Routed content is projected into `<main>`.
3921
+ *
3922
+ * Navigation, pinned and recent behave like `sd-sidebar-v4`. Every way of closing the drawer (backdrop, Escape, menu
3923
+ * selection, including the page already open) clears the search and returns focus to the control that opened it (INV-011).
3924
+ * Options are read only after `normalizeSidebarConfiguration` (INV-012). Mobile has no rail, so the collapse preference is
3925
+ * never read or written. With `context` configured, `context.items` reach `SdLayoutContextService.syncItems()` on init,
3926
+ * before the drawer and its switcher first render; without it the context service is never created.
3927
+ */
3928
+ class SdSidebarMobileV4 {
3929
+ #router = inject(Router);
3930
+ #document = inject(DOCUMENT);
3931
+ #destroyRef = inject(DestroyRef);
3932
+ #injector = inject(Injector);
3933
+ #navigationState = inject(SdLayoutNavigationStateService);
3934
+ #id = `sd-sidebar-mobile-v4-${nextMobileV4Id++}`;
3935
+ /** Requested result index; `focusedResultIndex` clamps it to the current results. */
3936
+ #focusRequest = signal(0, ...(ngDevMode ? [{ debugName: "#focusRequest" }] : []));
3937
+ #restoreFocusElement = null;
3938
+ #previousBodyOverflow = '';
3939
+ trigger = viewChild('trigger', ...(ngDevMode ? [{ debugName: "trigger" }] : []));
3940
+ searchInput = viewChild('searchInput', ...(ngDevMode ? [{ debugName: "searchInput" }] : []));
3941
+ list = viewChild('list', ...(ngDevMode ? [{ debugName: "list" }] : []));
3942
+ mainTree = viewChild('mainTree', ...(ngDevMode ? [{ debugName: "mainTree" }] : []));
3943
+ menus = input([], ...(ngDevMode ? [{ debugName: "menus" }] : []));
3944
+ userInfo = input.required(...(ngDevMode ? [{ debugName: "userInfo" }] : []));
3945
+ sidebar = input.required(...(ngDevMode ? [{ debugName: "sidebar" }] : []));
3946
+ /** `sidebar()` with the V4 defaults filled by `normalizeSidebarConfiguration`, the only place they are resolved (INV-012). */
3947
+ configuration = computed(() => normalizeSidebarConfiguration(this.sidebar()), ...(ngDevMode ? [{ debugName: "configuration" }] : []));
3948
+ isDrawerOpen = signal(false, ...(ngDevMode ? [{ debugName: "isDrawerOpen" }] : []));
3949
+ searchText = signal('', ...(ngDevMode ? [{ debugName: "searchText" }] : []));
3950
+ activePath = signal(this.#router.url.split(/[?#]/, 1)[0] ?? '', ...(ngDevMode ? [{ debugName: "activePath" }] : []));
3951
+ collapsedGroupKeys = signal([], ...(ngDevMode ? [{ debugName: "collapsedGroupKeys" }] : []));
3952
+ /** The drawer was opened from the app-bar search button: its search input takes the initial focus. */
3953
+ focusSearchOnOpen = signal(false, ...(ngDevMode ? [{ debugName: "focusSearchOnOpen" }] : []));
3954
+ /** Search results in the order the tree renders its options (accent-insensitive, without `comingSoon` items). */
3955
+ searchResults = computed(() => buildSidebarV4SearchResults(this.menus(), this.searchText()), ...(ngDevMode ? [{ debugName: "searchResults" }] : []));
3956
+ /** Index of the keyboard-selected result: the first one when results appear, -1 when there is none. */
3957
+ focusedResultIndex = computed(() => {
3958
+ const count = this.searchResults().length;
3959
+ return count ? Math.min(Math.max(this.#focusRequest(), 0), count - 1) : -1;
3960
+ }, ...(ngDevMode ? [{ debugName: "focusedResultIndex" }] : []));
3961
+ recentConfiguration = computed(() => this.configuration().recent, ...(ngDevMode ? [{ debugName: "recentConfiguration" }] : []));
3962
+ pinnedKeys = this.#navigationState.pinnedKeys;
3963
+ pinnedMenus = this.#navigationState.pinnedMenus;
3964
+ recentMenus = this.#navigationState.recentMenus;
3965
+ titleId = `${this.#id}-title`;
3966
+ hasQuery = computed(() => !!this.searchText().trim(), ...(ngDevMode ? [{ debugName: "hasQuery" }] : []));
3967
+ title = computed(() => this.configuration().defaultTitle || 'Back Office', ...(ngDevMode ? [{ debugName: "title" }] : []));
3968
+ logoInitial = computed(() => Array.from(this.title().trim())[0]?.toLocaleUpperCase() ?? '', ...(ngDevMode ? [{ debugName: "logoInitial" }] : []));
3969
+ /** The hierarchy starts with items that have no section heading. */
3970
+ leadsWithUnsectioned = computed(() => groupMenusBySection(this.menus())[0]?.section === null, ...(ngDevMode ? [{ debugName: "leadsWithUnsectioned" }] : []));
3971
+ displayName = computed(() => {
3972
+ const user = this.userInfo();
3973
+ return user.fullName || user.username || user.email || '';
3974
+ }, ...(ngDevMode ? [{ debugName: "displayName" }] : []));
3975
+ /** First letters of the first and last word of the display name, as on the README M1 avatar. */
3976
+ userInitials = computed(() => {
3977
+ const words = this.displayName().trim().split(/\s+/).filter(Boolean);
3978
+ const first = Array.from(words[0] ?? '')[0] ?? '';
3979
+ const last = words.length > 1 ? (Array.from(words[words.length - 1])[0] ?? '') : '';
3980
+ return (first + last).toLocaleUpperCase();
3981
+ }, ...(ngDevMode ? [{ debugName: "userInitials" }] : []));
3982
+ /** Menus of `mobile.bottomBar` that exist in `menus` (looked up by `id` at any depth), in configured order. */
3983
+ destinations = computed(() => {
3984
+ const ids = this.configuration().mobile?.bottomBar ?? [];
3985
+ if (!ids.length)
3986
+ return [];
3987
+ const menus = this.menus();
3988
+ const entries = indexMenusById(menus);
3989
+ const activeMenuPath = resolveActiveMenuPath(menus, this.activePath());
3990
+ return ids
3991
+ .map(id => entries.get(id))
3992
+ .filter((entry) => !!entry)
3993
+ .map((entry, index) => {
3994
+ const { menu, key } = entry;
3995
+ const isGroup = 'children' in menu && Array.isArray(menu.children) && menu.children.length > 0;
3996
+ const path = 'path' in menu && typeof menu.path === 'string' ? menu.path : '';
3997
+ const trailing = resolveMenuTrailing(menu);
3998
+ const live = trailing?.kind === 'status' && trailing.live ? trailing : null;
3999
+ return {
4000
+ menu,
4001
+ key,
4002
+ label: menu.tooltipTitle || menu.title || '',
4003
+ isGroup,
4004
+ isActive: !!activeMenuPath && (isGroup ? containsMenuPath(menu, activeMenuPath) : path === activeMenuPath),
4005
+ disabled: menu.comingSoon === true,
4006
+ expandKeys: [...entry.ancestorKeys, key],
4007
+ badge: trailing?.kind === 'badge' ? { value: trailing.value, tone: trailing.tone } : null,
4008
+ liveTone: live?.tone ?? null,
4009
+ liveLabel: live?.label ?? '',
4010
+ descriptionId: `${this.#id}-destination-${index}`,
4011
+ };
4012
+ });
4013
+ }, ...(ngDevMode ? [{ debugName: "destinations" }] : []));
4014
+ constructor() {
4015
+ effect(() => {
4016
+ const menus = this.menus();
4017
+ const maximum = this.configuration().recent.maxItems;
4018
+ untracked(() => this.#navigationState.hydrate(menus, maximum));
4019
+ });
4020
+ // why: switcher chỉ mount khi drawer mở — đối chiếu context ngay lúc khởi tạo (D-021) để listener nhiều tab chạy từ
4021
+ // đầu và lần chạm đầu vào menu không kích reload đối chiếu. Không có `context` thì không lấy service: app không cấu
4022
+ // hình context không tạo service lẫn listener.
4023
+ effect(() => {
4024
+ const context = this.configuration().context;
4025
+ if (!context)
4026
+ return;
4027
+ const items = context.items;
4028
+ untracked(() => this.#injector.get(SdLayoutContextService).syncItems(items));
4029
+ });
4030
+ this.#router.events.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(event => {
4031
+ if (event instanceof NavigationEnd) {
4032
+ this.activePath.set(event.urlAfterRedirects.split(/[?#]/, 1)[0] ?? '');
4033
+ this.closeFromNavigation();
4034
+ return;
4035
+ }
4036
+ // why: chọn đúng trang đang mở thì router bỏ qua (NavigationSkipped, navigate trả false) — vẫn là một lựa chọn menu
4037
+ // nên đóng drawer. Điều hướng bị guard huỷ (NavigationCancel) giữ drawer mở.
4038
+ if (event instanceof NavigationSkipped)
4039
+ this.closeFromNavigation();
4040
+ });
4041
+ effect(() => {
4042
+ const menus = this.menus();
4043
+ const activeMenuPath = resolveActiveMenuPath(menus, this.activePath());
4044
+ if (!activeMenuPath)
4045
+ return;
4046
+ const activeGroupKeys = new Set();
4047
+ const visit = (items, ancestors) => {
4048
+ for (const menu of items) {
4049
+ if (!('children' in menu) || !containsMenuPath(menu, activeMenuPath))
4050
+ continue;
4051
+ const key = getMenuStableKey(menu, ancestors);
4052
+ activeGroupKeys.add(key);
4053
+ visit(menu.children ?? [], [...ancestors, menu.title ?? key]);
4054
+ }
4055
+ };
4056
+ visit(menus, []);
4057
+ // why: Chỉ mở nhánh khi route/menu đổi; người dùng vẫn được đóng nhánh đang active.
4058
+ untracked(() => this.collapsedGroupKeys.update(keys => keys.filter(key => !activeGroupKeys.has(key))));
4059
+ });
4060
+ // why: chỉ trả lại overflow của body khi chính drawer đang khoá cuộn — không ghi đè giá trị phần khác đặt sau đó.
4061
+ this.#destroyRef.onDestroy(() => {
4062
+ if (this.isDrawerOpen())
4063
+ this.#releaseBodyScroll();
4064
+ });
4065
+ }
4066
+ /** Opens the drawer; focus returns to `trigger` (default: the focused element, else the app-bar menu button) on close. */
4067
+ openDrawer(trigger) {
4068
+ if (this.isDrawerOpen())
4069
+ return;
4070
+ const active = this.#document.activeElement;
4071
+ this.#restoreFocusElement =
4072
+ trigger instanceof HTMLElement
4073
+ ? trigger
4074
+ : active instanceof HTMLElement && active !== this.#document.body
4075
+ ? active
4076
+ : (this.trigger()?.nativeElement ?? null);
4077
+ // why: cdkTrapFocusAutoCapture trả focus về phần tử đang focus lúc mở khi drawer bị huỷ. Safari/iOS không focus nút
4078
+ // khi chạm, nên focus trigger trước để lần trả focus đó trùng trigger thay vì nhảy về phần tử khác trong trang.
4079
+ this.#restoreFocusElement?.focus({ preventScroll: true });
4080
+ this.#previousBodyOverflow = this.#document.body.style.overflow;
4081
+ this.#document.body.style.overflow = 'hidden';
4082
+ this.isDrawerOpen.set(true);
4083
+ }
4084
+ /** Opens the drawer with its search focused; focus returns to `trigger` on close. */
4085
+ openSearch(trigger) {
4086
+ if (this.isDrawerOpen()) {
4087
+ this.#focusSearchField();
4088
+ return;
4089
+ }
4090
+ this.focusSearchOnOpen.set(true);
4091
+ this.openDrawer(trigger);
4092
+ }
4093
+ closeFromBackdrop() {
4094
+ this.#closeDrawer();
4095
+ }
4096
+ closeFromEscape() {
4097
+ this.#closeDrawer();
4098
+ }
4099
+ closeFromNavigation() {
4100
+ this.#closeDrawer();
4101
+ }
4102
+ onDrawerKeydown(event) {
4103
+ // why: Esc đã được lớp trong xử lý (xoá query, đóng popup tài khoản) hoặc đang huỷ gõ IME thì không đóng luôn drawer.
4104
+ if (event.key !== 'Escape' || event.defaultPrevented || event.isComposing)
4105
+ return;
4106
+ event.preventDefault();
4107
+ this.closeFromEscape();
4108
+ }
4109
+ navigateMenu(menu) {
4110
+ if (!('path' in menu))
4111
+ return;
4112
+ this.#navigationState.recordRecent(menu, this.recentConfiguration());
4113
+ // why: `includes('http')` là substring test — `javascript:fetch(...)//http` lọt qua và chạy như
4114
+ // script trong origin của app. Parse URL thật rồi mới mở, kèm `noopener,noreferrer`.
4115
+ if (sdIsExternalHttpUrl(menu.path)) {
4116
+ sdOpenExternal(menu.path);
4117
+ this.closeFromNavigation();
4118
+ return;
4119
+ }
4120
+ void this.#router
4121
+ .navigate([menu.path.split('?')[0]], { queryParams: menu.queryParams ?? {}, state: { switchTab: true } })
4122
+ .then(navigated => {
4123
+ if (navigated)
4124
+ this.closeFromNavigation();
4125
+ });
4126
+ }
4127
+ onTogglePinned(menu) {
4128
+ this.#navigationState.togglePinned(menu);
4129
+ }
4130
+ activateDestination(destination, trigger) {
4131
+ if (destination.disabled)
4132
+ return;
4133
+ if (!destination.isGroup) {
4134
+ this.navigateMenu(destination.menu);
4135
+ return;
4136
+ }
4137
+ // why: group không có route — mở drawer tại đúng group đó (và các group cha) như rail V4 với collapsedGroup 'expand'.
4138
+ const keys = new Set(destination.expandKeys);
4139
+ this.collapsedGroupKeys.update(current => current.filter(key => !keys.has(key)));
4140
+ this.openDrawer(trigger);
4141
+ }
4142
+ onSearchInput(event) {
4143
+ const value = event.target.value;
4144
+ this.searchText.set(value);
4145
+ this.#focusRequest.set(0);
4146
+ // why: kết quả bắt đầu ở đầu list và kết quả đầu được chọn sẵn — bỏ vị trí cuộn cũ của cây để nó luôn thấy được.
4147
+ const list = this.list()?.nativeElement;
4148
+ if (value.trim() && list)
4149
+ list.scrollTop = 0;
4150
+ }
4151
+ clearSearch() {
4152
+ this.#clearQuery();
4153
+ this.searchInput()?.nativeElement.focus();
4154
+ }
4155
+ onSearchKeydown(event) {
4156
+ if (event.isComposing)
4157
+ return;
4158
+ switch (event.key) {
4159
+ case 'ArrowDown':
4160
+ case 'ArrowUp': {
4161
+ const count = this.searchResults().length;
4162
+ if (!count)
4163
+ return;
4164
+ event.preventDefault();
4165
+ const next = Math.min(Math.max(this.focusedResultIndex() + (event.key === 'ArrowDown' ? 1 : -1), 0), count - 1);
4166
+ this.#focusRequest.set(next);
4167
+ this.#revealResult(next);
4168
+ return;
4169
+ }
4170
+ case 'Enter': {
4171
+ const result = this.searchResults()[this.focusedResultIndex()];
4172
+ if (!result)
4173
+ return;
4174
+ event.preventDefault();
4175
+ this.navigateMenu(result.menu);
4176
+ return;
4177
+ }
4178
+ case 'Escape':
4179
+ // why: Esc đầu xoá query như gợi ý "Esc clear" của kết quả; ô đã trống thì để Esc tới drawer và đóng nó.
4180
+ if (!this.searchText())
4181
+ return;
4182
+ event.preventDefault();
4183
+ this.#clearQuery();
4184
+ }
4185
+ }
4186
+ #revealResult(index) {
4187
+ const tree = this.mainTree();
4188
+ // why: listbox cuộn trong nav — option được chọn phải luôn nằm trong vùng thấy được (WCAG 2.4.11).
4189
+ if (tree)
4190
+ this.#document.getElementById(tree.resultOptionId(index))?.scrollIntoView({ block: 'nearest' });
4191
+ }
4192
+ #focusSearchField() {
4193
+ const field = this.searchInput()?.nativeElement;
4194
+ field?.focus();
4195
+ field?.select();
4196
+ }
4197
+ #clearQuery() {
4198
+ this.searchText.set('');
4199
+ this.#focusRequest.set(0);
4200
+ }
4201
+ #closeDrawer() {
4202
+ if (!this.isDrawerOpen())
4203
+ return;
4204
+ this.isDrawerOpen.set(false);
4205
+ this.focusSearchOnOpen.set(false);
4206
+ this.#clearQuery();
4207
+ this.#releaseBodyScroll();
4208
+ (this.#restoreFocusElement ?? this.trigger()?.nativeElement)?.focus();
4209
+ this.#restoreFocusElement = null;
4210
+ }
4211
+ #releaseBodyScroll() {
4212
+ this.#document.body.style.overflow = this.#previousBodyOverflow;
4213
+ }
4214
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarMobileV4, deps: [], target: i0.ɵɵFactoryTarget.Component });
4215
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdSidebarMobileV4, isStandalone: true, selector: "sd-sidebar-mobile-v4", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.sd-sidebar-mobile-v4--soft": "configuration().itemShape === \"soft\"", "class.sd-sidebar-mobile-v4--bottom-bar": "destinations().length > 0" }, classAttribute: "sd-sidebar-mobile-v4" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "list", first: true, predicate: ["list"], descendants: true, isSignal: true }, { propertyName: "mainTree", first: true, predicate: ["mainTree"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _open = isDrawerOpen();\n@let _configuration = configuration();\n@let _destinations = destinations();\n@let _searchLabel = 'core.module.layout.sidebar.v4-search-placeholder' | sdTranslate;\n@let _navLabel = 'core.module.layout.sidebar.primary-nav' | sdTranslate;\n<header data-v4m-appbar class=\"sd-sidebar-mobile-v4__appbar\">\n <button\n #trigger\n type=\"button\"\n data-v4m-menu-trigger\n class=\"sd-sidebar-mobile-v4__icon-button sd-sidebar-mobile-v4__icon-button--appbar\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"'core.module.layout.sidebar.open-menu' | sdTranslate\"\n [attr.aria-expanded]=\"_open\"\n (click)=\"openDrawer($event.currentTarget)\">\n <sd-icon name=\"menu\" size=\"24px\"></sd-icon>\n </button>\n <span data-v4m-appbar-title class=\"sd-sidebar-mobile-v4__appbar-title\">{{ title() }}</span>\n <button\n type=\"button\"\n data-v4m-search-trigger\n class=\"sd-sidebar-mobile-v4__icon-button sd-sidebar-mobile-v4__icon-button--appbar\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"_searchLabel\"\n (click)=\"openSearch($event.currentTarget)\">\n <sd-icon name=\"search\" size=\"22px\"></sd-icon>\n </button>\n @let _displayName = displayName();\n <span\n data-v4m-avatar\n class=\"sd-sidebar-mobile-v4__avatar\"\n [attr.role]=\"_displayName ? 'img' : null\"\n [attr.aria-label]=\"_displayName || null\"\n [attr.aria-hidden]=\"_displayName ? null : 'true'\"\n >{{ userInitials() }}</span\n >\n</header>\n\n<main data-v4m-content class=\"sd-sidebar-mobile-v4__content\">\n <ng-content></ng-content>\n</main>\n\n@if (_destinations.length) {\n <nav data-v4m-bottom-bar class=\"sd-sidebar-mobile-v4__bottom-bar\" [attr.aria-label]=\"_navLabel\">\n @for (item of _destinations; track item.key) {\n <button\n #destinationButton\n type=\"button\"\n class=\"sd-sidebar-mobile-v4__destination\"\n [class.sd-sidebar-mobile-v4__destination--active]=\"item.isActive\"\n [class.sd-sidebar-mobile-v4__destination--disabled]=\"item.disabled\"\n [attr.data-v4m-destination]=\"item.key\"\n [attr.aria-current]=\"item.isActive ? (item.isGroup ? 'true' : 'page') : null\"\n [attr.aria-disabled]=\"item.disabled || null\"\n [attr.aria-haspopup]=\"item.isGroup && !item.disabled ? 'dialog' : null\"\n [attr.aria-describedby]=\"item.badge || item.liveTone ? item.descriptionId : null\"\n (click)=\"activateDestination(item, destinationButton)\">\n <span data-v4m-indicator class=\"sd-sidebar-mobile-v4__indicator\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-mobile-v4__destination-image\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon\n [name]=\"item.menu.icon || (item.isGroup ? 'folder' : 'chevron_right')\"\n [fontSet]=\"item.isActive ? 'material-icons' : 'material-icons-outlined'\"\n size=\"22px\"></sd-icon>\n }\n @if (item.badge) {\n <span\n data-v4m-badge\n class=\"sd-sidebar-mobile-v4__badge\"\n [class.sd-sidebar-mobile-v4__badge--error]=\"item.badge.tone === 'error'\"\n aria-hidden=\"true\">\n {{ item.badge.value }}\n </span>\n } @else if (item.liveTone) {\n <span data-v4m-live class=\"sd-sidebar-mobile-v4__live\" [attr.data-tone]=\"item.liveTone\" aria-hidden=\"true\"></span>\n }\n </span>\n <span data-v4m-label class=\"sd-sidebar-mobile-v4__label\">{{ item.label }}</span>\n @if (item.badge) {\n <span hidden [id]=\"item.descriptionId\">{{\n 'core.module.layout.sidebar.badge-pending' | sdTranslate: { count: item.badge.value }\n }}</span>\n } @else if (item.liveTone) {\n <span hidden [id]=\"item.descriptionId\">{{ item.liveLabel }}</span>\n }\n </button>\n }\n <button\n type=\"button\"\n data-v4m-more\n class=\"sd-sidebar-mobile-v4__destination\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"_open\"\n (click)=\"openDrawer($event.currentTarget)\">\n <span data-v4m-indicator class=\"sd-sidebar-mobile-v4__indicator\">\n <sd-icon name=\"menu\" size=\"22px\"></sd-icon>\n </span>\n <span data-v4m-label class=\"sd-sidebar-mobile-v4__label\">{{ 'core.module.layout.sidebar.more' | sdTranslate }}</span>\n </button>\n </nav>\n}\n\n@if (_open) {\n @let _query = searchText();\n @let _hasQuery = hasQuery();\n @let _focused = focusedResultIndex();\n @let _hasResults = _focused >= 0;\n @let _pinned = pinnedMenus();\n @let _recent = recentMenus();\n @let _showPinned = !_hasQuery && _pinned.length > 0;\n @let _showRecent = !_hasQuery && recentConfiguration().enabled && _recent.length > 0;\n <button\n type=\"button\"\n data-v4m-backdrop\n class=\"sd-sidebar-mobile-v4__backdrop\"\n [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\"\n (click)=\"closeFromBackdrop()\"></button>\n <aside\n data-v4m-drawer\n class=\"sd-sidebar-mobile-v4__drawer\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"titleId\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onDrawerKeydown($event)\">\n <header data-v4m-header class=\"sd-sidebar-mobile-v4__header\">\n <span class=\"sd-sidebar-mobile-v4__logo\" [class.sd-sidebar-mobile-v4__logo--image]=\"!!_configuration.logoUrl\" aria-hidden=\"true\">\n @if (_configuration.logoUrl) {\n <img [src]=\"_configuration.logoUrl\" alt=\"\" />\n } @else {\n {{ logoInitial() }}\n }\n </span>\n <div class=\"sd-sidebar-mobile-v4__brand\">\n <span data-v4m-drawer-title class=\"sd-sidebar-mobile-v4__title\" [id]=\"titleId\">{{ title() }}</span>\n @if (_configuration.context) {\n <sd-layout-context-switcher appearance=\"sheet\" [configuration]=\"_configuration.context\" />\n }\n </div>\n <button\n type=\"button\"\n data-v4m-close\n class=\"sd-sidebar-mobile-v4__icon-button\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"closeFromBackdrop()\">\n <sd-icon name=\"close\" size=\"22px\"></sd-icon>\n </button>\n </header>\n\n <div data-v4m-search class=\"sd-sidebar-mobile-v4__search\">\n <div data-v4m-search-field class=\"sd-sidebar-mobile-v4__search-field\" [class.sd-sidebar-mobile-v4__search-field--filled]=\"!!_query\">\n <sd-icon class=\"sd-sidebar-mobile-v4__search-icon\" name=\"search\" size=\"20px\" aria-hidden=\"true\"></sd-icon>\n <input\n #searchInput\n data-v4m-search-input\n class=\"sd-sidebar-mobile-v4__search-input\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n [attr.cdkFocusInitial]=\"focusSearchOnOpen() ? '' : null\"\n [attr.aria-label]=\"_searchLabel\"\n [attr.placeholder]=\"_searchLabel\"\n [attr.aria-expanded]=\"_hasResults\"\n [attr.aria-controls]=\"_hasResults ? mainTree.resultsId : null\"\n [attr.aria-activedescendant]=\"_hasResults ? mainTree.resultOptionId(_focused) : null\"\n [value]=\"_query\"\n (input)=\"onSearchInput($event)\"\n (keydown)=\"onSearchKeydown($event)\" />\n @if (_query) {\n <button\n type=\"button\"\n data-v4m-search-clear\n class=\"sd-sidebar-mobile-v4__search-clear\"\n [attr.aria-label]=\"'core.module.layout.sidebar.clear-search' | sdTranslate\"\n (click)=\"clearSearch()\">\n <sd-icon name=\"close\" size=\"18px\"></sd-icon>\n </button>\n }\n </div>\n </div>\n\n <nav #list data-v4m-nav class=\"sd-sidebar-mobile-v4__list\" [attr.aria-label]=\"'core.module.layout.sidebar.all-menu' | sdTranslate\">\n @if (_showPinned) {\n <section data-v4m-pinned class=\"sd-sidebar-mobile-v4__shortcuts\">\n <h2 class=\"sd-sidebar-mobile-v4__section-label\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-sidebar-v4-menu-tree\n presentation=\"shortcuts\"\n mode=\"mobile\"\n [menus]=\"_pinned\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\" />\n </section>\n }\n @if (_showRecent) {\n <section data-v4m-recent class=\"sd-sidebar-mobile-v4__shortcuts\">\n <h2 class=\"sd-sidebar-mobile-v4__section-label\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-sidebar-v4-menu-tree\n presentation=\"shortcuts\"\n mode=\"mobile\"\n [menus]=\"_recent\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\" />\n </section>\n }\n <!-- One tree instance for hierarchy and results: its live region must stay mounted to announce result counts. -->\n <sd-sidebar-v4-menu-tree\n #mainTree\n data-v4m-tree\n mode=\"mobile\"\n [class.sd-sidebar-mobile-v4__tree--separated]=\"(_showPinned || _showRecent) && leadsWithUnsectioned()\"\n [menus]=\"menus()\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [presentation]=\"_hasQuery ? 'results' : 'hierarchy'\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [pinnedKeys]=\"pinnedKeys()\"\n [query]=\"_query\"\n [focusedIndex]=\"_focused\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\" />\n </nav>\n\n <div data-v4m-footer class=\"sd-sidebar-mobile-v4__footer\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n </div>\n </aside>\n}\n", styles: [":host{--sd-sidebar-v4-item-height: 44px;--sd-sidebar-v4-child-height: 44px;--sd-sidebar-v4-item-radius: 999px;--sidebar-drawer-width: min(88vw, 360px);--sidebar-bottom-bar-height: 64px;--sidebar-bg: var(--sd-sidebar-v4-bg, color-mix(in srgb, var(--sd-text) 4%, var(--sd-surface)));--sidebar-line: var(--sd-sidebar-v4-line, color-mix(in srgb, var(--sd-border) 45%, var(--sd-surface)));--sidebar-hover-bg: var(--sd-sidebar-v4-hover-bg, color-mix(in srgb, var(--sd-text) 6%, transparent));--sidebar-muted-ink: var(--sd-text-secondary);--sidebar-focus-ring: inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary));display:block;min-height:100dvh;background:var(--sd-light);color:var(--sd-text)}:host(.sd-sidebar-mobile-v4--soft){--sd-sidebar-v4-item-radius: 8px}.sd-sidebar-mobile-v4__icon-button,.sd-sidebar-mobile-v4__search-clear{display:inline-flex;flex:none;align-items:center;justify-content:center;box-sizing:border-box;margin:0;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sidebar-muted-ink);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-sidebar-mobile-v4__icon-button:focus-visible,.sd-sidebar-mobile-v4__search-clear:focus-visible{outline:none;box-shadow:var(--sidebar-focus-ring)}@media(hover:hover){.sd-sidebar-mobile-v4__icon-button:hover,.sd-sidebar-mobile-v4__search-clear:hover{background:var(--sidebar-hover-bg)}}.sd-sidebar-mobile-v4__icon-button{width:44px;height:44px}.sd-sidebar-mobile-v4__icon-button--appbar{color:var(--sd-text)}.sd-sidebar-mobile-v4__appbar{display:flex;align-items:center;gap:var(--sd-space-4, 4px);box-sizing:border-box;height:56px;padding:0 8px 0 4px;border-bottom:1px solid var(--sidebar-line);background:var(--sd-surface)}.sd-sidebar-mobile-v4__appbar-title{flex:1 1 auto;min-width:0;overflow:hidden;font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-24, 24px);text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-mobile-v4__avatar{display:inline-flex;flex:none;align-items:center;justify-content:center;width:32px;height:32px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-sidebar-v4-avatar-bg, color-mix(in srgb, var(--sd-primary) 14%, var(--sd-surface)));color:var(--sd-sidebar-v4-avatar-ink, var(--sd-primary));font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-medium, 500);line-height:1}:host(.sd-sidebar-mobile-v4--bottom-bar) .sd-sidebar-mobile-v4__content{padding-bottom:calc(var(--sidebar-bottom-bar-height) + 1px + env(safe-area-inset-bottom))}.sd-sidebar-mobile-v4__bottom-bar{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:auto 0 0;display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;padding-bottom:env(safe-area-inset-bottom);border-top:1px solid var(--sidebar-line);background:var(--sd-surface)}.sd-sidebar-mobile-v4__destination{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;box-sizing:border-box;min-width:0;height:var(--sidebar-bottom-bar-height);margin:0;padding:0 2px;border:0;background:transparent;color:var(--sidebar-muted-ink);font:inherit;cursor:pointer}.sd-sidebar-mobile-v4__destination:focus-visible{outline:none}.sd-sidebar-mobile-v4__destination:focus-visible .sd-sidebar-mobile-v4__indicator{box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-mobile-v4__indicator{position:relative;display:flex;flex:none;align-items:center;justify-content:center;width:56px;height:30px;border-radius:var(--sd-radius-999, 999px);transition:background-color var(--sd-duration-fast, .12s) ease}@media(hover:hover){.sd-sidebar-mobile-v4__destination:hover .sd-sidebar-mobile-v4__indicator{background:var(--sidebar-hover-bg)}.sd-sidebar-mobile-v4__destination--disabled:hover .sd-sidebar-mobile-v4__indicator{background:transparent}}.sd-sidebar-mobile-v4__destination--active .sd-sidebar-mobile-v4__indicator,.sd-sidebar-mobile-v4__destination--active:hover .sd-sidebar-mobile-v4__indicator{background:var(--sd-primary-light);color:var(--sd-primary)}.sd-sidebar-mobile-v4__destination--active:focus-visible .sd-sidebar-mobile-v4__indicator{box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-mobile-v4__destination--disabled{color:var(--sd-disabled-text, color-mix(in srgb, var(--sd-text) 60%, transparent));cursor:not-allowed}.sd-sidebar-mobile-v4__destination-image{width:22px;height:22px;object-fit:contain}.sd-sidebar-mobile-v4__destination--disabled .sd-sidebar-mobile-v4__destination-image{opacity:.6}.sd-sidebar-mobile-v4__label{max-width:100%;overflow:hidden;color:var(--sd-text-secondary);font-size:11.5px;font-weight:var(--sd-font-weight-regular, 400);line-height:var(--sd-line-height-16, 16px);text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-mobile-v4__destination--active .sd-sidebar-mobile-v4__label{color:var(--sd-text);font-weight:var(--sd-font-weight-medium, 500)}.sd-sidebar-mobile-v4__destination--disabled .sd-sidebar-mobile-v4__label{color:inherit}.sd-sidebar-mobile-v4__badge{position:absolute;top:-2px;right:8px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:16px;height:16px;padding:0 4px;border-radius:var(--sd-radius-8, 8px);background:var(--sd-sidebar-v4-attention, var(--sd-warning));box-shadow:0 0 0 2px var(--sd-surface);color:var(--sd-warning-contrast);font-size:var(--sd-font-size-10, 10px);font-weight:var(--sd-font-weight-medium, 500);line-height:1;pointer-events:none}.sd-sidebar-mobile-v4__badge--error{background:var(--sd-error);color:var(--sd-error-contrast)}.sd-sidebar-mobile-v4__live{--live-tone: var(--sd-sidebar-v4-live, var(--sd-success));position:absolute;top:2px;right:14px;width:8px;height:8px;border-radius:var(--sd-radius-4, 4px);background:var(--live-tone);box-shadow:0 0 0 2px var(--sd-surface);pointer-events:none}.sd-sidebar-mobile-v4__live[data-tone=warning]{--live-tone: var(--sd-warning)}.sd-sidebar-mobile-v4__live[data-tone=error]{--live-tone: var(--sd-error)}.sd-sidebar-mobile-v4__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;margin:0;padding:0;border:0;background:var(--sd-overlay-backdrop, color-mix(in srgb, var(--sd-text) 40%, transparent))}.sd-sidebar-mobile-v4__drawer{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:0 auto 0 0;display:flex;flex-direction:column;box-sizing:border-box;width:var(--sidebar-drawer-width);max-width:100%;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);border-radius:0 var(--sd-radius-24, 24px) var(--sd-radius-24, 24px) 0;background:var(--sidebar-bg);box-shadow:0 8px 32px color-mix(in srgb,var(--sd-text) 18%,transparent);color:var(--sd-text)}.sd-sidebar-mobile-v4__drawer:focus{outline:none}.sd-sidebar-mobile-v4__header{display:flex;flex:none;align-items:center;gap:var(--sd-space-12, 12px);box-sizing:border-box;min-height:64px;padding:0 12px 0 16px}.sd-sidebar-mobile-v4__logo{display:inline-flex;flex:none;align-items:center;justify-content:center;overflow:hidden;width:28px;height:28px;border-radius:var(--sd-radius-8, 8px);background:var(--sd-primary);color:var(--sd-primary-contrast);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-bold, 700);line-height:1}.sd-sidebar-mobile-v4__logo img{width:100%;height:100%;object-fit:contain}.sd-sidebar-mobile-v4__logo--image{background:transparent}.sd-sidebar-mobile-v4__brand{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.sd-sidebar-mobile-v4__title{overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px;text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-mobile-v4__search{flex:none;padding:0 12px 6px}.sd-sidebar-mobile-v4__search-field{display:flex;align-items:center;gap:var(--sd-space-8, 8px);box-sizing:border-box;height:44px;padding:0 12px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-surface);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--sd-border) 50%,var(--sd-surface));color:var(--sidebar-muted-ink)}.sd-sidebar-mobile-v4__search-field:focus-within{box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-mobile-v4__search-field--filled,.sd-sidebar-mobile-v4__search-field--filled:focus-within{padding-right:0;box-shadow:inset 0 0 0 2px var(--sd-primary)}.sd-sidebar-mobile-v4__search-icon{flex:none}.sd-sidebar-mobile-v4__search-input{flex:1 1 auto;min-width:0;height:100%;margin:0;padding:0;border:0;outline:0;background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-13, 13px)}.sd-sidebar-mobile-v4__search-input::placeholder{color:var(--sidebar-muted-ink);opacity:1}.sd-sidebar-mobile-v4__search-clear{width:44px;height:44px}.sd-sidebar-mobile-v4__list{flex:1 1 auto;min-height:0;box-sizing:border-box;padding:0 12px 12px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}.sd-sidebar-mobile-v4__section-label{margin:0;padding:14px 12px 4px;color:var(--sidebar-muted-ink);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px}.sd-sidebar-mobile-v4__tree--separated{margin-top:var(--sd-space-16, 16px)}.sd-sidebar-mobile-v4__footer{flex:none;box-sizing:border-box;padding:12px 8px 12px 16px;border-top:1px solid var(--sidebar-line)}.sd-sidebar-mobile-v4__footer ::ng-deep .sd-layout-user-menu__popup{box-sizing:border-box;left:-4px;width:calc(var(--sidebar-drawer-width) - 24px)}@media(pointer:coarse){.sd-sidebar-mobile-v4__search-input{font-size:var(--sd-font-size-16, 16px)}}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v4__icon-button,.sd-sidebar-mobile-v4__search-clear,.sd-sidebar-mobile-v4__indicator{transition:none}}\n"], dependencies: [{ kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutContextSwitcher, selector: "sd-layout-context-switcher", inputs: ["configuration", "appearance", "placement", "anchor"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "component", type: SdSidebarV4MenuTree, selector: "sd-sidebar-v4-menu-tree", inputs: ["menus", "pathSource", "activePath", "presentation", "mode", "collapsedGroupKeys", "pinnedKeys", "showPin", "collapsedGroup", "query", "focusedIndex"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned", "expandGroup"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4216
+ }
4217
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdSidebarMobileV4, decorators: [{
4218
+ type: Component,
4219
+ args: [{ selector: 'sd-sidebar-mobile-v4', standalone: true, imports: [CdkTrapFocus, SdIcon, SdLayoutContextSwitcher, SdLayoutUserMenuComponent, SdSidebarV4MenuTree, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
4220
+ class: 'sd-sidebar-mobile-v4',
4221
+ '[class.sd-sidebar-mobile-v4--soft]': 'configuration().itemShape === "soft"',
4222
+ '[class.sd-sidebar-mobile-v4--bottom-bar]': 'destinations().length > 0',
4223
+ }, template: "@let _open = isDrawerOpen();\n@let _configuration = configuration();\n@let _destinations = destinations();\n@let _searchLabel = 'core.module.layout.sidebar.v4-search-placeholder' | sdTranslate;\n@let _navLabel = 'core.module.layout.sidebar.primary-nav' | sdTranslate;\n<header data-v4m-appbar class=\"sd-sidebar-mobile-v4__appbar\">\n <button\n #trigger\n type=\"button\"\n data-v4m-menu-trigger\n class=\"sd-sidebar-mobile-v4__icon-button sd-sidebar-mobile-v4__icon-button--appbar\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"'core.module.layout.sidebar.open-menu' | sdTranslate\"\n [attr.aria-expanded]=\"_open\"\n (click)=\"openDrawer($event.currentTarget)\">\n <sd-icon name=\"menu\" size=\"24px\"></sd-icon>\n </button>\n <span data-v4m-appbar-title class=\"sd-sidebar-mobile-v4__appbar-title\">{{ title() }}</span>\n <button\n type=\"button\"\n data-v4m-search-trigger\n class=\"sd-sidebar-mobile-v4__icon-button sd-sidebar-mobile-v4__icon-button--appbar\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"_searchLabel\"\n (click)=\"openSearch($event.currentTarget)\">\n <sd-icon name=\"search\" size=\"22px\"></sd-icon>\n </button>\n @let _displayName = displayName();\n <span\n data-v4m-avatar\n class=\"sd-sidebar-mobile-v4__avatar\"\n [attr.role]=\"_displayName ? 'img' : null\"\n [attr.aria-label]=\"_displayName || null\"\n [attr.aria-hidden]=\"_displayName ? null : 'true'\"\n >{{ userInitials() }}</span\n >\n</header>\n\n<main data-v4m-content class=\"sd-sidebar-mobile-v4__content\">\n <ng-content></ng-content>\n</main>\n\n@if (_destinations.length) {\n <nav data-v4m-bottom-bar class=\"sd-sidebar-mobile-v4__bottom-bar\" [attr.aria-label]=\"_navLabel\">\n @for (item of _destinations; track item.key) {\n <button\n #destinationButton\n type=\"button\"\n class=\"sd-sidebar-mobile-v4__destination\"\n [class.sd-sidebar-mobile-v4__destination--active]=\"item.isActive\"\n [class.sd-sidebar-mobile-v4__destination--disabled]=\"item.disabled\"\n [attr.data-v4m-destination]=\"item.key\"\n [attr.aria-current]=\"item.isActive ? (item.isGroup ? 'true' : 'page') : null\"\n [attr.aria-disabled]=\"item.disabled || null\"\n [attr.aria-haspopup]=\"item.isGroup && !item.disabled ? 'dialog' : null\"\n [attr.aria-describedby]=\"item.badge || item.liveTone ? item.descriptionId : null\"\n (click)=\"activateDestination(item, destinationButton)\">\n <span data-v4m-indicator class=\"sd-sidebar-mobile-v4__indicator\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-mobile-v4__destination-image\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon\n [name]=\"item.menu.icon || (item.isGroup ? 'folder' : 'chevron_right')\"\n [fontSet]=\"item.isActive ? 'material-icons' : 'material-icons-outlined'\"\n size=\"22px\"></sd-icon>\n }\n @if (item.badge) {\n <span\n data-v4m-badge\n class=\"sd-sidebar-mobile-v4__badge\"\n [class.sd-sidebar-mobile-v4__badge--error]=\"item.badge.tone === 'error'\"\n aria-hidden=\"true\">\n {{ item.badge.value }}\n </span>\n } @else if (item.liveTone) {\n <span data-v4m-live class=\"sd-sidebar-mobile-v4__live\" [attr.data-tone]=\"item.liveTone\" aria-hidden=\"true\"></span>\n }\n </span>\n <span data-v4m-label class=\"sd-sidebar-mobile-v4__label\">{{ item.label }}</span>\n @if (item.badge) {\n <span hidden [id]=\"item.descriptionId\">{{\n 'core.module.layout.sidebar.badge-pending' | sdTranslate: { count: item.badge.value }\n }}</span>\n } @else if (item.liveTone) {\n <span hidden [id]=\"item.descriptionId\">{{ item.liveLabel }}</span>\n }\n </button>\n }\n <button\n type=\"button\"\n data-v4m-more\n class=\"sd-sidebar-mobile-v4__destination\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"_open\"\n (click)=\"openDrawer($event.currentTarget)\">\n <span data-v4m-indicator class=\"sd-sidebar-mobile-v4__indicator\">\n <sd-icon name=\"menu\" size=\"22px\"></sd-icon>\n </span>\n <span data-v4m-label class=\"sd-sidebar-mobile-v4__label\">{{ 'core.module.layout.sidebar.more' | sdTranslate }}</span>\n </button>\n </nav>\n}\n\n@if (_open) {\n @let _query = searchText();\n @let _hasQuery = hasQuery();\n @let _focused = focusedResultIndex();\n @let _hasResults = _focused >= 0;\n @let _pinned = pinnedMenus();\n @let _recent = recentMenus();\n @let _showPinned = !_hasQuery && _pinned.length > 0;\n @let _showRecent = !_hasQuery && recentConfiguration().enabled && _recent.length > 0;\n <button\n type=\"button\"\n data-v4m-backdrop\n class=\"sd-sidebar-mobile-v4__backdrop\"\n [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\"\n (click)=\"closeFromBackdrop()\"></button>\n <aside\n data-v4m-drawer\n class=\"sd-sidebar-mobile-v4__drawer\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"titleId\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onDrawerKeydown($event)\">\n <header data-v4m-header class=\"sd-sidebar-mobile-v4__header\">\n <span class=\"sd-sidebar-mobile-v4__logo\" [class.sd-sidebar-mobile-v4__logo--image]=\"!!_configuration.logoUrl\" aria-hidden=\"true\">\n @if (_configuration.logoUrl) {\n <img [src]=\"_configuration.logoUrl\" alt=\"\" />\n } @else {\n {{ logoInitial() }}\n }\n </span>\n <div class=\"sd-sidebar-mobile-v4__brand\">\n <span data-v4m-drawer-title class=\"sd-sidebar-mobile-v4__title\" [id]=\"titleId\">{{ title() }}</span>\n @if (_configuration.context) {\n <sd-layout-context-switcher appearance=\"sheet\" [configuration]=\"_configuration.context\" />\n }\n </div>\n <button\n type=\"button\"\n data-v4m-close\n class=\"sd-sidebar-mobile-v4__icon-button\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"closeFromBackdrop()\">\n <sd-icon name=\"close\" size=\"22px\"></sd-icon>\n </button>\n </header>\n\n <div data-v4m-search class=\"sd-sidebar-mobile-v4__search\">\n <div data-v4m-search-field class=\"sd-sidebar-mobile-v4__search-field\" [class.sd-sidebar-mobile-v4__search-field--filled]=\"!!_query\">\n <sd-icon class=\"sd-sidebar-mobile-v4__search-icon\" name=\"search\" size=\"20px\" aria-hidden=\"true\"></sd-icon>\n <input\n #searchInput\n data-v4m-search-input\n class=\"sd-sidebar-mobile-v4__search-input\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n [attr.cdkFocusInitial]=\"focusSearchOnOpen() ? '' : null\"\n [attr.aria-label]=\"_searchLabel\"\n [attr.placeholder]=\"_searchLabel\"\n [attr.aria-expanded]=\"_hasResults\"\n [attr.aria-controls]=\"_hasResults ? mainTree.resultsId : null\"\n [attr.aria-activedescendant]=\"_hasResults ? mainTree.resultOptionId(_focused) : null\"\n [value]=\"_query\"\n (input)=\"onSearchInput($event)\"\n (keydown)=\"onSearchKeydown($event)\" />\n @if (_query) {\n <button\n type=\"button\"\n data-v4m-search-clear\n class=\"sd-sidebar-mobile-v4__search-clear\"\n [attr.aria-label]=\"'core.module.layout.sidebar.clear-search' | sdTranslate\"\n (click)=\"clearSearch()\">\n <sd-icon name=\"close\" size=\"18px\"></sd-icon>\n </button>\n }\n </div>\n </div>\n\n <nav #list data-v4m-nav class=\"sd-sidebar-mobile-v4__list\" [attr.aria-label]=\"'core.module.layout.sidebar.all-menu' | sdTranslate\">\n @if (_showPinned) {\n <section data-v4m-pinned class=\"sd-sidebar-mobile-v4__shortcuts\">\n <h2 class=\"sd-sidebar-mobile-v4__section-label\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-sidebar-v4-menu-tree\n presentation=\"shortcuts\"\n mode=\"mobile\"\n [menus]=\"_pinned\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\" />\n </section>\n }\n @if (_showRecent) {\n <section data-v4m-recent class=\"sd-sidebar-mobile-v4__shortcuts\">\n <h2 class=\"sd-sidebar-mobile-v4__section-label\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-sidebar-v4-menu-tree\n presentation=\"shortcuts\"\n mode=\"mobile\"\n [menus]=\"_recent\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\" />\n </section>\n }\n <!-- One tree instance for hierarchy and results: its live region must stay mounted to announce result counts. -->\n <sd-sidebar-v4-menu-tree\n #mainTree\n data-v4m-tree\n mode=\"mobile\"\n [class.sd-sidebar-mobile-v4__tree--separated]=\"(_showPinned || _showRecent) && leadsWithUnsectioned()\"\n [menus]=\"menus()\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [presentation]=\"_hasQuery ? 'results' : 'hierarchy'\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [pinnedKeys]=\"pinnedKeys()\"\n [query]=\"_query\"\n [focusedIndex]=\"_focused\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\" />\n </nav>\n\n <div data-v4m-footer class=\"sd-sidebar-mobile-v4__footer\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n </div>\n </aside>\n}\n", styles: [":host{--sd-sidebar-v4-item-height: 44px;--sd-sidebar-v4-child-height: 44px;--sd-sidebar-v4-item-radius: 999px;--sidebar-drawer-width: min(88vw, 360px);--sidebar-bottom-bar-height: 64px;--sidebar-bg: var(--sd-sidebar-v4-bg, color-mix(in srgb, var(--sd-text) 4%, var(--sd-surface)));--sidebar-line: var(--sd-sidebar-v4-line, color-mix(in srgb, var(--sd-border) 45%, var(--sd-surface)));--sidebar-hover-bg: var(--sd-sidebar-v4-hover-bg, color-mix(in srgb, var(--sd-text) 6%, transparent));--sidebar-muted-ink: var(--sd-text-secondary);--sidebar-focus-ring: inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary));display:block;min-height:100dvh;background:var(--sd-light);color:var(--sd-text)}:host(.sd-sidebar-mobile-v4--soft){--sd-sidebar-v4-item-radius: 8px}.sd-sidebar-mobile-v4__icon-button,.sd-sidebar-mobile-v4__search-clear{display:inline-flex;flex:none;align-items:center;justify-content:center;box-sizing:border-box;margin:0;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sidebar-muted-ink);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-sidebar-mobile-v4__icon-button:focus-visible,.sd-sidebar-mobile-v4__search-clear:focus-visible{outline:none;box-shadow:var(--sidebar-focus-ring)}@media(hover:hover){.sd-sidebar-mobile-v4__icon-button:hover,.sd-sidebar-mobile-v4__search-clear:hover{background:var(--sidebar-hover-bg)}}.sd-sidebar-mobile-v4__icon-button{width:44px;height:44px}.sd-sidebar-mobile-v4__icon-button--appbar{color:var(--sd-text)}.sd-sidebar-mobile-v4__appbar{display:flex;align-items:center;gap:var(--sd-space-4, 4px);box-sizing:border-box;height:56px;padding:0 8px 0 4px;border-bottom:1px solid var(--sidebar-line);background:var(--sd-surface)}.sd-sidebar-mobile-v4__appbar-title{flex:1 1 auto;min-width:0;overflow:hidden;font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-24, 24px);text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-mobile-v4__avatar{display:inline-flex;flex:none;align-items:center;justify-content:center;width:32px;height:32px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-sidebar-v4-avatar-bg, color-mix(in srgb, var(--sd-primary) 14%, var(--sd-surface)));color:var(--sd-sidebar-v4-avatar-ink, var(--sd-primary));font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-medium, 500);line-height:1}:host(.sd-sidebar-mobile-v4--bottom-bar) .sd-sidebar-mobile-v4__content{padding-bottom:calc(var(--sidebar-bottom-bar-height) + 1px + env(safe-area-inset-bottom))}.sd-sidebar-mobile-v4__bottom-bar{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:auto 0 0;display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;padding-bottom:env(safe-area-inset-bottom);border-top:1px solid var(--sidebar-line);background:var(--sd-surface)}.sd-sidebar-mobile-v4__destination{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;box-sizing:border-box;min-width:0;height:var(--sidebar-bottom-bar-height);margin:0;padding:0 2px;border:0;background:transparent;color:var(--sidebar-muted-ink);font:inherit;cursor:pointer}.sd-sidebar-mobile-v4__destination:focus-visible{outline:none}.sd-sidebar-mobile-v4__destination:focus-visible .sd-sidebar-mobile-v4__indicator{box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-mobile-v4__indicator{position:relative;display:flex;flex:none;align-items:center;justify-content:center;width:56px;height:30px;border-radius:var(--sd-radius-999, 999px);transition:background-color var(--sd-duration-fast, .12s) ease}@media(hover:hover){.sd-sidebar-mobile-v4__destination:hover .sd-sidebar-mobile-v4__indicator{background:var(--sidebar-hover-bg)}.sd-sidebar-mobile-v4__destination--disabled:hover .sd-sidebar-mobile-v4__indicator{background:transparent}}.sd-sidebar-mobile-v4__destination--active .sd-sidebar-mobile-v4__indicator,.sd-sidebar-mobile-v4__destination--active:hover .sd-sidebar-mobile-v4__indicator{background:var(--sd-primary-light);color:var(--sd-primary)}.sd-sidebar-mobile-v4__destination--active:focus-visible .sd-sidebar-mobile-v4__indicator{box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-mobile-v4__destination--disabled{color:var(--sd-disabled-text, color-mix(in srgb, var(--sd-text) 60%, transparent));cursor:not-allowed}.sd-sidebar-mobile-v4__destination-image{width:22px;height:22px;object-fit:contain}.sd-sidebar-mobile-v4__destination--disabled .sd-sidebar-mobile-v4__destination-image{opacity:.6}.sd-sidebar-mobile-v4__label{max-width:100%;overflow:hidden;color:var(--sd-text-secondary);font-size:11.5px;font-weight:var(--sd-font-weight-regular, 400);line-height:var(--sd-line-height-16, 16px);text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-mobile-v4__destination--active .sd-sidebar-mobile-v4__label{color:var(--sd-text);font-weight:var(--sd-font-weight-medium, 500)}.sd-sidebar-mobile-v4__destination--disabled .sd-sidebar-mobile-v4__label{color:inherit}.sd-sidebar-mobile-v4__badge{position:absolute;top:-2px;right:8px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:16px;height:16px;padding:0 4px;border-radius:var(--sd-radius-8, 8px);background:var(--sd-sidebar-v4-attention, var(--sd-warning));box-shadow:0 0 0 2px var(--sd-surface);color:var(--sd-warning-contrast);font-size:var(--sd-font-size-10, 10px);font-weight:var(--sd-font-weight-medium, 500);line-height:1;pointer-events:none}.sd-sidebar-mobile-v4__badge--error{background:var(--sd-error);color:var(--sd-error-contrast)}.sd-sidebar-mobile-v4__live{--live-tone: var(--sd-sidebar-v4-live, var(--sd-success));position:absolute;top:2px;right:14px;width:8px;height:8px;border-radius:var(--sd-radius-4, 4px);background:var(--live-tone);box-shadow:0 0 0 2px var(--sd-surface);pointer-events:none}.sd-sidebar-mobile-v4__live[data-tone=warning]{--live-tone: var(--sd-warning)}.sd-sidebar-mobile-v4__live[data-tone=error]{--live-tone: var(--sd-error)}.sd-sidebar-mobile-v4__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;margin:0;padding:0;border:0;background:var(--sd-overlay-backdrop, color-mix(in srgb, var(--sd-text) 40%, transparent))}.sd-sidebar-mobile-v4__drawer{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:0 auto 0 0;display:flex;flex-direction:column;box-sizing:border-box;width:var(--sidebar-drawer-width);max-width:100%;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);border-radius:0 var(--sd-radius-24, 24px) var(--sd-radius-24, 24px) 0;background:var(--sidebar-bg);box-shadow:0 8px 32px color-mix(in srgb,var(--sd-text) 18%,transparent);color:var(--sd-text)}.sd-sidebar-mobile-v4__drawer:focus{outline:none}.sd-sidebar-mobile-v4__header{display:flex;flex:none;align-items:center;gap:var(--sd-space-12, 12px);box-sizing:border-box;min-height:64px;padding:0 12px 0 16px}.sd-sidebar-mobile-v4__logo{display:inline-flex;flex:none;align-items:center;justify-content:center;overflow:hidden;width:28px;height:28px;border-radius:var(--sd-radius-8, 8px);background:var(--sd-primary);color:var(--sd-primary-contrast);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-bold, 700);line-height:1}.sd-sidebar-mobile-v4__logo img{width:100%;height:100%;object-fit:contain}.sd-sidebar-mobile-v4__logo--image{background:transparent}.sd-sidebar-mobile-v4__brand{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.sd-sidebar-mobile-v4__title{overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px;text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-mobile-v4__search{flex:none;padding:0 12px 6px}.sd-sidebar-mobile-v4__search-field{display:flex;align-items:center;gap:var(--sd-space-8, 8px);box-sizing:border-box;height:44px;padding:0 12px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-surface);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--sd-border) 50%,var(--sd-surface));color:var(--sidebar-muted-ink)}.sd-sidebar-mobile-v4__search-field:focus-within{box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-mobile-v4__search-field--filled,.sd-sidebar-mobile-v4__search-field--filled:focus-within{padding-right:0;box-shadow:inset 0 0 0 2px var(--sd-primary)}.sd-sidebar-mobile-v4__search-icon{flex:none}.sd-sidebar-mobile-v4__search-input{flex:1 1 auto;min-width:0;height:100%;margin:0;padding:0;border:0;outline:0;background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-13, 13px)}.sd-sidebar-mobile-v4__search-input::placeholder{color:var(--sidebar-muted-ink);opacity:1}.sd-sidebar-mobile-v4__search-clear{width:44px;height:44px}.sd-sidebar-mobile-v4__list{flex:1 1 auto;min-height:0;box-sizing:border-box;padding:0 12px 12px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}.sd-sidebar-mobile-v4__section-label{margin:0;padding:14px 12px 4px;color:var(--sidebar-muted-ink);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px}.sd-sidebar-mobile-v4__tree--separated{margin-top:var(--sd-space-16, 16px)}.sd-sidebar-mobile-v4__footer{flex:none;box-sizing:border-box;padding:12px 8px 12px 16px;border-top:1px solid var(--sidebar-line)}.sd-sidebar-mobile-v4__footer ::ng-deep .sd-layout-user-menu__popup{box-sizing:border-box;left:-4px;width:calc(var(--sidebar-drawer-width) - 24px)}@media(pointer:coarse){.sd-sidebar-mobile-v4__search-input{font-size:var(--sd-font-size-16, 16px)}}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v4__icon-button,.sd-sidebar-mobile-v4__search-clear,.sd-sidebar-mobile-v4__indicator{transition:none}}\n"] }]
4224
+ }], ctorParameters: () => [], propDecorators: { trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], searchInput: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], list: [{ type: i0.ViewChild, args: ['list', { isSignal: true }] }], mainTree: [{ type: i0.ViewChild, args: ['mainTree', { isSignal: true }] }], menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }] } });
4225
+ /** First menu of every `id` in the tree, with the stable keys of its ancestor groups (keys as the V4 tree computes them). */
4226
+ function indexMenusById(menus) {
4227
+ const entries = new Map();
4228
+ const visit = (items, ancestors, ancestorKeys) => {
4229
+ for (const menu of items ?? []) {
4230
+ if (!menu || typeof menu !== 'object')
4231
+ continue;
4232
+ const key = getMenuStableKey(menu, ancestors);
4233
+ const id = typeof menu.id === 'string' ? menu.id.trim() : '';
4234
+ if (id && key && !entries.has(id))
4235
+ entries.set(id, { menu, key, ancestorKeys });
4236
+ if ('children' in menu && Array.isArray(menu.children)) {
4237
+ visit(menu.children, [...ancestors, menu.title ?? key], [...ancestorKeys, key]);
4238
+ }
4239
+ }
4240
+ };
4241
+ visit(menus, [], []);
4242
+ return entries;
4243
+ }
4244
+
4245
+ class SdLayoutComponent {
4246
+ // ==========================================
4247
+ // INJECT SERVICES
4248
+ // ==========================================
4249
+ #menuPipe = inject(MenuPipe);
4250
+ #layoutService = inject(SdLayoutService);
4251
+ #responsiveService = inject(SdLayoutResponsiveService);
4252
+ #layoutConfiguration = inject(SD_LAYOUT_CONFIGURATION, { optional: true });
4253
+ // ==========================================
4254
+ // SIGNAL INPUTS
4255
+ // ==========================================
4256
+ menusInput = input([], ...(ngDevMode ? [{ debugName: "menusInput", alias: 'menus' }] : [{ alias: 'menus' }]));
4257
+ menus = computed(() => this.#menuPipe.transform(this.menusInput() || []), ...(ngDevMode ? [{ debugName: "menus" }] : []));
4258
+ // ==========================================
4259
+ // CONSUME SHARED STATE
4260
+ // ==========================================
4261
+ userInfo = this.#layoutService.userInfo;
4262
+ sidebar = this.#layoutService.sidebar;
4263
+ sidebarV1 = computed(() => {
4264
+ const sidebar = this.sidebar();
4265
+ return sidebar?.version === 1 ? sidebar : undefined;
4266
+ }, ...(ngDevMode ? [{ debugName: "sidebarV1" }] : []));
4267
+ sidebarV2 = computed(() => {
4268
+ const sidebar = this.sidebar();
4269
+ return sidebar?.version === 2 ? sidebar : undefined;
4270
+ }, ...(ngDevMode ? [{ debugName: "sidebarV2" }] : []));
4271
+ sidebarV3 = computed(() => {
4272
+ const sidebar = this.sidebar();
4273
+ return sidebar?.version === 3 ? sidebar : undefined;
4274
+ }, ...(ngDevMode ? [{ debugName: "sidebarV3" }] : []));
4275
+ // why: V4 là cấu hình duy nhất cần chuẩn hoá ở đây (INV-012) — bottomBar/itemShape/density/collapsedGroup có mặc định + sanitize.
4276
+ sidebarV4 = computed(() => {
4277
+ const sidebar = this.sidebar();
4278
+ return sidebar?.version === 4 ? normalizeSidebarConfiguration(sidebar) : undefined;
4279
+ }, ...(ngDevMode ? [{ debugName: "sidebarV4" }] : []));
2527
4280
  mobileBreakpoint = normalizeLayoutMobileBreakpoint(this.#layoutConfiguration?.mobileBreakpoint);
2528
4281
  isMobile = computed(() => this.#responsiveService.isMobile(this.mobileBreakpoint), ...(ngDevMode ? [{ debugName: "isMobile" }] : []));
2529
4282
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2530
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdLayoutComponent, isStandalone: true, selector: "sd-layout", inputs: { menusInput: { classPropertyName: "menusInput", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-template #projectedContent>\n <ng-content></ng-content>\n</ng-template>\n\n@let _userInfo = userInfo();\n@let _sidebarV1 = sidebarV1();\n@let _sidebarV2 = sidebarV2();\n@let _sidebarV3 = sidebarV3();\n\n@if (_userInfo && _sidebarV1) {\n @if (!isMobile()) {\n <sd-sidebar-v1 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV1\" [isMobile]=\"false\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v1>\n } @else {\n <sd-sidebar-mobile-v1 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV1\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v1>\n }\n}\n\n@if (_userInfo && _sidebarV3) {\n @if (!isMobile()) {\n <sd-sidebar-v3 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV3\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v3>\n } @else {\n <sd-sidebar-mobile-v3 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV3\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v3>\n }\n}\n\n@if (_userInfo && _sidebarV2) {\n @if (!isMobile()) {\n <sd-sidebar-v2 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV2\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v2>\n } @else {\n <sd-sidebar-mobile-v2 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV2\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v2>\n }\n}\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: SdSidebarV1, selector: "sd-sidebar-v1", inputs: ["menus", "userInfo", "sidebar", "isMobile"] }, { kind: "component", type: SdSidebarMobileV1, selector: "sd-sidebar-mobile-v1", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarV2, selector: "sd-sidebar-v2", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarMobileV2, selector: "sd-sidebar-mobile-v2", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarV3, selector: "sd-sidebar-v3", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarMobileV3, selector: "sd-sidebar-mobile-v3", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4283
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.25", type: SdLayoutComponent, isStandalone: true, selector: "sd-layout", inputs: { menusInput: { classPropertyName: "menusInput", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-template #projectedContent>\n <ng-content></ng-content>\n</ng-template>\n\n@let _userInfo = userInfo();\n@let _sidebarV1 = sidebarV1();\n@let _sidebarV2 = sidebarV2();\n@let _sidebarV3 = sidebarV3();\n@let _sidebarV4 = sidebarV4();\n\n@if (_userInfo && _sidebarV1) {\n @if (!isMobile()) {\n <sd-sidebar-v1 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV1\" [isMobile]=\"false\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v1>\n } @else {\n <sd-sidebar-mobile-v1 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV1\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v1>\n }\n}\n\n@if (_userInfo && _sidebarV3) {\n @if (!isMobile()) {\n <sd-sidebar-v3 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV3\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v3>\n } @else {\n <sd-sidebar-mobile-v3 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV3\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v3>\n }\n}\n\n@if (_userInfo && _sidebarV4) {\n @if (!isMobile()) {\n <sd-sidebar-v4 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV4\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v4>\n } @else {\n <sd-sidebar-mobile-v4 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV4\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v4>\n }\n}\n\n@if (_userInfo && _sidebarV2) {\n @if (!isMobile()) {\n <sd-sidebar-v2 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV2\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v2>\n } @else {\n <sd-sidebar-mobile-v2 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV2\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v2>\n }\n}\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: SdSidebarV1, selector: "sd-sidebar-v1", inputs: ["menus", "userInfo", "sidebar", "isMobile"] }, { kind: "component", type: SdSidebarMobileV1, selector: "sd-sidebar-mobile-v1", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarV2, selector: "sd-sidebar-v2", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarMobileV2, selector: "sd-sidebar-mobile-v2", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarV3, selector: "sd-sidebar-v3", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarMobileV3, selector: "sd-sidebar-mobile-v3", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarV4, selector: "sd-sidebar-v4", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarMobileV4, selector: "sd-sidebar-mobile-v4", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2531
4284
  }
2532
4285
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: SdLayoutComponent, decorators: [{
2533
4286
  type: Component,
2534
- args: [{ selector: 'sd-layout', imports: [SdSidebarV1, SdSidebarMobileV1, SdSidebarV2, SdSidebarMobileV2, SdSidebarV3, SdSidebarMobileV3, NgTemplateOutlet], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #projectedContent>\n <ng-content></ng-content>\n</ng-template>\n\n@let _userInfo = userInfo();\n@let _sidebarV1 = sidebarV1();\n@let _sidebarV2 = sidebarV2();\n@let _sidebarV3 = sidebarV3();\n\n@if (_userInfo && _sidebarV1) {\n @if (!isMobile()) {\n <sd-sidebar-v1 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV1\" [isMobile]=\"false\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v1>\n } @else {\n <sd-sidebar-mobile-v1 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV1\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v1>\n }\n}\n\n@if (_userInfo && _sidebarV3) {\n @if (!isMobile()) {\n <sd-sidebar-v3 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV3\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v3>\n } @else {\n <sd-sidebar-mobile-v3 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV3\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v3>\n }\n}\n\n@if (_userInfo && _sidebarV2) {\n @if (!isMobile()) {\n <sd-sidebar-v2 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV2\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v2>\n } @else {\n <sd-sidebar-mobile-v2 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV2\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v2>\n }\n}\n", styles: [":host{display:block}\n"] }]
4287
+ args: [{ selector: 'sd-layout', imports: [
4288
+ SdSidebarV1,
4289
+ SdSidebarMobileV1,
4290
+ SdSidebarV2,
4291
+ SdSidebarMobileV2,
4292
+ SdSidebarV3,
4293
+ SdSidebarMobileV3,
4294
+ SdSidebarV4,
4295
+ SdSidebarMobileV4,
4296
+ NgTemplateOutlet,
4297
+ ], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #projectedContent>\n <ng-content></ng-content>\n</ng-template>\n\n@let _userInfo = userInfo();\n@let _sidebarV1 = sidebarV1();\n@let _sidebarV2 = sidebarV2();\n@let _sidebarV3 = sidebarV3();\n@let _sidebarV4 = sidebarV4();\n\n@if (_userInfo && _sidebarV1) {\n @if (!isMobile()) {\n <sd-sidebar-v1 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV1\" [isMobile]=\"false\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v1>\n } @else {\n <sd-sidebar-mobile-v1 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV1\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v1>\n }\n}\n\n@if (_userInfo && _sidebarV3) {\n @if (!isMobile()) {\n <sd-sidebar-v3 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV3\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v3>\n } @else {\n <sd-sidebar-mobile-v3 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV3\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v3>\n }\n}\n\n@if (_userInfo && _sidebarV4) {\n @if (!isMobile()) {\n <sd-sidebar-v4 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV4\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v4>\n } @else {\n <sd-sidebar-mobile-v4 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV4\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v4>\n }\n}\n\n@if (_userInfo && _sidebarV2) {\n @if (!isMobile()) {\n <sd-sidebar-v2 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV2\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v2>\n } @else {\n <sd-sidebar-mobile-v2 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV2\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v2>\n }\n}\n", styles: [":host{display:block}\n"] }]
2535
4298
  }], propDecorators: { menusInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }] } });
2536
4299
 
2537
4300
  // End
@@ -2698,7 +4461,7 @@ let RootComponent$1 = class RootComponent {
2698
4461
  void this.#router.navigateByUrl(this.#layoutService.homeUrl);
2699
4462
  }
2700
4463
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: RootComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2701
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: RootComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "@let _userInfo = userInfo();\n<sd-page>\n <div class=\"d-flex flex-column\" headerLeft>\n <div class=\"font-weight-medium fs-20\">{{ 'core.module.layout.greeting.hello' | sdTranslate: { name: _userInfo?.fullName ?? _userInfo?.email ?? _userInfo?.username ?? '' } }}</div>\n <span class=\"T12R text-secondary\">{{ todayInfo() }}</span>\n </div>\n\n <div class=\"h-full d-flex flex-column align-items-center\">\n <div class=\"h-full d-flex flex-column align-items-center justify-content-center text-center wrapper\">\n <img alt=\"not-found\" class=\"sd-image-not-found\" />\n <span class=\"T16M mt-24\">{{ 'core.module.layout.not-found.title' | sdTranslate }}</span>\n <span class=\"T16R text-secondary mt-4\">\n {{ 'core.module.layout.not-found.message' | sdTranslate }}\n </span>\n <sd-button class=\"mt-16\" type=\"fill\" color=\"primary\" (click)=\"reload()\" [title]=\"'core.module.layout.not-found.back' | sdTranslate\" prefixIcon=\"arrow_back\"> </sd-button>\n </div>\n </div>\n</sd-page>\n", styles: [".wrapper{width:300px}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdPageComponent, selector: "sd-page", inputs: ["title", "description", "noHeader"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }] });
4464
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: RootComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "@let _userInfo = userInfo();\n<sd-page>\n <div class=\"d-flex flex-column\" headerLeft>\n <div class=\"font-weight-medium fs-20\">{{ 'core.module.layout.greeting.hello' | sdTranslate: { name: _userInfo?.fullName ?? _userInfo?.email ?? _userInfo?.username ?? '' } }}</div>\n <span class=\"T12R text-secondary\">{{ todayInfo() }}</span>\n </div>\n\n <div class=\"h-full d-flex flex-column align-items-center\">\n <div class=\"h-full d-flex flex-column align-items-center justify-content-center text-center wrapper\">\n <img alt=\"not-found\" class=\"sd-image-not-found\" />\n <span class=\"T16M mt-24\">{{ 'core.module.layout.not-found.title' | sdTranslate }}</span>\n <span class=\"T16R text-secondary mt-4\">\n {{ 'core.module.layout.not-found.message' | sdTranslate }}\n </span>\n <sd-button class=\"mt-16\" type=\"fill\" color=\"primary\" (click)=\"reload()\" [title]=\"'core.module.layout.not-found.back' | sdTranslate\" prefixIcon=\"arrow_back\"> </sd-button>\n </div>\n </div>\n</sd-page>\n", styles: [".wrapper{width:300px}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdPageComponent, selector: "sd-page", inputs: ["title", "description", "noHeader"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }] });
2702
4465
  };
2703
4466
  RootComponent$1 = __decorate([
2704
4467
  SdTabComponent({
@@ -2774,7 +4537,7 @@ let RootComponent = class RootComponent {
2774
4537
  void this.#router.navigateByUrl(this.#layoutService.homeUrl);
2775
4538
  }
2776
4539
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: RootComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2777
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: RootComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "@let _userInfo = userInfo();\n<sd-page>\n <div class=\"d-flex flex-column\" headerLeft>\n <div class=\"font-weight-medium fs-20\">{{ 'core.module.layout.greeting.hello' | sdTranslate: { name: _userInfo?.fullName ?? _userInfo?.email ?? _userInfo?.username ?? '' } }}</div>\n <span class=\"T12R text-secondary\">{{ todayInfo() }}</span>\n </div>\n <div class=\"h-full d-flex flex-column align-items-center\">\n <div class=\"h-full d-flex flex-column align-items-center justify-content-center text-center wrapper\">\n <img alt=\"forbidden\" class=\"sd-image-forbidden\" />\n <span class=\"T16M mt-24\">{{ 'core.module.layout.forbidden.title' | sdTranslate }}</span>\n <span class=\"T14R text-secondary mt-4\"\n >{{ 'core.module.layout.forbidden.message' | sdTranslate }}</span\n >\n <sd-button class=\"mt-16\" type=\"fill\" color=\"primary\" (click)=\"reload()\" [title]=\"'core.module.layout.forbidden.back-home' | sdTranslate\"> </sd-button>\n </div>\n </div>\n</sd-page>\n", styles: [".wrapper{width:300px}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdPageComponent, selector: "sd-page", inputs: ["title", "description", "noHeader"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }] });
4540
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: RootComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "@let _userInfo = userInfo();\n<sd-page>\n <div class=\"d-flex flex-column\" headerLeft>\n <div class=\"font-weight-medium fs-20\">{{ 'core.module.layout.greeting.hello' | sdTranslate: { name: _userInfo?.fullName ?? _userInfo?.email ?? _userInfo?.username ?? '' } }}</div>\n <span class=\"T12R text-secondary\">{{ todayInfo() }}</span>\n </div>\n <div class=\"h-full d-flex flex-column align-items-center\">\n <div class=\"h-full d-flex flex-column align-items-center justify-content-center text-center wrapper\">\n <img alt=\"forbidden\" class=\"sd-image-forbidden\" />\n <span class=\"T16M mt-24\">{{ 'core.module.layout.forbidden.title' | sdTranslate }}</span>\n <span class=\"T14R text-secondary mt-4\"\n >{{ 'core.module.layout.forbidden.message' | sdTranslate }}</span\n >\n <sd-button class=\"mt-16\" type=\"fill\" color=\"primary\" (click)=\"reload()\" [title]=\"'core.module.layout.forbidden.back-home' | sdTranslate\"> </sd-button>\n </div>\n </div>\n</sd-page>\n", styles: [".wrapper{width:300px}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdPageComponent, selector: "sd-page", inputs: ["title", "description", "noHeader"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }] });
2778
4541
  };
2779
4542
  RootComponent = __decorate([
2780
4543
  SdTabComponent({
@@ -2856,5 +4619,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
2856
4619
  * Generated bundle index. Do not edit.
2857
4620
  */
2858
4621
 
2859
- export { DEFAULT_LAYOUT_MOBILE_BREAKPOINT, ForbiddenModule, HighlightSearchPipe, HomeModule, MenuFocusPipe, MenuPipe, NotFoundModule, SD_LAYOUT_CONFIGURATION, SD_LAYOUT_DEMO_FALLBACK, SD_LAYOUT_STORAGE_NAMESPACE, SD_LAYOUT_VIEWPORT, SdLayoutComponent, SdLayoutMenuTreeComponent, SdLayoutModule, SdLayoutNavigationStateService, SdLayoutResponsiveService, SdLayoutService, SdLayoutStorageService, SdLayoutUserMenuComponent, SdPageComponent, SdSidebarMobileOverlay, SdSidebarMobileV1, SdSidebarMobileV2, SdSidebarMobileV3, SdSidebarV2, SdSidebarV3, collectMatchedMenuPaths, containsMenuPath, flattenMenuLeaves, getMenuStableKey, isMenuPathMatch, normalizeLayoutMobileBreakpoint, normalizeMenuPath, normalizeSidebarConfiguration, resolveActiveMenuPath, resolveMenuKeys, resolveSidebarV2Interaction, resolveSidebarV3Recent, resolveTabName, searchMenuLeaves, selectPrimaryMenuGroups };
4622
+ export { DEFAULT_LAYOUT_MOBILE_BREAKPOINT, ForbiddenModule, HighlightSearchPipe, HomeModule, MenuFocusPipe, MenuPipe, NotFoundModule, SD_LAYOUT_CONFIGURATION, SD_LAYOUT_CONTEXT_MARKER_KEY, SD_LAYOUT_CONTEXT_RUNTIME, SD_LAYOUT_DEMO_FALLBACK, SD_LAYOUT_STORAGE_NAMESPACE, SD_LAYOUT_VIEWPORT, SdLayoutComponent, SdLayoutContextService, SdLayoutContextSwitcher, SdLayoutMenuTreeComponent, SdLayoutModule, SdLayoutNavigationStateService, SdLayoutResponsiveService, SdLayoutService, SdLayoutStorageService, SdLayoutUserMenuComponent, SdPageComponent, SdSidebarMobileOverlay, SdSidebarMobileV1, SdSidebarMobileV2, SdSidebarMobileV3, SdSidebarMobileV4, SdSidebarV2, SdSidebarV3, SdSidebarV4, collectMatchedMenuPaths, containsMenuPath, createSdLayoutContextBrowserRuntime, flattenMenuLeaves, getMenuStableKey, groupMenusBySection, isMenuPathMatch, normalizeLayoutMobileBreakpoint, normalizeMenuPath, normalizeSidebarConfiguration, resolveActiveMenuPath, resolveMenuKeys, resolveMenuTrailing, resolveSidebarV2Interaction, resolveSidebarV3Recent, resolveTabName, searchAvailableMenuLeaves, searchMenuLeaves, selectPrimaryMenuGroups };
2860
4623
  //# sourceMappingURL=sdcorejs-angular-modules-layout.mjs.map