import { createWindowManager, createDesktopBinder } from './chunk-YCHJXSTC.js'; import { signal, computed, inject, DestroyRef } from '@angular/core'; function onDestroy(dispose) { let destroyRef = null; try { destroyRef = inject(DestroyRef); } catch { destroyRef = null; } destroyRef?.onDestroy(dispose); } function useWindowManager(options) { const wm = createWindowManager(options); onDestroy(() => wm.destroy()); return wm; } function useWmState(wm) { const state = signal(wm.getState()); const stop = wm.subscribe((next) => state.set(next)); onDestroy(stop); return state.asReadonly(); } function useWmWindow(wm, id) { const state = useWmState(wm); return computed(() => state().windows[id]); } function createDesktop(wm, options) { const binder = createDesktopBinder(wm, options); return { binder, desktop(element) { const unbind = binder.bindDesktop(element); onDestroy(unbind); }, window(id, windowOptions) { return (element) => { const unbind = binder.bindWindow(id, element, windowOptions); onDestroy(unbind); }; } }; } export { createDesktop, useWindowManager, useWmState, useWmWindow }; //# sourceMappingURL=angular.js.map //# sourceMappingURL=angular.js.map