{"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// Managers whose suppressed transitions are restored in the next frame, all in one callback\nconst pendingTransitionRestores = new Set<ElementClassManager>();\nlet transitionRestoreRafId: number | null = null;\n\ninterface ClassSource {\n\tclasses: Set<string>;\n\torder: number;\n}\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, ClassSource>;\n\t/** The sources by registration order, reset when a source is added or removed */\n\tsortedSources: ClassSource[] | null;\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\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\tsortedSources: null,\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\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\tconst source = manager!.sources.get(sourceId);\n\t\t\tif (source) {\n\t\t\t\tsource.classes = new Set(newClasses);\n\t\t\t} else {\n\t\t\t\tmanager!.sources.set(sourceId, { classes: new Set(newClasses), order: sourceOrder });\n\t\t\t\tmanager!.sortedSources = null;\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\tscheduleTransitionRestore(manager!);\n\t\t\t}\n\t\t}\n\n\t\t// Register cleanup with DestroyRef\n\t\tdestroyRef.onDestroy(() => {\n\t\t\tif (pendingTransitionRestores.delete(manager!)) {\n\t\t\t\trestoreTransitionSuppression(manager!);\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\t\t\tmanager!.sortedSources = null;\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 scheduleTransitionRestore(manager: ElementClassManager): void {\n\tpendingTransitionRestores.add(manager);\n\t// Requested from the effect, inside the zone: the callback would trigger a change detection pass\n\ttransitionRestoreRafId ??= manager.zone.runOutsideAngular(() =>\n\t\trequestAnimationFrame(() => {\n\t\t\ttransitionRestoreRafId = null;\n\t\t\tfor (const pending of pendingTransitionRestores) {\n\t\t\t\trestoreTransitionSuppression(pending);\n\t\t\t}\n\t\t\tpendingTransitionRestores.clear();\n\t\t}),\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\tmanager.sortedSources ??= Array.from(manager.sources.values()).sort((a, b) => a.order - b.order);\n\n\tconst allSourceClasses: string[] = [];\n\tfor (const source of manager.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: start over once it is full, so the\n\t// class strings in use now are cached rather than the first ones ever seen\n\tif (classListCache.size >= 1000) {\n\t\tclassListCache.clear();\n\t}\n\tclassListCache.set(className, result);\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;AAC/C;AACA,MAAM,yBAAyB,GAAG,IAAI,GAAG,EAAuB;AAChE,IAAI,sBAAsB,GAAkB,IAAI;AA+BhD,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,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AACtC,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AACrC,QAAA,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,kBAAk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