@spartan-ng/brain 1.10.0-beta.4 → 1.10.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/fesm2022/spartan-ng-brain-autocomplete.mjs +11 -5
  2. package/fesm2022/spartan-ng-brain-autocomplete.mjs.map +1 -1
  3. package/fesm2022/spartan-ng-brain-checkbox.mjs +2 -2
  4. package/fesm2022/spartan-ng-brain-checkbox.mjs.map +1 -1
  5. package/fesm2022/spartan-ng-brain-combobox.mjs +18 -14
  6. package/fesm2022/spartan-ng-brain-combobox.mjs.map +1 -1
  7. package/fesm2022/spartan-ng-brain-core.mjs +124 -67
  8. package/fesm2022/spartan-ng-brain-core.mjs.map +1 -1
  9. package/fesm2022/spartan-ng-brain-date-picker.mjs +14 -2
  10. package/fesm2022/spartan-ng-brain-date-picker.mjs.map +1 -1
  11. package/fesm2022/spartan-ng-brain-dialog.mjs +1 -1
  12. package/fesm2022/spartan-ng-brain-dialog.mjs.map +1 -1
  13. package/fesm2022/spartan-ng-brain-forms.mjs +26 -2
  14. package/fesm2022/spartan-ng-brain-forms.mjs.map +1 -1
  15. package/fesm2022/spartan-ng-brain-input.mjs +13 -5
  16. package/fesm2022/spartan-ng-brain-input.mjs.map +1 -1
  17. package/fesm2022/spartan-ng-brain-navigation-menu.mjs +3 -0
  18. package/fesm2022/spartan-ng-brain-navigation-menu.mjs.map +1 -1
  19. package/fesm2022/spartan-ng-brain-overlay.mjs +1 -1
  20. package/fesm2022/spartan-ng-brain-overlay.mjs.map +1 -1
  21. package/fesm2022/spartan-ng-brain-radio-group.mjs +12 -4
  22. package/fesm2022/spartan-ng-brain-radio-group.mjs.map +1 -1
  23. package/fesm2022/spartan-ng-brain-select.mjs +4 -2
  24. package/fesm2022/spartan-ng-brain-select.mjs.map +1 -1
  25. package/fesm2022/spartan-ng-brain-slider.mjs +5 -5
  26. package/fesm2022/spartan-ng-brain-slider.mjs.map +1 -1
  27. package/fesm2022/spartan-ng-brain-sonner.mjs +30 -10
  28. package/fesm2022/spartan-ng-brain-sonner.mjs.map +1 -1
  29. package/fesm2022/spartan-ng-brain-switch.mjs +2 -2
  30. package/fesm2022/spartan-ng-brain-switch.mjs.map +1 -1
  31. package/fesm2022/spartan-ng-brain-textarea.mjs +13 -5
  32. package/fesm2022/spartan-ng-brain-textarea.mjs.map +1 -1
  33. package/fesm2022/spartan-ng-brain-tooltip.mjs +2 -0
  34. package/fesm2022/spartan-ng-brain-tooltip.mjs.map +1 -1
  35. package/package.json +1 -1
  36. package/types/spartan-ng-brain-autocomplete.d.ts +4 -2
  37. package/types/spartan-ng-brain-combobox.d.ts +7 -5
  38. package/types/spartan-ng-brain-date-picker.d.ts +12 -1
  39. package/types/spartan-ng-brain-forms.d.ts +3 -0
  40. package/types/spartan-ng-brain-input.d.ts +9 -2
  41. package/types/spartan-ng-brain-radio-group.d.ts +9 -2
  42. package/types/spartan-ng-brain-select.d.ts +2 -2
  43. package/types/spartan-ng-brain-slider.d.ts +1 -1
  44. package/types/spartan-ng-brain-textarea.d.ts +9 -2
@@ -1,5 +1,5 @@
1
1
  import { isPlatformBrowser, isPlatformServer } from '@angular/common';
2
- import { runInInjectionContext, inject, Injector, ElementRef, PLATFORM_ID, DestroyRef, HostAttributeToken, NgZone, effect, untracked, computed, InjectionToken, forwardRef, signal, afterNextRender, SimpleChange } from '@angular/core';
2
+ import { runInInjectionContext, inject, Injector, ElementRef, PLATFORM_ID, DestroyRef, HostAttributeToken, NgZone, ErrorHandler, effect, untracked, computed, InjectionToken, forwardRef, signal, afterNextRender, SimpleChange } from '@angular/core';
3
3
  import { Observable, pipe, merge, fromEvent } from 'rxjs';
4
4
  import { map, filter, distinctUntilChanged, takeUntil, debounceTime } from 'rxjs/operators';
5
5
  import { toObservable, toSignal } from '@angular/core/rxjs-interop';
@@ -48,19 +48,21 @@ function brnClasses(computed, options) {
48
48
  merge: options.merge,
49
49
  sources: new Map(),
50
50
  baseClasses: initialBaseClasses,
51
- isUpdating: false,
51
+ updateQueued: false,
52
+ errorHandler: inject(ErrorHandler, { optional: true }),
53
+ zone: inject(NgZone),
52
54
  nextOrder: 0,
53
- hasInitialized: false,
54
- appliedClasses: null,
55
+ writtenClassName: null,
55
56
  restoreRafId: null,
56
57
  transitionsSuppressed: false,
57
58
  previousTransition: '',
58
59
  previousTransitionPriority: '',
59
60
  };
60
61
  elementClassManagers.set(element, manager);
62
+ trackClassList(manager);
61
63
  // Setup global observer if needed and register this element. Created outside the zone so
62
64
  // class mutations don't trigger app-wide change detection (and loop if CD writes a class).
63
- inject(NgZone).runOutsideAngular(() => setupGlobalObserver(platformId));
65
+ manager.zone.runOutsideAngular(() => setupGlobalObserver(platformId));
64
66
  observedElements.add(element);
65
67
  // Suppress transitions until the first effect writes correct classes and
66
68
  // the browser has painted them. This prevents CSS transition animations
@@ -145,10 +147,11 @@ function setupGlobalObserver(platformId) {
145
147
  const manager = elementClassManagers.get(element);
146
148
  // Only process elements we're managing
147
149
  if (manager && observedElements.has(element)) {
148
- // Ignore our own writes, and wait for the first source: its effect captures the live classes
149
- if (manager.isUpdating || !manager.hasInitialized)
150
+ // Wait for the first source (it adopts the live classes), and skip our own writes:
151
+ // the callback runs after they're done, so only the written value tells them apart
152
+ if (manager.writtenClassName === null || element.className === manager.writtenClassName)
150
153
  continue;
151
- updateElement(manager);
154
+ scheduleUpdate(manager);
152
155
  }
153
156
  }
154
157
  }
@@ -162,47 +165,9 @@ function setupGlobalObserver(platformId) {
162
165
  }
163
166
  }
164
167
  function updateElement(manager) {
165
- if (manager.isUpdating)
166
- return; // Prevent recursive updates
167
- manager.isUpdating = true;
168
- // the merge function is user-provided (e.g. createCn), never leave the manager stuck in updating mode
169
- try {
170
- applyClasses(manager);
171
- }
172
- finally {
173
- manager.isUpdating = false;
174
- }
175
- }
176
- function applyClasses(manager) {
177
- // Handle initialization: capture base classes after first source registration
178
- if (!manager.hasInitialized && manager.sources.size > 0) {
179
- // Get current classes on element (may include SSR classes)
180
- const currentClasses = toClassList(manager.element.className);
181
- // A static class missing from the live element was removed externally before this first write
182
- for (const className of manager.baseClasses) {
183
- if (!currentClasses.includes(className)) {
184
- manager.baseClasses.delete(className);
185
- }
186
- }
187
- // Get all classes that will be applied by sources
188
- const allSourceClasses = new Set();
189
- for (const source of manager.sources.values()) {
190
- source.classes.forEach((className) => allSourceClasses.add(className));
191
- }
192
- // Only consider classes as "base" if they're not produced by any source
193
- // This prevents SSR-rendered classes from being preserved as base classes
194
- currentClasses.forEach((className) => {
195
- if (!allSourceClasses.has(className)) {
196
- manager.baseClasses.add(className);
197
- }
198
- });
199
- manager.hasInitialized = true;
200
- }
201
- else if (manager.appliedClasses) {
202
- // Reconcile with the live element instead of waiting for the mutation observer: a class binding
203
- // that changed in the same tick as a source would otherwise be overwritten with stale base classes.
204
- syncBaseClasses(manager);
205
- }
168
+ adoptOutsideWrite(manager);
169
+ // After adopting: this merge is the one adopting queued
170
+ manager.updateQueued = false;
206
171
  // Get classes from all sources, sorted by registration order (later takes precedence)
207
172
  const sortedSources = Array.from(manager.sources.entries()).sort(([, a], [, b]) => a.order - b.order);
208
173
  const allSourceClasses = [];
@@ -213,36 +178,128 @@ function applyClasses(manager) {
213
178
  const classesToApply = allSourceClasses.length > 0 || manager.baseClasses.size > 0
214
179
  ? manager.merge([...allSourceClasses, ...manager.baseClasses])
215
180
  : '';
216
- const applied = new Set(toClassList(classesToApply));
217
- // Forget merged-out base classes like before, so a cleared binding can't bring them back
218
- for (const className of manager.baseClasses) {
219
- if (!applied.has(className))
220
- manager.baseClasses.delete(className);
221
- }
222
181
  // Apply the classes to the element
223
182
  if (manager.element.className !== classesToApply) {
224
183
  manager.element.className = classesToApply;
225
184
  }
226
- manager.appliedClasses = applied;
185
+ manager.writtenClassName = manager.element.className;
227
186
  }
228
- function syncBaseClasses(manager) {
229
- const applied = manager.appliedClasses;
230
- const current = new Set(toClassList(manager.element.className));
231
- for (const className of applied) {
232
- if (!current.has(className)) {
233
- manager.baseClasses.delete(className);
234
- }
235
- }
236
- for (const className of current) {
237
- if (!applied.has(className)) {
187
+ /**
188
+ * writtenClassName is the class list as brnClasses last left it, so any difference is a className or
189
+ * class attribute write from outside. Those replace the whole list: the wanted classes become the live
190
+ * ones (minus what the sources put there), and a class the merge had dropped is forgotten.
191
+ * Before the first source runs, writtenClassName is null and the live classes (including SSR) are adopted.
192
+ */
193
+ function adoptOutsideWrite(manager) {
194
+ if (manager.sources.size === 0)
195
+ return;
196
+ const current = manager.element.className;
197
+ if (current === manager.writtenClassName)
198
+ return;
199
+ // What the sources put on the element; a class that is also wanted (static or tracked) stays wanted
200
+ const sourceOutput = manager.writtenClassName === null
201
+ ? [...manager.sources.values()].flatMap((source) => [...source.classes])
202
+ : toClassList(manager.writtenClassName);
203
+ const fromSources = new Set(sourceOutput.filter((className) => !manager.baseClasses.has(className)));
204
+ manager.baseClasses.clear();
205
+ for (const className of toClassList(current)) {
206
+ if (!fromSources.has(className))
238
207
  manager.baseClasses.add(className);
239
- }
240
208
  }
209
+ manager.writtenClassName = current;
210
+ // The observer now sees nothing new, so merge from here even if the write that got us here throws
211
+ scheduleUpdate(manager);
212
+ }
213
+ const trackedMethods = ['add', 'remove', 'toggle', 'replace'];
214
+ /**
215
+ * Angular applies `[class]` and `[class.x]` through `classList`. Recording those writes keeps every wanted
216
+ * class, including one the merge currently drops, so it comes back once the class it lost to is removed.
217
+ * The DOM can't tell us that: removing a class that isn't on the element changes nothing there.
218
+ */
219
+ function trackClassList(manager) {
220
+ const list = manager.element.classList;
221
+ if (!list)
222
+ return;
223
+ const native = { add: list.add, remove: list.remove, replace: list.replace };
224
+ const wanted = manager.baseClasses;
225
+ // Write to the DOM right away so the classList answers like the native one; only the merge is batched
226
+ const write = (apply, nativeWrite) => {
227
+ adoptOutsideWrite(manager);
228
+ // Native first: it rejects invalid tokens ('', 'a b') before anything lands in the wanted set
229
+ nativeWrite();
230
+ apply();
231
+ // Before the first source runs the wanted set is still kept: it decides which source classes stay wanted
232
+ if (manager.writtenClassName === null)
233
+ return;
234
+ manager.writtenClassName = manager.element.className;
235
+ scheduleUpdate(manager);
236
+ };
237
+ const add = (...tokens) => write(() => tokens.forEach((token) => (wanted.delete(token), wanted.add(token))), () => native.add.apply(list, tokens));
238
+ const remove = (...tokens) => write(() => tokens.forEach((token) => wanted.delete(token)), () => native.remove.apply(list, tokens));
239
+ const toggle = (token, force) => {
240
+ const on = force ?? !list.contains(token);
241
+ if (on)
242
+ add(token);
243
+ else
244
+ remove(token);
245
+ return on;
246
+ };
247
+ // One native call, so both tokens are validated before anything changes
248
+ const replace = (oldToken, newToken) => {
249
+ let replaced = false;
250
+ write(() => {
251
+ if (!replaced)
252
+ return;
253
+ wanted.delete(oldToken);
254
+ wanted.delete(newToken);
255
+ wanted.add(newToken);
256
+ }, () => (replaced = native.replace.call(list, oldToken, newToken)));
257
+ return replaced;
258
+ };
259
+ // Domino (SSR) declares these read-only on the prototype, so assigning them would throw
260
+ const overrides = { add, remove, toggle, replace };
261
+ for (const method of trackedMethods) {
262
+ Object.defineProperty(list, method, { value: overrides[method], configurable: true, writable: true });
263
+ }
264
+ }
265
+ /**
266
+ * Angular writes each class binding separately, so merging per write would run the merge once per binding.
267
+ * One merge per element per tick still lands before paint, and keeps a throwing merge out of Angular's renderer.
268
+ */
269
+ function scheduleUpdate(manager) {
270
+ if (manager.updateQueued)
271
+ return;
272
+ manager.updateQueued = true;
273
+ // Tracked writes come from the renderer inside the zone; a microtask queued there would make zone.js
274
+ // fire onMicrotaskEmpty again and run a second change detection pass for every class binding change
275
+ manager.zone.runOutsideAngular(() => queueMicrotask(() => {
276
+ // A source update or cleanup in between already handled it
277
+ if (!manager.updateQueued || elementClassManagers.get(manager.element) !== manager)
278
+ return;
279
+ updateElementOutsideAngular(manager);
280
+ }));
281
+ }
282
+ /** For batched updates (tracked writes and the observer), where nothing in Angular would catch a throwing merge */
283
+ function updateElementOutsideAngular(manager) {
284
+ try {
285
+ updateElement(manager);
286
+ }
287
+ catch (error) {
288
+ if (!manager.errorHandler)
289
+ throw error;
290
+ manager.errorHandler.handleError(error);
291
+ }
292
+ }
293
+ function untrackClassList(element) {
294
+ // The overrides are own properties, deleting them restores the native DOMTokenList methods
295
+ for (const method of trackedMethods)
296
+ delete element.classList[method];
241
297
  }
242
298
  function cleanupManager(element) {
243
299
  // Remove from global tracking
244
300
  observedElements.delete(element);
245
301
  elementClassManagers.delete(element);
302
+ untrackClassList(element);
246
303
  // If no more elements being tracked, cleanup global observer
247
304
  if (observedElements.size === 0 && globalObserver) {
248
305
  globalObserver.disconnect();
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-core.mjs","sources":["../../../../libs/brain/core/src/helpers/css-classes-to-array.ts","../../../../libs/brain/core/src/helpers/brn-classes.ts","../../../../libs/brain/core/src/helpers/computed-previous.ts","../../../../libs/brain/core/src/helpers/zone-free.ts","../../../../libs/brain/core/src/helpers/create-hover-observable.ts","../../../../libs/brain/core/src/helpers/create-injection-token.ts","../../../../libs/brain/core/src/helpers/custom-element-class-settable.ts","../../../../libs/brain/core/src/helpers/debounced-signal.ts","../../../../libs/brain/core/src/helpers/dev-mode.ts","../../../../libs/brain/core/src/helpers/exposes-side.ts","../../../../libs/brain/core/src/helpers/exposes-state.ts","../../../../libs/brain/core/src/helpers/inject-content-dimensions.ts","../../../../libs/brain/core/src/helpers/inject-element-size.ts","../../../../libs/brain/core/src/helpers/menu-align.ts","../../../../libs/brain/core/src/helpers/resolve-value-label.ts","../../../../libs/brain/core/src/helpers/skip-delay.ts","../../../../libs/brain/core/src/helpers/table-classes-settable.ts","../../../../libs/brain/core/src/helpers/wait-for-element-animations.ts","../../../../libs/brain/core/src/spartan-ng-brain-core.ts"],"sourcesContent":["export function cssClassesToArray(classes: string | string[] | null | undefined, defaultClass = ''): string[] {\n\tconst value = classes ?? defaultClass;\n\treturn (Array.isArray(value) ? value : [value]).flatMap((className) => className.split(/\\s+/).filter(Boolean));\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n\tDestroyRef,\n\teffect,\n\tElementRef,\n\tHostAttributeToken,\n\tinject,\n\tInjector,\n\tNgZone,\n\tPLATFORM_ID,\n\trunInInjectionContext,\n} from '@angular/core';\nimport type { BrnClassValue } from './brn-class-value';\nimport { cssClassesToArray } from './css-classes-to-array';\n\n/** Merges class values into a single class string, resolving Tailwind conflicts (e.g. `hlm`). */\nexport type BrnClassMerge = (...inputs: BrnClassValue[]) => string;\n\nexport interface BrnClassesOptions {\n\t/** The function used to merge the classes, typically `hlm` from `@spartan-ng/helm/utils`. */\n\tmerge: BrnClassMerge;\n\telementRef?: ElementRef<HTMLElement>;\n\tinjector?: Injector;\n}\n\n// Global map to track class managers per element\nconst elementClassManagers = new WeakMap<HTMLElement, ElementClassManager>();\n// Global mutation observer for all elements\nlet globalObserver: MutationObserver | null = null;\nconst observedElements = new Set<HTMLElement>();\n\ninterface ElementClassManager {\n\telement: HTMLElement;\n\t/** The merge function of the first source registered on this element */\n\tmerge: BrnClassMerge;\n\tsources: Map<number, { classes: Set<string>; order: number }>;\n\tbaseClasses: Set<string>;\n\tisUpdating: boolean;\n\tnextOrder: number;\n\thasInitialized: boolean;\n\t/** The class list this manager last wrote, to tell external class changes apart from its own. */\n\tappliedClasses: Set<string> | null;\n\trestoreRafId: number | null;\n\t/** Transitions are suppressed until the first effect writes correct classes */\n\ttransitionsSuppressed: boolean;\n\t/** Original inline transition value to restore after suppression (empty string = none was set) */\n\tpreviousTransition: string;\n\t/** Original inline transition priority to preserve !important when restoring */\n\tpreviousTransitionPriority: string;\n}\n\nlet sourceCounter = 0;\n\n/**\n * This function dynamically adds and removes classes for a given element without requiring\n * the a class binding (e.g. `[class]=\"...\"`) which may interfere with other class bindings.\n *\n * 1. This will merge the existing classes on the element with the new classes.\n * 2. It will also remove any classes that were previously added by this function but are no longer present in the new classes.\n * 3. Multiple calls to this function on the same element will be merged efficiently.\n *\n * The classes are merged with `options.merge`, so a customized merge function (e.g. one created\n * with `createCn` from `cn/config`) is respected.\n */\nexport function brnClasses(computed: () => BrnClassValue[] | string, options: BrnClassesOptions) {\n\trunInInjectionContext(options.injector ?? inject(Injector), () => {\n\t\tconst elementRef = options.elementRef ?? inject(ElementRef);\n\t\tconst platformId = inject(PLATFORM_ID);\n\t\tconst destroyRef = inject(DestroyRef);\n\t\tconst baseClasses = inject(new HostAttributeToken('class'), { optional: true });\n\n\t\tconst element = elementRef.nativeElement;\n\n\t\t// Create unique identifier for this source\n\t\tconst sourceId = sourceCounter++;\n\n\t\t// Get or create the class manager for this element\n\t\tlet manager = elementClassManagers.get(element);\n\n\t\tif (!manager) {\n\t\t\t// Initialize base classes from variation (host attribute 'class')\n\t\t\tconst initialBaseClasses = new Set<string>();\n\n\t\t\tif (baseClasses) {\n\t\t\t\ttoClassList(baseClasses).forEach((cls) => initialBaseClasses.add(cls));\n\t\t\t}\n\n\t\t\tmanager = {\n\t\t\t\telement,\n\t\t\t\tmerge: options.merge,\n\t\t\t\tsources: new Map(),\n\t\t\t\tbaseClasses: initialBaseClasses,\n\t\t\t\tisUpdating: false,\n\t\t\t\tnextOrder: 0,\n\t\t\t\thasInitialized: false,\n\t\t\t\tappliedClasses: null,\n\t\t\t\trestoreRafId: null,\n\t\t\t\ttransitionsSuppressed: false,\n\t\t\t\tpreviousTransition: '',\n\t\t\t\tpreviousTransitionPriority: '',\n\t\t\t};\n\t\t\telementClassManagers.set(element, manager);\n\n\t\t\t// Setup global observer if needed and register this element. Created outside the zone so\n\t\t\t// class mutations don't trigger app-wide change detection (and loop if CD writes a class).\n\t\t\tinject(NgZone).runOutsideAngular(() => setupGlobalObserver(platformId));\n\t\t\tobservedElements.add(element);\n\n\t\t\t// Suppress transitions until the first effect writes correct classes and\n\t\t\t// the browser has painted them. This prevents CSS transition animations\n\t\t\t// during hydration when classes change from SSR state to client state.\n\t\t\tif (isPlatformBrowser(platformId)) {\n\t\t\t\tmanager.previousTransition = element.style.getPropertyValue('transition');\n\t\t\t\tmanager.previousTransitionPriority = element.style.getPropertyPriority('transition');\n\t\t\t\telement.style.setProperty('transition', 'none', 'important');\n\t\t\t\tmanager.transitionsSuppressed = true;\n\t\t\t}\n\t\t}\n\n\t\t// Assign order once at registration time\n\t\tconst sourceOrder = manager.nextOrder++;\n\n\t\tfunction updateClasses(): void {\n\t\t\t// Get the new classes from the computed function, the merge function resolves arrays and objects\n\t\t\tconst value = computed();\n\t\t\tconst newClasses = toClassList(typeof value === 'string' ? value : options.merge(value));\n\n\t\t\t// Update this source's classes, keeping the original order\n\t\t\tmanager!.sources.set(sourceId, {\n\t\t\t\tclasses: new Set(newClasses),\n\t\t\t\torder: sourceOrder,\n\t\t\t});\n\n\t\t\t// Update the element\n\t\t\tupdateElement(manager!);\n\n\t\t\t// Re-enable transitions after the first effect writes correct classes.\n\t\t\t// Deferred to next animation frame so the browser paints the class change\n\t\t\t// with transitions disabled first, then re-enables them.\n\t\t\tif (manager!.transitionsSuppressed) {\n\t\t\t\tmanager!.transitionsSuppressed = false;\n\t\t\t\tmanager!.restoreRafId = requestAnimationFrame(() => {\n\t\t\t\t\tmanager!.restoreRafId = null;\n\t\t\t\t\trestoreTransitionSuppression(manager!);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Register cleanup with DestroyRef\n\t\tdestroyRef.onDestroy(() => {\n\t\t\tif (manager!.restoreRafId !== null) {\n\t\t\t\tcancelAnimationFrame(manager!.restoreRafId);\n\t\t\t\tmanager!.restoreRafId = null;\n\t\t\t}\n\n\t\t\tif (manager!.transitionsSuppressed) {\n\t\t\t\tmanager!.transitionsSuppressed = false;\n\t\t\t\trestoreTransitionSuppression(manager!);\n\t\t\t}\n\n\t\t\t// Remove this source from the manager\n\t\t\tmanager!.sources.delete(sourceId);\n\n\t\t\t// If no more sources, clean up the manager\n\t\t\tif (manager!.sources.size === 0) {\n\t\t\t\tcleanupManager(element);\n\t\t\t} else {\n\t\t\t\t// Update element without this source's classes\n\t\t\t\tupdateElement(manager!);\n\t\t\t}\n\t\t});\n\n\t\t/**\n\t\t * We need this effect to track changes to the computed classes. Ideally, we would use\n\t\t * afterRenderEffect here, but that doesn't run in SSR contexts, so we use a standard\n\t\t * effect which works in both browser and SSR.\n\t\t */\n\t\teffect(updateClasses);\n\t});\n}\n\nfunction restoreTransitionSuppression(manager: ElementClassManager): void {\n\tconst prev = manager.previousTransition;\n\tif (prev) {\n\t\tmanager.element.style.setProperty('transition', prev, manager.previousTransitionPriority || undefined);\n\t} else {\n\t\tmanager.element.style.removeProperty('transition');\n\t}\n}\n\n// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\nfunction setupGlobalObserver(platformId: Object): void {\n\tif (isPlatformBrowser(platformId) && !globalObserver) {\n\t\t// Create single global observer that watches the entire document\n\t\tglobalObserver = new MutationObserver((mutations) => {\n\t\t\tfor (const mutation of mutations) {\n\t\t\t\tif (mutation.type === 'attributes' && mutation.attributeName === 'class') {\n\t\t\t\t\tconst element = mutation.target as HTMLElement;\n\t\t\t\t\tconst manager = elementClassManagers.get(element);\n\n\t\t\t\t\t// Only process elements we're managing\n\t\t\t\t\tif (manager && observedElements.has(element)) {\n\t\t\t\t\t\t// Ignore our own writes, and wait for the first source: its effect captures the live classes\n\t\t\t\t\t\tif (manager.isUpdating || !manager.hasInitialized) continue;\n\n\t\t\t\t\t\tupdateElement(manager);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Start observing the entire document for class attribute changes\n\t\tglobalObserver.observe(document, {\n\t\t\tattributes: true,\n\t\t\tattributeFilter: ['class'],\n\t\t\tsubtree: true, // Watch all descendants\n\t\t});\n\t}\n}\n\nfunction updateElement(manager: ElementClassManager): void {\n\tif (manager.isUpdating) return; // Prevent recursive updates\n\n\tmanager.isUpdating = true;\n\n\t// the merge function is user-provided (e.g. createCn), never leave the manager stuck in updating mode\n\ttry {\n\t\tapplyClasses(manager);\n\t} finally {\n\t\tmanager.isUpdating = false;\n\t}\n}\n\nfunction applyClasses(manager: ElementClassManager): void {\n\t// Handle initialization: capture base classes after first source registration\n\tif (!manager.hasInitialized && manager.sources.size > 0) {\n\t\t// Get current classes on element (may include SSR classes)\n\t\tconst currentClasses = toClassList(manager.element.className);\n\n\t\t// A static class missing from the live element was removed externally before this first write\n\t\tfor (const className of manager.baseClasses) {\n\t\t\tif (!currentClasses.includes(className)) {\n\t\t\t\tmanager.baseClasses.delete(className);\n\t\t\t}\n\t\t}\n\n\t\t// Get all classes that will be applied by sources\n\t\tconst allSourceClasses = new Set<string>();\n\t\tfor (const source of manager.sources.values()) {\n\t\t\tsource.classes.forEach((className) => allSourceClasses.add(className));\n\t\t}\n\n\t\t// Only consider classes as \"base\" if they're not produced by any source\n\t\t// This prevents SSR-rendered classes from being preserved as base classes\n\t\tcurrentClasses.forEach((className) => {\n\t\t\tif (!allSourceClasses.has(className)) {\n\t\t\t\tmanager.baseClasses.add(className);\n\t\t\t}\n\t\t});\n\n\t\tmanager.hasInitialized = true;\n\t} else if (manager.appliedClasses) {\n\t\t// Reconcile with the live element instead of waiting for the mutation observer: a class binding\n\t\t// that changed in the same tick as a source would otherwise be overwritten with stale base classes.\n\t\tsyncBaseClasses(manager);\n\t}\n\n\t// Get classes from all sources, sorted by registration order (later takes precedence)\n\tconst sortedSources = Array.from(manager.sources.entries()).sort(([, a], [, b]) => a.order - b.order);\n\n\tconst allSourceClasses: string[] = [];\n\tfor (const [, source] of sortedSources) {\n\t\tallSourceClasses.push(...source.classes);\n\t}\n\n\t// Combine base classes with all source classes, ensuring base classes take precedence\n\tconst classesToApply =\n\t\tallSourceClasses.length > 0 || manager.baseClasses.size > 0\n\t\t\t? manager.merge([...allSourceClasses, ...manager.baseClasses])\n\t\t\t: '';\n\tconst applied = new Set(toClassList(classesToApply));\n\t// Forget merged-out base classes like before, so a cleared binding can't bring them back\n\tfor (const className of manager.baseClasses) {\n\t\tif (!applied.has(className)) manager.baseClasses.delete(className);\n\t}\n\n\t// Apply the classes to the element\n\tif (manager.element.className !== classesToApply) {\n\t\tmanager.element.className = classesToApply;\n\t}\n\tmanager.appliedClasses = applied;\n}\n\nfunction syncBaseClasses(manager: ElementClassManager): void {\n\tconst applied = manager.appliedClasses!;\n\tconst current = new Set(toClassList(manager.element.className));\n\n\tfor (const className of applied) {\n\t\tif (!current.has(className)) {\n\t\t\tmanager.baseClasses.delete(className);\n\t\t}\n\t}\n\n\tfor (const className of current) {\n\t\tif (!applied.has(className)) {\n\t\t\tmanager.baseClasses.add(className);\n\t\t}\n\t}\n}\n\nfunction cleanupManager(element: HTMLElement): void {\n\t// Remove from global tracking\n\tobservedElements.delete(element);\n\telementClassManagers.delete(element);\n\n\t// If no more elements being tracked, cleanup global observer\n\tif (observedElements.size === 0 && globalObserver) {\n\t\tglobalObserver.disconnect();\n\t\tglobalObserver = null;\n\t}\n}\n\n// Cache for parsed class lists to avoid repeated string operations\nconst classListCache = new Map<string, string[]>();\n\nfunction toClassList(className: string): string[] {\n\t// Use the cache to avoid repeated parsing\n\tif (classListCache.has(className)) {\n\t\treturn classListCache.get(className)!;\n\t}\n\n\tconst result = cssClassesToArray(className);\n\n\t// Cache results, but limit cache size to prevent memory growth\n\tif (classListCache.size < 1000) {\n\t\tclassListCache.set(className, result);\n\t}\n\n\treturn result;\n}\n","import { computed, type Signal, untracked } from '@angular/core';\n\n/**\n * Returns a signal that emits the previous value of the given signal.\n * The first time the signal is emitted, the previous value will be the same as the current value.\n *\n * @example\n * ```ts\n * const value = signal(0);\n * const previous = computedPrevious(value);\n *\n * effect(() => {\n * console.log('Current value:', value());\n * console.log('Previous value:', previous());\n * });\n *\n * Logs:\n * // Current value: 0\n * // Previous value: 0\n *\n * value.set(1);\n *\n * Logs:\n * // Current value: 1\n * // Previous value: 0\n *\n * value.set(2);\n *\n * Logs:\n * // Current value: 2\n * // Previous value: 1\n *```\n *\n * @param computation Signal to compute previous value for\n * @returns Signal that emits previous value of `s`\n */\nexport function computedPrevious<T>(computation: Signal<T>): Signal<T> {\n\tlet current = null as T;\n\tlet previous = untracked(() => computation()); // initial value is the current value\n\n\treturn computed(() => {\n\t\tcurrent = computation();\n\t\tconst result = previous;\n\t\tprevious = current;\n\t\treturn result;\n\t});\n}\n","/**\n * We are building on shoulders of giants here and use the implementation provided by the incredible TaigaUI\n * team: https://github.com/taiga-family/taiga-ui/blob/main/projects/cdk/observables/zone-free.ts#L22\n * Check them out! Give them a try! Leave a star! Their work is incredible!\n */\nimport type { NgZone } from '@angular/core';\nimport { type MonoTypeOperatorFunction, Observable, pipe } from 'rxjs';\n\nexport function brnZoneFull<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn (source) =>\n\t\tnew Observable((subscriber) =>\n\t\t\tsource.subscribe({\n\t\t\t\tnext: (value) => zone.run(() => subscriber.next(value)),\n\t\t\t\terror: (error: unknown) => zone.run(() => subscriber.error(error)),\n\t\t\t\tcomplete: () => zone.run(() => subscriber.complete()),\n\t\t\t}),\n\t\t);\n}\n\nexport function brnZoneFree<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn (source) => new Observable((subscriber) => zone.runOutsideAngular(() => source.subscribe(subscriber)));\n}\n\nexport function brnZoneOptimized<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn pipe(brnZoneFree(zone), brnZoneFull(zone));\n}\n","import type { NgZone } from '@angular/core';\nimport { type Observable, type Subject, fromEvent, merge } from 'rxjs';\nimport { distinctUntilChanged, filter, map, takeUntil } from 'rxjs/operators';\nimport { brnZoneOptimized } from './zone-free';\n\nfunction movedOut({ currentTarget, relatedTarget }: MouseEvent): boolean {\n\treturn !isElement(relatedTarget) || !isElement(currentTarget) || !currentTarget.contains(relatedTarget);\n}\n\nexport function isElement(node?: Element | EventTarget | Node | null): node is Element {\n\treturn !!node && 'nodeType' in node && node.nodeType === Node.ELEMENT_NODE;\n}\n\nexport const createHoverObservable = (\n\tnativeElement: HTMLElement,\n\tzone: NgZone,\n\tdestroyed$: Subject<void>,\n): Observable<{ hover: boolean; relatedTarget?: EventTarget | null }> => {\n\treturn merge(\n\t\tfromEvent(nativeElement, 'mouseenter').pipe(map(() => ({ hover: true }))),\n\t\tfromEvent<MouseEvent>(nativeElement, 'mouseleave').pipe(\n\t\t\tmap((e) => ({ hover: false, relatedTarget: e.relatedTarget })),\n\t\t),\n\t\t// Hello, Safari\n\t\tfromEvent<MouseEvent>(nativeElement, 'mouseout').pipe(\n\t\t\tfilter(movedOut),\n\t\t\tmap((e) => ({ hover: false, relatedTarget: e.relatedTarget })),\n\t\t),\n\t).pipe(distinctUntilChanged(), brnZoneOptimized(zone), takeUntil(destroyed$));\n};\n","import { type InjectOptions, InjectionToken, type Provider, type Type, forwardRef, inject } from '@angular/core';\n\ntype InjectFn<TTokenValue> = {\n\t(): TTokenValue;\n\t(injectOptions: InjectOptions & { optional?: false }): TTokenValue;\n\t(injectOptions: InjectOptions & { optional: true }): TTokenValue | null;\n};\n\ntype ProvideFn<TTokenValue> = (value: TTokenValue) => Provider;\n\ntype ProvideExistingFn<TTokenValue> = (valueFactory: () => Type<TTokenValue>) => Provider;\n\nexport type CreateInjectionTokenReturn<TTokenValue> = [\n\tInjectFn<TTokenValue>,\n\tProvideFn<TTokenValue>,\n\tProvideExistingFn<TTokenValue>,\n\tInjectionToken<TTokenValue>,\n];\n\nexport function createInjectionToken<TTokenValue>(description: string): CreateInjectionTokenReturn<TTokenValue> {\n\tconst token = new InjectionToken<TTokenValue>(description);\n\n\tconst provideFn = (value: TTokenValue) => {\n\t\treturn { provide: token, useValue: value };\n\t};\n\n\tconst provideExistingFn = (value: () => TTokenValue) => {\n\t\treturn { provide: token, useExisting: forwardRef(value) };\n\t};\n\n\tconst injectFn = (options: InjectOptions = {}) => {\n\t\treturn inject(token, options);\n\t};\n\n\treturn [injectFn, provideFn, provideExistingFn, token] as CreateInjectionTokenReturn<TTokenValue>;\n}\n","import { createInjectionToken } from './create-injection-token';\n\nexport interface CustomElementClassSettable {\n\tsetClassToCustomElement: (newClass: string) => void;\n}\n\nexport const [\n\tinjectCustomClassSettable,\n\tprovideCustomClassSettable,\n\tprovideCustomClassSettableExisting,\n\tSET_CLASS_TO_CUSTOM_ELEMENT_TOKEN,\n] = createInjectionToken<CustomElementClassSettable>('@spartan-ng SET_CLASS_TO_CUSTOM_ELEMENT_TOKEN');\n","import type { Signal } from '@angular/core';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { debounceTime, distinctUntilChanged } from 'rxjs/operators';\n\n/**\n * Creates a debounced version of a source signal.\n *\n * @param source - The input signal to debounce.\n * @param delay - Debounce time in milliseconds.\n * @returns A new signal that updates only after the source has stopped changing for `delay` ms.\n */\nexport function debouncedSignal<T>(source: Signal<T>, delay: number): Signal<T> {\n\tconst source$ = toObservable(source);\n\n\tconst debounced$ = source$.pipe(debounceTime(delay), distinctUntilChanged());\n\n\treturn toSignal(debounced$, { initialValue: source() });\n}\n","declare const ngDevMode: boolean;\n/**\n * Set by Angular to true when in development mode.\n * Allows for tree-shaking code that is only used in development.\n */\nexport const brnDevMode = ngDevMode;\n","import type { Signal } from '@angular/core';\nimport { createInjectionToken } from './create-injection-token';\n\nexport interface ExposesSide {\n\tside: Signal<'top' | 'bottom' | 'left' | 'right'>;\n}\n\nexport const [\n\tinjectExposedSideProvider,\n\tprovideExposedSideProvider,\n\tprovideExposedSideProviderExisting,\n\tEXPOSES_SIDE_TOKEN,\n] = createInjectionToken<ExposesSide>('@spartan-ng EXPOSES_SIDE_TOKEN');\n","import type { Signal } from '@angular/core';\nimport { createInjectionToken } from './create-injection-token';\n\nexport interface ExposesState {\n\tstate: Signal<'open' | 'closed'>;\n}\n\nexport const [\n\tinjectExposesStateProvider,\n\tprovideExposesStateProvider,\n\tprovideExposesStateProviderExisting,\n\tEXPOSES_STATE_TOKEN,\n] = createInjectionToken<ExposesState>('@spartan-ng EXPOSES_STATE_TOKEN');\n","import { isPlatformServer } from '@angular/common';\nimport { afterNextRender, DestroyRef, ElementRef, inject, PLATFORM_ID, type Signal, signal } from '@angular/core';\n\n/** Reactive natural size of a collapsible host's projected content, or `null` before measurement. */\nexport interface ContentDimensions {\n\twidth: Signal<number | null>;\n\theight: Signal<number | null>;\n}\n\n/**\n * Measures the natural size of a collapsible host's content via `scrollHeight` so it can animate\n * between `height: 0` and a measured pixel height - the whole content is covered, regardless of how\n * it is projected. A `ResizeObserver` on the content keeps the value live. SSR-safe; the host must\n * be a block-level element for `scrollHeight` to reflect its content.\n *\n * @returns Signals with the content's width and height in px, or `null` before measurement.\n */\nexport function injectContentDimensions(): ContentDimensions {\n\tconst host = inject(ElementRef).nativeElement as HTMLElement;\n\tconst platformId = inject(PLATFORM_ID);\n\tconst destroyRef = inject(DestroyRef);\n\n\tconst width = signal<number | null>(null);\n\tconst height = signal<number | null>(null);\n\n\tif (isPlatformServer(platformId)) {\n\t\treturn { width: width.asReadonly(), height: height.asReadonly() };\n\t}\n\n\tconst measure = (): void => {\n\t\t// Drop the clamped height for the read: scrollHeight is never smaller than the element's own\n\t\t// height, so while clamped it would only ever grow. `height: auto` lets it reflect the real\n\t\t// content size (and shrink). The read is synchronous, so the swap never paints.\n\t\tconst previousHeight = host.style.height;\n\t\thost.style.height = 'auto';\n\t\twidth.set(host.scrollWidth);\n\t\theight.set(host.scrollHeight);\n\t\thost.style.height = previousHeight;\n\t};\n\n\tafterNextRender({\n\t\tread: () => {\n\t\t\tmeasure();\n\t\t\tif (typeof ResizeObserver === 'undefined') return;\n\n\t\t\t// Observe the content wrapper (not the clamped/animated host) so re-measures fire on content\n\t\t\t// changes, never on the open/close height animation. Re-measure on a fresh frame rather than\n\t\t\t// inside the callback: measure() mutates the host's inline height, and doing that during\n\t\t\t// delivery trips \"ResizeObserver loop completed with undelivered notifications\".\n\t\t\tlet frame = 0;\n\t\t\tconst observer = new ResizeObserver(() => {\n\t\t\t\tcancelAnimationFrame(frame);\n\t\t\t\tframe = requestAnimationFrame(measure);\n\t\t\t});\n\t\t\tconst content = host.firstElementChild;\n\t\t\tif (content) {\n\t\t\t\tobserver.observe(content);\n\t\t\t}\n\t\t\tdestroyRef.onDestroy(() => {\n\t\t\t\tcancelAnimationFrame(frame);\n\t\t\t\tobserver.disconnect();\n\t\t\t});\n\t\t},\n\t});\n\n\treturn { width: width.asReadonly(), height: height.asReadonly() };\n}\n","import { isPlatformServer } from '@angular/common';\nimport {\n\tafterNextRender,\n\tDestroyRef,\n\tElementRef,\n\tinject,\n\tInjector,\n\tPLATFORM_ID,\n\trunInInjectionContext,\n\ttype Signal,\n\tsignal,\n\ttype WritableSignal,\n} from '@angular/core';\n\n/**\n * Returns a reactive signal that tracks the size of a DOM element.\n *\n * This function uses a shared {@link ResizeObserver} internally to monitor multiple elements efficiently.\n * The returned signal updates whenever the element's width or height changes. It is fully SSR-safe.\n *\n * @param options Optional {@link ElementSizeOptions} configuration object.\n * @param options.elementRef The {@link ElementRef} of the element to observe. Defaults to the {@link ElementRef} injected in the current context.\n * @param options.injector Optional custom {@link Injector} to run the function in. Defaults to the current injection context.\n *\n * @returns A readonly {@link Signal} containing `{ width, height }` of the element, or `undefined` if the element has not yet been measured or on the server.\n *\n * Based on https://github.com/radix-ui/primitives/blob/main/packages/react/use-size/src/use-size.tsx\n */\nexport function injectElementSize(\n\toptions: ElementSizeOptions = {},\n): Signal<{ width: number; height: number } | undefined> {\n\treturn runInInjectionContext(options.injector ?? inject(Injector), () => {\n\t\tconst elementRef = options.elementRef ?? inject(ElementRef);\n\t\tconst platformId = inject(PLATFORM_ID);\n\t\tconst destroyRef = inject(DestroyRef);\n\n\t\tconst element = elementRef.nativeElement;\n\t\tconst size = signal<{ width: number; height: number } | undefined>(undefined);\n\n\t\tif (isPlatformServer(platformId)) {\n\t\t\treturn size;\n\t\t}\n\n\t\tafterNextRender({\n\t\t\tread: () => {\n\t\t\t\t// Initial read\n\t\t\t\tconst rect = element.getBoundingClientRect();\n\t\t\t\tsize.set({\n\t\t\t\t\twidth: rect.width || element.offsetWidth,\n\t\t\t\t\theight: rect.height || element.offsetHeight,\n\t\t\t\t});\n\n\t\t\t\t// Register element in shared observer\n\t\t\t\tobserverMap.set(element, { element, size });\n\t\t\t\tgetSharedObserver().observe(element, { box: 'border-box' });\n\n\t\t\t\tdestroyRef.onDestroy(() => {\n\t\t\t\t\tgetSharedObserver().unobserve(element);\n\t\t\t\t\tobserverMap.delete(element);\n\n\t\t\t\t\t// Disconnect global observer if no elements left\n\t\t\t\t\tif (observerMap.size === 0 && sharedObserver) {\n\t\t\t\t\t\tsharedObserver.disconnect();\n\t\t\t\t\t\tsharedObserver = undefined;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\n\t\treturn size.asReadonly();\n\t});\n}\n\nconst observerMap = new Map<HTMLElement, SizeEntry>();\nlet sharedObserver: ResizeObserver | undefined;\n\nfunction getSharedObserver() {\n\tif (!sharedObserver) {\n\t\tsharedObserver = new ResizeObserver((entries) => {\n\t\t\tfor (const entry of entries) {\n\t\t\t\tconst el = entry.target as HTMLElement;\n\t\t\t\tconst entryData = observerMap.get(el);\n\t\t\t\tif (!entryData) continue;\n\n\t\t\t\tlet width: number;\n\t\t\t\tlet height: number;\n\n\t\t\t\tif ('borderBoxSize' in entry) {\n\t\t\t\t\t// Iron out differences between browsers\n\t\t\t\t\tconst borderSize = Array.isArray(entry.borderBoxSize) ? entry.borderBoxSize[0] : entry.borderBoxSize;\n\t\t\t\t\twidth = borderSize.inlineSize;\n\t\t\t\t\theight = borderSize.blockSize;\n\t\t\t\t} else {\n\t\t\t\t\twidth = el.offsetWidth;\n\t\t\t\t\theight = el.offsetHeight;\n\t\t\t\t}\n\n\t\t\t\tentryData.size.set({ width, height });\n\t\t\t}\n\t\t});\n\t}\n\n\treturn sharedObserver;\n}\n\n/**\n * Options to configure `injectElementSize`.\n */\ninterface ElementSizeOptions {\n\t/** The ElementRef of the element to observe. Defaults to injected ElementRef in the current context. */\n\telementRef?: ElementRef<HTMLElement>;\n\t/** Optional Injector to run the function in. Defaults to the current injection context. */\n\tinjector?: Injector;\n}\n\n/**\n * Internal type used to track each observed element in the shared ResizeObserver.\n */\ninterface SizeEntry {\n\t/** The HTML element being observed. */\n\telement: HTMLElement;\n\t/** Writable signal storing the element's current width and height. */\n\tsize: WritableSignal<{ width: number; height: number } | undefined>;\n}\n","import type { CdkMenuTrigger } from '@angular/cdk/menu';\nimport type { ConnectedPosition } from '@angular/cdk/overlay';\nimport { InjectionToken, SimpleChange } from '@angular/core';\n\nexport type MenuAlign = 'start' | 'center' | 'end';\nexport type MenuSide = 'top' | 'bottom' | 'left' | 'right';\n\nconst OPPOSITE_SIDE: Record<string, MenuSide> = { top: 'bottom', bottom: 'top', left: 'right', right: 'left' };\n\n/**\n * Lets a menu trigger expose its configured `side` to the portaled content. CDK gives the content a\n * child injector whose parent is the trigger's injector, so the content can resolve this token to\n * learn which axis to read off the transform-origin.\n */\nexport interface MenuSideProvider {\n\treadonly side: () => MenuSide;\n}\n\nexport const MENU_SIDE = new InjectionToken<MenuSideProvider>('SpartanMenuSide');\n\n// derive data-side from the transform-origin CDK sets on the content. the anchored corner faces the\n// trigger, so the side is its opposite. the configured `side` tells us which axis carries the anchor\n// (top/bottom -> vertical token, left/right -> horizontal), so a CDK flip is read off the right axis.\n// CDK's origin is rtl-aware, so the derived side is too. falls back to the configured side when the\n// transform-origin is missing or centered (no flip information to apply).\nexport const deriveMenuSideFromTransformOrigin = (transformOrigin: string, side: MenuSide): MenuSide => {\n\tconst [x, y] = transformOrigin.trim().split(/\\s+/);\n\tconst anchor = side === 'top' || side === 'bottom' ? y : x;\n\treturn OPPOSITE_SIDE[anchor] ?? side;\n};\n\nexport const createMenuPosition = (align: MenuAlign, side: MenuSide): ConnectedPosition[] => {\n\tconst verticalAlign = align === 'start' ? 'top' : align === 'end' ? 'bottom' : 'center';\n\n\tconst createPositions = (\n\t\toriginX: 'start' | 'center' | 'end',\n\t\toriginY: 'top' | 'center' | 'bottom',\n\t\toverlayX: 'start' | 'center' | 'end',\n\t\toverlayY: 'top' | 'center' | 'bottom',\n\t): ConnectedPosition[] => [\n\t\t{ originX, originY, overlayX, overlayY },\n\t\t{ originX: overlayX, originY: overlayY, overlayX: originX, overlayY: originY },\n\t];\n\n\tswitch (side) {\n\t\tcase 'top':\n\t\t\treturn createPositions(align, 'top', align, 'bottom');\n\t\tcase 'bottom':\n\t\t\treturn createPositions(align, 'bottom', align, 'top');\n\t\tcase 'left':\n\t\t\treturn createPositions('start', verticalAlign, 'end', verticalAlign);\n\t\tcase 'right':\n\t\t\treturn createPositions('end', verticalAlign, 'start', verticalAlign);\n\t}\n};\n\n/**\n * Applies the given positions to a CDK menu trigger.\n *\n * CDK reads `menuPosition` only when it builds the overlay's `FlexibleConnectedPositionStrategy` (first\n * open) and when its `ngOnChanges` runs. The trigger reuses a single overlay across opens, so a bare\n * `menuPosition` assignment is silently ignored once the overlay exists - e.g. when `side`/`align`\n * change at runtime, the next open keeps the position from the first open. Assigning the property and\n * poking CDK's change handler refreshes an already-created overlay (whether open or reused) so the new\n * positions take effect. When no overlay exists yet the assignment alone is enough.\n */\nexport const updateMenuPosition = (trigger: CdkMenuTrigger, position: ConnectedPosition[]): void => {\n\ttrigger.menuPosition = position;\n\ttrigger.ngOnChanges({ menuPosition: new SimpleChange(undefined, position, false) });\n};\n","export function stringifyAsLabel(item: any, itemToStringLabel?: (item: any) => string) {\n\tif (itemToStringLabel && item !== null && item !== undefined) {\n\t\treturn itemToStringLabel(item) ?? '';\n\t}\n\tif (item && typeof item === 'object') {\n\t\tif ('label' in item && item.label !== null && item.label !== undefined) {\n\t\t\treturn String(item.label);\n\t\t}\n\t\tif ('value' in item && item.value !== null && item.value !== undefined) {\n\t\t\treturn String(item.value);\n\t\t}\n\t}\n\treturn serializeValue(item);\n}\n\nexport function serializeValue(value: unknown): string {\n\tif (value === null || value === undefined) {\n\t\treturn '';\n\t}\n\tif (typeof value === 'string') {\n\t\treturn value;\n\t}\n\ttry {\n\t\treturn JSON.stringify(value);\n\t} catch {\n\t\treturn String(value);\n\t}\n}\n","import { DestroyRef, inject, type Signal, signal } from '@angular/core';\n\n/** Skip-delay grouping: once one member opens, siblings skip their delay until the window elapses. */\nexport interface SkipDelay {\n\t/** Whether the next open should still wait for its delay (`true`) or open instantly (`false`). */\n\treadonly isOpenDelayed: Signal<boolean>;\n\t/** Report that a member opened: opens the skip window so siblings skip their delay. */\n\topen(): void;\n\t/** Report that a member closed: re-require the delay once the window elapses. */\n\tclose(): void;\n}\n\n/** Must be called in an injection context; cleans up its pending timer on destroy. */\nexport function injectSkipDelay(skipDelayDuration: () => number): SkipDelay {\n\tconst isOpenDelayed = signal(true);\n\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\n\tinject(DestroyRef).onDestroy(() => clearTimeout(timer));\n\n\treturn {\n\t\tisOpenDelayed: isOpenDelayed.asReadonly(),\n\t\topen(): void {\n\t\t\tclearTimeout(timer);\n\t\t\tif (skipDelayDuration() > 0) isOpenDelayed.set(false);\n\t\t},\n\t\tclose(): void {\n\t\t\tclearTimeout(timer);\n\t\t\tconst duration = skipDelayDuration();\n\t\t\tif (duration > 0) {\n\t\t\t\ttimer = setTimeout(() => isOpenDelayed.set(true), duration);\n\t\t\t}\n\t\t},\n\t};\n}\n","import { createInjectionToken } from './create-injection-token';\n\nexport interface TableClassesSettable {\n\tsetTableClasses: (classes: Partial<{ table: string; headerRow: string; bodyRow: string }>) => void;\n}\n\nexport const [\n\tinjectTableClassesSettable,\n\tprovideTableClassesSettable,\n\tprovideTableClassesSettableExisting,\n\tSET_TABLE_CLASSES_TOKEN,\n] = createInjectionToken<TableClassesSettable>('@spartan-ng SET_TABLE_CLASSES_TOKEN');\n","const MAX_ANIMATION_WAIT_MS = 5_000;\nconst ANIMATION_WAIT_BUFFER_MS = 50;\n\nexport function getActiveElementAnimations(elements: readonly (HTMLElement | null | undefined)[]): Animation[] {\n\treturn elements\n\t\t.filter((element): element is HTMLElement => !!element)\n\t\t.flatMap((element) =>\n\t\t\ttypeof element.getAnimations === 'function'\n\t\t\t\t? element.getAnimations({ subtree: true }).filter((animation) => animation.playState !== 'finished')\n\t\t\t\t: [],\n\t\t);\n}\n\nexport async function waitForAnimations(animations: readonly Animation[]): Promise<void> {\n\tif (!animations.length) return;\n\n\tlet timeout: ReturnType<typeof setTimeout> | undefined;\n\tconst fallbackMs = getFallbackTimeout(animations);\n\n\ttry {\n\t\tawait Promise.race([\n\t\t\tPromise.allSettled(animations.map((animation) => animation.finished)),\n\t\t\tnew Promise<void>((resolve) => {\n\t\t\t\ttimeout = setTimeout(resolve, fallbackMs);\n\t\t\t}),\n\t\t]);\n\t} finally {\n\t\tif (timeout) clearTimeout(timeout);\n\t}\n}\n\n/**\n * Waits for active animations, including subtree animations, within the given element to finish.\n */\nexport async function waitForElementAnimations(element: HTMLElement): Promise<void> {\n\tawait waitForAnimations(getActiveElementAnimations([element]));\n}\n\nfunction getFallbackTimeout(animations: readonly Animation[]): number {\n\tconst longestAnimation = animations.reduce((longest, animation) => {\n\t\tconst endTime = animation.effect?.getComputedTiming().endTime;\n\t\treturn typeof endTime === 'number' && Number.isFinite(endTime) ? Math.max(longest, endTime) : longest;\n\t}, 0);\n\n\tif (!longestAnimation) return MAX_ANIMATION_WAIT_MS;\n\treturn Math.min(longestAnimation + ANIMATION_WAIT_BUFFER_MS, MAX_ANIMATION_WAIT_MS);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;SAAgB,iBAAiB,CAAC,OAA6C,EAAE,YAAY,GAAG,EAAE,EAAA;AACjG,IAAA,MAAM,KAAK,GAAG,OAAO,IAAI,YAAY;AACrC,IAAA,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC/G;;ACsBA;AACA,MAAM,oBAAoB,GAAG,IAAI,OAAO,EAAoC;AAC5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CAAC;AACF,SAAA,CAAC;IACH;YAAU;AACT,QAAA,IAAI,OAAO;YAAE,YAAY,CAAC,OAAO,CAAC;IACnC;AACD;AAEA;;AAEG;AACI,eAAe,wBAAwB,CAAC,OAAoB,EAAA;IAClE,MAAM,iBAAiB,CAAC,0BAA0B,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/D;AAEA,SAAS,kBAAkB,CAAC,UAAgC,EAAA;IAC3D,MAAM,gBAAgB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,SAAS,KAAI;QACjE,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,OAAO;QAC7D,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,OAAO;IACtG,CAAC,EAAE,CAAC,CAAC;AAEL,IAAA,IAAI,CAAC,gBAAgB;AAAE,QAAA,OAAO,qBAAqB;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,gBAAgB,GAAG,wBAAwB,EAAE,qBAAqB,CAAC;AACpF;;AC9CA;;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-core.mjs","sources":["../../../../libs/brain/core/src/helpers/css-classes-to-array.ts","../../../../libs/brain/core/src/helpers/brn-classes.ts","../../../../libs/brain/core/src/helpers/computed-previous.ts","../../../../libs/brain/core/src/helpers/zone-free.ts","../../../../libs/brain/core/src/helpers/create-hover-observable.ts","../../../../libs/brain/core/src/helpers/create-injection-token.ts","../../../../libs/brain/core/src/helpers/custom-element-class-settable.ts","../../../../libs/brain/core/src/helpers/debounced-signal.ts","../../../../libs/brain/core/src/helpers/dev-mode.ts","../../../../libs/brain/core/src/helpers/exposes-side.ts","../../../../libs/brain/core/src/helpers/exposes-state.ts","../../../../libs/brain/core/src/helpers/inject-content-dimensions.ts","../../../../libs/brain/core/src/helpers/inject-element-size.ts","../../../../libs/brain/core/src/helpers/menu-align.ts","../../../../libs/brain/core/src/helpers/resolve-value-label.ts","../../../../libs/brain/core/src/helpers/skip-delay.ts","../../../../libs/brain/core/src/helpers/table-classes-settable.ts","../../../../libs/brain/core/src/helpers/wait-for-element-animations.ts","../../../../libs/brain/core/src/spartan-ng-brain-core.ts"],"sourcesContent":["export function cssClassesToArray(classes: string | string[] | null | undefined, defaultClass = ''): string[] {\n\tconst value = classes ?? defaultClass;\n\treturn (Array.isArray(value) ? value : [value]).flatMap((className) => className.split(/\\s+/).filter(Boolean));\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n\tDestroyRef,\n\teffect,\n\tElementRef,\n\tErrorHandler,\n\tHostAttributeToken,\n\tinject,\n\tInjector,\n\tNgZone,\n\tPLATFORM_ID,\n\trunInInjectionContext,\n} from '@angular/core';\nimport type { BrnClassValue } from './brn-class-value';\nimport { cssClassesToArray } from './css-classes-to-array';\n\n/** Merges class values into a single class string, resolving Tailwind conflicts (e.g. `hlm`). */\nexport type BrnClassMerge = (...inputs: BrnClassValue[]) => string;\n\nexport interface BrnClassesOptions {\n\t/** The function used to merge the classes, typically `hlm` from `@spartan-ng/helm/utils`. */\n\tmerge: BrnClassMerge;\n\telementRef?: ElementRef<HTMLElement>;\n\tinjector?: Injector;\n}\n\n// Global map to track class managers per element\nconst elementClassManagers = new WeakMap<HTMLElement, ElementClassManager>();\n// Global mutation observer for all elements\nlet globalObserver: MutationObserver | null = null;\nconst observedElements = new Set<HTMLElement>();\n\ninterface ElementClassManager {\n\telement: HTMLElement;\n\t/** The merge function of the first source registered on this element */\n\tmerge: BrnClassMerge;\n\tsources: Map<number, { classes: Set<string>; order: number }>;\n\t/** Classes wanted by everything except the sources, in write order; the latest write wins conflicts */\n\tbaseClasses: Set<string>;\n\t/** A classList write is waiting for the batched merge */\n\tupdateQueued: boolean;\n\terrorHandler: ErrorHandler | null;\n\tzone: NgZone;\n\tnextOrder: number;\n\t/** The className as brnClasses last left it (null until the first source runs); a difference is an outside write */\n\twrittenClassName: string | null;\n\trestoreRafId: number | null;\n\t/** Transitions are suppressed until the first effect writes correct classes */\n\ttransitionsSuppressed: boolean;\n\t/** Original inline transition value to restore after suppression (empty string = none was set) */\n\tpreviousTransition: string;\n\t/** Original inline transition priority to preserve !important when restoring */\n\tpreviousTransitionPriority: string;\n}\n\nlet sourceCounter = 0;\n\n/**\n * This function dynamically adds and removes classes for a given element without requiring\n * the a class binding (e.g. `[class]=\"...\"`) which may interfere with other class bindings.\n *\n * 1. This will merge the existing classes on the element with the new classes.\n * 2. It will also remove any classes that were previously added by this function but are no longer present in the new classes.\n * 3. Multiple calls to this function on the same element will be merged efficiently.\n *\n * The classes are merged with `options.merge`, so a customized merge function (e.g. one created\n * with `createCn` from `cn/config`) is respected.\n */\nexport function brnClasses(computed: () => BrnClassValue[] | string, options: BrnClassesOptions) {\n\trunInInjectionContext(options.injector ?? inject(Injector), () => {\n\t\tconst elementRef = options.elementRef ?? inject(ElementRef);\n\t\tconst platformId = inject(PLATFORM_ID);\n\t\tconst destroyRef = inject(DestroyRef);\n\t\tconst baseClasses = inject(new HostAttributeToken('class'), { optional: true });\n\n\t\tconst element = elementRef.nativeElement;\n\n\t\t// Create unique identifier for this source\n\t\tconst sourceId = sourceCounter++;\n\n\t\t// Get or create the class manager for this element\n\t\tlet manager = elementClassManagers.get(element);\n\n\t\tif (!manager) {\n\t\t\t// Initialize base classes from variation (host attribute 'class')\n\t\t\tconst initialBaseClasses = new Set<string>();\n\n\t\t\tif (baseClasses) {\n\t\t\t\ttoClassList(baseClasses).forEach((cls) => initialBaseClasses.add(cls));\n\t\t\t}\n\n\t\t\tmanager = {\n\t\t\t\telement,\n\t\t\t\tmerge: options.merge,\n\t\t\t\tsources: new Map(),\n\t\t\t\tbaseClasses: initialBaseClasses,\n\t\t\t\tupdateQueued: false,\n\t\t\t\terrorHandler: inject(ErrorHandler, { optional: true }),\n\t\t\t\tzone: inject(NgZone),\n\t\t\t\tnextOrder: 0,\n\t\t\t\twrittenClassName: null,\n\t\t\t\trestoreRafId: null,\n\t\t\t\ttransitionsSuppressed: false,\n\t\t\t\tpreviousTransition: '',\n\t\t\t\tpreviousTransitionPriority: '',\n\t\t\t};\n\t\t\telementClassManagers.set(element, manager);\n\t\t\ttrackClassList(manager);\n\n\t\t\t// Setup global observer if needed and register this element. Created outside the zone so\n\t\t\t// class mutations don't trigger app-wide change detection (and loop if CD writes a class).\n\t\t\tmanager.zone.runOutsideAngular(() => setupGlobalObserver(platformId));\n\t\t\tobservedElements.add(element);\n\n\t\t\t// Suppress transitions until the first effect writes correct classes and\n\t\t\t// the browser has painted them. This prevents CSS transition animations\n\t\t\t// during hydration when classes change from SSR state to client state.\n\t\t\tif (isPlatformBrowser(platformId)) {\n\t\t\t\tmanager.previousTransition = element.style.getPropertyValue('transition');\n\t\t\t\tmanager.previousTransitionPriority = element.style.getPropertyPriority('transition');\n\t\t\t\telement.style.setProperty('transition', 'none', 'important');\n\t\t\t\tmanager.transitionsSuppressed = true;\n\t\t\t}\n\t\t}\n\n\t\t// Assign order once at registration time\n\t\tconst sourceOrder = manager.nextOrder++;\n\n\t\tfunction updateClasses(): void {\n\t\t\t// Get the new classes from the computed function, the merge function resolves arrays and objects\n\t\t\tconst value = computed();\n\t\t\tconst newClasses = toClassList(typeof value === 'string' ? value : options.merge(value));\n\n\t\t\t// Update this source's classes, keeping the original order\n\t\t\tmanager!.sources.set(sourceId, {\n\t\t\t\tclasses: new Set(newClasses),\n\t\t\t\torder: sourceOrder,\n\t\t\t});\n\n\t\t\t// Update the element\n\t\t\tupdateElement(manager!);\n\n\t\t\t// Re-enable transitions after the first effect writes correct classes.\n\t\t\t// Deferred to next animation frame so the browser paints the class change\n\t\t\t// with transitions disabled first, then re-enables them.\n\t\t\tif (manager!.transitionsSuppressed) {\n\t\t\t\tmanager!.transitionsSuppressed = false;\n\t\t\t\tmanager!.restoreRafId = requestAnimationFrame(() => {\n\t\t\t\t\tmanager!.restoreRafId = null;\n\t\t\t\t\trestoreTransitionSuppression(manager!);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Register cleanup with DestroyRef\n\t\tdestroyRef.onDestroy(() => {\n\t\t\tif (manager!.restoreRafId !== null) {\n\t\t\t\tcancelAnimationFrame(manager!.restoreRafId);\n\t\t\t\tmanager!.restoreRafId = null;\n\t\t\t}\n\n\t\t\tif (manager!.transitionsSuppressed) {\n\t\t\t\tmanager!.transitionsSuppressed = false;\n\t\t\t\trestoreTransitionSuppression(manager!);\n\t\t\t}\n\n\t\t\t// Remove this source from the manager\n\t\t\tmanager!.sources.delete(sourceId);\n\n\t\t\t// If no more sources, clean up the manager\n\t\t\tif (manager!.sources.size === 0) {\n\t\t\t\tcleanupManager(element);\n\t\t\t} else {\n\t\t\t\t// Update element without this source's classes\n\t\t\t\tupdateElement(manager!);\n\t\t\t}\n\t\t});\n\n\t\t/**\n\t\t * We need this effect to track changes to the computed classes. Ideally, we would use\n\t\t * afterRenderEffect here, but that doesn't run in SSR contexts, so we use a standard\n\t\t * effect which works in both browser and SSR.\n\t\t */\n\t\teffect(updateClasses);\n\t});\n}\n\nfunction restoreTransitionSuppression(manager: ElementClassManager): void {\n\tconst prev = manager.previousTransition;\n\tif (prev) {\n\t\tmanager.element.style.setProperty('transition', prev, manager.previousTransitionPriority || undefined);\n\t} else {\n\t\tmanager.element.style.removeProperty('transition');\n\t}\n}\n\n// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\nfunction setupGlobalObserver(platformId: Object): void {\n\tif (isPlatformBrowser(platformId) && !globalObserver) {\n\t\t// Create single global observer that watches the entire document\n\t\tglobalObserver = new MutationObserver((mutations) => {\n\t\t\tfor (const mutation of mutations) {\n\t\t\t\tif (mutation.type === 'attributes' && mutation.attributeName === 'class') {\n\t\t\t\t\tconst element = mutation.target as HTMLElement;\n\t\t\t\t\tconst manager = elementClassManagers.get(element);\n\n\t\t\t\t\t// Only process elements we're managing\n\t\t\t\t\tif (manager && observedElements.has(element)) {\n\t\t\t\t\t\t// Wait for the first source (it adopts the live classes), and skip our own writes:\n\t\t\t\t\t\t// the callback runs after they're done, so only the written value tells them apart\n\t\t\t\t\t\tif (manager.writtenClassName === null || element.className === manager.writtenClassName) continue;\n\n\t\t\t\t\t\tscheduleUpdate(manager);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// Start observing the entire document for class attribute changes\n\t\tglobalObserver.observe(document, {\n\t\t\tattributes: true,\n\t\t\tattributeFilter: ['class'],\n\t\t\tsubtree: true, // Watch all descendants\n\t\t});\n\t}\n}\n\nfunction updateElement(manager: ElementClassManager): void {\n\tadoptOutsideWrite(manager);\n\t// After adopting: this merge is the one adopting queued\n\tmanager.updateQueued = false;\n\n\t// Get classes from all sources, sorted by registration order (later takes precedence)\n\tconst sortedSources = Array.from(manager.sources.entries()).sort(([, a], [, b]) => a.order - b.order);\n\n\tconst allSourceClasses: string[] = [];\n\tfor (const [, source] of sortedSources) {\n\t\tallSourceClasses.push(...source.classes);\n\t}\n\n\t// Combine base classes with all source classes, ensuring base classes take precedence\n\tconst classesToApply =\n\t\tallSourceClasses.length > 0 || manager.baseClasses.size > 0\n\t\t\t? manager.merge([...allSourceClasses, ...manager.baseClasses])\n\t\t\t: '';\n\n\t// Apply the classes to the element\n\tif (manager.element.className !== classesToApply) {\n\t\tmanager.element.className = classesToApply;\n\t}\n\tmanager.writtenClassName = manager.element.className;\n}\n\n/**\n * writtenClassName is the class list as brnClasses last left it, so any difference is a className or\n * class attribute write from outside. Those replace the whole list: the wanted classes become the live\n * ones (minus what the sources put there), and a class the merge had dropped is forgotten.\n * Before the first source runs, writtenClassName is null and the live classes (including SSR) are adopted.\n */\nfunction adoptOutsideWrite(manager: ElementClassManager): void {\n\tif (manager.sources.size === 0) return;\n\tconst current = manager.element.className;\n\tif (current === manager.writtenClassName) return;\n\n\t// What the sources put on the element; a class that is also wanted (static or tracked) stays wanted\n\tconst sourceOutput =\n\t\tmanager.writtenClassName === null\n\t\t\t? [...manager.sources.values()].flatMap((source) => [...source.classes])\n\t\t\t: toClassList(manager.writtenClassName);\n\tconst fromSources = new Set(sourceOutput.filter((className) => !manager.baseClasses.has(className)));\n\n\tmanager.baseClasses.clear();\n\tfor (const className of toClassList(current)) {\n\t\tif (!fromSources.has(className)) manager.baseClasses.add(className);\n\t}\n\tmanager.writtenClassName = current;\n\t// The observer now sees nothing new, so merge from here even if the write that got us here throws\n\tscheduleUpdate(manager);\n}\n\nconst trackedMethods = ['add', 'remove', 'toggle', 'replace'] as const;\n\n/**\n * Angular applies `[class]` and `[class.x]` through `classList`. Recording those writes keeps every wanted\n * class, including one the merge currently drops, so it comes back once the class it lost to is removed.\n * The DOM can't tell us that: removing a class that isn't on the element changes nothing there.\n */\nfunction trackClassList(manager: ElementClassManager): void {\n\tconst list = manager.element.classList;\n\tif (!list) return;\n\tconst native = { add: list.add, remove: list.remove, replace: list.replace };\n\tconst wanted = manager.baseClasses;\n\n\t// Write to the DOM right away so the classList answers like the native one; only the merge is batched\n\tconst write = (apply: () => void, nativeWrite: () => void) => {\n\t\tadoptOutsideWrite(manager);\n\t\t// Native first: it rejects invalid tokens ('', 'a b') before anything lands in the wanted set\n\t\tnativeWrite();\n\t\tapply();\n\t\t// Before the first source runs the wanted set is still kept: it decides which source classes stay wanted\n\t\tif (manager.writtenClassName === null) return;\n\t\tmanager.writtenClassName = manager.element.className;\n\t\tscheduleUpdate(manager);\n\t};\n\n\tconst add = (...tokens: string[]) =>\n\t\twrite(\n\t\t\t() => tokens.forEach((token) => (wanted.delete(token), wanted.add(token))),\n\t\t\t() => native.add.apply(list, tokens),\n\t\t);\n\tconst remove = (...tokens: string[]) =>\n\t\twrite(\n\t\t\t() => tokens.forEach((token) => wanted.delete(token)),\n\t\t\t() => native.remove.apply(list, tokens),\n\t\t);\n\tconst toggle = (token: string, force?: boolean) => {\n\t\tconst on = force ?? !list.contains(token);\n\t\tif (on) add(token);\n\t\telse remove(token);\n\t\treturn on;\n\t};\n\t// One native call, so both tokens are validated before anything changes\n\tconst replace = (oldToken: string, newToken: string) => {\n\t\tlet replaced = false;\n\t\twrite(\n\t\t\t() => {\n\t\t\t\tif (!replaced) return;\n\t\t\t\twanted.delete(oldToken);\n\t\t\t\twanted.delete(newToken);\n\t\t\t\twanted.add(newToken);\n\t\t\t},\n\t\t\t() => (replaced = native.replace.call(list, oldToken, newToken)),\n\t\t);\n\t\treturn replaced;\n\t};\n\n\t// Domino (SSR) declares these read-only on the prototype, so assigning them would throw\n\tconst overrides = { add, remove, toggle, replace };\n\tfor (const method of trackedMethods) {\n\t\tObject.defineProperty(list, method, { value: overrides[method], configurable: true, writable: true });\n\t}\n}\n\n/**\n * Angular writes each class binding separately, so merging per write would run the merge once per binding.\n * One merge per element per tick still lands before paint, and keeps a throwing merge out of Angular's renderer.\n */\nfunction scheduleUpdate(manager: ElementClassManager): void {\n\tif (manager.updateQueued) return;\n\tmanager.updateQueued = true;\n\n\t// Tracked writes come from the renderer inside the zone; a microtask queued there would make zone.js\n\t// fire onMicrotaskEmpty again and run a second change detection pass for every class binding change\n\tmanager.zone.runOutsideAngular(() =>\n\t\tqueueMicrotask(() => {\n\t\t\t// A source update or cleanup in between already handled it\n\t\t\tif (!manager.updateQueued || elementClassManagers.get(manager.element) !== manager) return;\n\n\t\t\tupdateElementOutsideAngular(manager);\n\t\t}),\n\t);\n}\n\n/** For batched updates (tracked writes and the observer), where nothing in Angular would catch a throwing merge */\nfunction updateElementOutsideAngular(manager: ElementClassManager): void {\n\ttry {\n\t\tupdateElement(manager);\n\t} catch (error) {\n\t\tif (!manager.errorHandler) throw error;\n\t\tmanager.errorHandler.handleError(error);\n\t}\n}\n\nfunction untrackClassList(element: HTMLElement): void {\n\t// The overrides are own properties, deleting them restores the native DOMTokenList methods\n\tfor (const method of trackedMethods) delete (element.classList as Partial<DOMTokenList>)[method];\n}\n\nfunction cleanupManager(element: HTMLElement): void {\n\t// Remove from global tracking\n\tobservedElements.delete(element);\n\telementClassManagers.delete(element);\n\tuntrackClassList(element);\n\n\t// If no more elements being tracked, cleanup global observer\n\tif (observedElements.size === 0 && globalObserver) {\n\t\tglobalObserver.disconnect();\n\t\tglobalObserver = null;\n\t}\n}\n\n// Cache for parsed class lists to avoid repeated string operations\nconst classListCache = new Map<string, string[]>();\n\nfunction toClassList(className: string): string[] {\n\t// Use the cache to avoid repeated parsing\n\tif (classListCache.has(className)) {\n\t\treturn classListCache.get(className)!;\n\t}\n\n\tconst result = cssClassesToArray(className);\n\n\t// Cache results, but limit cache size to prevent memory growth\n\tif (classListCache.size < 1000) {\n\t\tclassListCache.set(className, result);\n\t}\n\n\treturn result;\n}\n","import { computed, type Signal, untracked } from '@angular/core';\n\n/**\n * Returns a signal that emits the previous value of the given signal.\n * The first time the signal is emitted, the previous value will be the same as the current value.\n *\n * @example\n * ```ts\n * const value = signal(0);\n * const previous = computedPrevious(value);\n *\n * effect(() => {\n * console.log('Current value:', value());\n * console.log('Previous value:', previous());\n * });\n *\n * Logs:\n * // Current value: 0\n * // Previous value: 0\n *\n * value.set(1);\n *\n * Logs:\n * // Current value: 1\n * // Previous value: 0\n *\n * value.set(2);\n *\n * Logs:\n * // Current value: 2\n * // Previous value: 1\n *```\n *\n * @param computation Signal to compute previous value for\n * @returns Signal that emits previous value of `s`\n */\nexport function computedPrevious<T>(computation: Signal<T>): Signal<T> {\n\tlet current = null as T;\n\tlet previous = untracked(() => computation()); // initial value is the current value\n\n\treturn computed(() => {\n\t\tcurrent = computation();\n\t\tconst result = previous;\n\t\tprevious = current;\n\t\treturn result;\n\t});\n}\n","/**\n * We are building on shoulders of giants here and use the implementation provided by the incredible TaigaUI\n * team: https://github.com/taiga-family/taiga-ui/blob/main/projects/cdk/observables/zone-free.ts#L22\n * Check them out! Give them a try! Leave a star! Their work is incredible!\n */\nimport type { NgZone } from '@angular/core';\nimport { type MonoTypeOperatorFunction, Observable, pipe } from 'rxjs';\n\nexport function brnZoneFull<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn (source) =>\n\t\tnew Observable((subscriber) =>\n\t\t\tsource.subscribe({\n\t\t\t\tnext: (value) => zone.run(() => subscriber.next(value)),\n\t\t\t\terror: (error: unknown) => zone.run(() => subscriber.error(error)),\n\t\t\t\tcomplete: () => zone.run(() => subscriber.complete()),\n\t\t\t}),\n\t\t);\n}\n\nexport function brnZoneFree<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn (source) => new Observable((subscriber) => zone.runOutsideAngular(() => source.subscribe(subscriber)));\n}\n\nexport function brnZoneOptimized<T>(zone: NgZone): MonoTypeOperatorFunction<T> {\n\treturn pipe(brnZoneFree(zone), brnZoneFull(zone));\n}\n","import type { NgZone } from '@angular/core';\nimport { type Observable, type Subject, fromEvent, merge } from 'rxjs';\nimport { distinctUntilChanged, filter, map, takeUntil } from 'rxjs/operators';\nimport { brnZoneOptimized } from './zone-free';\n\nfunction movedOut({ currentTarget, relatedTarget }: MouseEvent): boolean {\n\treturn !isElement(relatedTarget) || !isElement(currentTarget) || !currentTarget.contains(relatedTarget);\n}\n\nexport function isElement(node?: Element | EventTarget | Node | null): node is Element {\n\treturn !!node && 'nodeType' in node && node.nodeType === Node.ELEMENT_NODE;\n}\n\nexport const createHoverObservable = (\n\tnativeElement: HTMLElement,\n\tzone: NgZone,\n\tdestroyed$: Subject<void>,\n): Observable<{ hover: boolean; relatedTarget?: EventTarget | null }> => {\n\treturn merge(\n\t\tfromEvent(nativeElement, 'mouseenter').pipe(map(() => ({ hover: true }))),\n\t\tfromEvent<MouseEvent>(nativeElement, 'mouseleave').pipe(\n\t\t\tmap((e) => ({ hover: false, relatedTarget: e.relatedTarget })),\n\t\t),\n\t\t// Hello, Safari\n\t\tfromEvent<MouseEvent>(nativeElement, 'mouseout').pipe(\n\t\t\tfilter(movedOut),\n\t\t\tmap((e) => ({ hover: false, relatedTarget: e.relatedTarget })),\n\t\t),\n\t).pipe(distinctUntilChanged(), brnZoneOptimized(zone), takeUntil(destroyed$));\n};\n","import { type InjectOptions, InjectionToken, type Provider, type Type, forwardRef, inject } from '@angular/core';\n\ntype InjectFn<TTokenValue> = {\n\t(): TTokenValue;\n\t(injectOptions: InjectOptions & { optional?: false }): TTokenValue;\n\t(injectOptions: InjectOptions & { optional: true }): TTokenValue | null;\n};\n\ntype ProvideFn<TTokenValue> = (value: TTokenValue) => Provider;\n\ntype ProvideExistingFn<TTokenValue> = (valueFactory: () => Type<TTokenValue>) => Provider;\n\nexport type CreateInjectionTokenReturn<TTokenValue> = [\n\tInjectFn<TTokenValue>,\n\tProvideFn<TTokenValue>,\n\tProvideExistingFn<TTokenValue>,\n\tInjectionToken<TTokenValue>,\n];\n\nexport function createInjectionToken<TTokenValue>(description: string): CreateInjectionTokenReturn<TTokenValue> {\n\tconst token = new InjectionToken<TTokenValue>(description);\n\n\tconst provideFn = (value: TTokenValue) => {\n\t\treturn { provide: token, useValue: value };\n\t};\n\n\tconst provideExistingFn = (value: () => TTokenValue) => {\n\t\treturn { provide: token, useExisting: forwardRef(value) };\n\t};\n\n\tconst injectFn = (options: InjectOptions = {}) => {\n\t\treturn inject(token, options);\n\t};\n\n\treturn [injectFn, provideFn, provideExistingFn, token] as CreateInjectionTokenReturn<TTokenValue>;\n}\n","import { createInjectionToken } from './create-injection-token';\n\nexport interface CustomElementClassSettable {\n\tsetClassToCustomElement: (newClass: string) => void;\n}\n\nexport const [\n\tinjectCustomClassSettable,\n\tprovideCustomClassSettable,\n\tprovideCustomClassSettableExisting,\n\tSET_CLASS_TO_CUSTOM_ELEMENT_TOKEN,\n] = createInjectionToken<CustomElementClassSettable>('@spartan-ng SET_CLASS_TO_CUSTOM_ELEMENT_TOKEN');\n","import type { Signal } from '@angular/core';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { debounceTime, distinctUntilChanged } from 'rxjs/operators';\n\n/**\n * Creates a debounced version of a source signal.\n *\n * @param source - The input signal to debounce.\n * @param delay - Debounce time in milliseconds.\n * @returns A new signal that updates only after the source has stopped changing for `delay` ms.\n */\nexport function debouncedSignal<T>(source: Signal<T>, delay: number): Signal<T> {\n\tconst source$ = toObservable(source);\n\n\tconst debounced$ = source$.pipe(debounceTime(delay), distinctUntilChanged());\n\n\treturn toSignal(debounced$, { initialValue: source() });\n}\n","declare const ngDevMode: boolean;\n/**\n * Set by Angular to true when in development mode.\n * Allows for tree-shaking code that is only used in development.\n */\nexport const brnDevMode = ngDevMode;\n","import type { Signal } from '@angular/core';\nimport { createInjectionToken } from './create-injection-token';\n\nexport interface ExposesSide {\n\tside: Signal<'top' | 'bottom' | 'left' | 'right'>;\n}\n\nexport const [\n\tinjectExposedSideProvider,\n\tprovideExposedSideProvider,\n\tprovideExposedSideProviderExisting,\n\tEXPOSES_SIDE_TOKEN,\n] = createInjectionToken<ExposesSide>('@spartan-ng EXPOSES_SIDE_TOKEN');\n","import type { Signal } from '@angular/core';\nimport { createInjectionToken } from './create-injection-token';\n\nexport interface ExposesState {\n\tstate: Signal<'open' | 'closed'>;\n}\n\nexport const [\n\tinjectExposesStateProvider,\n\tprovideExposesStateProvider,\n\tprovideExposesStateProviderExisting,\n\tEXPOSES_STATE_TOKEN,\n] = createInjectionToken<ExposesState>('@spartan-ng EXPOSES_STATE_TOKEN');\n","import { isPlatformServer } from '@angular/common';\nimport { afterNextRender, DestroyRef, ElementRef, inject, PLATFORM_ID, type Signal, signal } from '@angular/core';\n\n/** Reactive natural size of a collapsible host's projected content, or `null` before measurement. */\nexport interface ContentDimensions {\n\twidth: Signal<number | null>;\n\theight: Signal<number | null>;\n}\n\n/**\n * Measures the natural size of a collapsible host's content via `scrollHeight` so it can animate\n * between `height: 0` and a measured pixel height - the whole content is covered, regardless of how\n * it is projected. A `ResizeObserver` on the content keeps the value live. SSR-safe; the host must\n * be a block-level element for `scrollHeight` to reflect its content.\n *\n * @returns Signals with the content's width and height in px, or `null` before measurement.\n */\nexport function injectContentDimensions(): ContentDimensions {\n\tconst host = inject(ElementRef).nativeElement as HTMLElement;\n\tconst platformId = inject(PLATFORM_ID);\n\tconst destroyRef = inject(DestroyRef);\n\n\tconst width = signal<number | null>(null);\n\tconst height = signal<number | null>(null);\n\n\tif (isPlatformServer(platformId)) {\n\t\treturn { width: width.asReadonly(), height: height.asReadonly() };\n\t}\n\n\tconst measure = (): void => {\n\t\t// Drop the clamped height for the read: scrollHeight is never smaller than the element's own\n\t\t// height, so while clamped it would only ever grow. `height: auto` lets it reflect the real\n\t\t// content size (and shrink). The read is synchronous, so the swap never paints.\n\t\tconst previousHeight = host.style.height;\n\t\thost.style.height = 'auto';\n\t\twidth.set(host.scrollWidth);\n\t\theight.set(host.scrollHeight);\n\t\thost.style.height = previousHeight;\n\t};\n\n\tafterNextRender({\n\t\tread: () => {\n\t\t\tmeasure();\n\t\t\tif (typeof ResizeObserver === 'undefined') return;\n\n\t\t\t// Observe the content wrapper (not the clamped/animated host) so re-measures fire on content\n\t\t\t// changes, never on the open/close height animation. Re-measure on a fresh frame rather than\n\t\t\t// inside the callback: measure() mutates the host's inline height, and doing that during\n\t\t\t// delivery trips \"ResizeObserver loop completed with undelivered notifications\".\n\t\t\tlet frame = 0;\n\t\t\tconst observer = new ResizeObserver(() => {\n\t\t\t\tcancelAnimationFrame(frame);\n\t\t\t\tframe = requestAnimationFrame(measure);\n\t\t\t});\n\t\t\tconst content = host.firstElementChild;\n\t\t\tif (content) {\n\t\t\t\tobserver.observe(content);\n\t\t\t}\n\t\t\tdestroyRef.onDestroy(() => {\n\t\t\t\tcancelAnimationFrame(frame);\n\t\t\t\tobserver.disconnect();\n\t\t\t});\n\t\t},\n\t});\n\n\treturn { width: width.asReadonly(), height: height.asReadonly() };\n}\n","import { isPlatformServer } from '@angular/common';\nimport {\n\tafterNextRender,\n\tDestroyRef,\n\tElementRef,\n\tinject,\n\tInjector,\n\tPLATFORM_ID,\n\trunInInjectionContext,\n\ttype Signal,\n\tsignal,\n\ttype WritableSignal,\n} from '@angular/core';\n\n/**\n * Returns a reactive signal that tracks the size of a DOM element.\n *\n * This function uses a shared {@link ResizeObserver} internally to monitor multiple elements efficiently.\n * The returned signal updates whenever the element's width or height changes. It is fully SSR-safe.\n *\n * @param options Optional {@link ElementSizeOptions} configuration object.\n * @param options.elementRef The {@link ElementRef} of the element to observe. Defaults to the {@link ElementRef} injected in the current context.\n * @param options.injector Optional custom {@link Injector} to run the function in. Defaults to the current injection context.\n *\n * @returns A readonly {@link Signal} containing `{ width, height }` of the element, or `undefined` if the element has not yet been measured or on the server.\n *\n * Based on https://github.com/radix-ui/primitives/blob/main/packages/react/use-size/src/use-size.tsx\n */\nexport function injectElementSize(\n\toptions: ElementSizeOptions = {},\n): Signal<{ width: number; height: number } | undefined> {\n\treturn runInInjectionContext(options.injector ?? inject(Injector), () => {\n\t\tconst elementRef = options.elementRef ?? inject(ElementRef);\n\t\tconst platformId = inject(PLATFORM_ID);\n\t\tconst destroyRef = inject(DestroyRef);\n\n\t\tconst element = elementRef.nativeElement;\n\t\tconst size = signal<{ width: number; height: number } | undefined>(undefined);\n\n\t\tif (isPlatformServer(platformId)) {\n\t\t\treturn size;\n\t\t}\n\n\t\tafterNextRender({\n\t\t\tread: () => {\n\t\t\t\t// Initial read\n\t\t\t\tconst rect = element.getBoundingClientRect();\n\t\t\t\tsize.set({\n\t\t\t\t\twidth: rect.width || element.offsetWidth,\n\t\t\t\t\theight: rect.height || element.offsetHeight,\n\t\t\t\t});\n\n\t\t\t\t// Register element in shared observer\n\t\t\t\tobserverMap.set(element, { element, size });\n\t\t\t\tgetSharedObserver().observe(element, { box: 'border-box' });\n\n\t\t\t\tdestroyRef.onDestroy(() => {\n\t\t\t\t\tgetSharedObserver().unobserve(element);\n\t\t\t\t\tobserverMap.delete(element);\n\n\t\t\t\t\t// Disconnect global observer if no elements left\n\t\t\t\t\tif (observerMap.size === 0 && sharedObserver) {\n\t\t\t\t\t\tsharedObserver.disconnect();\n\t\t\t\t\t\tsharedObserver = undefined;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\n\t\treturn size.asReadonly();\n\t});\n}\n\nconst observerMap = new Map<HTMLElement, SizeEntry>();\nlet sharedObserver: ResizeObserver | undefined;\n\nfunction getSharedObserver() {\n\tif (!sharedObserver) {\n\t\tsharedObserver = new ResizeObserver((entries) => {\n\t\t\tfor (const entry of entries) {\n\t\t\t\tconst el = entry.target as HTMLElement;\n\t\t\t\tconst entryData = observerMap.get(el);\n\t\t\t\tif (!entryData) continue;\n\n\t\t\t\tlet width: number;\n\t\t\t\tlet height: number;\n\n\t\t\t\tif ('borderBoxSize' in entry) {\n\t\t\t\t\t// Iron out differences between browsers\n\t\t\t\t\tconst borderSize = Array.isArray(entry.borderBoxSize) ? entry.borderBoxSize[0] : entry.borderBoxSize;\n\t\t\t\t\twidth = borderSize.inlineSize;\n\t\t\t\t\theight = borderSize.blockSize;\n\t\t\t\t} else {\n\t\t\t\t\twidth = el.offsetWidth;\n\t\t\t\t\theight = el.offsetHeight;\n\t\t\t\t}\n\n\t\t\t\tentryData.size.set({ width, height });\n\t\t\t}\n\t\t});\n\t}\n\n\treturn sharedObserver;\n}\n\n/**\n * Options to configure `injectElementSize`.\n */\ninterface ElementSizeOptions {\n\t/** The ElementRef of the element to observe. Defaults to injected ElementRef in the current context. */\n\telementRef?: ElementRef<HTMLElement>;\n\t/** Optional Injector to run the function in. Defaults to the current injection context. */\n\tinjector?: Injector;\n}\n\n/**\n * Internal type used to track each observed element in the shared ResizeObserver.\n */\ninterface SizeEntry {\n\t/** The HTML element being observed. */\n\telement: HTMLElement;\n\t/** Writable signal storing the element's current width and height. */\n\tsize: WritableSignal<{ width: number; height: number } | undefined>;\n}\n","import type { CdkMenuTrigger } from '@angular/cdk/menu';\nimport type { ConnectedPosition } from '@angular/cdk/overlay';\nimport { InjectionToken, SimpleChange } from '@angular/core';\n\nexport type MenuAlign = 'start' | 'center' | 'end';\nexport type MenuSide = 'top' | 'bottom' | 'left' | 'right';\n\nconst OPPOSITE_SIDE: Record<string, MenuSide> = { top: 'bottom', bottom: 'top', left: 'right', right: 'left' };\n\n/**\n * Lets a menu trigger expose its configured `side` to the portaled content. CDK gives the content a\n * child injector whose parent is the trigger's injector, so the content can resolve this token to\n * learn which axis to read off the transform-origin.\n */\nexport interface MenuSideProvider {\n\treadonly side: () => MenuSide;\n}\n\nexport const MENU_SIDE = new InjectionToken<MenuSideProvider>('SpartanMenuSide');\n\n// derive data-side from the transform-origin CDK sets on the content. the anchored corner faces the\n// trigger, so the side is its opposite. the configured `side` tells us which axis carries the anchor\n// (top/bottom -> vertical token, left/right -> horizontal), so a CDK flip is read off the right axis.\n// CDK's origin is rtl-aware, so the derived side is too. falls back to the configured side when the\n// transform-origin is missing or centered (no flip information to apply).\nexport const deriveMenuSideFromTransformOrigin = (transformOrigin: string, side: MenuSide): MenuSide => {\n\tconst [x, y] = transformOrigin.trim().split(/\\s+/);\n\tconst anchor = side === 'top' || side === 'bottom' ? y : x;\n\treturn OPPOSITE_SIDE[anchor] ?? side;\n};\n\nexport const createMenuPosition = (align: MenuAlign, side: MenuSide): ConnectedPosition[] => {\n\tconst verticalAlign = align === 'start' ? 'top' : align === 'end' ? 'bottom' : 'center';\n\n\tconst createPositions = (\n\t\toriginX: 'start' | 'center' | 'end',\n\t\toriginY: 'top' | 'center' | 'bottom',\n\t\toverlayX: 'start' | 'center' | 'end',\n\t\toverlayY: 'top' | 'center' | 'bottom',\n\t): ConnectedPosition[] => [\n\t\t{ originX, originY, overlayX, overlayY },\n\t\t{ originX: overlayX, originY: overlayY, overlayX: originX, overlayY: originY },\n\t];\n\n\tswitch (side) {\n\t\tcase 'top':\n\t\t\treturn createPositions(align, 'top', align, 'bottom');\n\t\tcase 'bottom':\n\t\t\treturn createPositions(align, 'bottom', align, 'top');\n\t\tcase 'left':\n\t\t\treturn createPositions('start', verticalAlign, 'end', verticalAlign);\n\t\tcase 'right':\n\t\t\treturn createPositions('end', verticalAlign, 'start', verticalAlign);\n\t}\n};\n\n/**\n * Applies the given positions to a CDK menu trigger.\n *\n * CDK reads `menuPosition` only when it builds the overlay's `FlexibleConnectedPositionStrategy` (first\n * open) and when its `ngOnChanges` runs. The trigger reuses a single overlay across opens, so a bare\n * `menuPosition` assignment is silently ignored once the overlay exists - e.g. when `side`/`align`\n * change at runtime, the next open keeps the position from the first open. Assigning the property and\n * poking CDK's change handler refreshes an already-created overlay (whether open or reused) so the new\n * positions take effect. When no overlay exists yet the assignment alone is enough.\n */\nexport const updateMenuPosition = (trigger: CdkMenuTrigger, position: ConnectedPosition[]): void => {\n\ttrigger.menuPosition = position;\n\ttrigger.ngOnChanges({ menuPosition: new SimpleChange(undefined, position, false) });\n};\n","export function stringifyAsLabel(item: any, itemToStringLabel?: (item: any) => string) {\n\tif (itemToStringLabel && item !== null && item !== undefined) {\n\t\treturn itemToStringLabel(item) ?? '';\n\t}\n\tif (item && typeof item === 'object') {\n\t\tif ('label' in item && item.label !== null && item.label !== undefined) {\n\t\t\treturn String(item.label);\n\t\t}\n\t\tif ('value' in item && item.value !== null && item.value !== undefined) {\n\t\t\treturn String(item.value);\n\t\t}\n\t}\n\treturn serializeValue(item);\n}\n\nexport function serializeValue(value: unknown): string {\n\tif (value === null || value === undefined) {\n\t\treturn '';\n\t}\n\tif (typeof value === 'string') {\n\t\treturn value;\n\t}\n\ttry {\n\t\treturn JSON.stringify(value);\n\t} catch {\n\t\treturn String(value);\n\t}\n}\n","import { DestroyRef, inject, type Signal, signal } from '@angular/core';\n\n/** Skip-delay grouping: once one member opens, siblings skip their delay until the window elapses. */\nexport interface SkipDelay {\n\t/** Whether the next open should still wait for its delay (`true`) or open instantly (`false`). */\n\treadonly isOpenDelayed: Signal<boolean>;\n\t/** Report that a member opened: opens the skip window so siblings skip their delay. */\n\topen(): void;\n\t/** Report that a member closed: re-require the delay once the window elapses. */\n\tclose(): void;\n}\n\n/** Must be called in an injection context; cleans up its pending timer on destroy. */\nexport function injectSkipDelay(skipDelayDuration: () => number): SkipDelay {\n\tconst isOpenDelayed = signal(true);\n\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\n\tinject(DestroyRef).onDestroy(() => clearTimeout(timer));\n\n\treturn {\n\t\tisOpenDelayed: isOpenDelayed.asReadonly(),\n\t\topen(): void {\n\t\t\tclearTimeout(timer);\n\t\t\tif (skipDelayDuration() > 0) isOpenDelayed.set(false);\n\t\t},\n\t\tclose(): void {\n\t\t\tclearTimeout(timer);\n\t\t\tconst duration = skipDelayDuration();\n\t\t\tif (duration > 0) {\n\t\t\t\ttimer = setTimeout(() => isOpenDelayed.set(true), duration);\n\t\t\t}\n\t\t},\n\t};\n}\n","import { createInjectionToken } from './create-injection-token';\n\nexport interface TableClassesSettable {\n\tsetTableClasses: (classes: Partial<{ table: string; headerRow: string; bodyRow: string }>) => void;\n}\n\nexport const [\n\tinjectTableClassesSettable,\n\tprovideTableClassesSettable,\n\tprovideTableClassesSettableExisting,\n\tSET_TABLE_CLASSES_TOKEN,\n] = createInjectionToken<TableClassesSettable>('@spartan-ng SET_TABLE_CLASSES_TOKEN');\n","const MAX_ANIMATION_WAIT_MS = 5_000;\nconst ANIMATION_WAIT_BUFFER_MS = 50;\n\nexport function getActiveElementAnimations(elements: readonly (HTMLElement | null | undefined)[]): Animation[] {\n\treturn elements\n\t\t.filter((element): element is HTMLElement => !!element)\n\t\t.flatMap((element) =>\n\t\t\ttypeof element.getAnimations === 'function'\n\t\t\t\t? element.getAnimations({ subtree: true }).filter((animation) => animation.playState !== 'finished')\n\t\t\t\t: [],\n\t\t);\n}\n\nexport async function waitForAnimations(animations: readonly Animation[]): Promise<void> {\n\tif (!animations.length) return;\n\n\tlet timeout: ReturnType<typeof setTimeout> | undefined;\n\tconst fallbackMs = getFallbackTimeout(animations);\n\n\ttry {\n\t\tawait Promise.race([\n\t\t\tPromise.allSettled(animations.map((animation) => animation.finished)),\n\t\t\tnew Promise<void>((resolve) => {\n\t\t\t\ttimeout = setTimeout(resolve, fallbackMs);\n\t\t\t}),\n\t\t]);\n\t} finally {\n\t\tif (timeout) clearTimeout(timeout);\n\t}\n}\n\n/**\n * Waits for active animations, including subtree animations, within the given element to finish.\n */\nexport async function waitForElementAnimations(element: HTMLElement): Promise<void> {\n\tawait waitForAnimations(getActiveElementAnimations([element]));\n}\n\nfunction getFallbackTimeout(animations: readonly Animation[]): number {\n\tconst longestAnimation = animations.reduce((longest, animation) => {\n\t\tconst endTime = animation.effect?.getComputedTiming().endTime;\n\t\treturn typeof endTime === 'number' && Number.isFinite(endTime) ? Math.max(longest, endTime) : longest;\n\t}, 0);\n\n\tif (!longestAnimation) return MAX_ANIMATION_WAIT_MS;\n\treturn Math.min(longestAnimation + ANIMATION_WAIT_BUFFER_MS, MAX_ANIMATION_WAIT_MS);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;SAAgB,iBAAiB,CAAC,OAA6C,EAAE,YAAY,GAAG,EAAE,EAAA;AACjG,IAAA,MAAM,KAAK,GAAG,OAAO,IAAI,YAAY;AACrC,IAAA,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC/G;;ACuBA;AACA,MAAM,oBAAoB,GAAG,IAAI,OAAO,EAAoC;AAC5E;AACA,IAAI,cAAc,GAA4B,IAAI;AAClD,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAe;AAyB/C,IAAI,aAAa,GAAG,CAAC;AAErB;;;;;;;;;;AAUG;AACG,SAAU,UAAU,CAAC,QAAwC,EAAE,OAA0B,EAAA;IAC9F,qBAAqB,CAAC,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAK;QAChE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,MAAM,CAAC,UAAU,CAAC;AAC3D,QAAA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AO,EAAE,OAAO,CAAC,GAAG,OAAO;IACtG,CAAC,EAAE,CAAC,CAAC;AAEL,IAAA,IAAI,CAAC,gBAAgB;AAAE,QAAA,OAAO,qBAAqB;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,gBAAgB,GAAG,wBAAwB,EAAE,qBAAqB,CAAC;AACpF;;AC9CA;;AAEG;;;;"}
@@ -40,6 +40,18 @@ class BrnDateInput {
40
40
  openOnClick = input(false, { ...(ngDevMode ? { debugName: "openOnClick" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
41
41
  /** Forces the invalid state visually, regardless of form control state. */
42
42
  forceInvalid = input(false, { ...(ngDevMode ? { debugName: "forceInvalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
43
+ /** Accessible name of the text input. Forwarded to the inner `<input>`, not the host. */
44
+ ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
45
+ /** Id(s) of the element(s) labelling the text input. Forwarded to the inner `<input>`, not the host. */
46
+ ariaLabelledby = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
47
+ /** Id(s) of the element(s) describing the text input. Forwarded to the inner `<input>`, not the host. */
48
+ ariaDescribedby = input(null, { ...(ngDevMode ? { debugName: "ariaDescribedby" } : /* istanbul ignore next */ {}), alias: 'aria-describedby' });
49
+ /**
50
+ * Manual override for aria-invalid, e.g. for server-side validation errors.
51
+ * When not set, it follows the error state matcher (and `forceInvalid`).
52
+ */
53
+ ariaInvalidInput = input(undefined, { ...(ngDevMode ? { debugName: "ariaInvalidInput" } : /* istanbul ignore next */ {}), transform: (v) => (v === '' || v === undefined ? undefined : booleanAttribute(v)),
54
+ alias: 'aria-invalid' });
43
55
  /** Accessible label for the clear button. */
44
56
  clearAriaLabel = input('Clear date', ...(ngDevMode ? [{ debugName: "clearAriaLabel" }] : /* istanbul ignore next */ []));
45
57
  /** Accessible label for the calendar trigger button. */
@@ -147,11 +159,11 @@ class BrnDateInput {
147
159
  }
148
160
  }
149
161
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDateInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
150
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.16", type: BrnDateInput, isStandalone: true, inputs: { inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, inputValue: { classPropertyName: "inputValue", publicName: "inputValue", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, openOnClick: { classPropertyName: "openOnClick", publicName: "openOnClick", isSignal: true, isRequired: false, transformFunction: null }, forceInvalid: { classPropertyName: "forceInvalid", publicName: "forceInvalid", isSignal: true, isRequired: false, transformFunction: null }, clearAriaLabel: { classPropertyName: "clearAriaLabel", publicName: "clearAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, calendarAriaLabel: { classPropertyName: "calendarAriaLabel", publicName: "calendarAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0 });
162
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.16", type: BrnDateInput, isStandalone: true, inputs: { inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, inputValue: { classPropertyName: "inputValue", publicName: "inputValue", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, openOnClick: { classPropertyName: "openOnClick", publicName: "openOnClick", isSignal: true, isRequired: false, transformFunction: null }, forceInvalid: { classPropertyName: "forceInvalid", publicName: "forceInvalid", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalidInput: { classPropertyName: "ariaInvalidInput", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null }, clearAriaLabel: { classPropertyName: "clearAriaLabel", publicName: "clearAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, calendarAriaLabel: { classPropertyName: "calendarAriaLabel", publicName: "calendarAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0 });
151
163
  }
152
164
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: BrnDateInput, decorators: [{
153
165
  type: Directive
154
- }], ctorParameters: () => [], propDecorators: { inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], _inputElement: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }], inputValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputValue", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], openOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "openOnClick", required: false }] }], forceInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceInvalid", required: false }] }], clearAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearAriaLabel", required: false }] }], calendarAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendarAriaLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }] } });
166
+ }], ctorParameters: () => [], propDecorators: { inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], _inputElement: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }], inputValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputValue", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], openOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "openOnClick", required: false }] }], forceInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceInvalid", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], ariaInvalidInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-invalid", required: false }] }], clearAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearAriaLabel", required: false }] }], calendarAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendarAriaLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }] } });
155
167
 
156
168
  const BrnDatePickerTriggerToken = new InjectionToken('BrnDatePickerTriggerToken');
157
169
  function provideBrnDatePickerTrigger(instance) {