@aerogel/core 0.0.0-next.9487bb13082b9d479112445804d906125ded5cbc → 0.0.0-next.97312fd206b83ac5ae520da32b1bb3f12fb55969

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 (72) hide show
  1. package/dist/aerogel-core.cjs.js +1 -1
  2. package/dist/aerogel-core.cjs.js.map +1 -1
  3. package/dist/aerogel-core.d.ts +603 -123
  4. package/dist/aerogel-core.esm.js +1 -1
  5. package/dist/aerogel-core.esm.js.map +1 -1
  6. package/package.json +12 -6
  7. package/src/bootstrap/bootstrap.test.ts +4 -3
  8. package/src/bootstrap/index.ts +19 -3
  9. package/src/bootstrap/options.ts +3 -0
  10. package/src/components/AGAppLayout.vue +7 -2
  11. package/src/components/AGAppOverlays.vue +5 -1
  12. package/src/components/AGAppSnackbars.vue +1 -1
  13. package/src/components/forms/AGCheckbox.vue +7 -1
  14. package/src/components/forms/AGInput.vue +8 -6
  15. package/src/components/forms/AGSelect.story.vue +21 -3
  16. package/src/components/forms/AGSelect.vue +10 -3
  17. package/src/components/headless/forms/AGHeadlessInput.ts +21 -1
  18. package/src/components/headless/forms/AGHeadlessInput.vue +4 -1
  19. package/src/components/headless/forms/AGHeadlessInputLabel.vue +8 -2
  20. package/src/components/headless/forms/AGHeadlessSelect.ts +21 -22
  21. package/src/components/headless/forms/AGHeadlessSelect.vue +24 -24
  22. package/src/components/headless/forms/AGHeadlessSelectLabel.vue +4 -1
  23. package/src/components/headless/forms/AGHeadlessSelectOption.vue +6 -6
  24. package/src/components/headless/modals/AGHeadlessModal.ts +27 -0
  25. package/src/components/headless/modals/AGHeadlessModal.vue +3 -5
  26. package/src/components/headless/modals/index.ts +4 -6
  27. package/src/components/headless/snackbars/index.ts +23 -8
  28. package/src/components/index.ts +1 -1
  29. package/src/components/lib/AGMeasured.vue +15 -0
  30. package/src/components/lib/AGStartupCrash.vue +31 -0
  31. package/src/components/lib/index.ts +5 -0
  32. package/src/components/modals/AGAlertModal.ts +15 -0
  33. package/src/components/modals/AGAlertModal.vue +4 -15
  34. package/src/components/modals/AGConfirmModal.ts +27 -0
  35. package/src/components/modals/AGConfirmModal.vue +8 -12
  36. package/src/components/modals/AGErrorReportModal.ts +27 -1
  37. package/src/components/modals/AGErrorReportModal.vue +8 -16
  38. package/src/components/modals/AGErrorReportModalButtons.vue +4 -2
  39. package/src/components/modals/AGErrorReportModalTitle.vue +1 -1
  40. package/src/components/modals/AGLoadingModal.ts +23 -0
  41. package/src/components/modals/AGLoadingModal.vue +4 -8
  42. package/src/components/modals/AGModal.ts +2 -2
  43. package/src/components/modals/AGModal.vue +14 -12
  44. package/src/components/modals/AGPromptModal.ts +30 -0
  45. package/src/components/modals/AGPromptModal.vue +34 -0
  46. package/src/components/modals/index.ts +13 -19
  47. package/src/components/snackbars/AGSnackbar.vue +3 -9
  48. package/src/components/utils.ts +10 -0
  49. package/src/directives/index.ts +3 -1
  50. package/src/directives/measure.ts +12 -0
  51. package/src/errors/Errors.ts +11 -6
  52. package/src/errors/index.ts +9 -13
  53. package/src/forms/Form.ts +1 -0
  54. package/src/services/App.state.ts +3 -4
  55. package/src/services/App.ts +23 -2
  56. package/src/services/Service.ts +21 -11
  57. package/src/services/index.ts +1 -1
  58. package/src/ui/UI.ts +118 -15
  59. package/src/ui/index.ts +8 -3
  60. package/src/utils/composition/events.ts +1 -0
  61. package/src/utils/index.ts +1 -0
  62. package/src/utils/tailwindcss.test.ts +26 -0
  63. package/src/utils/tailwindcss.ts +7 -0
  64. package/src/utils/vue.ts +10 -1
  65. package/tsconfig.json +1 -1
  66. package/.eslintrc.js +0 -3
  67. package/dist/virtual.d.ts +0 -11
  68. package/src/components/basic/index.ts +0 -5
  69. package/src/types/virtual.d.ts +0 -11
  70. /package/src/components/{basic → lib}/AGErrorMessage.vue +0 -0
  71. /package/src/components/{basic → lib}/AGLink.vue +0 -0
  72. /package/src/components/{basic → lib}/AGMarkdown.vue +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"aerogel-core.esm.js","sources":["../src/errors/ServiceBootError.ts","../src/services/store.ts","../src/services/Service.ts","../src/services/Events.ts","../src/services/App.state.ts","../src/services/App.ts","../src/plugins/index.ts","../src/utils/vue.ts","../src/directives/index.ts","../src/directives/initial-focus.ts","../src/services/index.ts","../src/ui/UI.state.ts","../src/ui/UI.ts","../src/lang/Lang.ts","../src/lang/utils.ts","../src/errors/Errors.state.ts","../src/components/constants.ts","../src/errors/Errors.ts","../src/errors/index.ts","../src/lang/index.ts","../src/utils/composition/events.ts","../src/utils/composition/forms.ts","../src/utils/composition/hooks.ts","../src/components/headless/modals/AGHeadlessModal.vue","../src/components/modals/AGModalContext.vue","../src/components/headless/modals/AGHeadlessModalPanel.vue","../src/components/modals/AGModal.vue","../src/utils/markdown.ts","../src/components/basic/AGMarkdown.vue","../src/components/headless/forms/AGHeadlessButton.vue","../src/components/forms/AGButton.vue","../src/components/modals/AGErrorReportModal.ts","../src/components/modals/AGErrorReportModalButtons.vue","../src/components/modals/AGErrorReportModalTitle.vue","../src/components/modals/AGErrorReportModal.vue","../src/components/modals/AGLoadingModal.vue","../src/components/headless/forms/AGHeadlessSelect.ts","../src/components/headless/forms/AGHeadlessInput.vue","../src/components/headless/forms/AGHeadlessInputError.vue","../src/components/headless/forms/AGHeadlessInputInput.vue","../src/components/headless/forms/AGHeadlessInputLabel.vue","../src/components/headless/forms/AGHeadlessSelect.vue","../src/components/headless/forms/AGHeadlessSelectButton.vue","../src/components/headless/forms/AGHeadlessSelectError.vue","../src/components/headless/forms/AGHeadlessSelectLabel.vue","../src/components/headless/forms/AGHeadlessSelectOption.vue","../src/components/headless/snackbars/index.ts","../src/components/snackbars/AGSnackbar.vue","../src/ui/index.ts","../src/bootstrap/index.ts","../src/components/AGAppModals.vue","../src/components/AGAppSnackbars.vue?vue&type=template&id=7942f27a&lang.js","../src/components/AGAppOverlays.vue","../src/components/basic/AGErrorMessage.vue","../src/components/forms/AGCheckbox.vue","../src/components/forms/AGForm.vue","../src/components/forms/AGInput.vue","../src/components/forms/AGSelect.vue","../src/forms/Form.ts","../src/forms/composition.ts","../src/forms/utils.ts"],"sourcesContent":["import { JSError } from '@noeldemartin/utils';\n\nexport default class ServiceBootError extends JSError {\n\n constructor(serviceNamespace: string, cause: unknown) {\n super(`Service '${serviceNamespace}' failed booting`, { cause });\n }\n\n}\n","import { createPinia, defineStore, setActivePinia } from 'pinia';\nimport type { DefineStoreOptions, Pinia, StateTree, Store, _GettersTree } from 'pinia';\n\nlet _store: Pinia | null = null;\n\nfunction initializePiniaStore(): Pinia {\n if (!_store) {\n _store = createPinia();\n\n setActivePinia(_store);\n }\n\n return _store;\n}\n\nexport function getPiniaStore(): Pinia {\n return _store ?? initializePiniaStore();\n}\n\nexport function defineServiceStore<Id extends string, S extends StateTree = {}, G extends _GettersTree<S> = {}, A = {}>(\n name: Id,\n options: Omit<DefineStoreOptions<Id, S, G, A>, 'id'>,\n): Store<Id, S, G, A> {\n initializePiniaStore();\n\n return defineStore(name, options)();\n}\n","import { MagicObject, PromisedValue, Storage, isEmpty, objectDeepClone, objectOnly } from '@noeldemartin/utils';\nimport type { Constructor } from '@noeldemartin/utils';\nimport type { Store } from 'pinia';\n\nimport ServiceBootError from '@/errors/ServiceBootError';\nimport { defineServiceStore } from '@/services/store';\n\nexport type ServiceState = Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any\nexport type DefaultServiceState = any; // eslint-disable-line @typescript-eslint/no-explicit-any\nexport type ServiceConstructor<T extends Service = Service> = Constructor<T> & typeof Service;\n\nexport type ComputedStateDefinition<TState extends ServiceState, TComputedState extends ServiceState> = {\n [K in keyof TComputedState]: (state: TState) => TComputedState[K];\n} & ThisType<{\n readonly [K in keyof TComputedState]: TComputedState[K];\n}>;\n\nexport function defineServiceState<\n State extends ServiceState = ServiceState,\n ComputedState extends ServiceState = {}\n>(options: {\n name: string;\n initialState: State;\n persist?: (keyof State)[];\n computed?: ComputedStateDefinition<State, ComputedState>;\n serialize?: (state: Partial<State>) => Partial<State>;\n}): Constructor<State> & Constructor<ComputedState> & Constructor<Service<State, ComputedState, Partial<State>>> {\n return class extends Service<State, ComputedState> {\n\n public static persist = (options.persist as string[]) ?? [];\n\n protected usesStore(): boolean {\n return true;\n }\n\n protected getName(): string | null {\n return options.name ?? null;\n }\n\n protected getInitialState(): State {\n return options.initialState;\n }\n\n protected getComputedStateDefinition(): ComputedStateDefinition<State, ComputedState> {\n return options.computed ?? ({} as ComputedStateDefinition<State, ComputedState>);\n }\n\n protected serializePersistedState(state: Partial<State>): Partial<State> {\n return options.serialize?.(state) ?? state;\n }\n \n } as unknown as Constructor<State> &\n Constructor<ComputedState> &\n Constructor<Service<State, ComputedState, Partial<State>>>;\n}\n\nexport default class Service<\n State extends ServiceState = DefaultServiceState,\n ComputedState extends ServiceState = {},\n ServiceStorage extends Partial<State> = Partial<State>\n> extends MagicObject {\n\n public static persist: string[] = [];\n\n protected _name: string;\n private _booted: PromisedValue<void>;\n private _computedStateKeys: Set<keyof State>;\n private _store?: Store | false;\n\n constructor() {\n super();\n\n const getters = this.getComputedStateDefinition();\n\n this._name = this.getName() ?? new.target.name;\n this._booted = new PromisedValue();\n this._computedStateKeys = new Set(Object.keys(getters));\n this._store =\n this.usesStore() &&\n defineServiceStore(this._name, {\n state: () => this.getInitialState(),\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getters: getters as any,\n });\n }\n\n public get booted(): PromisedValue<void> {\n return this._booted;\n }\n\n public launch(): Promise<void> {\n const handleError = (error: unknown) => this._booted.reject(new ServiceBootError(this._name, error));\n\n try {\n this.frameworkBoot()\n .then(() => this.boot())\n .then(() => this._booted.resolve())\n .catch(handleError);\n } catch (error) {\n handleError(error);\n }\n\n return this._booted;\n }\n\n public hasState<P extends keyof State>(property: P): boolean {\n if (!this._store) {\n return false;\n }\n\n return property in this._store.$state || this._computedStateKeys.has(property);\n }\n\n public getState(): State;\n public getState<P extends keyof State>(property: P): State[P];\n public getState<P extends keyof State>(property?: P): State | State[P] {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const store = this._store as any;\n\n if (property) {\n return store ? store[property] : undefined;\n }\n\n return store ? store : {};\n }\n\n public setState<P extends keyof State>(property: P, value: State[P]): void;\n public setState(state: Partial<State>): void;\n public setState<P extends keyof State>(stateOrProperty: P | Partial<State>, value?: State[P]): void {\n if (!this._store) {\n return;\n }\n\n const state = (\n typeof stateOrProperty === 'string' ? { [stateOrProperty]: value } : stateOrProperty\n ) as Partial<State>;\n\n Object.assign(this._store.$state, state);\n\n this.onStateUpdated(state);\n }\n\n protected __get(property: string): unknown {\n if (this.hasState(property)) {\n return this.getState(property);\n }\n\n return super.__get(property);\n }\n\n protected __set(property: string, value: unknown): void {\n this.setState({ [property]: value } as Partial<State>);\n }\n\n protected onStateUpdated(state: Partial<State>): void {\n // TODO fix this.static()\n const persist = (this.constructor as unknown as { persist: string[] }).persist;\n const persisted = objectOnly(state, persist);\n\n if (isEmpty(persisted)) {\n return;\n }\n\n const storage = Storage.require<ServiceStorage>(this._name);\n\n Storage.set(this._name, {\n ...storage,\n ...this.serializePersistedState(objectDeepClone(persisted) as Partial<State>),\n });\n }\n\n protected usesStore(): boolean {\n return false;\n }\n\n protected getName(): string | null {\n return null;\n }\n\n protected getInitialState(): State {\n return {} as State;\n }\n\n protected getComputedStateDefinition(): ComputedStateDefinition<State, ComputedState> {\n return {} as ComputedStateDefinition<State, ComputedState>;\n }\n\n protected serializePersistedState(state: Partial<State>): Partial<State> {\n return state;\n }\n\n protected async frameworkBoot(): Promise<void> {\n this.restorePersistedState();\n }\n\n protected async boot(): Promise<void> {\n // Override.\n }\n\n protected restorePersistedState(): void {\n // TODO fix this.static()\n const persist = (this.constructor as unknown as { persist: string[] }).persist;\n\n if (!this.usesStore() || isEmpty(persist)) {\n return;\n }\n\n if (Storage.has(this._name)) {\n const persisted = Storage.require<ServiceStorage>(this._name);\n this.setState(persisted);\n\n return;\n }\n\n Storage.set(this._name, objectOnly(this.getState(), persist));\n }\n\n}\n","import { arr, facade, tap } from '@noeldemartin/utils';\nimport type { FluentArray } from '@noeldemartin/utils';\n\nimport Service from '@/services/Service';\n\nexport interface EventsPayload {}\n\nexport type EventListener<T = unknown> = (payload: T) => unknown;\nexport type UnknownEvent<T> = T extends keyof EventsPayload ? never : T;\n\nexport type EventWithoutPayload = {\n [K in keyof EventsPayload]: EventsPayload[K] extends void ? K : never;\n}[keyof EventsPayload];\n\nexport type EventWithPayload = {\n [K in keyof EventsPayload]: EventsPayload[K] extends void ? never : K;\n}[keyof EventsPayload];\n\nexport class EventsService extends Service {\n\n private listeners: Record<string, FluentArray<EventListener>> = {};\n\n public emit<Event extends EventWithoutPayload>(event: Event): Promise<void>;\n public emit<Event extends EventWithPayload>(event: Event, payload: EventsPayload[Event]): Promise<void>;\n public emit<Event extends string>(event: UnknownEvent<Event>, payload?: unknown): Promise<void>;\n public async emit(event: string, payload?: unknown): Promise<void> {\n const listeners = [...(this.listeners[event] ?? [])];\n\n await Promise.all(listeners.map((listener) => listener(payload)) ?? []);\n }\n\n public on<Event extends EventWithoutPayload>(event: Event, listener: () => unknown): () => void;\n public on<Event extends EventWithPayload>(\n event: Event,\n listener: EventListener<EventsPayload[Event]>\n ): () => void | void;\n\n public on<Event extends string>(event: UnknownEvent<Event>, listener: EventListener): () => void;\n public on(event: string, listener: EventListener): () => void {\n (this.listeners[event] ??= arr<EventListener>([])).push(listener);\n\n return () => this.off(event, listener);\n }\n\n public once<Event extends EventWithoutPayload>(event: Event, listener: () => unknown): () => void;\n public once<Event extends EventWithPayload>(\n event: Event,\n listener: EventListener<EventsPayload[Event]>\n ): () => void | void;\n\n public once<Event extends string>(event: UnknownEvent<Event>, listener: EventListener): () => void;\n public once(event: string, listener: EventListener): () => void {\n let onceListener: EventListener | null = null;\n\n return tap(\n () => onceListener && this.off(event, onceListener),\n (off) => {\n (this.listeners[event] ??= arr<EventListener>([])).push(\n (onceListener = (...args) => {\n off();\n\n return listener(...args);\n }),\n );\n },\n );\n }\n\n public off(event: string, listener: EventListener): void {\n const eventListeners = this.listeners[event];\n\n if (!eventListeners) {\n return;\n }\n\n eventListeners.remove(listener);\n\n if (eventListeners.isEmpty()) {\n delete this.listeners[event];\n }\n }\n\n}\n\nexport default facade(new EventsService());\n","import Build from 'virtual:aerogel';\n\nimport { defineServiceState } from '@/services/Service';\nimport type { Plugin } from '@/plugins/Plugin';\n\nexport default defineServiceState({\n name: 'app',\n initialState: {\n plugins: {} as Record<string, Plugin>,\n environment: Build.environment,\n sourceUrl: Build.sourceUrl,\n isMounted: false,\n },\n computed: {\n development: (state) => state.environment === 'development',\n testing: (state) => state.environment === 'testing',\n },\n});\n","import { facade } from '@noeldemartin/utils';\n\nimport Events from '@/services/Events';\nimport type { Plugin } from '@/plugins';\n\nimport Service from './App.state';\n\nexport class AppService extends Service {\n\n public plugin<T extends Plugin = Plugin>(name: string): T | null {\n return (this.plugins[name] as T) ?? null;\n }\n\n protected async boot(): Promise<void> {\n Events.once('application-mounted', () => this.setState({ isMounted: true }));\n }\n\n}\n\nexport default facade(new AppService());\n","import type { GetClosureArgs } from '@noeldemartin/utils';\n\nimport App from '@/services/App';\n\nimport type { Plugin } from './Plugin';\n\nexport * from './Plugin';\n\nexport function definePlugin<T extends Plugin>(plugin: T): T {\n return plugin;\n}\n\nexport async function installPlugins(plugins: Plugin[], ...args: GetClosureArgs<Plugin['install']>): Promise<void> {\n App.setState(\n 'plugins',\n plugins.reduce((pluginsMap, plugin) => {\n if (plugin.name) {\n pluginsMap[plugin.name] = plugin;\n }\n\n return pluginsMap;\n }, {} as Record<string, Plugin>),\n );\n\n await Promise.all(plugins.map((plugin) => plugin.install(...args)) ?? []);\n}\n","import { fail } from '@noeldemartin/utils';\nimport { inject, reactive, ref } from 'vue';\nimport type { Directive, InjectionKey, PropType, Ref, UnwrapNestedRefs } from 'vue';\n\ntype BaseProp<T> = {\n type?: PropType<T>;\n validator?(value: unknown): boolean;\n};\n\ntype RequiredProp<T> = BaseProp<T> & { required: true };\ntype OptionalProp<T> = BaseProp<T> & { default: T | (() => T) | null };\n\nexport type ComponentProps = Record<string, unknown>;\n\nexport function arrayProp<T>(defaultValue?: () => T[]): OptionalProp<T[]> {\n return {\n type: Array as PropType<T[]>,\n default: defaultValue ?? (() => []),\n };\n}\n\nexport function booleanProp(defaultValue: boolean = false): OptionalProp<boolean> {\n return {\n type: Boolean,\n default: defaultValue,\n };\n}\n\nexport function componentRef<T>(): Ref<UnwrapNestedRefs<T> | undefined> {\n return ref<UnwrapNestedRefs<T>>();\n}\n\nexport function defineDirective(directive: Directive): Directive {\n return directive;\n}\n\nexport function enumProp<Enum extends Record<string, unknown>>(\n enumeration: Enum,\n defaultValue?: Enum[keyof Enum],\n): OptionalProp<Enum[keyof Enum]> {\n const values = Object.values(enumeration) as Enum[keyof Enum][];\n\n return {\n type: String as unknown as PropType<Enum[keyof Enum]>,\n default: defaultValue ?? values[0] ?? null,\n validator: (value) => values.includes(value as Enum[keyof Enum]),\n };\n}\n\nexport function injectReactive<T extends object>(key: InjectionKey<T> | string): UnwrapNestedRefs<T> | undefined {\n const value = inject(key);\n\n return value ? reactive<T>(value) : undefined;\n}\n\nexport function injectReactiveOrFail<T extends object>(\n key: InjectionKey<T> | string,\n errorMessage?: string,\n): UnwrapNestedRefs<T> {\n return injectReactive(key) ?? fail(errorMessage ?? `Could not resolve '${key}' injection key`);\n}\n\nexport function injectOrFail<T>(key: InjectionKey<T> | string, errorMessage?: string): T {\n return inject(key) ?? fail(errorMessage ?? `Could not resolve '${key}' injection key`);\n}\n\nexport function mixedProp<T>(type?: PropType<T>): OptionalProp<T | null> {\n return {\n type,\n default: null,\n };\n}\n\nexport function numberProp(): OptionalProp<number | null>;\nexport function numberProp(defaultValue: number): OptionalProp<number>;\nexport function numberProp(defaultValue: number | null = null): OptionalProp<number | null> {\n return {\n type: Number,\n default: defaultValue,\n };\n}\n\nexport function objectProp<T = Object>(): OptionalProp<T | null>;\nexport function objectProp<T>(defaultValue: () => T): OptionalProp<T>;\nexport function objectProp<T = Object>(defaultValue: (() => T) | null = null): OptionalProp<T | null> {\n return {\n type: Object,\n default: defaultValue,\n };\n}\n\nexport function requiredArrayProp<T>(): RequiredProp<T[]> {\n return {\n type: Array as PropType<T[]>,\n required: true,\n };\n}\n\nexport function requiredEnumProp<Enum extends Record<string, unknown>>(\n enumeration: Enum,\n): RequiredProp<Enum[keyof Enum]> {\n const values = Object.values(enumeration);\n\n return {\n type: String as unknown as PropType<Enum[keyof Enum]>,\n required: true,\n validator: (value) => values.includes(value),\n };\n}\n\nexport function requiredMixedProp<T>(type?: PropType<T>): RequiredProp<T> {\n return {\n type,\n required: true,\n };\n}\n\nexport function requiredNumberProp(): RequiredProp<number> {\n return {\n type: Number,\n required: true,\n };\n}\n\nexport function requiredObjectProp<T = Object>(): RequiredProp<T> {\n return {\n type: Object,\n required: true,\n };\n}\n\nexport function requiredStringProp(): RequiredProp<string> {\n return {\n type: String,\n required: true,\n };\n}\n\nexport function stringProp(): OptionalProp<string | null>;\nexport function stringProp(defaultValue: string): OptionalProp<string>;\nexport function stringProp(defaultValue: string | null = null): OptionalProp<string | null> {\n return {\n type: String,\n default: defaultValue,\n };\n}\n","import type { Directive } from 'vue';\n\nimport { definePlugin } from '@/plugins';\n\nimport initialFocus from './initial-focus';\n\nconst builtInDirectives: Record<string, Directive> = {\n 'initial-focus': initialFocus,\n};\n\nexport default definePlugin({\n install(app, options) {\n const directives = {\n ...builtInDirectives,\n ...options.directives,\n };\n\n for (const [name, directive] of Object.entries(directives)) {\n app.directive(name, directive);\n }\n },\n});\n\ndeclare module '@/bootstrap/options' {\n interface AerogelOptions {\n directives?: Record<string, Directive>;\n }\n}\n","import { defineDirective } from '@/utils/vue';\n\nexport default defineDirective({\n mounted(element: HTMLElement, { value }) {\n if (value === false) {\n return;\n }\n\n element.focus();\n },\n});\n","import type { App as VueApp } from 'vue';\n\nimport { definePlugin } from '@/plugins';\n\nimport App from './App';\nimport Events from './Events';\nimport Service from './Service';\nimport { getPiniaStore } from './store';\n\nexport * from './App';\nexport * from './Events';\nexport * from './Service';\n\nexport { App, Events, Service };\n\nconst defaultServices = {\n $app: App,\n $events: Events,\n};\n\nexport type DefaultServices = typeof defaultServices;\n\nexport interface Services extends DefaultServices {}\n\nexport async function bootServices(app: VueApp, services: Record<string, Service>): Promise<void> {\n await Promise.all(\n Object.entries(services).map(async ([name, service]) => {\n await service\n .launch()\n .catch((error) => app.config.errorHandler?.(error, null, `Failed launching ${name}.`));\n }),\n );\n\n Object.assign(app.config.globalProperties, services);\n\n App.development && Object.assign(window, services);\n}\n\nexport default definePlugin({\n async install(app, options) {\n const services = {\n ...defaultServices,\n ...options.services,\n };\n\n app.use(getPiniaStore());\n\n await bootServices(app, services);\n },\n});\n\ndeclare module '@/bootstrap/options' {\n interface AerogelOptions {\n services?: Record<string, Service>;\n }\n}\n\ndeclare module '@vue/runtime-core' {\n interface ComponentCustomProperties extends Services {}\n}\n","import type { Component } from 'vue';\n\nimport { defineServiceState } from '@/services/Service';\n\nexport interface Modal<T = unknown> {\n id: string;\n properties: Record<string, unknown>;\n component: Component;\n beforeClose: Promise<T | undefined>;\n afterClose: Promise<T | undefined>;\n}\n\nexport interface ModalComponent<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Properties extends Record<string, unknown> = Record<string, unknown>,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Result = unknown\n> {}\n\nexport interface Snackbar {\n id: string;\n component: Component;\n properties: Record<string, unknown>;\n}\n\nexport default defineServiceState({\n name: 'ui',\n initialState: {\n modals: [] as Modal[],\n snackbars: [] as Snackbar[],\n },\n});\n","import { facade, fail, uuid } from '@noeldemartin/utils';\nimport { markRaw, nextTick } from 'vue';\nimport type { Component } from 'vue';\nimport type { ObjectValues } from '@noeldemartin/utils';\n\nimport Events from '@/services/Events';\nimport type { SnackbarAction, SnackbarColor } from '@/components/headless/snackbars';\n\nimport Service from './UI.state';\nimport type { Modal, ModalComponent, Snackbar } from './UI.state';\n\ninterface ModalCallbacks<T = unknown> {\n willClose(result: T | undefined): void;\n closed(result: T | undefined): void;\n}\n\ntype ModalProperties<TComponent> = TComponent extends ModalComponent<infer TProperties, unknown> ? TProperties : never;\ntype ModalResult<TComponent> = TComponent extends ModalComponent<Record<string, unknown>, infer TResult>\n ? TResult\n : never;\n\nexport const UIComponents = {\n AlertModal: 'alert-modal',\n ConfirmModal: 'confirm-modal',\n ErrorReportModal: 'error-report-modal',\n LoadingModal: 'loading-modal',\n Snackbar: 'snackbar',\n} as const;\n\nexport type UIComponent = ObjectValues<typeof UIComponents>;\n\nexport interface ShowSnackbarOptions {\n component?: Component;\n color?: SnackbarColor;\n actions?: SnackbarAction[];\n}\n\nexport class UIService extends Service {\n\n private modalCallbacks: Record<string, Partial<ModalCallbacks>> = {};\n private components: Partial<Record<UIComponent, Component>> = {};\n\n public requireComponent(name: UIComponent): Component {\n return this.components[name] ?? fail(`UI Component '${name}' is not defined!`);\n }\n\n public alert(message: string): void;\n public alert(title: string, message: string): void;\n public alert(messageOrTitle: string, message?: string): void {\n const options = typeof message === 'string' ? { title: messageOrTitle, message } : { message: messageOrTitle };\n\n this.openModal(this.requireComponent(UIComponents.AlertModal), options);\n }\n\n public async confirm(message: string): Promise<boolean>;\n public async confirm(title: string, message: string): Promise<boolean>;\n public async confirm(messageOrTitle: string, message?: string): Promise<boolean> {\n const options = typeof message === 'string' ? { title: messageOrTitle, message } : { message: messageOrTitle };\n const modal = await this.openModal<ModalComponent<{ message: string }, boolean>>(\n this.requireComponent(UIComponents.ConfirmModal),\n options,\n );\n const result = await modal.beforeClose;\n\n return result ?? false;\n }\n\n public async loading<T>(operation: Promise<T>): Promise<T>;\n public async loading<T>(message: string, operation: Promise<T>): Promise<T>;\n public async loading<T>(messageOrOperation: string | Promise<T>, operation?: Promise<T>): Promise<T> {\n operation = typeof messageOrOperation === 'string' ? (operation as Promise<T>) : messageOrOperation;\n\n const message = typeof messageOrOperation === 'string' ? messageOrOperation : undefined;\n const modal = await this.openModal(this.requireComponent(UIComponents.LoadingModal), { message });\n const result = await operation;\n\n await this.closeModal(modal.id);\n\n return result;\n }\n\n public showSnackbar(message: string, options: ShowSnackbarOptions = {}): void {\n const snackbar: Snackbar = {\n id: uuid(),\n properties: { message, ...options },\n component: options.component ?? markRaw(this.requireComponent(UIComponents.Snackbar)),\n };\n\n this.setState('snackbars', this.snackbars.concat(snackbar));\n\n setTimeout(() => this.hideSnackbar(snackbar.id), 5000);\n }\n\n public hideSnackbar(id: string): void {\n this.setState(\n 'snackbars',\n this.snackbars.filter((snackbar) => snackbar.id !== id),\n );\n }\n\n public registerComponent(name: UIComponent, component: Component): void {\n this.components[name] = component;\n }\n\n public async openModal<TModalComponent extends ModalComponent>(\n component: TModalComponent,\n properties?: ModalProperties<TModalComponent>,\n ): Promise<Modal<ModalResult<TModalComponent>>> {\n const id = uuid();\n const callbacks: Partial<ModalCallbacks<ModalResult<TModalComponent>>> = {};\n const modal: Modal<ModalResult<TModalComponent>> = {\n id,\n properties: properties ?? {},\n component: markRaw(component),\n beforeClose: new Promise((resolve) => (callbacks.willClose = resolve)),\n afterClose: new Promise((resolve) => (callbacks.closed = resolve)),\n };\n const activeModal = this.modals.at(-1);\n const modals = this.modals.concat(modal);\n\n this.modalCallbacks[modal.id] = callbacks;\n\n this.setState({ modals });\n\n await nextTick();\n await (activeModal && Events.emit('hide-modal', { id: activeModal.id }));\n await Promise.all([\n activeModal || Events.emit('show-overlays-backdrop'),\n Events.emit('show-modal', { id: modal.id }),\n ]);\n\n return modal;\n }\n\n public async closeModal(id: string, result?: unknown): Promise<void> {\n await Events.emit('close-modal', { id, result });\n }\n\n protected async boot(): Promise<void> {\n this.watchModalEvents();\n }\n\n private watchModalEvents(): void {\n Events.on('modal-will-close', ({ modal, result }) => {\n this.modalCallbacks[modal.id]?.willClose?.(result);\n\n if (this.modals.length === 1) {\n Events.emit('hide-overlays-backdrop');\n }\n });\n\n Events.on('modal-closed', async ({ modal, result }) => {\n this.setState(\n 'modals',\n this.modals.filter((m) => m.id !== modal.id),\n );\n\n this.modalCallbacks[modal.id]?.closed?.(result);\n\n delete this.modalCallbacks[modal.id];\n\n const activeModal = this.modals.at(-1);\n\n await (activeModal && Events.emit('show-modal', { id: activeModal.id }));\n });\n }\n\n}\n\nexport default facade(new UIService());\n\ndeclare module '@/services/Events' {\n export interface EventsPayload {\n 'modal-will-close': { modal: Modal; result?: unknown };\n 'modal-closed': { modal: Modal; result?: unknown };\n 'close-modal': { id: string; result?: unknown };\n 'hide-modal': { id: string };\n 'show-modal': { id: string };\n }\n}\n","import { facade, toString } from '@noeldemartin/utils';\n\nimport App from '@/services/App';\nimport Service from '@/services/Service';\n\nexport interface LangProvider {\n translate(key: string, parameters?: Record<string, unknown>): string;\n}\n\nexport class LangService extends Service {\n\n private provider: LangProvider;\n\n constructor() {\n super();\n\n this.provider = {\n translate: (key) => {\n // eslint-disable-next-line no-console\n App.development && console.warn('Lang provider is missing');\n\n return key;\n },\n };\n }\n\n public setProvider(provider: LangProvider): void {\n this.provider = provider;\n }\n\n public translate(key: string, parameters?: Record<string, unknown>): string {\n return this.provider.translate(key, parameters) ?? key;\n }\n\n public translateWithDefault(key: string, defaultMessage: string): string;\n public translateWithDefault(key: string, parameters: Record<string, unknown>, defaultMessage: string): string;\n public translateWithDefault(\n key: string,\n defaultMessageOrParameters?: string | Record<string, unknown>,\n defaultMessage?: string,\n ): string {\n defaultMessage ??= defaultMessageOrParameters as string;\n\n const parameters = typeof defaultMessageOrParameters === 'string' ? {} : defaultMessageOrParameters ?? {};\n const message = this.provider.translate(key, parameters) ?? key;\n\n if (message === key) {\n return Object.entries(parameters).reduce(\n (renderedMessage, [name, value]) =>\n renderedMessage.replace(new RegExp(`\\\\{\\\\s*${name}\\\\s*\\\\}`, 'g'), toString(value)),\n defaultMessage,\n );\n }\n\n return message;\n }\n\n}\n\nexport default facade(new LangService());\n","import Lang from './Lang';\n\nexport const translate = Lang.translate.bind(Lang);\nexport const translateWithDefault = Lang.translateWithDefault.bind(Lang);\n","import type { JSError } from '@noeldemartin/utils';\n\nimport { defineServiceState } from '@/services';\n\nexport type ErrorSource = string | Error | JSError | unknown;\n\nexport interface ErrorReport {\n title: string;\n description?: string;\n details?: string;\n error?: Error | JSError | unknown;\n}\n\nexport interface ErrorReportLog {\n report: ErrorReport;\n seen: boolean;\n date: Date;\n}\n\nexport default defineServiceState({\n name: 'errors',\n initialState: {\n logs: [] as ErrorReportLog[],\n startupErrors: [] as ErrorReport[],\n },\n computed: {\n hasErrors: ({ logs }) => logs.length > 0,\n hasNewErrors: ({ logs }) => logs.some((error) => !error.seen),\n hasStartupErrors: ({ startupErrors }) => startupErrors.length > 0,\n },\n});\n","export const Colors = {\n Primary: 'primary',\n Secondary: 'secondary',\n Danger: 'danger',\n Clear: 'clear',\n} as const;\n\nexport type Color = (typeof Colors)[keyof typeof Colors];\n","import { JSError, facade, isObject, objectWithoutEmpty, toString } from '@noeldemartin/utils';\n\nimport App from '@/services/App';\nimport ServiceBootError from '@/errors/ServiceBootError';\nimport UI, { UIComponents } from '@/ui/UI';\nimport { translateWithDefault } from '@/lang/utils';\n\nimport Service from './Errors.state';\nimport { Colors } from '@/components/constants';\nimport type { ErrorReport, ErrorReportLog, ErrorSource } from './Errors.state';\n\nexport class ErrorsService extends Service {\n\n public forceReporting: boolean = false;\n private enabled: boolean = true;\n\n public enable(): void {\n this.enabled = true;\n }\n\n public disable(): void {\n this.enabled = false;\n }\n\n public async inspect(error: ErrorSource | ErrorReport[]): Promise<void> {\n const reports = Array.isArray(error) ? error : [await this.createErrorReport(error)];\n\n if (reports.length === 0) {\n UI.alert(translateWithDefault('errors.inspectEmpty', 'Nothing to inspect!'));\n\n return;\n }\n\n UI.openModal(UI.requireComponent(UIComponents.ErrorReportModal), { reports });\n }\n\n public async report(error: ErrorSource, message?: string): Promise<void> {\n if (App.development || App.testing) {\n this.logError(error);\n }\n\n if (!this.enabled) {\n throw error;\n }\n\n if (!App.isMounted) {\n const startupError = await this.createStartupErrorReport(error);\n\n if (startupError) {\n this.setState({ startupErrors: this.startupErrors.concat(startupError) });\n }\n\n return;\n }\n\n const report = await this.createErrorReport(error);\n const log: ErrorReportLog = {\n report,\n seen: false,\n date: new Date(),\n };\n\n UI.showSnackbar(\n message ??\n translateWithDefault('errors.notice', 'Something went wrong, but it\\'s not your fault. Try again!'),\n {\n color: Colors.Danger,\n actions: [\n {\n text: translateWithDefault('errors.viewDetails', 'View details'),\n dismiss: true,\n handler: () =>\n UI.openModal(UI.requireComponent(UIComponents.ErrorReportModal), {\n reports: [report],\n }),\n },\n ],\n },\n );\n\n this.setState({ logs: [log].concat(this.logs) });\n }\n\n public see(report: ErrorReport): void {\n this.setState({\n logs: this.logs.map((log) => {\n if (log.report !== report) {\n return log;\n }\n\n return {\n ...log,\n seen: true,\n };\n }),\n });\n }\n\n public seeAll(): void {\n this.setState({\n logs: this.logs.map((log) => ({\n ...log,\n seen: true,\n })),\n });\n }\n\n public getErrorMessage(error: ErrorSource): string {\n if (typeof error === 'string') {\n return error;\n }\n\n if (error instanceof Error || error instanceof JSError) {\n return error.message;\n }\n\n if (isObject(error)) {\n return toString(error['message'] ?? error['description'] ?? 'Unknown error object');\n }\n\n return translateWithDefault('errors.unknown', 'Unknown Error');\n }\n\n private logError(error: unknown): void {\n // eslint-disable-next-line no-console\n console.error(error);\n\n if (isObject(error) && error.cause) {\n this.logError(error.cause);\n }\n }\n\n private async createErrorReport(error: ErrorSource): Promise<ErrorReport> {\n if (typeof error === 'string') {\n return { title: error };\n }\n\n if (error instanceof Error || error instanceof JSError) {\n return this.createErrorReportFromError(error);\n }\n\n if (isObject(error)) {\n return objectWithoutEmpty({\n title: toString(\n error['name'] ?? error['title'] ?? translateWithDefault('errors.unknown', 'Unknown Error'),\n ),\n description: toString(\n error['message'] ??\n error['description'] ??\n translateWithDefault('errors.unknownDescription', 'Unknown error object'),\n ),\n error,\n });\n }\n\n return {\n title: translateWithDefault('errors.unknown', 'Unknown Error'),\n error,\n };\n }\n\n private async createStartupErrorReport(error: ErrorSource): Promise<ErrorReport | null> {\n if (error instanceof ServiceBootError) {\n // Ignore second-order boot errors in order to have a cleaner startup crash screen.\n return error.cause instanceof ServiceBootError ? null : this.createErrorReport(error.cause);\n }\n\n return this.createErrorReport(error);\n }\n\n private createErrorReportFromError(error: Error | JSError, defaults: Partial<ErrorReport> = {}): ErrorReport {\n return {\n title: error.name,\n description: error.message,\n details: error.stack,\n error,\n ...defaults,\n };\n }\n\n}\n\nexport default facade(new ErrorsService());\n","import { tap } from '@noeldemartin/utils';\n\nimport { bootServices } from '@/services';\nimport { definePlugin } from '@/plugins';\n\nimport Errors from './Errors';\nimport { ErrorReport, ErrorReportLog, ErrorSource } from './Errors.state';\n\nexport { Errors, ErrorSource, ErrorReport, ErrorReportLog };\n\nconst services = { $errors: Errors };\nconst frameworkHandler: ErrorHandler = (error) => {\n if (!Errors.instance) {\n // eslint-disable-next-line no-console\n console.warn('Errors service hasn\\'t been initialized properly!');\n\n // eslint-disable-next-line no-console\n console.error(error);\n\n return true;\n }\n\n Errors.report(error);\n\n return true;\n};\n\nfunction setUpErrorHandler(baseHandler: ErrorHandler = () => false): ErrorHandler {\n return tap(\n (error) => baseHandler(error) || frameworkHandler(error),\n (errorHandler) => {\n globalThis.onerror = (message, _, __, ___, error) => errorHandler(error ?? message);\n globalThis.onunhandledrejection = (event) => errorHandler(event.reason);\n },\n );\n}\n\nexport type ErrorHandler = (error: ErrorSource) => boolean;\nexport type ErrorsServices = typeof services;\n\nexport default definePlugin({\n async install(app, options) {\n const errorHandler = setUpErrorHandler(options.handleError);\n\n app.config.errorHandler = errorHandler;\n\n await bootServices(app, services);\n },\n});\n\ndeclare module '@/bootstrap/options' {\n interface AerogelOptions {\n handleError?(error: ErrorSource): boolean;\n }\n}\n\ndeclare module '@/services' {\n export interface Services extends ErrorsServices {}\n}\n","import { bootServices } from '@/services';\nimport { definePlugin } from '@/plugins';\n\nimport Lang, { LangProvider } from './Lang';\nimport { translate, translateWithDefault } from './utils';\n\nexport { Lang, LangProvider, translate, translateWithDefault };\n\nconst services = { $lang: Lang };\n\nexport type LangServices = typeof services;\n\nexport default definePlugin({\n async install(app) {\n app.config.globalProperties.$t ??= translate;\n app.config.globalProperties.$td = translateWithDefault;\n\n await bootServices(app, services);\n },\n});\n\ndeclare module '@/services' {\n export interface Services extends LangServices {}\n}\n\ndeclare module '@vue/runtime-core' {\n interface ComponentCustomProperties {\n $td: typeof translateWithDefault;\n }\n}\n","import { onUnmounted } from 'vue';\n\nimport Events from '@/services/Events';\nimport type {\n EventListener,\n EventWithPayload,\n EventWithoutPayload,\n EventsPayload,\n UnknownEvent,\n} from '@/services/Events';\n\nexport function useEvent<Event extends EventWithoutPayload>(event: Event, listener: () => unknown): void;\nexport function useEvent<Event extends EventWithPayload>(\n event: Event,\n listener: EventListener<EventsPayload[Event]>\n): void;\nexport function useEvent<Event extends string>(event: UnknownEvent<Event>, listener: EventListener): void;\n\nexport function useEvent(event: string, listener: EventListener): void {\n const unsubscribe = Events.on(event, listener);\n\n onUnmounted(() => unsubscribe());\n}\n","import { objectWithout } from '@noeldemartin/utils';\nimport { computed, useAttrs } from 'vue';\nimport type { ComputedRef } from 'vue';\n\nexport function useInputAttrs(): [ComputedRef<{}>, ComputedRef<unknown>] {\n const attrs = useAttrs();\n const className = computed(() => attrs.class);\n const inputAttrs = computed(() => objectWithout(attrs, 'class'));\n\n return [inputAttrs, className];\n}\n","import { noop } from '@noeldemartin/utils';\nimport { onMounted, onUnmounted } from 'vue';\n\nexport function onCleanMounted(operation: () => Function): void {\n let cleanUp: Function = noop;\n\n onMounted(() => (cleanUp = operation()));\n onUnmounted(() => cleanUp());\n}\n","<template>\n <Dialog ref=\"$root\" :open=\"true\" @close=\"cancellable && close()\">\n <slot :close=\"close\" />\n </Dialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, toRef } from 'vue';\nimport { Dialog } from '@headlessui/vue';\nimport type { VNode } from 'vue';\n\nimport Events from '@/services/Events';\nimport { useEvent } from '@/utils/composition/events';\nimport { booleanProp, injectReactiveOrFail } from '@/utils/vue';\nimport type { IAGModalContext } from '@/components/modals/AGModalContext';\n\nimport type { IAGHeadlessModal, IAGHeadlessModalDefaultSlotProps } from './AGHeadlessModal';\n\nconst props = defineProps({\n cancellable: booleanProp(true),\n});\n\nconst $root = ref<{ $el?: HTMLElement } | null>(null);\nconst hidden = ref(true);\nconst closed = ref(false);\nconst { modal } = injectReactiveOrFail<IAGModalContext>(\n 'modal',\n 'could not obtain modal reference from <AGHeadlessModal>, ' +\n 'did you render this component manually? Show it using $ui.openModal() instead',\n);\n\nasync function hide(): Promise<void> {\n if (!$root.value?.$el) {\n return;\n }\n\n hidden.value = true;\n}\n\nasync function show(): Promise<void> {\n if (!$root.value?.$el) {\n return;\n }\n\n hidden.value = false;\n}\n\nasync function close(result?: unknown) {\n if (closed.value) {\n return;\n }\n\n Events.emit('modal-will-close', { modal, result });\n\n await hide();\n\n closed.value = true;\n\n Events.emit('modal-closed', { modal, result });\n}\n\nuseEvent('close-modal', async ({ id, result }) => {\n if (id !== modal.id) {\n return;\n }\n\n await close(result);\n});\n\nuseEvent('hide-modal', async ({ id }) => {\n if (id !== modal.id) {\n return;\n }\n\n await hide();\n});\n\nuseEvent('show-modal', async ({ id }) => {\n if (id !== modal.id) {\n return;\n }\n\n await show();\n});\n\ndefineSlots<{ default(props: IAGHeadlessModalDefaultSlotProps): VNode[] }>();\ndefineExpose<IAGHeadlessModal>({ close, cancellable: toRef(props, 'cancellable') });\n</script>\n","<template>\n <component :is=\"modal.component\" v-bind=\"modal.properties\" />\n</template>\n\n<script setup lang=\"ts\">\nimport { provide, toRef } from 'vue';\n\nimport { requiredNumberProp, requiredObjectProp } from '@/utils/vue';\nimport type { Modal } from '@/ui/UI.state';\n\nimport type { IAGModalContext } from './AGModalContext';\n\nconst props = defineProps({\n modal: requiredObjectProp<Modal>(),\n childIndex: requiredNumberProp(),\n});\n\nprovide<IAGModalContext>('modal', {\n modal: toRef(props, 'modal'),\n childIndex: toRef(props, 'childIndex'),\n});\n</script>\n","<template>\n <DialogPanel>\n <slot />\n\n <template v-if=\"childModal\">\n <div class=\"pointer-events-none fixed inset-0 z-50 bg-black/30\" />\n <AGModalContext :child-index=\"modal.childIndex + 1\" :modal=\"childModal\" />\n </template>\n </DialogPanel>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { DialogPanel } from '@headlessui/vue';\n\nimport UI from '@/ui/UI';\nimport { injectReactiveOrFail } from '@/utils/vue';\nimport type { IAGModalContext } from '@/components/modals/AGModalContext';\n\nimport AGModalContext from '../../modals/AGModalContext.vue';\n\nconst modal = injectReactiveOrFail<IAGModalContext>(\n 'modal',\n 'could not obtain modal reference from <AGHeadlessModalPanel>, ' +\n 'did you render this component manually? Show it using $ui.openModal() instead',\n);\nconst childModal = computed(() => UI.modals[modal.childIndex] ?? null);\n</script>\n","<template>\n <AGHeadlessModal\n ref=\"$headlessModal\"\n v-slot=\"{ close }: IAGHeadlessModalDefaultSlotProps\"\n :cancellable=\"cancellable\"\n class=\"relative z-50\"\n >\n <div class=\"fixed inset-0 flex items-center justify-center p-8\">\n <AGHeadlessModalPanel class=\"flex max-h-full max-w-full flex-col overflow-hidden bg-white\">\n <div class=\"flex max-h-full flex-col overflow-auto p-4\" v-bind=\"$attrs\">\n <slot :close=\"close\" />\n </div>\n </AGHeadlessModalPanel>\n </div>\n </AGHeadlessModal>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue';\n\nimport { booleanProp } from '@/utils';\nimport type { IAGHeadlessModal, IAGHeadlessModalDefaultSlotProps } from '@/components/headless/modals/AGHeadlessModal';\n\nimport type { IAGModal } from './AGModal';\n\nimport AGHeadlessModal from '../headless/modals/AGHeadlessModal.vue';\nimport AGHeadlessModalPanel from '../headless/modals/AGHeadlessModalPanel.vue';\n\nconst $headlessModal = ref<IAGHeadlessModal>();\n\ndefineOptions({ inheritAttrs: false });\ndefineProps({ cancellable: booleanProp(true) });\ndefineExpose<IAGModal>({\n close: async () => $headlessModal.value?.close(),\n cancellable: computed(() => !!$headlessModal.value?.cancellable),\n});\n</script>\n","import { tap } from '@noeldemartin/utils';\nimport DOMPurify from 'dompurify';\nimport { Renderer, marked } from 'marked';\n\nfunction makeRenderer(): Renderer {\n return tap(new Renderer(), (renderer) => {\n renderer.link = function(href, title, text) {\n return Renderer.prototype.link.apply(this, [href, title, text]).replace('<a', '<a target=\"_blank\"');\n };\n });\n}\n\nexport function renderMarkdown(markdown: string): string {\n return safeHtml(marked(markdown, { mangle: false, headerIds: false, renderer: makeRenderer() }));\n}\n\nexport function safeHtml(html: string): string {\n // TODO improve target=\"_blank\" exception\n // See https://github.com/cure53/DOMPurify/issues/317\n return DOMPurify.sanitize(html, { ADD_ATTR: ['target'] });\n}\n","<template>\n <root />\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, h } from 'vue';\n\nimport { renderMarkdown } from '@/utils/markdown';\nimport { booleanProp, objectProp, stringProp } from '@/utils/vue';\nimport { translate } from '@/lang';\n\nconst props = defineProps({\n as: stringProp(),\n inline: booleanProp(),\n langKey: stringProp(),\n langParams: objectProp<Record<string, unknown>>(),\n text: stringProp(),\n});\n\nconst markdown = computed(() => props.text ?? (props.langKey && translate(props.langKey, props.langParams ?? {})));\nconst html = computed(() => {\n if (!markdown.value) {\n return null;\n }\n\n let renderedHtml = renderMarkdown(markdown.value);\n\n if (props.inline) {\n renderedHtml = renderedHtml.replace('<p>', '<span>').replace('</p>', '</span>');\n }\n\n return renderedHtml;\n});\nconst root = () =>\n h(props.as ?? (props.inline ? 'span' : 'div'), { class: props.inline ? '' : 'prose', innerHTML: html.value });\n</script>\n","<template>\n <component :is=\"component.tag\" v-bind=\"component.props\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { objectWithoutEmpty } from '@noeldemartin/utils';\n\nimport { booleanProp, objectProp, stringProp } from '@/utils/vue';\n\nconst { href, url, route, routeParams, routeQuery, submit } = defineProps({\n href: stringProp(),\n url: stringProp(),\n route: stringProp(),\n routeParams: objectProp(() => ({})),\n routeQuery: objectProp(() => ({})),\n submit: booleanProp(),\n});\n\nconst component = computed(() => {\n if (route) {\n return {\n tag: 'router-link',\n props: {\n to: objectWithoutEmpty({\n name: route,\n params: routeParams,\n query: routeQuery,\n }),\n },\n };\n }\n\n if (href || url) {\n return {\n tag: 'a',\n props: {\n target: '_blank',\n href: href || url,\n },\n };\n }\n\n return {\n tag: 'button',\n props: { type: submit ? 'submit' : 'button' },\n };\n});\n</script>\n","<template>\n <AGHeadlessButton class=\"px-2.5 py-1.5 focus-visible:outline focus-visible:outline-2\" :class=\"colorClasses\">\n <slot />\n </AGHeadlessButton>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nimport { enumProp } from '@/utils/vue';\nimport { Colors } from '@/components/constants';\n\nimport AGHeadlessButton from '../headless/forms/AGHeadlessButton.vue';\n\nconst props = defineProps({\n color: enumProp(Colors, Colors.Primary),\n});\n\nconst colorClasses = computed(() => {\n switch (props.color) {\n case Colors.Secondary:\n return [\n 'text-white bg-gray-600',\n 'hover:bg-gray-500',\n 'focus-visible:outline-offset-2 focus-visible:outline-gray-600',\n ].join(' ');\n case Colors.Clear:\n return 'hover:bg-gray-500/20 focus-visible:outline-gray-500/60';\n case Colors.Danger:\n return [\n 'text-white bg-red-600',\n 'hover:bg-red-500',\n 'focus-visible:outline-offset-2 focus-visible:outline-red-600',\n ].join(' ');\n case Colors.Primary:\n default:\n return [\n 'text-white bg-indigo-600',\n 'hover:bg-indigo-500',\n 'focus-visible:outline-offset-2 focus-visible:outline-indigo-600',\n ].join(' ');\n }\n});\n</script>\n","import type { Component } from 'vue';\n\nimport { requiredArrayProp } from '@/utils/vue';\nimport type { ErrorReport } from '@/errors';\n\nexport interface IAGErrorReportModalButtonsDefaultSlotProps {\n id: string;\n description: string;\n iconComponent: Component;\n url?: string;\n handler?(): void;\n}\n\nexport const errorReportModalProps = {\n reports: requiredArrayProp<ErrorReport>(),\n};\n\nexport function useErrorReportModalProps(): typeof errorReportModalProps {\n return errorReportModalProps;\n}\n","<template>\n <div class=\"flex\">\n <slot v-for=\"(button, i) of buttons\" v-bind=\"(button as unknown as ComponentProps)\" :key=\"i\">\n <AGButton\n color=\"clear\"\n :url=\"button.url\"\n :title=\"$td(`errors.report_${button.id}`, button.description)\"\n :aria-label=\"$td(`errors.report_${button.id}`, button.description)\"\n @click=\"button.handler\"\n >\n <component :is=\"button.iconComponent\" class=\"h-4 w-4\" aria-hidden=\"true\" />\n </AGButton>\n </slot>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport IconConsole from '~icons/mdi/console';\nimport IconCopy from '~icons/zondicons/copy';\nimport IconGitHub from '~icons/mdi/github';\n\nimport { computed } from 'vue';\nimport { stringExcerpt, tap } from '@noeldemartin/utils';\n\nimport App from '@/services/App';\nimport UI from '@/ui/UI';\nimport { requiredObjectProp } from '@/utils/vue';\nimport { translateWithDefault } from '@/lang/utils';\nimport type { ComponentProps } from '@/utils/vue';\nimport type { ErrorReport } from '@/errors';\n\nimport AGButton from '../forms/AGButton.vue';\nimport type { IAGErrorReportModalButtonsDefaultSlotProps } from './AGErrorReportModal';\n\nconst props = defineProps({\n report: requiredObjectProp<ErrorReport>(),\n});\nconst summary = computed(() =>\n props.report.description ? `${props.report.title}: ${props.report.description}` : props.report.title);\nconst githubReportUrl = computed(() => {\n if (!App.sourceUrl) {\n return false;\n }\n\n const issueTitle = encodeURIComponent(summary.value);\n const issueBody = encodeURIComponent(\n [\n '[Please, explain here what you were trying to do when this error appeared]',\n '',\n 'Error details:',\n '```',\n stringExcerpt(\n props.report.details ?? 'Details missing from report',\n 1800 - issueTitle.length - App.sourceUrl.length,\n ).trim(),\n '```',\n ].join('\\n'),\n );\n\n return `${App.sourceUrl}/issues/new?title=${issueTitle}&body=${issueBody}`;\n});\nconst buttons = computed(() =>\n tap(\n [\n {\n id: 'clipboard',\n description: 'Copy to clipboard',\n iconComponent: IconCopy,\n async handler() {\n await navigator.clipboard.writeText(`${summary.value}\\n\\n${props.report.details}`);\n\n UI.showSnackbar(\n translateWithDefault('errors.copiedToClipboard', 'Debug information copied to clipboard'),\n );\n },\n },\n {\n id: 'console',\n description: 'Log to console',\n iconComponent: IconConsole,\n handler() {\n (window as { error?: unknown }).error = props.report.error;\n\n // eslint-disable-next-line no-console\n console.error(props.report.error);\n\n UI.showSnackbar(\n translateWithDefault(\n 'errors.addedToConsole',\n 'You can now use the **error** variable in the console',\n ),\n );\n },\n },\n ],\n (reportButtons: IAGErrorReportModalButtonsDefaultSlotProps[]) => {\n if (!githubReportUrl.value) {\n return;\n }\n\n reportButtons.push({\n id: 'github',\n description: 'Report in GitHub',\n iconComponent: IconGitHub,\n url: githubReportUrl.value,\n });\n },\n ));\n</script>\n","<template>\n <AGMarkdown :text=\"text\" inline />\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nimport { numberProp, requiredObjectProp } from '@/utils/vue';\nimport type { ErrorReport } from '@/errors';\n\nimport AGMarkdown from '../basic/AGMarkdown.vue';\n\nconst props = defineProps({\n report: requiredObjectProp<ErrorReport>(),\n currentReport: numberProp(),\n totalReports: numberProp(),\n});\nconst text = computed(() => {\n if (!props.totalReports || props.totalReports <= 1) {\n return props.report.title;\n }\n\n return `${props.report.title} (${props.currentReport}/${props.totalReports})`;\n});\n</script>\n","<template>\n <AGModal>\n <div>\n <h2 class=\"flex items-center justify-between text-lg font-medium\">\n <div class=\"flex items-center\">\n <AGErrorReportModalTitle\n :report=\"report\"\n :current-report=\"activeReportIndex + 1\"\n :total-reports=\"reports.length\"\n />\n <template v-if=\"reports.length > 1\">\n <AGButton\n color=\"clear\"\n :disabled=\"activeReportIndex === 0\"\n :title=\"$td('errors.previousReport', 'Show previous report')\"\n :aria-label=\"$td('errors.previousReport', 'Show previous report')\"\n @click=\"activeReportIndex--\"\n >\n <IconCheveronLeft aria-hidden=\"true\" class=\"h-4 w-4\" />\n </AGButton>\n <AGButton\n color=\"clear\"\n :disabled=\"activeReportIndex === reports.length - 1\"\n :title=\"$td('errors.nextReport', 'Show next report')\"\n :aria-label=\"$td('errors.nextReport', 'Show next report')\"\n @click=\"activeReportIndex++\"\n >\n <IconCheveronRight aria-hidden=\"true\" class=\"h-4 w-4\" />\n </AGButton>\n </template>\n </div>\n <AGErrorReportModalButtons :report=\"report\" />\n </h2>\n <AGMarkdown v-if=\"report.description\" :text=\"report.description\" class=\"mt-2\" />\n </div>\n <pre\n class=\"h-full overflow-auto bg-gray-200 p-4 text-xs text-red-900\"\n v-text=\"report.details ?? $td('errors.detailsEmpty', 'This error is missing a stacktrace.')\"\n />\n </AGModal>\n</template>\n\n<script setup lang=\"ts\">\nimport IconCheveronRight from '~icons/zondicons/cheveron-right';\nimport IconCheveronLeft from '~icons/zondicons/cheveron-left';\n\nimport { computed, ref } from 'vue';\n\nimport type { ErrorReport } from '@/errors';\n\nimport { useErrorReportModalProps } from './AGErrorReportModal';\n\nimport AGButton from '../forms/AGButton.vue';\nimport AGErrorReportModalButtons from './AGErrorReportModalButtons.vue';\nimport AGErrorReportModalTitle from './AGErrorReportModalTitle.vue';\nimport AGMarkdown from '../basic/AGMarkdown.vue';\nimport AGModal from './AGModal.vue';\n\nconst props = defineProps(useErrorReportModalProps());\nconst activeReportIndex = ref(0);\nconst report = computed(() => props.reports[activeReportIndex.value] as ErrorReport);\n</script>\n","<template>\n <AGModal :cancellable=\"false\">\n <AGMarkdown :text=\"renderedMessage\" />\n </AGModal>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nimport { stringProp } from '@/utils/vue';\nimport { translateWithDefault } from '@/lang/utils';\n\nimport AGModal from './AGModal.vue';\n\nimport AGMarkdown from '../basic/AGMarkdown.vue';\n\nconst props = defineProps({ message: stringProp() });\nconst renderedMessage = computed(() => props.message ?? translateWithDefault('ui.loading', 'Loading...'));\n</script>\n","import type { ComputedRef, DeepReadonly, Ref } from 'vue';\n\nimport { requiredArrayProp, stringProp } from '@/utils/vue';\n\nexport interface IAGSelectOption {\n value: string | number | boolean | object | null;\n text: string;\n}\n\nexport type IAGSelectOptionValue = string | number | boolean | object | null;\n\nexport interface IAGHeadlessSelect {\n id: string;\n label: ComputedRef<string | null>;\n noSelectionText: ComputedRef<string>;\n buttonText: ComputedRef<string>;\n selectedOption: ComputedRef<IAGSelectOption | undefined>;\n options: ComputedRef<IAGSelectOption[]>;\n errors: DeepReadonly<Ref<string[] | null>>;\n update(value: IAGSelectOptionValue): void;\n}\n\nexport const selectProps = {\n options: requiredArrayProp<IAGSelectOptionValue>(),\n label: stringProp(),\n noSelectionText: stringProp(),\n};\n\nexport function useSelectProps(): typeof selectProps {\n return selectProps;\n}\n\nexport function extractSelectProps<T extends Record<keyof typeof selectProps, unknown>>(\n componentProps: T,\n): Pick<T, keyof typeof selectProps> {\n return Object.keys(selectProps).reduce((extractedProps, selectProp) => {\n const prop = selectProp as keyof typeof selectProps;\n\n extractedProps[prop] = componentProps[prop];\n\n return extractedProps;\n }, {} as Pick<T, keyof typeof selectProps>);\n}\n","<template>\n <component :is=\"as\" v-if=\"as\">\n <slot />\n </component>\n <slot v-else />\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, inject, provide, readonly } from 'vue';\nimport { uuid } from '@noeldemartin/utils';\n\nimport { mixedProp, stringProp } from '@/utils/vue';\nimport type Form from '@/forms/Form';\n\nimport type { IAGHeadlessInput } from './AGHeadlessInput';\n\nconst emit = defineEmits(['update:modelValue']);\nconst props = defineProps({\n as: stringProp('div'),\n name: stringProp(),\n modelValue: mixedProp<string | number | boolean>([String, Number, Boolean]),\n});\nconst errors = computed(() => {\n if (!form || !props.name) {\n return null;\n }\n\n return form.errors[props.name] ?? null;\n});\nconst form = inject<Form | null>('form', null);\nconst api: IAGHeadlessInput = {\n id: `input-${uuid()}`,\n value: computed(() => {\n if (form && props.name) {\n return form.getFieldValue(props.name) as string | number | boolean | null;\n }\n\n return props.modelValue;\n }),\n errors: readonly(errors),\n update(value) {\n if (form && props.name) {\n form.setFieldValue(props.name, value);\n\n return;\n }\n\n emit('update:modelValue', value);\n },\n};\n\nprovide<IAGHeadlessInput>('input', api);\ndefineExpose<IAGHeadlessInput>(api);\n</script>\n","<template>\n <p v-if=\"errorMessage\" :id=\"`${input.id}-error`\">\n {{ errorMessage }}\n </p>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nimport { injectReactiveOrFail } from '@/utils/vue';\nimport { translateWithDefault } from '@/lang/utils';\n\nimport type { IAGHeadlessInput } from './AGHeadlessInput';\n\nconst input = injectReactiveOrFail<IAGHeadlessInput>(\n 'input',\n '<AGHeadlessInputError> must be a child of a <AGHeadlessInput>',\n);\nconst errorMessage = computed(() => {\n if (!input.errors) {\n return null;\n }\n\n return translateWithDefault(`errors.${input.errors[0]}`, `Error: ${input.errors[0]}`);\n});\n</script>\n","<template>\n <input\n :id=\"input.id\"\n ref=\"$input\"\n :type=\"type\"\n :value=\"value\"\n :aria-invalid=\"input.errors ? 'true' : 'false'\"\n :aria-describedby=\"input.errors ? `${input.id}-error` : undefined\"\n :checked=\"checked\"\n @input=\"update\"\n >\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue';\n\nimport { injectReactiveOrFail, stringProp } from '@/utils';\nimport type { IAGHeadlessInput } from '@/components/headless/forms/AGHeadlessInput';\n\nconst props = defineProps({\n type: stringProp('text'),\n});\n\nconst $input = ref<HTMLInputElement>();\nconst input = injectReactiveOrFail<IAGHeadlessInput>(\n 'input',\n '<AGHeadlessInputInput> must be a child of a <AGHeadlessInput>',\n);\nconst value = computed(() => input.value);\nconst checked = computed(() => {\n if (props.type !== 'checkbox') {\n return;\n }\n\n return !!value.value;\n});\n\nfunction update() {\n if (!$input.value) {\n return;\n }\n\n input.update(props.type === 'checkbox' ? $input.value.checked : $input.value.value);\n}\n</script>\n","<template>\n <label :for=\"input.id\">\n <slot />\n </label>\n</template>\n\n<script setup lang=\"ts\">\nimport { injectReactiveOrFail } from '@/utils/vue';\n\nimport type { IAGHeadlessInput } from './AGHeadlessInput';\n\nconst input = injectReactiveOrFail<IAGHeadlessInput>(\n 'input',\n '<AGHeadlessInputLabel> must be a child of a <AGHeadlessInput>',\n);\n</script>\n","<template>\n <Listbox\n v-slot=\"{ value, open, disabled }: ComponentProps\"\n :model-value=\"selectedOption?.value\"\n @update:model-value=\"update($event)\"\n >\n <slot :value=\"value\" :open=\"open\" :disabled=\"disabled\" />\n </Listbox>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, inject, provide } from 'vue';\nimport { isObject, toString, uuid } from '@noeldemartin/utils';\nimport { Listbox } from '@headlessui/vue';\n\nimport { mixedProp, stringProp } from '@/utils/vue';\nimport { translateWithDefault } from '@/lang/utils';\nimport type Form from '@/forms/Form';\nimport type { ComponentProps } from '@/utils/vue';\n\nimport { useSelectProps } from './AGHeadlessSelect';\nimport type { IAGHeadlessSelect, IAGSelectOption, IAGSelectOptionValue } from './AGHeadlessSelect';\n\nconst emit = defineEmits(['update:modelValue']);\nconst props = defineProps({\n name: stringProp(),\n modelValue: mixedProp<IAGSelectOptionValue>(),\n ...useSelectProps(),\n});\nconst form = inject<Form | null>('form', null);\nconst noSelectionText = computed(() => props.noSelectionText ?? translateWithDefault('select.noSelection', '-'));\nconst options = computed(() =>\n props.options.map((value) => {\n const option: IAGSelectOption = {\n value,\n text: toString(isObject(value) && 'text' in value ? value.text : value),\n };\n\n return option;\n }));\nconst selectedOption = computed(() => {\n const selectedOptionValue = form && props.name ? form.getFieldValue(props.name) : props.modelValue;\n\n return options.value.find((option) => option.value === selectedOptionValue);\n});\nconst errors = computed(() => {\n if (!form || !props.name) {\n return null;\n }\n\n return form.errors[props.name] ?? null;\n});\n\nfunction update(value: IAGSelectOptionValue) {\n if (form && props.name) {\n form.setFieldValue(props.name, value);\n\n return;\n }\n\n emit('update:modelValue', value);\n}\n\nconst api: IAGHeadlessSelect = {\n id: `select-${uuid()}`,\n options,\n noSelectionText,\n selectedOption,\n errors,\n label: computed(() => props.label),\n buttonText: computed(() => selectedOption.value?.text ?? noSelectionText.value),\n update,\n};\n\nprovide<IAGHeadlessSelect>('select', api);\ndefineExpose<IAGHeadlessSelect>(api);\n</script>\n","<template>\n <ListboxButton v-slot=\"{ value, open, disabled }: ComponentProps\">\n <slot :value=\"value\" :open=\"open\" :disabled=\"disabled\">\n <span :class=\"textClass\">{{ select?.buttonText }}</span>\n </slot>\n <slot name=\"icon\" />\n </ListboxButton>\n</template>\n\n<script setup lang=\"ts\">\nimport { ListboxButton } from '@headlessui/vue';\n\nimport { injectReactiveOrFail, stringProp } from '@/utils/vue';\nimport type { ComponentProps } from '@/utils/vue';\n\nimport type { IAGHeadlessSelect } from './AGHeadlessSelect';\n\ndefineProps({ textClass: stringProp() });\n\nconst select = injectReactiveOrFail<IAGHeadlessSelect>(\n 'select',\n '<AGHeadlessSelectButton> must be a child of a <AGHeadlessSelect>',\n);\n</script>\n","<template>\n <p v-if=\"errorMessage\" :id=\"`${select.id}-error`\">\n {{ errorMessage }}\n </p>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nimport { injectReactiveOrFail } from '@/utils/vue';\nimport { translateWithDefault } from '@/lang/utils';\n\nimport type { IAGHeadlessSelect } from './AGHeadlessSelect';\n\nconst select = injectReactiveOrFail<IAGHeadlessSelect>(\n 'select',\n '<AGHeadlessSelectError> must be a child of a <AGHeadlessSelect>',\n);\nconst errorMessage = computed(() => {\n if (!select.errors) {\n return null;\n }\n\n return translateWithDefault(`errors.${select.errors[0]}`, `Error: ${select.errors[0]}`);\n});\n</script>\n","<template>\n <ListboxLabel v-if=\"select.label\" v-slot=\"{ open, disabled }: ComponentProps\">\n <slot :open=\"open\" :disabled=\"disabled\">\n {{ select.label }}\n </slot>\n </ListboxLabel>\n</template>\n\n<script setup lang=\"ts\">\nimport { ListboxLabel } from '@headlessui/vue';\n\nimport { injectReactiveOrFail } from '@/utils/vue';\nimport type { ComponentProps } from '@/utils/vue';\n\nimport type { IAGHeadlessSelect } from './AGHeadlessSelect';\n\nconst select = injectReactiveOrFail<IAGHeadlessSelect>(\n 'select',\n '<AGHeadlessSelectLabel> must be a child of a <AGHeadlessSelect>',\n);\n</script>\n","<template>\n <ListboxOption v-slot=\"{ active, selected, disabled }: ComponentProps\" :value=\"value\" as=\"template\">\n <slot :active=\"active\" :selected=\"selected\" :disabled=\"disabled\">\n <li\n :class=\"{\n [activeClass ?? 'active']: active,\n [inactiveClass ?? 'inactive']: !active,\n [selectedClass ?? 'selected']: selected,\n [unselectedClass ?? 'unselected']: !selected,\n }\"\n >\n {{ option?.text }}\n </li>\n </slot>\n </ListboxOption>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { ListboxOption } from '@headlessui/vue';\n\nimport { injectReactiveOrFail, requiredMixedProp, stringProp } from '@/utils/vue';\nimport type { ComponentProps } from '@/utils/vue';\n\nimport type { IAGHeadlessSelect, IAGSelectOptionValue } from './AGHeadlessSelect';\n\nconst props = defineProps({\n value: requiredMixedProp<IAGSelectOptionValue>(),\n selectedClass: stringProp(),\n unselectedClass: stringProp(),\n activeClass: stringProp(),\n inactiveClass: stringProp(),\n});\nconst select = injectReactiveOrFail<IAGHeadlessSelect>(\n 'select',\n '<AGHeadlessSelectOption> must be a child of a <AGHeadlessSelect>',\n);\nconst option = computed(() => select.options.find((selectOption) => selectOption.value === props.value));\n</script>\n","import { arrayProp, enumProp, requiredStringProp } from '@/utils/vue';\nimport { Colors } from '@/components/constants';\nimport { objectWithout } from '@noeldemartin/utils';\n\nexport { default as AGHeadlessSnackbar } from './AGHeadlessSnackbar.vue';\n\nexport interface SnackbarAction {\n text: string;\n dismiss?: boolean;\n handler?(): unknown;\n}\n\nexport type SnackbarColor = (typeof SnackbarColors)[keyof typeof SnackbarColors];\n\nexport const SnackbarColors = objectWithout(Colors, ['Primary', 'Clear']);\nexport const snackbarProps = {\n id: requiredStringProp(),\n message: requiredStringProp(),\n actions: arrayProp<SnackbarAction>(() => []),\n color: enumProp(SnackbarColors, Colors.Secondary),\n};\n\nexport function useSnackbarProps(): typeof snackbarProps {\n return snackbarProps;\n}\n","<template>\n <AGHeadlessSnackbar class=\"flex flex-row items-center justify-center gap-3 p-4\" :class=\"styleClasses\">\n <AGMarkdown :text=\"message\" inline />\n <AGButton\n v-for=\"(action, i) of actions\"\n :key=\"i\"\n :color=\"color\"\n @click=\"activate(action)\"\n >\n {{ action.text }}\n </AGButton>\n </AGHeadlessSnackbar>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nimport UI from '@/ui/UI';\nimport { Colors } from '@/components/constants';\nimport { useSnackbarProps } from '@/components/headless';\nimport type { SnackbarAction } from '@/components/headless';\n\nimport AGButton from '../forms/AGButton.vue';\nimport AGHeadlessSnackbar from '../headless/snackbars/AGHeadlessSnackbar.vue';\nimport AGMarkdown from '../basic/AGMarkdown.vue';\n\nconst props = defineProps(useSnackbarProps());\nconst styleClasses = computed(() => {\n switch (props.color) {\n case Colors.Danger:\n return 'bg-red-200 text-red-900';\n default:\n case Colors.Secondary:\n return 'bg-gray-900 text-white';\n }\n});\n\nfunction activate(action: SnackbarAction): void {\n action.handler?.();\n action.dismiss && UI.hideSnackbar(props.id);\n}\n</script>\n","import type { Component } from 'vue';\n\nimport { bootServices } from '@/services';\nimport { definePlugin } from '@/plugins';\n\nimport UI, { UIComponents } from './UI';\nimport AGAlertModal from '../components/modals/AGAlertModal.vue';\nimport AGConfirmModal from '../components/modals/AGConfirmModal.vue';\nimport AGErrorReportModal from '../components/modals/AGErrorReportModal.vue';\nimport AGLoadingModal from '../components/modals/AGLoadingModal.vue';\nimport AGSnackbar from '../components/snackbars/AGSnackbar.vue';\nimport type { UIComponent } from './UI';\n\nexport { UI, UIComponents, UIComponent };\n\nconst services = { $ui: UI };\n\nexport type UIServices = typeof services;\n\nexport default definePlugin({\n async install(app, options) {\n const defaultComponents = {\n [UIComponents.AlertModal]: AGAlertModal,\n [UIComponents.ConfirmModal]: AGConfirmModal,\n [UIComponents.ErrorReportModal]: AGErrorReportModal,\n [UIComponents.LoadingModal]: AGLoadingModal,\n [UIComponents.Snackbar]: AGSnackbar,\n };\n\n Object.entries({\n ...defaultComponents,\n ...options.components,\n }).forEach(([name, component]) => UI.registerComponent(name as UIComponent, component));\n\n await bootServices(app, services);\n },\n});\n\ndeclare module '@/bootstrap/options' {\n interface AerogelOptions {\n components?: Partial<Record<UIComponent, Component>>;\n }\n}\n\ndeclare module '@/services' {\n export interface Services extends UIServices {}\n}\n","import { createApp } from 'vue';\nimport type { Component } from 'vue';\n\nimport directives from '@/directives';\nimport errors from '@/errors';\nimport Events from '@/services/Events';\nimport lang from '@/lang';\nimport services from '@/services';\nimport ui from '@/ui';\nimport { installPlugins } from '@/plugins';\nimport type { AerogelOptions } from '@/bootstrap/options';\n\nexport async function bootstrapApplication(rootComponent: Component, options: AerogelOptions = {}): Promise<void> {\n const plugins = [directives, errors, lang, services, ui, ...(options.plugins ?? [])];\n const app = createApp(rootComponent);\n\n await installPlugins(plugins, app, options);\n\n app.mount('#app');\n app._container?.classList.remove('loading');\n\n Events.emit('application-mounted');\n}\n","<template>\n <aside v-if=\"modal\">\n <AGModalContext :child-index=\"1\" :modal=\"modal\" />\n </aside>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nimport UI from '@/ui/UI';\n\nimport AGModalContext from './modals/AGModalContext.vue';\n\nconst modal = computed(() => UI.modals[0] ?? null);\n</script>\n","<template>\n <div aria-live=\"assertive\" class=\"z-60 pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:p-6\">\n <div class=\"flex w-full flex-col items-center space-y-4 sm:items-end\">\n <component\n :is=\"snackbar.component\"\n v-for=\"snackbar of $ui.snackbars\"\n :id=\"snackbar.id\"\n :key=\"snackbar.id\"\n v-bind=\"snackbar.properties\"\n />\n </div>\n </div>\n</template>\n","<template>\n <div ref=\"$backdrop\" class=\"pointer-events-none fixed inset-0 z-50 bg-black/30 opacity-0\" />\n <AGAppModals />\n <AGAppSnackbars />\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue';\n\nimport { useEvent } from '@/utils/composition/events';\n\nimport AGAppModals from './AGAppModals.vue';\nimport AGAppSnackbars from './AGAppSnackbars.vue';\n\nconst $backdrop = ref<HTMLElement | null>(null);\nconst backdropHidden = ref(true);\n\nuseEvent('show-overlays-backdrop', async () => {\n if (!$backdrop.value || !backdropHidden.value) {\n return;\n }\n\n backdropHidden.value = false;\n\n $backdrop.value.classList.remove('opacity-0');\n});\n\nuseEvent('hide-overlays-backdrop', async () => {\n if (!$backdrop.value || backdropHidden.value) {\n return;\n }\n\n backdropHidden.value = true;\n\n $backdrop.value.classList.add('opacity-0');\n});\n</script>\n","<template>\n <AGMarkdown :text=\"message\" inline />\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nimport Errors from '@/errors/Errors';\nimport { requiredObjectProp } from '@/utils/vue';\nimport type { ErrorSource } from '@/errors/Errors.state';\n\nimport AGMarkdown from './AGMarkdown.vue';\n\nconst props = defineProps({ error: requiredObjectProp<ErrorSource>() });\nconst message = computed(() => Errors.getErrorMessage(props.error));\n</script>\n","<template>\n <AGHeadlessInput ref=\"$input\" :name=\"name\" class=\"flex\">\n <AGHeadlessInputInput\n v-bind=\"$attrs\"\n type=\"checkbox\"\n :class=\"{\n 'text-indigo-600 focus:ring-indigo-600': !$input?.errors,\n 'border-red-200 text-red-600 focus:ring-red-600': $input?.errors,\n }\"\n />\n\n <div class=\"ml-2\">\n <AGHeadlessInputLabel v-if=\"$slots.default\">\n <slot />\n </AGHeadlessInputLabel>\n <AGHeadlessInputError class=\"text-sm text-red-600\" />\n </div>\n </AGHeadlessInput>\n</template>\n\n<script setup lang=\"ts\">\nimport { componentRef, stringProp } from '@/utils/vue';\n\nimport type { IAGHeadlessInput } from '@/components/headless/forms/AGHeadlessInput';\n\nimport AGHeadlessInput from '../headless/forms/AGHeadlessInput.vue';\nimport AGHeadlessInputError from '../headless/forms/AGHeadlessInputError.vue';\nimport AGHeadlessInputInput from '../headless/forms/AGHeadlessInputInput.vue';\nimport AGHeadlessInputLabel from '../headless/forms/AGHeadlessInputLabel.vue';\n\ndefineProps({ name: stringProp() });\ndefineOptions({ inheritAttrs: false });\n\nconst $input = componentRef<IAGHeadlessInput>();\n</script>\n","<template>\n <form @submit.prevent=\"submit\">\n <slot />\n </form>\n</template>\n\n<script setup lang=\"ts\">\nimport { provide } from 'vue';\n\nimport { objectProp } from '@/utils/vue';\nimport type Form from '@/forms/Form';\n\nconst props = defineProps({ form: objectProp<Form>() });\n\nconst emit = defineEmits<{ submit: [] }>();\n\nprovide('form', props.form);\n\nfunction submit() {\n if (props.form && !props.form.submit()) {\n return;\n }\n\n emit('submit');\n}\n</script>\n","<template>\n <AGHeadlessInput\n ref=\"$input\"\n class=\"relative flex flex-col items-center\"\n :class=\"className\"\n :name=\"name\"\n >\n <AGHeadlessInputInput\n v-bind=\"attrs\"\n class=\"block w-full border-0 py-1.5 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600\"\n :class=\"{\n 'ring-1 ring-red-500': $input?.errors,\n }\"\n />\n <div class=\"absolute bottom-0 left-0 translate-y-full\">\n <AGHeadlessInputError class=\"mt-1 text-sm text-red-500\" />\n </div>\n </AGHeadlessInput>\n</template>\n\n<script setup lang=\"ts\">\nimport { componentRef, stringProp } from '@/utils/vue';\n\nimport { useInputAttrs } from '@/utils';\nimport type { IAGHeadlessInput } from '@/components/headless/forms/AGHeadlessInput';\n\nimport AGHeadlessInput from '../headless/forms/AGHeadlessInput.vue';\nimport AGHeadlessInputInput from '../headless/forms/AGHeadlessInputInput.vue';\nimport AGHeadlessInputError from '../headless/forms/AGHeadlessInputError.vue';\n\ndefineProps({ name: stringProp() });\ndefineOptions({ inheritAttrs: false });\n\nconst $input = componentRef<IAGHeadlessInput>();\nconst [attrs, className] = useInputAttrs();\n</script>\n","<template>\n <AGHeadlessSelect v-bind=\"props\" ref=\"$select\" as=\"div\">\n <AGHeadlessSelectLabel class=\"block text-sm font-medium leading-6 text-gray-900\" />\n <div class=\"relative\" :class=\"{ 'mt-2': $select?.label }\">\n <AGHeadlessSelectButton\n class=\"relative w-full cursor-default bg-white py-1.5 pl-3 pr-10 text-left text-gray-900 ring-1 ring-inset ring-gray-300 focus:outline-none focus:ring-2 focus:ring-indigo-600\"\n text-class=\"block truncate\"\n :class=\"{\n 'ring-1 ring-red-500': $select?.errors,\n }\"\n >\n <template #icon>\n <span class=\"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2\">\n <IconCheveronDown class=\"h-5 w-5 text-gray-400\" />\n </span>\n </template>\n </AGHeadlessSelectButton>\n <AGHeadlessSelectOptions\n class=\"absolute z-10 mt-1 max-h-60 w-full overflow-auto border bg-white py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none\"\n >\n <AGHeadlessSelectOption\n v-for=\"(option, index) in $select?.options ?? []\"\n :key=\"index\"\n :value=\"option.value\"\n class=\"relative block cursor-default select-none truncate py-2 pl-3 pr-9\"\n selected-class=\"font-semibold\"\n unselected-class=\"font-normal\"\n active-class=\"bg-indigo-600 text-white\"\n inactive-class=\"text-gray-900\"\n />\n </AGHeadlessSelectOptions>\n </div>\n <AGHeadlessSelectError class=\"mt-2 text-sm text-red-600\" />\n </AGHeadlessSelect>\n</template>\n\n<script setup lang=\"ts\">\nimport IconCheveronDown from '~icons/zondicons/cheveron-down';\n\nimport { componentRef } from '@/utils/vue';\nimport { useSelectProps } from '@/components/headless/forms/AGHeadlessSelect';\nimport type { IAGHeadlessSelect } from '@/components/headless/forms/AGHeadlessSelect';\n\nimport AGHeadlessSelect from '../headless/forms/AGHeadlessSelect.vue';\nimport AGHeadlessSelectButton from '../headless/forms/AGHeadlessSelectButton.vue';\nimport AGHeadlessSelectError from '../headless/forms/AGHeadlessSelectError.vue';\nimport AGHeadlessSelectLabel from '../headless/forms/AGHeadlessSelectLabel.vue';\nimport AGHeadlessSelectOption from '../headless/forms/AGHeadlessSelectOption.vue';\nimport AGHeadlessSelectOptions from '../headless/forms/AGHeadlessSelectOptions';\n\nconst props = defineProps(useSelectProps());\nconst $select = componentRef<IAGHeadlessSelect>();\n</script>\n","import { MagicObject } from '@noeldemartin/utils';\nimport { computed, reactive, readonly, ref } from 'vue';\nimport type { ObjectValues } from '@noeldemartin/utils';\nimport type { ComputedRef, DeepReadonly, Ref, UnwrapNestedRefs } from 'vue';\n\nexport const FormFieldTypes = {\n String: 'string',\n Number: 'number',\n Boolean: 'boolean',\n Object: 'object',\n} as const;\n\nexport interface FormFieldDefinition<TType extends FormFieldType = FormFieldType, TRules extends string = string> {\n type: TType;\n default?: GetFormFieldValue<TType>;\n rules?: TRules;\n}\n\nexport type FormFieldDefinitions = Record<string, FormFieldDefinition>;\nexport type FormFieldType = ObjectValues<typeof FormFieldTypes>;\n\nexport type FormData<T> = {\n -readonly [k in keyof T]: T[k] extends FormFieldDefinition<infer TType, infer TRules>\n ? TRules extends 'required'\n ? GetFormFieldValue<TType>\n : GetFormFieldValue<TType> | null\n : never;\n};\n\nexport type FormErrors<T> = {\n [k in keyof T]: string[] | null;\n};\n\nexport type GetFormFieldValue<TType> = TType extends typeof FormFieldTypes.String\n ? string\n : TType extends typeof FormFieldTypes.Number\n ? number\n : TType extends typeof FormFieldTypes.Boolean\n ? boolean\n : TType extends typeof FormFieldTypes.Object\n ? object\n : never;\n\nconst validForms: WeakMap<Form, ComputedRef<boolean>> = new WeakMap();\n\nexport default class Form<Fields extends FormFieldDefinitions = FormFieldDefinitions> extends MagicObject {\n\n public errors: DeepReadonly<UnwrapNestedRefs<FormErrors<Fields>>>;\n\n private _fields: Fields;\n private _data: FormData<Fields>;\n private _submitted: Ref<boolean>;\n private _errors: FormErrors<Fields>;\n\n constructor(fields: Fields) {\n super();\n\n this._fields = fields;\n this._submitted = ref(false);\n this._data = this.getInitialData(fields);\n this._errors = this.getInitialErrors(fields);\n\n validForms.set(\n this,\n computed(() => !Object.values(this._errors).some((error) => error !== null)),\n );\n\n this.errors = readonly(this._errors);\n }\n\n public get valid(): boolean {\n return !!validForms.get(this)?.value;\n }\n\n public get submitted(): boolean {\n return this._submitted.value;\n }\n\n public setFieldValue<T extends keyof Fields>(field: T, value: FormData<Fields>[T]): void {\n this._data[field] = value;\n\n if (this._submitted.value) {\n this.validate();\n }\n }\n\n public getFieldValue<T extends keyof Fields>(field: T): GetFormFieldValue<Fields[T]['type']> {\n return this._data[field] as unknown as GetFormFieldValue<Fields[T]['type']>;\n }\n\n public validate(): boolean {\n const errors = Object.entries(this._fields).reduce((formErrors, [name, definition]) => {\n formErrors[name] = this.getFieldErrors(name, definition);\n\n return formErrors;\n }, {} as Record<string, string[] | null>);\n\n this.resetErrors(errors);\n\n return this.valid;\n }\n\n public reset(options: { keepData?: boolean; keepErrors?: boolean } = {}): void {\n this._submitted.value = false;\n\n options.keepData || this.resetData();\n options.keepErrors || this.resetErrors();\n }\n\n public submit(): boolean {\n this._submitted.value = true;\n\n return this.validate();\n }\n\n protected __get(property: string): unknown {\n if (!(property in this._fields)) {\n return super.__get(property);\n }\n\n return this._data[property];\n }\n\n protected __set(property: string, value: unknown): void {\n if (!(property in this._fields)) {\n super.__set(property, value);\n\n return;\n }\n\n Object.assign(this._data, { [property]: value });\n }\n\n private getFieldErrors(name: keyof Fields, definition: FormFieldDefinition): string[] | null {\n const errors = [];\n\n if (definition.rules?.includes('required') && !this._data[name]) {\n errors.push('required');\n }\n\n return errors.length > 0 ? errors : null;\n }\n\n private getInitialData(fields: Fields): FormData<Fields> {\n if (this.static().isConjuring()) {\n return {} as FormData<Fields>;\n }\n\n const data = Object.entries(fields).reduce((formData, [name, definition]) => {\n formData[name as keyof Fields] = (definition.default ?? null) as FormData<Fields>[keyof Fields];\n\n return formData;\n }, {} as FormData<Fields>);\n\n return reactive(data) as FormData<Fields>;\n }\n\n private getInitialErrors(fields: Fields): FormErrors<Fields> {\n if (this.static().isConjuring()) {\n return {} as FormErrors<Fields>;\n }\n\n const errors = Object.keys(fields).reduce((formErrors, name) => {\n formErrors[name as keyof Fields] = null;\n\n return formErrors;\n }, {} as FormErrors<Fields>);\n\n return reactive(errors) as FormErrors<Fields>;\n }\n\n private resetData(): void {\n for (const [name, field] of Object.entries(this._fields)) {\n this._data[name as keyof Fields] = (field.default ?? null) as FormData<Fields>[keyof Fields];\n }\n }\n\n private resetErrors(errors?: Record<string, string[] | null>): void {\n Object.keys(this._errors).forEach((key) => delete this._errors[key as keyof Fields]);\n\n errors && Object.assign(this._errors, errors);\n }\n\n}\n","import Form from '@/forms/Form';\nimport type { FormData, FormFieldDefinitions } from '@/forms/Form';\n\nexport function useForm<const T extends FormFieldDefinitions>(fields: T): Form<T> & FormData<T> {\n return new Form(fields) as Form<T> & FormData<T>;\n}\n","import { FormFieldTypes } from './Form';\nimport type { FormFieldDefinition } from './Form';\n\nexport function booleanInput(defaultValue?: boolean): FormFieldDefinition<typeof FormFieldTypes.Boolean> {\n return {\n default: defaultValue,\n type: FormFieldTypes.Boolean,\n };\n}\n\nexport function requiredBooleanInput(\n defaultValue?: boolean,\n): FormFieldDefinition<typeof FormFieldTypes.Boolean, 'required'> {\n return {\n default: defaultValue,\n type: FormFieldTypes.Boolean,\n rules: 'required',\n };\n}\n\nexport function requiredNumberInput(\n defaultValue?: number,\n): FormFieldDefinition<typeof FormFieldTypes.Number, 'required'> {\n return {\n default: defaultValue,\n type: FormFieldTypes.Number,\n rules: 'required',\n };\n}\n\nexport function requiredStringInput(\n defaultValue?: string,\n): FormFieldDefinition<typeof FormFieldTypes.String, 'required'> {\n return {\n default: defaultValue,\n type: FormFieldTypes.String,\n rules: 'required',\n };\n}\n\nexport function numberInput(defaultValue?: number): FormFieldDefinition<typeof FormFieldTypes.Number> {\n return {\n default: defaultValue,\n type: FormFieldTypes.Number,\n };\n}\n\nexport function stringInput(defaultValue?: string): FormFieldDefinition<typeof FormFieldTypes.String> {\n return {\n default: defaultValue,\n type: FormFieldTypes.String,\n };\n}\n"],"names":["ServiceBootError","JSError","constructor","serviceNamespace","cause","super","_store","initializePiniaStore","createPinia","setActivePinia","defineServiceState","options","_class","_defineProperty","Service","usesStore","getName","name","getInitialState","initialState","getComputedStateDefinition","computed","serializePersistedState","state","serialize","persist","MagicObject","this","getters","_name","_booted","PromisedValue","_computedStateKeys","Set","Object","keys","defineStore","booted","launch","handleError","error","reject","frameworkBoot","then","boot","resolve","catch","hasState","property","$state","has","getState","store","undefined","setState","stateOrProperty","value","assign","onStateUpdated","__get","__set","persisted","objectOnly","isEmpty","storage","Storage","require","set","objectDeepClone","restorePersistedState","EventsService","arguments","emit","event","payload","listeners","Promise","all","map","listener","on","arr","push","off","once","onceListener","tap","eventListeners","remove","Events","facade","Service$2","plugins","environment","Build","sourceUrl","isMounted","development","testing","AppService","plugin","App","definePlugin","async","installPlugins","_len","length","args","Array","_key","reduce","pluginsMap","install","arrayProp","defaultValue","type","default","booleanProp","Boolean","componentRef","ref","defineDirective","directive","enumProp","enumeration","values","String","validator","includes","injectReactive","key","inject","reactive","injectReactiveOrFail","errorMessage","fail","injectOrFail","mixedProp","numberProp","Number","objectProp","requiredArrayProp","required","requiredEnumProp","requiredMixedProp","requiredNumberProp","requiredObjectProp","requiredStringProp","stringProp","builtInDirectives","mounted","element","_ref","focus","directives","app","entries","defaultServices","$app","$events","bootServices","services","service","config","errorHandler","globalProperties","window","services$3","use","Service$1","modals","snackbars","UIComponents","AlertModal","ConfirmModal","ErrorReportModal","LoadingModal","Snackbar","UI","requireComponent","components","alert","messageOrTitle","message","title","openModal","confirm","modal","beforeClose","loading","messageOrOperation","operation","result","closeModal","id","showSnackbar","snackbar","uuid","properties","component","markRaw","concat","setTimeout","hideSnackbar","filter","registerComponent","callbacks","willClose","afterClose","closed","activeModal","at","modalCallbacks","nextTick","watchModalEvents","_ref2","m","Lang","provider","translate","console","warn","setProvider","parameters","translateWithDefault","defaultMessageOrParameters","defaultMessage","renderedMessage","replace","RegExp","toString","bind","logs","startupErrors","hasErrors","hasNewErrors","some","seen","hasStartupErrors","_ref3","Colors","Primary","Secondary","Danger","Clear","Errors","enable","enabled","disable","inspect","reports","isArray","createErrorReport","report","logError","startupError","createStartupErrorReport","log","date","Date","color","actions","text","dismiss","handler","see","seeAll","getErrorMessage","Error","isObject","createErrorReportFromError","objectWithoutEmpty","description","defaults","details","stack","$errors","setUpErrorHandler","baseHandler","instance","frameworkHandler","globalThis","onerror","_","__","___","onunhandledrejection","reason","errors","$lang","lang","$t","$td","useEvent","unsubscribe","onUnmounted","useInputAttrs","attrs","useAttrs","className","class","objectWithout","onCleanMounted","cleanUp","noop","onMounted","$root","hidden","hide","$el","close","show","__expose","cancellable","toRef","props","provide","childIndex","childModal","$headlessModal","renderMarkdown","markdown","html","marked","mangle","headerIds","renderer","Renderer","link","href","prototype","apply","DOMPurify","sanitize","ADD_ATTR","langKey","langParams","renderedHtml","inline","root","h","as","innerHTML","route","tag","to","params","routeParams","query","routeQuery","url","target","submit","colorClasses","join","errorReportModalProps","useErrorReportModalProps","summary","githubReportUrl","issueTitle","encodeURIComponent","issueBody","stringExcerpt","trim","buttons","iconComponent","IconCopy","navigator","clipboard","writeText","IconConsole","reportButtons","IconGitHub","totalReports","currentReport","activeReportIndex","selectProps","label","noSelectionText","useSelectProps","extractSelectProps","componentProps","extractedProps","selectProp","prop","form","api","getFieldValue","modelValue","readonly","update","setFieldValue","input","$input","checked","selectedOption","selectedOptionValue","find","option","buttonText","select","selectOption","SnackbarColors","snackbarProps","useSnackbarProps","styleClasses","action","$ui","ui","defaultComponents","AGAlertModal","AGConfirmModal","AGErrorReportModal","AGLoadingModal","AGSnackbar","forEach","bootstrapApplication","rootComponent","createApp","mount","_container","classList","_hoisted_2","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_Fragment","_renderList","_ctx","_createBlock","_resolveDynamicComponent","_mergeProps","$backdrop","backdropHidden","add","$select","FormFieldTypes","validForms","WeakMap","Form","fields","_fields","_submitted","_data","getInitialData","_errors","getInitialErrors","valid","get","submitted","field","validate","formErrors","definition","getFieldErrors","resetErrors","reset","keepData","resetData","keepErrors","rules","static","isConjuring","data","formData","useForm","booleanInput","requiredBooleanInput","requiredNumberInput","requiredStringInput","numberInput","stringInput"],"mappings":"+xFAEqB,MAAAA,yBAAyBC,EAE1CC,WAAAA,CAAYC,EAA0BC,GAClCC,kBAAkBF,oBAAoC,CAAEC,SAC5D,ECHJ,IAAIE,GAAuB,KAE3B,SAASC,KAOL,OANKD,KACDA,GAASE,KAETC,GAAeH,KAGZA,EACX,CCIM,SAAUI,GAGdC,GAMD,IAAAC,EACG,OA0B8DC,EA1B9DD,EAAO,cAAcE,GAIPC,SAAAA,GACN,OAAO,CACX,CAEUC,OAAAA,GACN,OAAOL,EAAQM,MAAQ,IAC3B,CAEUC,eAAAA,GACN,OAAOP,EAAQQ,YACnB,CAEUC,0BAAAA,GACN,OAAOT,EAAQU,UAAa,EAChC,CAEUC,uBAAAA,CAAwBC,GAC9B,OAAOZ,EAAQa,YAAYD,IAAUA,CACzC,GAI0D,UAxBjCZ,EAAQc,SAAwB,IAAEb,CAyBnE,CAEA,MAAqBE,WAIXY,EASNxB,WAAAA,GACIG,QAAQQ,EAAAc,KAAA,aAAA,GAAAd,EAAAc,KAAA,eAAA,GAAAd,EAAAc,KAAA,0BAAA,GAAAd,EAAAc,KAAA,cAAA,GAER,MAAMC,EAAUD,KAAKP,6BDrDb,IACZH,EACAN,ECqDIgB,KAAKE,MAAQF,KAAKX,sBAAwBC,KAC1CU,KAAKG,QAAU,IAAIC,EACnBJ,KAAKK,mBAAqB,IAAIC,IAAIC,OAAOC,KAAKP,IAC9CD,KAAKrB,OACDqB,KAAKZ,cD1DbE,EC2D2BU,KAAKE,MD1DhClB,EC0DuC,CAC3BY,MAAOA,IAAMI,KAAKT,kBAGlBU,QAASA,GD5DrBrB,KAEO6B,EAAYnB,EAAMN,EAAlByB,GC4DP,CAEA,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KAAMkU,GAAe1S,OAE7B,CAEM,SAAU6U,GAAYtW,GACxB,MAAO,CACHE,QAASF,EACTC,KAAMkU,GAAevT,OAE7B"}
1
+ {"version":3,"file":"aerogel-core.esm.js","sources":["../src/errors/ServiceBootError.ts","../src/services/store.ts","../src/services/Service.ts","../src/services/Events.ts","../src/services/App.state.ts","../src/services/App.ts","../src/plugins/index.ts","../src/utils/vue.ts","../src/directives/index.ts","../src/directives/initial-focus.ts","../src/directives/measure.ts","../src/services/index.ts","../src/ui/UI.state.ts","../src/ui/UI.ts","../src/lang/Lang.ts","../src/lang/utils.ts","../src/errors/Errors.state.ts","../src/components/constants.ts","../src/errors/Errors.ts","../src/errors/index.ts","../src/lang/index.ts","../src/utils/composition/events.ts","../src/utils/composition/forms.ts","../src/utils/composition/hooks.ts","../src/utils/tailwindcss.ts","../src/components/utils.ts","../src/components/headless/modals/AGHeadlessModal.ts","../src/components/headless/modals/AGHeadlessModal.vue","../src/components/modals/AGModalContext.vue","../src/components/headless/modals/AGHeadlessModalPanel.vue","../src/utils/markdown.ts","../src/components/lib/AGMarkdown.vue","../src/components/modals/AGModal.vue","../src/components/modals/AGAlertModal.ts","../src/components/modals/AGConfirmModal.ts","../src/components/headless/forms/AGHeadlessButton.vue","../src/components/forms/AGButton.vue","../src/components/modals/AGConfirmModal.vue","../src/components/modals/AGErrorReportModal.ts","../src/components/modals/AGErrorReportModalButtons.vue","../src/components/modals/AGErrorReportModalTitle.vue","../src/components/modals/AGErrorReportModal.vue","../src/components/modals/AGLoadingModal.ts","../src/components/modals/AGLoadingModal.vue","../src/components/modals/AGPromptModal.ts","../src/components/forms/AGForm.vue","../src/components/headless/forms/AGHeadlessInput.ts","../src/components/headless/forms/AGHeadlessInput.vue","../src/components/headless/forms/AGHeadlessInputError.vue","../src/components/headless/forms/AGHeadlessInputInput.vue","../src/components/headless/forms/AGHeadlessInputLabel.vue","../src/components/forms/AGInput.vue","../src/forms/Form.ts","../src/forms/composition.ts","../src/forms/utils.ts","../src/components/modals/AGPromptModal.vue","../src/components/headless/snackbars/index.ts","../src/components/snackbars/AGSnackbar.vue","../src/ui/index.ts","../src/bootstrap/index.ts","../src/components/AGAppModals.vue","../src/components/AGAppSnackbars.vue?vue&type=template&id=7942f27a&lang.js","../src/components/AGAppOverlays.vue","../src/components/forms/AGCheckbox.vue","../src/components/headless/forms/AGHeadlessSelect.ts","../src/components/headless/forms/AGHeadlessSelect.vue","../src/components/headless/forms/AGHeadlessSelectButton.vue","../src/components/headless/forms/AGHeadlessSelectError.vue","../src/components/headless/forms/AGHeadlessSelectLabel.vue","../src/components/headless/forms/AGHeadlessSelectOption.vue","../src/components/forms/AGSelect.vue","../src/components/lib/AGErrorMessage.vue","../src/components/lib/AGMeasured.vue"],"sourcesContent":["import { JSError } from '@noeldemartin/utils';\n\nexport default class ServiceBootError extends JSError {\n\n constructor(serviceNamespace: string, cause: unknown) {\n super(`Service '${serviceNamespace}' failed booting`, { cause });\n }\n\n}\n","import { createPinia, defineStore, setActivePinia } from 'pinia';\nimport type { DefineStoreOptions, Pinia, StateTree, Store, _GettersTree } from 'pinia';\n\nlet _store: Pinia | null = null;\n\nfunction initializePiniaStore(): Pinia {\n if (!_store) {\n _store = createPinia();\n\n setActivePinia(_store);\n }\n\n return _store;\n}\n\nexport function getPiniaStore(): Pinia {\n return _store ?? initializePiniaStore();\n}\n\nexport function defineServiceStore<Id extends string, S extends StateTree = {}, G extends _GettersTree<S> = {}, A = {}>(\n name: Id,\n options: Omit<DefineStoreOptions<Id, S, G, A>, 'id'>,\n): Store<Id, S, G, A> {\n initializePiniaStore();\n\n return defineStore(name, options)();\n}\n","import { MagicObject, PromisedValue, Storage, isEmpty, objectDeepClone, objectOnly } from '@noeldemartin/utils';\nimport type { Constructor } from '@noeldemartin/utils';\nimport type { MaybeRef } from 'vue';\nimport type { Store } from 'pinia';\n\nimport ServiceBootError from '@/errors/ServiceBootError';\nimport { defineServiceStore } from '@/services/store';\n\nexport type ServiceState = Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any\nexport type DefaultServiceState = any; // eslint-disable-line @typescript-eslint/no-explicit-any\nexport type ServiceConstructor<T extends Service = Service> = Constructor<T> & typeof Service;\nexport type UnrefServiceState<State extends ServiceState> = {\n [K in keyof State]: State[K] extends MaybeRef<infer T> ? T : State[K];\n};\n\nexport type ComputedStateDefinition<TState extends ServiceState, TComputedState extends ServiceState> = {\n [K in keyof TComputedState]: (state: TState) => TComputedState[K];\n} & ThisType<{\n readonly [K in keyof TComputedState]: TComputedState[K];\n}>;\n\nexport function defineServiceState<\n State extends ServiceState = ServiceState,\n ComputedState extends ServiceState = {}\n>(options: {\n name: string;\n initialState: State;\n persist?: (keyof State)[];\n computed?: ComputedStateDefinition<State, ComputedState>;\n serialize?: (state: Partial<State>) => Partial<State>;\n}): Constructor<UnrefServiceState<State>> &\n Constructor<ComputedState> &\n Constructor<Service<UnrefServiceState<State>, ComputedState, Partial<UnrefServiceState<State>>>> {\n return class extends Service<UnrefServiceState<State>, ComputedState> {\n\n public static persist = (options.persist as string[]) ?? [];\n\n protected usesStore(): boolean {\n return true;\n }\n\n protected getName(): string | null {\n return options.name ?? null;\n }\n\n protected getInitialState(): UnrefServiceState<State> {\n return options.initialState;\n }\n\n protected getComputedStateDefinition(): ComputedStateDefinition<UnrefServiceState<State>, ComputedState> {\n return (options.computed ?? {}) as ComputedStateDefinition<UnrefServiceState<State>, ComputedState>;\n }\n\n protected serializePersistedState(state: Partial<State>): Partial<State> {\n return options.serialize?.(state) ?? state;\n }\n \n } as unknown as Constructor<UnrefServiceState<State>> &\n Constructor<ComputedState> &\n Constructor<Service<UnrefServiceState<State>, ComputedState, Partial<UnrefServiceState<State>>>>;\n}\n\nexport default class Service<\n State extends ServiceState = DefaultServiceState,\n ComputedState extends ServiceState = {},\n ServiceStorage extends Partial<State> = Partial<State>\n> extends MagicObject {\n\n public static persist: string[] = [];\n\n protected _name: string;\n private _booted: PromisedValue<void>;\n private _computedStateKeys: Set<keyof State>;\n private _store?: Store | false;\n\n constructor() {\n super();\n\n const getters = this.getComputedStateDefinition();\n\n this._name = this.getName() ?? new.target.name;\n this._booted = new PromisedValue();\n this._computedStateKeys = new Set(Object.keys(getters));\n this._store =\n this.usesStore() &&\n defineServiceStore(this._name, {\n state: () => this.getInitialState(),\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getters: getters as any,\n });\n }\n\n public get booted(): PromisedValue<void> {\n return this._booted;\n }\n\n public launch(): Promise<void> {\n const handleError = (error: unknown) => this._booted.reject(new ServiceBootError(this._name, error));\n\n try {\n this.frameworkBoot()\n .then(() => this.boot())\n .then(() => this._booted.resolve())\n .catch(handleError);\n } catch (error) {\n handleError(error);\n }\n\n return this._booted;\n }\n\n public hasState<P extends keyof State>(property: P): boolean {\n if (!this._store) {\n return false;\n }\n\n return property in this._store.$state || this._computedStateKeys.has(property);\n }\n\n public getState(): State;\n public getState<P extends keyof State>(property: P): State[P];\n public getState<P extends keyof State>(property?: P): State | State[P] {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const store = this._store as any;\n\n if (property) {\n return store ? store[property] : undefined;\n }\n\n return store ? store : {};\n }\n\n public setState<P extends keyof State>(property: P, value: State[P]): void;\n public setState(state: Partial<State>): void;\n public setState<P extends keyof State>(stateOrProperty: P | Partial<State>, value?: State[P]): void {\n if (!this._store) {\n return;\n }\n\n const state = (\n typeof stateOrProperty === 'string' ? { [stateOrProperty]: value } : stateOrProperty\n ) as Partial<State>;\n\n Object.assign(this._store.$state, state);\n\n this.onStateUpdated(state);\n }\n\n protected __get(property: string): unknown {\n if (this.hasState(property)) {\n return this.getState(property);\n }\n\n return super.__get(property);\n }\n\n protected __set(property: string, value: unknown): void {\n this.setState({ [property]: value } as Partial<State>);\n }\n\n protected onStateUpdated(state: Partial<State>): void {\n // TODO fix this.static()\n const persist = (this.constructor as unknown as { persist: string[] }).persist;\n const persisted = objectOnly(state, persist);\n\n if (isEmpty(persisted)) {\n return;\n }\n\n const storage = Storage.get<ServiceStorage>(this._name);\n\n if (!storage) {\n return;\n }\n\n Storage.set(this._name, {\n ...storage,\n ...this.serializePersistedState(objectDeepClone(persisted) as Partial<State>),\n });\n }\n\n protected usesStore(): boolean {\n return false;\n }\n\n protected getName(): string | null {\n return null;\n }\n\n protected getInitialState(): State {\n return {} as State;\n }\n\n protected getComputedStateDefinition(): ComputedStateDefinition<State, ComputedState> {\n return {} as ComputedStateDefinition<State, ComputedState>;\n }\n\n protected serializePersistedState(state: Partial<State>): Partial<State> {\n return state;\n }\n\n protected async frameworkBoot(): Promise<void> {\n this.initializePersistedState();\n }\n\n protected async boot(): Promise<void> {\n // Placeholder for overrides, don't place any functionality here.\n }\n\n protected initializePersistedState(): void {\n // TODO fix this.static()\n const persist = (this.constructor as unknown as { persist: string[] }).persist;\n\n if (!this.usesStore() || isEmpty(persist)) {\n return;\n }\n\n if (Storage.has(this._name)) {\n const persisted = Storage.require<ServiceStorage>(this._name);\n this.setState(persisted);\n\n return;\n }\n\n Storage.set(this._name, objectOnly(this.getState(), persist));\n }\n\n}\n","import { arr, facade, tap } from '@noeldemartin/utils';\nimport type { FluentArray } from '@noeldemartin/utils';\n\nimport Service from '@/services/Service';\n\nexport interface EventsPayload {}\n\nexport type EventListener<T = unknown> = (payload: T) => unknown;\nexport type UnknownEvent<T> = T extends keyof EventsPayload ? never : T;\n\nexport type EventWithoutPayload = {\n [K in keyof EventsPayload]: EventsPayload[K] extends void ? K : never;\n}[keyof EventsPayload];\n\nexport type EventWithPayload = {\n [K in keyof EventsPayload]: EventsPayload[K] extends void ? never : K;\n}[keyof EventsPayload];\n\nexport class EventsService extends Service {\n\n private listeners: Record<string, FluentArray<EventListener>> = {};\n\n public emit<Event extends EventWithoutPayload>(event: Event): Promise<void>;\n public emit<Event extends EventWithPayload>(event: Event, payload: EventsPayload[Event]): Promise<void>;\n public emit<Event extends string>(event: UnknownEvent<Event>, payload?: unknown): Promise<void>;\n public async emit(event: string, payload?: unknown): Promise<void> {\n const listeners = [...(this.listeners[event] ?? [])];\n\n await Promise.all(listeners.map((listener) => listener(payload)) ?? []);\n }\n\n public on<Event extends EventWithoutPayload>(event: Event, listener: () => unknown): () => void;\n public on<Event extends EventWithPayload>(\n event: Event,\n listener: EventListener<EventsPayload[Event]>\n ): () => void | void;\n\n public on<Event extends string>(event: UnknownEvent<Event>, listener: EventListener): () => void;\n public on(event: string, listener: EventListener): () => void {\n (this.listeners[event] ??= arr<EventListener>([])).push(listener);\n\n return () => this.off(event, listener);\n }\n\n public once<Event extends EventWithoutPayload>(event: Event, listener: () => unknown): () => void;\n public once<Event extends EventWithPayload>(\n event: Event,\n listener: EventListener<EventsPayload[Event]>\n ): () => void | void;\n\n public once<Event extends string>(event: UnknownEvent<Event>, listener: EventListener): () => void;\n public once(event: string, listener: EventListener): () => void {\n let onceListener: EventListener | null = null;\n\n return tap(\n () => onceListener && this.off(event, onceListener),\n (off) => {\n (this.listeners[event] ??= arr<EventListener>([])).push(\n (onceListener = (...args) => {\n off();\n\n return listener(...args);\n }),\n );\n },\n );\n }\n\n public off(event: string, listener: EventListener): void {\n const eventListeners = this.listeners[event];\n\n if (!eventListeners) {\n return;\n }\n\n eventListeners.remove(listener);\n\n if (eventListeners.isEmpty()) {\n delete this.listeners[event];\n }\n }\n\n}\n\nexport default facade(new EventsService());\n","import Aerogel from 'virtual:aerogel';\n\nimport { defineServiceState } from '@/services/Service';\nimport type { Plugin } from '@/plugins/Plugin';\n\nexport default defineServiceState({\n name: 'app',\n initialState: {\n plugins: {} as Record<string, Plugin>,\n environment: Aerogel.environment,\n sourceUrl: Aerogel.sourceUrl,\n },\n computed: {\n development: (state) => state.environment === 'development',\n testing: (state) => state.environment === 'testing',\n },\n});\n","import { PromisedValue, facade, forever, updateLocationQueryParameters } from '@noeldemartin/utils';\n\nimport Events from '@/services/Events';\nimport type { Plugin } from '@/plugins';\n\nimport Service from './App.state';\n\nexport class AppService extends Service {\n\n public readonly ready = new PromisedValue<void>();\n public readonly mounted = new PromisedValue<void>();\n\n public isReady(): boolean {\n return this.ready.isResolved();\n }\n\n public isMounted(): boolean {\n return this.mounted.isResolved();\n }\n\n public async reload(queryParameters?: Record<string, string | undefined>): Promise<void> {\n queryParameters && updateLocationQueryParameters(queryParameters);\n\n location.reload();\n\n // Stall until the reload happens\n await forever();\n }\n\n public plugin<T extends Plugin = Plugin>(name: string): T | null {\n return (this.plugins[name] as T) ?? null;\n }\n\n protected async boot(): Promise<void> {\n Events.once('application-ready', () => this.ready.resolve());\n Events.once('application-mounted', () => this.mounted.resolve());\n }\n\n}\n\nexport default facade(new AppService());\n","import type { GetClosureArgs } from '@noeldemartin/utils';\n\nimport App from '@/services/App';\n\nimport type { Plugin } from './Plugin';\n\nexport * from './Plugin';\n\nexport function definePlugin<T extends Plugin>(plugin: T): T {\n return plugin;\n}\n\nexport async function installPlugins(plugins: Plugin[], ...args: GetClosureArgs<Plugin['install']>): Promise<void> {\n App.setState(\n 'plugins',\n plugins.reduce((pluginsMap, plugin) => {\n if (plugin.name) {\n pluginsMap[plugin.name] = plugin;\n }\n\n return pluginsMap;\n }, {} as Record<string, Plugin>),\n );\n\n await Promise.all(plugins.map((plugin) => plugin.install(...args)) ?? []);\n}\n","import { fail } from '@noeldemartin/utils';\nimport { computed, inject, reactive, ref, watch } from 'vue';\nimport type { Directive, InjectionKey, PropType, Ref, UnwrapNestedRefs } from 'vue';\n\ntype BaseProp<T> = {\n type?: PropType<T>;\n validator?(value: unknown): boolean;\n};\n\ntype RequiredProp<T> = BaseProp<T> & { required: true };\ntype OptionalProp<T> = BaseProp<T> & { default: T | (() => T) | null };\n\nexport type ComponentProps = Record<string, unknown>;\n\nexport function arrayProp<T>(defaultValue?: () => T[]): OptionalProp<T[]> {\n return {\n type: Array as PropType<T[]>,\n default: defaultValue ?? (() => []),\n };\n}\n\nexport function booleanProp(defaultValue: boolean = false): OptionalProp<boolean> {\n return {\n type: Boolean,\n default: defaultValue,\n };\n}\n\nexport function componentRef<T>(): Ref<UnwrapNestedRefs<T> | undefined> {\n return ref<UnwrapNestedRefs<T>>();\n}\n\nexport function computedAsync<T>(getter: () => Promise<T>): Ref<T | undefined> {\n const result = ref<T>();\n const asyncValue = computed(getter);\n\n watch(asyncValue, async () => (result.value = await asyncValue.value), { immediate: true });\n\n return result;\n}\n\nexport function defineDirective(directive: Directive): Directive {\n return directive;\n}\n\nexport function enumProp<Enum extends Record<string, unknown>>(\n enumeration: Enum,\n defaultValue?: Enum[keyof Enum],\n): OptionalProp<Enum[keyof Enum]> {\n const values = Object.values(enumeration) as Enum[keyof Enum][];\n\n return {\n type: String as unknown as PropType<Enum[keyof Enum]>,\n default: defaultValue ?? values[0] ?? null,\n validator: (value) => values.includes(value as Enum[keyof Enum]),\n };\n}\n\nexport function injectReactive<T extends object>(key: InjectionKey<T> | string): UnwrapNestedRefs<T> | undefined {\n const value = inject(key);\n\n return value ? reactive<T>(value) : undefined;\n}\n\nexport function injectReactiveOrFail<T extends object>(\n key: InjectionKey<T> | string,\n errorMessage?: string,\n): UnwrapNestedRefs<T> {\n return injectReactive(key) ?? fail(errorMessage ?? `Could not resolve '${key}' injection key`);\n}\n\nexport function injectOrFail<T>(key: InjectionKey<T> | string, errorMessage?: string): T {\n return inject(key) ?? fail(errorMessage ?? `Could not resolve '${key}' injection key`);\n}\n\nexport function mixedProp<T>(type?: PropType<T>): OptionalProp<T | null> {\n return {\n type,\n default: null,\n };\n}\n\nexport function numberProp(): OptionalProp<number | null>;\nexport function numberProp(defaultValue: number): OptionalProp<number>;\nexport function numberProp(defaultValue: number | null = null): OptionalProp<number | null> {\n return {\n type: Number,\n default: defaultValue,\n };\n}\n\nexport function objectProp<T = Object>(): OptionalProp<T | null>;\nexport function objectProp<T>(defaultValue: () => T): OptionalProp<T>;\nexport function objectProp<T = Object>(defaultValue: (() => T) | null = null): OptionalProp<T | null> {\n return {\n type: Object,\n default: defaultValue,\n };\n}\n\nexport function requiredArrayProp<T>(): RequiredProp<T[]> {\n return {\n type: Array as PropType<T[]>,\n required: true,\n };\n}\n\nexport function requiredEnumProp<Enum extends Record<string, unknown>>(\n enumeration: Enum,\n): RequiredProp<Enum[keyof Enum]> {\n const values = Object.values(enumeration);\n\n return {\n type: String as unknown as PropType<Enum[keyof Enum]>,\n required: true,\n validator: (value) => values.includes(value),\n };\n}\n\nexport function requiredMixedProp<T>(type?: PropType<T>): RequiredProp<T> {\n return {\n type,\n required: true,\n };\n}\n\nexport function requiredNumberProp(): RequiredProp<number> {\n return {\n type: Number,\n required: true,\n };\n}\n\nexport function requiredObjectProp<T = Object>(): RequiredProp<T> {\n return {\n type: Object,\n required: true,\n };\n}\n\nexport function requiredStringProp(): RequiredProp<string> {\n return {\n type: String,\n required: true,\n };\n}\n\nexport function stringProp(): OptionalProp<string | null>;\nexport function stringProp(defaultValue: string): OptionalProp<string>;\nexport function stringProp(defaultValue: string | null = null): OptionalProp<string | null> {\n return {\n type: String,\n default: defaultValue,\n };\n}\n","import type { Directive } from 'vue';\n\nimport { definePlugin } from '@/plugins';\n\nimport initialFocus from './initial-focus';\nimport measure from './measure';\n\nconst builtInDirectives: Record<string, Directive> = {\n 'initial-focus': initialFocus,\n 'measure': measure,\n};\n\nexport default definePlugin({\n install(app, options) {\n const directives = {\n ...builtInDirectives,\n ...options.directives,\n };\n\n for (const [name, directive] of Object.entries(directives)) {\n app.directive(name, directive);\n }\n },\n});\n\ndeclare module '@/bootstrap/options' {\n export interface AerogelOptions {\n directives?: Record<string, Directive>;\n }\n}\n","import { defineDirective } from '@/utils/vue';\n\nexport default defineDirective({\n mounted(element: HTMLElement, { value }) {\n if (value === false) {\n return;\n }\n\n element.focus();\n },\n});\n","import { defineDirective } from '@/utils/vue';\n\nexport default defineDirective({\n mounted(element: HTMLElement, { value }: { value?: () => unknown }) {\n const sizes = element.getBoundingClientRect();\n\n element.style.setProperty('--width', `${sizes.width}px`);\n element.style.setProperty('--height', `${sizes.height}px`);\n\n value?.();\n },\n});\n","import type { App as VueApp } from 'vue';\n\nimport { definePlugin } from '@/plugins';\n\nimport App from './App';\nimport Events from './Events';\nimport Service from './Service';\nimport { getPiniaStore } from './store';\n\nexport * from './App';\nexport * from './Events';\nexport * from './Service';\n\nexport { App, Events, Service };\n\nconst defaultServices = {\n $app: App,\n $events: Events,\n};\n\nexport type DefaultServices = typeof defaultServices;\n\nexport interface Services extends DefaultServices {}\n\nexport async function bootServices(app: VueApp, services: Record<string, Service>): Promise<void> {\n await Promise.all(\n Object.entries(services).map(async ([name, service]) => {\n await service\n .launch()\n .catch((error) => app.config.errorHandler?.(error, null, `Failed launching ${name}.`));\n }),\n );\n\n Object.assign(app.config.globalProperties, services);\n\n App.development && Object.assign(window, services);\n}\n\nexport default definePlugin({\n async install(app, options) {\n const services = {\n ...defaultServices,\n ...options.services,\n };\n\n app.use(getPiniaStore());\n\n await bootServices(app, services);\n },\n});\n\ndeclare module '@/bootstrap/options' {\n export interface AerogelOptions {\n services?: Record<string, Service>;\n }\n}\n\ndeclare module '@vue/runtime-core' {\n interface ComponentCustomProperties extends Services {}\n}\n","import type { Component } from 'vue';\n\nimport { defineServiceState } from '@/services/Service';\n\nexport interface Modal<T = unknown> {\n id: string;\n properties: Record<string, unknown>;\n component: Component;\n beforeClose: Promise<T | undefined>;\n afterClose: Promise<T | undefined>;\n}\n\nexport interface ModalComponent<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Properties extends Record<string, unknown> = Record<string, unknown>,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n Result = unknown\n> {}\n\nexport interface Snackbar {\n id: string;\n component: Component;\n properties: Record<string, unknown>;\n}\n\nexport default defineServiceState({\n name: 'ui',\n initialState: {\n modals: [] as Modal[],\n snackbars: [] as Snackbar[],\n },\n});\n","import { after, facade, fail, uuid } from '@noeldemartin/utils';\nimport { markRaw, nextTick } from 'vue';\nimport type { Component } from 'vue';\nimport type { ObjectValues } from '@noeldemartin/utils';\n\nimport Events from '@/services/Events';\nimport type { SnackbarAction, SnackbarColor } from '@/components/headless/snackbars';\nimport type { AGAlertModalProps, AGConfirmModalProps, AGLoadingModalProps, AGPromptModalProps } from '@/components';\n\nimport Service from './UI.state';\nimport type { Modal, ModalComponent, Snackbar } from './UI.state';\n\ninterface ModalCallbacks<T = unknown> {\n willClose(result: T | undefined): void;\n closed(result: T | undefined): void;\n}\n\ntype ModalProperties<TComponent> = TComponent extends ModalComponent<infer TProperties, unknown> ? TProperties : never;\ntype ModalResult<TComponent> = TComponent extends ModalComponent<Record<string, unknown>, infer TResult>\n ? TResult\n : never;\n\nexport const UIComponents = {\n AlertModal: 'alert-modal',\n ConfirmModal: 'confirm-modal',\n ErrorReportModal: 'error-report-modal',\n LoadingModal: 'loading-modal',\n PromptModal: 'prompt-modal',\n Snackbar: 'snackbar',\n StartupCrash: 'startup-crash',\n} as const;\n\nexport type UIComponent = ObjectValues<typeof UIComponents>;\n\nexport interface ConfirmOptions {\n acceptText?: string;\n cancelText?: string;\n}\n\nexport interface PromptOptions {\n label?: string;\n defaultValue?: string;\n placeholder?: string;\n acceptText?: string;\n cancelText?: string;\n}\n\nexport interface ShowSnackbarOptions {\n component?: Component;\n color?: SnackbarColor;\n actions?: SnackbarAction[];\n}\n\nexport class UIService extends Service {\n\n private modalCallbacks: Record<string, Partial<ModalCallbacks>> = {};\n private components: Partial<Record<UIComponent, Component>> = {};\n\n public requireComponent(name: UIComponent): Component {\n return this.components[name] ?? fail(`UI Component '${name}' is not defined!`);\n }\n\n public alert(message: string): void;\n public alert(title: string, message: string): void;\n public alert(messageOrTitle: string, message?: string): void {\n const getProperties = (): AGAlertModalProps => {\n if (typeof message !== 'string') {\n return { message: messageOrTitle };\n }\n\n return {\n title: messageOrTitle,\n message,\n };\n };\n\n this.openModal(this.requireComponent(UIComponents.AlertModal), getProperties());\n }\n\n public async confirm(message: string, options?: ConfirmOptions): Promise<boolean>;\n public async confirm(title: string, message: string, options?: ConfirmOptions): Promise<boolean>;\n public async confirm(\n messageOrTitle: string,\n messageOrOptions?: string | ConfirmOptions,\n options?: ConfirmOptions,\n ): Promise<boolean> {\n const getProperties = (): AGConfirmModalProps => {\n if (typeof messageOrOptions !== 'string') {\n return {\n message: messageOrTitle,\n ...(messageOrOptions ?? {}),\n };\n }\n\n return {\n title: messageOrTitle,\n message: messageOrOptions,\n ...(options ?? {}),\n };\n };\n\n const modal = await this.openModal<ModalComponent<AGConfirmModalProps, boolean>>(\n this.requireComponent(UIComponents.ConfirmModal),\n getProperties(),\n );\n const result = await modal.beforeClose;\n\n return result ?? false;\n }\n\n public async prompt(message: string, options?: PromptOptions): Promise<string | null>;\n public async prompt(title: string, message: string, options?: PromptOptions): Promise<string | null>;\n public async prompt(\n messageOrTitle: string,\n messageOrOptions?: string | PromptOptions,\n options?: PromptOptions,\n ): Promise<string | null> {\n const getProperties = (): AGPromptModalProps => {\n if (typeof messageOrOptions !== 'string') {\n return {\n message: messageOrTitle,\n ...(messageOrOptions ?? {}),\n };\n }\n\n return {\n title: messageOrTitle,\n message: messageOrOptions,\n ...(options ?? {}),\n };\n };\n\n const modal = await this.openModal<ModalComponent<AGPromptModalProps, string | null>>(\n this.requireComponent(UIComponents.PromptModal),\n getProperties(),\n );\n const result = await modal.beforeClose;\n\n return result ?? null;\n }\n\n public async loading<T>(operation: Promise<T>): Promise<T>;\n public async loading<T>(message: string, operation: Promise<T>): Promise<T>;\n public async loading<T>(messageOrOperation: string | Promise<T>, operation?: Promise<T>): Promise<T> {\n const getProperties = (): AGLoadingModalProps => {\n if (typeof messageOrOperation !== 'string') {\n return {};\n }\n\n return { message: messageOrOperation };\n };\n\n const modal = await this.openModal(this.requireComponent(UIComponents.LoadingModal), getProperties());\n\n try {\n operation = typeof messageOrOperation === 'string' ? (operation as Promise<T>) : messageOrOperation;\n\n const [result] = await Promise.all([operation, after({ seconds: 1 })]);\n\n return result;\n } finally {\n await this.closeModal(modal.id);\n }\n }\n\n public showSnackbar(message: string, options: ShowSnackbarOptions = {}): void {\n const snackbar: Snackbar = {\n id: uuid(),\n properties: { message, ...options },\n component: options.component ?? markRaw(this.requireComponent(UIComponents.Snackbar)),\n };\n\n this.setState('snackbars', this.snackbars.concat(snackbar));\n\n setTimeout(() => this.hideSnackbar(snackbar.id), 5000);\n }\n\n public hideSnackbar(id: string): void {\n this.setState(\n 'snackbars',\n this.snackbars.filter((snackbar) => snackbar.id !== id),\n );\n }\n\n public registerComponent(name: UIComponent, component: Component): void {\n this.components[name] = component;\n }\n\n public async openModal<TModalComponent extends ModalComponent>(\n component: TModalComponent,\n properties?: ModalProperties<TModalComponent>,\n ): Promise<Modal<ModalResult<TModalComponent>>> {\n const id = uuid();\n const callbacks: Partial<ModalCallbacks<ModalResult<TModalComponent>>> = {};\n const modal: Modal<ModalResult<TModalComponent>> = {\n id,\n properties: properties ?? {},\n component: markRaw(component),\n beforeClose: new Promise((resolve) => (callbacks.willClose = resolve)),\n afterClose: new Promise((resolve) => (callbacks.closed = resolve)),\n };\n const activeModal = this.modals.at(-1);\n const modals = this.modals.concat(modal);\n\n this.modalCallbacks[modal.id] = callbacks;\n\n this.setState({ modals });\n\n await nextTick();\n await (activeModal && Events.emit('hide-modal', { id: activeModal.id }));\n await Promise.all([\n activeModal || Events.emit('show-overlays-backdrop'),\n Events.emit('show-modal', { id: modal.id }),\n ]);\n\n return modal;\n }\n\n public async closeModal(id: string, result?: unknown): Promise<void> {\n await Events.emit('close-modal', { id, result });\n }\n\n protected async boot(): Promise<void> {\n this.watchModalEvents();\n this.watchMountedEvent();\n }\n\n private watchModalEvents(): void {\n Events.on('modal-will-close', ({ modal, result }) => {\n this.modalCallbacks[modal.id]?.willClose?.(result);\n\n if (this.modals.length === 1) {\n Events.emit('hide-overlays-backdrop');\n }\n });\n\n Events.on('modal-closed', async ({ modal, result }) => {\n this.setState(\n 'modals',\n this.modals.filter((m) => m.id !== modal.id),\n );\n\n this.modalCallbacks[modal.id]?.closed?.(result);\n\n delete this.modalCallbacks[modal.id];\n\n const activeModal = this.modals.at(-1);\n\n await (activeModal && Events.emit('show-modal', { id: activeModal.id }));\n });\n }\n\n private watchMountedEvent(): void {\n Events.once('application-mounted', async () => {\n const splash = document.getElementById('splash');\n\n if (!splash) {\n return;\n }\n\n if (window.getComputedStyle(splash).opacity !== '0') {\n splash.style.opacity = '0';\n\n await after({ ms: 600 });\n }\n\n splash.remove();\n });\n }\n\n}\n\nexport default facade(new UIService());\n\ndeclare module '@/services/Events' {\n export interface EventsPayload {\n 'modal-will-close': { modal: Modal; result?: unknown };\n 'modal-closed': { modal: Modal; result?: unknown };\n 'close-modal': { id: string; result?: unknown };\n 'hide-modal': { id: string };\n 'show-modal': { id: string };\n }\n}\n","import { facade, toString } from '@noeldemartin/utils';\n\nimport App from '@/services/App';\nimport Service from '@/services/Service';\n\nexport interface LangProvider {\n translate(key: string, parameters?: Record<string, unknown>): string;\n}\n\nexport class LangService extends Service {\n\n private provider: LangProvider;\n\n constructor() {\n super();\n\n this.provider = {\n translate: (key) => {\n // eslint-disable-next-line no-console\n App.development && console.warn('Lang provider is missing');\n\n return key;\n },\n };\n }\n\n public setProvider(provider: LangProvider): void {\n this.provider = provider;\n }\n\n public translate(key: string, parameters?: Record<string, unknown>): string {\n return this.provider.translate(key, parameters) ?? key;\n }\n\n public translateWithDefault(key: string, defaultMessage: string): string;\n public translateWithDefault(key: string, parameters: Record<string, unknown>, defaultMessage: string): string;\n public translateWithDefault(\n key: string,\n defaultMessageOrParameters?: string | Record<string, unknown>,\n defaultMessage?: string,\n ): string {\n defaultMessage ??= defaultMessageOrParameters as string;\n\n const parameters = typeof defaultMessageOrParameters === 'string' ? {} : defaultMessageOrParameters ?? {};\n const message = this.provider.translate(key, parameters) ?? key;\n\n if (message === key) {\n return Object.entries(parameters).reduce(\n (renderedMessage, [name, value]) =>\n renderedMessage.replace(new RegExp(`\\\\{\\\\s*${name}\\\\s*\\\\}`, 'g'), toString(value)),\n defaultMessage,\n );\n }\n\n return message;\n }\n\n}\n\nexport default facade(new LangService());\n","import Lang from './Lang';\n\nexport const translate = Lang.translate.bind(Lang);\nexport const translateWithDefault = Lang.translateWithDefault.bind(Lang);\n","import type { JSError } from '@noeldemartin/utils';\n\nimport { defineServiceState } from '@/services';\n\nexport type ErrorSource = string | Error | JSError | unknown;\n\nexport interface ErrorReport {\n title: string;\n description?: string;\n details?: string;\n error?: Error | JSError | unknown;\n}\n\nexport interface ErrorReportLog {\n report: ErrorReport;\n seen: boolean;\n date: Date;\n}\n\nexport default defineServiceState({\n name: 'errors',\n initialState: {\n logs: [] as ErrorReportLog[],\n startupErrors: [] as ErrorReport[],\n },\n computed: {\n hasErrors: ({ logs }) => logs.length > 0,\n hasNewErrors: ({ logs }) => logs.some((error) => !error.seen),\n hasStartupErrors: ({ startupErrors }) => startupErrors.length > 0,\n },\n});\n","export const Colors = {\n Primary: 'primary',\n Secondary: 'secondary',\n Danger: 'danger',\n Clear: 'clear',\n} as const;\n\nexport type Color = (typeof Colors)[keyof typeof Colors];\n","import { JSError, facade, isObject, objectWithoutEmpty, toString } from '@noeldemartin/utils';\n\nimport App from '@/services/App';\nimport ServiceBootError from '@/errors/ServiceBootError';\nimport UI, { UIComponents } from '@/ui/UI';\nimport { translateWithDefault } from '@/lang/utils';\n\nimport Service from './Errors.state';\nimport { Colors } from '@/components/constants';\nimport type { AGErrorReportModalProps } from '@/components/modals/AGErrorReportModal';\nimport type { ErrorReport, ErrorReportLog, ErrorSource } from './Errors.state';\nimport type { ModalComponent } from '@/ui/UI.state';\n\nexport class ErrorsService extends Service {\n\n public forceReporting: boolean = false;\n private enabled: boolean = true;\n\n public enable(): void {\n this.enabled = true;\n }\n\n public disable(): void {\n this.enabled = false;\n }\n\n public async inspect(error: ErrorSource | ErrorReport[]): Promise<void> {\n const reports = Array.isArray(error) ? (error as ErrorReport[]) : [await this.createErrorReport(error)];\n\n if (reports.length === 0) {\n UI.alert(translateWithDefault('errors.inspectEmpty', 'Nothing to inspect!'));\n\n return;\n }\n\n UI.openModal<ModalComponent<AGErrorReportModalProps>>(UI.requireComponent(UIComponents.ErrorReportModal), {\n reports,\n });\n }\n\n public async report(error: ErrorSource, message?: string): Promise<void> {\n if (App.development || App.testing) {\n this.logError(error);\n }\n\n if (!this.enabled) {\n throw error;\n }\n\n if (!App.isMounted()) {\n const startupError = await this.createStartupErrorReport(error);\n\n if (startupError) {\n this.setState({ startupErrors: this.startupErrors.concat(startupError) });\n }\n\n return;\n }\n\n const report = await this.createErrorReport(error);\n const log: ErrorReportLog = {\n report,\n seen: false,\n date: new Date(),\n };\n\n UI.showSnackbar(\n message ??\n translateWithDefault('errors.notice', 'Something went wrong, but it\\'s not your fault. Try again!'),\n {\n color: Colors.Danger,\n actions: [\n {\n text: translateWithDefault('errors.viewDetails', 'View details'),\n dismiss: true,\n handler: () =>\n UI.openModal<ModalComponent<AGErrorReportModalProps>>(\n UI.requireComponent(UIComponents.ErrorReportModal),\n { reports: [report] },\n ),\n },\n ],\n },\n );\n\n this.setState({ logs: [log].concat(this.logs) });\n }\n\n public see(report: ErrorReport): void {\n this.setState({\n logs: this.logs.map((log) => {\n if (log.report !== report) {\n return log;\n }\n\n return {\n ...log,\n seen: true,\n };\n }),\n });\n }\n\n public seeAll(): void {\n this.setState({\n logs: this.logs.map((log) => ({\n ...log,\n seen: true,\n })),\n });\n }\n\n public getErrorMessage(error: ErrorSource): string {\n if (typeof error === 'string') {\n return error;\n }\n\n if (error instanceof Error || error instanceof JSError) {\n return error.message;\n }\n\n if (isObject(error)) {\n return toString(error['message'] ?? error['description'] ?? 'Unknown error object');\n }\n\n return translateWithDefault('errors.unknown', 'Unknown Error');\n }\n\n private logError(error: unknown): void {\n // eslint-disable-next-line no-console\n console.error(error);\n\n if (isObject(error) && error.cause) {\n this.logError(error.cause);\n }\n }\n\n private async createErrorReport(error: ErrorSource): Promise<ErrorReport> {\n if (typeof error === 'string') {\n return { title: error };\n }\n\n if (error instanceof Error || error instanceof JSError) {\n return this.createErrorReportFromError(error);\n }\n\n if (isObject(error)) {\n return objectWithoutEmpty({\n title: toString(\n error['name'] ?? error['title'] ?? translateWithDefault('errors.unknown', 'Unknown Error'),\n ),\n description: toString(\n error['message'] ??\n error['description'] ??\n translateWithDefault('errors.unknownDescription', 'Unknown error object'),\n ),\n error,\n });\n }\n\n return {\n title: translateWithDefault('errors.unknown', 'Unknown Error'),\n error,\n };\n }\n\n private async createStartupErrorReport(error: ErrorSource): Promise<ErrorReport | null> {\n if (error instanceof ServiceBootError) {\n // Ignore second-order boot errors in order to have a cleaner startup crash screen.\n return error.cause instanceof ServiceBootError ? null : this.createErrorReport(error.cause);\n }\n\n return this.createErrorReport(error);\n }\n\n private createErrorReportFromError(error: Error | JSError, defaults: Partial<ErrorReport> = {}): ErrorReport {\n return {\n title: error.name,\n description: error.message,\n details: error.stack,\n error,\n ...defaults,\n };\n }\n\n}\n\nexport default facade(new ErrorsService());\n","import type { App } from 'vue';\n\nimport { bootServices } from '@/services';\nimport { definePlugin } from '@/plugins';\n\nimport Errors from './Errors';\nimport { ErrorReport, ErrorReportLog, ErrorSource } from './Errors.state';\n\nexport { Errors, ErrorSource, ErrorReport, ErrorReportLog };\n\nconst services = { $errors: Errors };\nconst frameworkHandler: ErrorHandler = (error) => {\n if (!Errors.instance) {\n // eslint-disable-next-line no-console\n console.warn('Errors service hasn\\'t been initialized properly!');\n\n // eslint-disable-next-line no-console\n console.error(error);\n\n return true;\n }\n\n Errors.report(error);\n\n return true;\n};\n\nfunction setUpErrorHandler(app: App, baseHandler: ErrorHandler = () => false): void {\n const errorHandler: ErrorHandler = (error) => baseHandler(error) || frameworkHandler(error);\n\n app.config.errorHandler = errorHandler;\n globalThis.onerror = (event, _, __, ___, error) => errorHandler(error ?? event);\n globalThis.onunhandledrejection = (event) => errorHandler(event.reason);\n}\n\nexport type ErrorHandler = (error: ErrorSource) => boolean;\nexport type ErrorsServices = typeof services;\n\nexport default definePlugin({\n async install(app, options) {\n setUpErrorHandler(app, options.handleError);\n\n await bootServices(app, services);\n },\n});\n\ndeclare module '@/bootstrap/options' {\n export interface AerogelOptions {\n handleError?(error: ErrorSource): boolean;\n }\n}\n\ndeclare module '@/services' {\n export interface Services extends ErrorsServices {}\n}\n","import { bootServices } from '@/services';\nimport { definePlugin } from '@/plugins';\n\nimport Lang, { LangProvider } from './Lang';\nimport { translate, translateWithDefault } from './utils';\n\nexport { Lang, LangProvider, translate, translateWithDefault };\n\nconst services = { $lang: Lang };\n\nexport type LangServices = typeof services;\n\nexport default definePlugin({\n async install(app) {\n app.config.globalProperties.$t ??= translate;\n app.config.globalProperties.$td = translateWithDefault;\n\n await bootServices(app, services);\n },\n});\n\ndeclare module '@/services' {\n export interface Services extends LangServices {}\n}\n\ndeclare module '@vue/runtime-core' {\n interface ComponentCustomProperties {\n $td: typeof translateWithDefault;\n }\n}\n","import { onUnmounted } from 'vue';\n\nimport Events from '@/services/Events';\nimport type {\n EventListener,\n EventWithPayload,\n EventWithoutPayload,\n EventsPayload,\n UnknownEvent,\n} from '@/services/Events';\n\nexport function useEvent<Event extends EventWithoutPayload>(event: Event, listener: () => unknown): void;\nexport function useEvent<Event extends EventWithPayload>(\n event: Event,\n listener: EventListener<EventsPayload[Event]>\n): void;\nexport function useEvent<Payload>(event: string, listener: (payload: Payload) => unknown): void;\nexport function useEvent<Event extends string>(event: UnknownEvent<Event>, listener: EventListener): void;\n\nexport function useEvent(event: string, listener: EventListener): void {\n const unsubscribe = Events.on(event, listener);\n\n onUnmounted(() => unsubscribe());\n}\n","import { objectWithout } from '@noeldemartin/utils';\nimport { computed, useAttrs } from 'vue';\nimport type { ComputedRef } from 'vue';\n\nexport function useInputAttrs(): [ComputedRef<{}>, ComputedRef<unknown>] {\n const attrs = useAttrs();\n const className = computed(() => attrs.class);\n const inputAttrs = computed(() => objectWithout(attrs, 'class'));\n\n return [inputAttrs, className];\n}\n","import { noop } from '@noeldemartin/utils';\nimport { onMounted, onUnmounted } from 'vue';\n\nexport function onCleanMounted(operation: () => Function): void {\n let cleanUp: Function = noop;\n\n onMounted(() => (cleanUp = operation()));\n onUnmounted(() => cleanUp());\n}\n","export function removeInteractiveClasses(classes: string): string {\n return classes\n .split(/\\s+/)\n .filter((className) => !/^(hover|focus|focus-visible):/.test(className))\n .join(' ')\n .trim();\n}\n","export function extractComponentProps<T extends Record<string, unknown>>(\n values: Record<string, unknown>,\n definitions: Record<string, unknown>,\n): T {\n return Object.keys(definitions).reduce((extracted, prop) => {\n extracted[prop] = values[prop];\n\n return extracted;\n }, {} as Record<string, unknown>) as T;\n}\n","import { computed } from 'vue';\nimport type { ExtractPropTypes, Ref } from 'vue';\n\nimport { booleanProp, stringProp } from '@/utils';\nimport { extractComponentProps } from '@/components/utils';\nimport type { IAGModal } from '@/components/modals/AGModal';\n\nexport interface IAGHeadlessModal extends IAGModal {}\n\nexport interface IAGHeadlessModalDefaultSlotProps {\n close(result?: unknown): Promise<void>;\n}\n\nexport const modalProps = {\n cancellable: booleanProp(true),\n title: stringProp(),\n};\n\nexport function useModalProps(): typeof modalProps {\n return modalProps;\n}\n\nexport function extractModalProps<T extends ExtractPropTypes<typeof modalProps>>(\n props: T,\n): Pick<T, keyof typeof modalProps> {\n return extractComponentProps(props, modalProps);\n}\n\nexport function useModalExpose($modal: Ref<IAGHeadlessModal | undefined>): IAGModal {\n return {\n close: async () => $modal.value?.close(),\n cancellable: computed(() => !!$modal.value?.cancellable),\n };\n}\n","<template>\n <Dialog ref=\"$root\" :open=\"true\" @close=\"cancellable && close()\">\n <slot :close=\"close\" />\n </Dialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, toRef } from 'vue';\nimport { Dialog } from '@headlessui/vue';\nimport type { VNode } from 'vue';\n\nimport Events from '@/services/Events';\nimport { useEvent } from '@/utils/composition/events';\nimport { injectReactiveOrFail } from '@/utils/vue';\nimport type { IAGModalContext } from '@/components/modals/AGModalContext';\n\nimport { useModalProps } from './AGHeadlessModal';\nimport type { IAGHeadlessModal, IAGHeadlessModalDefaultSlotProps } from './AGHeadlessModal';\n\nconst props = defineProps(useModalProps());\nconst $root = ref<{ $el?: HTMLElement } | null>(null);\nconst hidden = ref(true);\nconst closed = ref(false);\nconst { modal } = injectReactiveOrFail<IAGModalContext>(\n 'modal',\n 'could not obtain modal reference from <AGHeadlessModal>, ' +\n 'did you render this component manually? Show it using $ui.openModal() instead',\n);\n\nasync function hide(): Promise<void> {\n if (!$root.value?.$el) {\n return;\n }\n\n hidden.value = true;\n}\n\nasync function show(): Promise<void> {\n if (!$root.value?.$el) {\n return;\n }\n\n hidden.value = false;\n}\n\nasync function close(result?: unknown) {\n if (closed.value) {\n return;\n }\n\n Events.emit('modal-will-close', { modal, result });\n\n await hide();\n\n closed.value = true;\n\n Events.emit('modal-closed', { modal, result });\n}\n\nuseEvent('close-modal', async ({ id, result }) => {\n if (id !== modal.id) {\n return;\n }\n\n await close(result);\n});\n\nuseEvent('hide-modal', async ({ id }) => {\n if (id !== modal.id) {\n return;\n }\n\n await hide();\n});\n\nuseEvent('show-modal', async ({ id }) => {\n if (id !== modal.id) {\n return;\n }\n\n await show();\n});\n\ndefineSlots<{ default(props: IAGHeadlessModalDefaultSlotProps): VNode[] }>();\ndefineExpose<IAGHeadlessModal>({ close, cancellable: toRef(props, 'cancellable') });\n</script>\n","<template>\n <component :is=\"modal.component\" v-bind=\"modal.properties\" />\n</template>\n\n<script setup lang=\"ts\">\nimport { provide, toRef } from 'vue';\n\nimport { requiredNumberProp, requiredObjectProp } from '@/utils/vue';\nimport type { Modal } from '@/ui/UI.state';\n\nimport type { IAGModalContext } from './AGModalContext';\n\nconst props = defineProps({\n modal: requiredObjectProp<Modal>(),\n childIndex: requiredNumberProp(),\n});\n\nprovide<IAGModalContext>('modal', {\n modal: toRef(props, 'modal'),\n childIndex: toRef(props, 'childIndex'),\n});\n</script>\n","<template>\n <DialogPanel>\n <slot />\n\n <template v-if=\"childModal\">\n <div class=\"pointer-events-none fixed inset-0 z-50 bg-black/30\" />\n <AGModalContext :child-index=\"modal.childIndex + 1\" :modal=\"childModal\" />\n </template>\n </DialogPanel>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { DialogPanel } from '@headlessui/vue';\n\nimport UI from '@/ui/UI';\nimport { injectReactiveOrFail } from '@/utils/vue';\nimport type { IAGModalContext } from '@/components/modals/AGModalContext';\n\nimport AGModalContext from '../../modals/AGModalContext.vue';\n\nconst modal = injectReactiveOrFail<IAGModalContext>(\n 'modal',\n 'could not obtain modal reference from <AGHeadlessModalPanel>, ' +\n 'did you render this component manually? Show it using $ui.openModal() instead',\n);\nconst childModal = computed(() => UI.modals[modal.childIndex] ?? null);\n</script>\n","import { tap } from '@noeldemartin/utils';\nimport DOMPurify from 'dompurify';\nimport { Renderer, marked } from 'marked';\n\nfunction makeRenderer(): Renderer {\n return tap(new Renderer(), (renderer) => {\n renderer.link = function(href, title, text) {\n return Renderer.prototype.link.apply(this, [href, title, text]).replace('<a', '<a target=\"_blank\"');\n };\n });\n}\n\nexport function renderMarkdown(markdown: string): string {\n return safeHtml(marked(markdown, { mangle: false, headerIds: false, renderer: makeRenderer() }));\n}\n\nexport function safeHtml(html: string): string {\n // TODO improve target=\"_blank\" exception\n // See https://github.com/cure53/DOMPurify/issues/317\n return DOMPurify.sanitize(html, { ADD_ATTR: ['target'] });\n}\n","<template>\n <root />\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, h } from 'vue';\n\nimport { renderMarkdown } from '@/utils/markdown';\nimport { booleanProp, objectProp, stringProp } from '@/utils/vue';\nimport { translate } from '@/lang';\n\nconst props = defineProps({\n as: stringProp(),\n inline: booleanProp(),\n langKey: stringProp(),\n langParams: objectProp<Record<string, unknown>>(),\n text: stringProp(),\n});\n\nconst markdown = computed(() => props.text ?? (props.langKey && translate(props.langKey, props.langParams ?? {})));\nconst html = computed(() => {\n if (!markdown.value) {\n return null;\n }\n\n let renderedHtml = renderMarkdown(markdown.value);\n\n if (props.inline) {\n renderedHtml = renderedHtml.replace('<p>', '<span>').replace('</p>', '</span>');\n }\n\n return renderedHtml;\n});\nconst root = () =>\n h(props.as ?? (props.inline ? 'span' : 'div'), { class: props.inline ? '' : 'prose', innerHTML: html.value });\n</script>\n","<template>\n <AGHeadlessModal\n ref=\"$modal\"\n v-slot=\"{ close }: IAGHeadlessModalDefaultSlotProps\"\n v-bind=\"props\"\n class=\"relative z-50\"\n >\n <div class=\"fixed inset-0 flex items-center justify-center p-8\">\n <AGHeadlessModalPanel class=\"flex max-h-full max-w-full flex-col overflow-hidden bg-white p-4\">\n <AGHeadlessModalTitle v-if=\"title\" class=\"mb-2 text-lg font-semibold\">\n <AGMarkdown :text=\"title\" inline />\n </AGHeadlessModalTitle>\n <div class=\"flex max-h-full flex-col overflow-auto\" v-bind=\"$attrs\">\n <slot :close=\"close\" />\n </div>\n </AGHeadlessModalPanel>\n </div>\n </AGHeadlessModal>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue';\n\nimport { useModalExpose, useModalProps } from '@/components/headless/modals/AGHeadlessModal';\nimport type { IAGHeadlessModal, IAGHeadlessModalDefaultSlotProps } from '@/components/headless/modals/AGHeadlessModal';\n\nimport type { IAGModal } from './AGModal';\n\nimport AGHeadlessModal from '../headless/modals/AGHeadlessModal.vue';\nimport AGHeadlessModalPanel from '../headless/modals/AGHeadlessModalPanel.vue';\nimport AGHeadlessModalTitle from '../headless/modals/AGHeadlessModalTitle.vue';\nimport AGMarkdown from '../lib/AGMarkdown.vue';\n\nconst props = defineProps(useModalProps());\nconst $modal = ref<IAGHeadlessModal>();\n\ndefineOptions({ inheritAttrs: false });\ndefineExpose<IAGModal>(useModalExpose($modal));\n</script>\n","import type { ExtractPropTypes } from 'vue';\nimport type { ObjectWithoutEmpty } from '@noeldemartin/utils';\n\nimport { requiredStringProp, stringProp } from '@/utils';\n\nexport const alertModalProps = {\n title: stringProp(),\n message: requiredStringProp(),\n};\n\nexport type AGAlertModalProps = ObjectWithoutEmpty<ExtractPropTypes<typeof alertModalProps>>;\n\nexport function useAlertModalProps(): typeof alertModalProps {\n return alertModalProps;\n}\n","import { computed } from 'vue';\nimport type { ExtractPropTypes } from 'vue';\nimport type { ObjectWithoutEmpty } from '@noeldemartin/utils';\n\nimport { requiredStringProp, stringProp } from '@/utils';\nimport { translateWithDefault } from '@/lang';\n\nexport const confirmModalProps = {\n title: stringProp(),\n message: requiredStringProp(),\n acceptText: stringProp(),\n cancelText: stringProp(),\n};\n\nexport type AGConfirmModalProps = ObjectWithoutEmpty<ExtractPropTypes<typeof confirmModalProps>>;\n\nexport function useConfirmModalProps(): typeof confirmModalProps {\n return confirmModalProps;\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function useConfirmModal(props: ExtractPropTypes<typeof confirmModalProps>) {\n const renderedAcceptText = computed(() => props.acceptText ?? translateWithDefault('ui.accept', 'Ok'));\n const renderedCancelText = computed(() => props.cancelText ?? translateWithDefault('ui.cancel', 'Cancel'));\n\n return { renderedAcceptText, renderedCancelText };\n}\n","<template>\n <component :is=\"component.tag\" v-bind=\"component.props\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { objectWithoutEmpty } from '@noeldemartin/utils';\n\nimport { booleanProp, objectProp, stringProp } from '@/utils/vue';\n\nconst { href, url, route, routeParams, routeQuery, submit } = defineProps({\n href: stringProp(),\n url: stringProp(),\n route: stringProp(),\n routeParams: objectProp(() => ({})),\n routeQuery: objectProp(() => ({})),\n submit: booleanProp(),\n});\n\nconst component = computed(() => {\n if (route) {\n return {\n tag: 'router-link',\n props: {\n to: objectWithoutEmpty({\n name: route,\n params: routeParams,\n query: routeQuery,\n }),\n },\n };\n }\n\n if (href || url) {\n return {\n tag: 'a',\n props: {\n target: '_blank',\n href: href || url,\n },\n };\n }\n\n return {\n tag: 'button',\n props: { type: submit ? 'submit' : 'button' },\n };\n});\n</script>\n","<template>\n <AGHeadlessButton class=\"px-2.5 py-1.5 focus-visible:outline focus-visible:outline-2\" :class=\"colorClasses\">\n <slot />\n </AGHeadlessButton>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nimport { enumProp } from '@/utils/vue';\nimport { Colors } from '@/components/constants';\n\nimport AGHeadlessButton from '../headless/forms/AGHeadlessButton.vue';\n\nconst props = defineProps({\n color: enumProp(Colors, Colors.Primary),\n});\n\nconst colorClasses = computed(() => {\n switch (props.color) {\n case Colors.Secondary:\n return [\n 'text-white bg-gray-600',\n 'hover:bg-gray-500',\n 'focus-visible:outline-offset-2 focus-visible:outline-gray-600',\n ].join(' ');\n case Colors.Clear:\n return 'hover:bg-gray-500/20 focus-visible:outline-gray-500/60';\n case Colors.Danger:\n return [\n 'text-white bg-red-600',\n 'hover:bg-red-500',\n 'focus-visible:outline-offset-2 focus-visible:outline-red-600',\n ].join(' ');\n case Colors.Primary:\n default:\n return [\n 'text-white bg-indigo-600',\n 'hover:bg-indigo-500',\n 'focus-visible:outline-offset-2 focus-visible:outline-indigo-600',\n ].join(' ');\n }\n});\n</script>\n","<template>\n <AGModal v-slot=\"{ close }: IAGModalDefaultSlotProps\" :cancellable=\"false\" :title=\"title\">\n <AGMarkdown :text=\"message\" />\n\n <div class=\"mt-2 flex flex-row-reverse gap-2\">\n <AGButton @click=\"close(true)\">\n {{ renderedAcceptText }}\n </AGButton>\n <AGButton color=\"secondary\" @click=\"close()\">\n {{ renderedCancelText }}\n </AGButton>\n </div>\n </AGModal>\n</template>\n\n<script setup lang=\"ts\">\nimport AGModal from './AGModal.vue';\nimport { useConfirmModal, useConfirmModalProps } from './AGConfirmModal';\nimport type { IAGModalDefaultSlotProps } from './AGModal';\n\nimport AGButton from '../forms/AGButton.vue';\nimport AGMarkdown from '../lib/AGMarkdown.vue';\n\nconst props = defineProps(useConfirmModalProps());\nconst { renderedAcceptText, renderedCancelText } = useConfirmModal(props);\n</script>\n","import { computed, ref } from 'vue';\nimport type { Component, ExtractPropTypes } from 'vue';\nimport type { ObjectWithoutEmpty } from '@noeldemartin/utils';\n\nimport { requiredArrayProp } from '@/utils/vue';\nimport { translateWithDefault } from '@/lang';\nimport type { ErrorReport } from '@/errors';\n\nexport interface IAGErrorReportModalButtonsDefaultSlotProps {\n id: string;\n description: string;\n iconComponent: Component;\n url?: string;\n handler?(): void;\n}\n\nexport const errorReportModalProps = {\n reports: requiredArrayProp<ErrorReport>(),\n};\n\nexport type AGErrorReportModalProps = ObjectWithoutEmpty<ExtractPropTypes<typeof errorReportModalProps>>;\n\nexport function useErrorReportModalProps(): typeof errorReportModalProps {\n return errorReportModalProps;\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function useErrorReportModal(props: ExtractPropTypes<typeof errorReportModalProps>) {\n const activeReportIndex = ref(0);\n const report = computed(() => props.reports[activeReportIndex.value] as ErrorReport);\n const details = computed(\n () =>\n report.value.details?.trim() ||\n translateWithDefault('errors.detailsEmpty', 'This error is missing a stacktrace.'),\n );\n const previousReportText = translateWithDefault('errors.previousReport', 'Show previous report');\n const nextReportText = translateWithDefault('errors.nextReport', 'Show next report');\n\n return {\n activeReportIndex,\n details,\n nextReportText,\n previousReportText,\n report,\n };\n}\n","<template>\n <div class=\"flex\">\n <slot v-for=\"(button, i) of buttons\" v-bind=\"(button as unknown as ComponentProps)\" :key=\"i\">\n <AGButton\n color=\"clear\"\n :url=\"button.url\"\n :title=\"$td(`errors.report_${button.id}`, button.description)\"\n :aria-label=\"$td(`errors.report_${button.id}`, button.description)\"\n @click=\"button.handler\"\n >\n <component :is=\"button.iconComponent\" class=\"h-4 w-4\" aria-hidden=\"true\" />\n </AGButton>\n </slot>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport IconConsole from '~icons/mdi/console';\nimport IconCopy from '~icons/zondicons/copy';\nimport IconGitHub from '~icons/mdi/github';\n\nimport { computed } from 'vue';\nimport { stringExcerpt, tap } from '@noeldemartin/utils';\n\nimport App from '@/services/App';\nimport UI from '@/ui/UI';\nimport { requiredObjectProp } from '@/utils/vue';\nimport { translateWithDefault } from '@/lang/utils';\nimport type { ComponentProps } from '@/utils/vue';\nimport type { ErrorReport } from '@/errors';\n\nimport AGButton from '../forms/AGButton.vue';\nimport type { IAGErrorReportModalButtonsDefaultSlotProps } from './AGErrorReportModal';\n\nconst props = defineProps({\n report: requiredObjectProp<ErrorReport>(),\n});\nconst summary = computed(() =>\n props.report.description ? `${props.report.title}: ${props.report.description}` : props.report.title);\nconst githubReportUrl = computed(() => {\n if (!App.sourceUrl) {\n return false;\n }\n\n const issueTitle = encodeURIComponent(summary.value);\n const issueBody = encodeURIComponent(\n [\n '[Please, explain here what you were trying to do when this error appeared]',\n '',\n 'Error details:',\n '```',\n stringExcerpt(\n props.report.details ?? 'Details missing from report',\n 1800 - issueTitle.length - App.sourceUrl.length,\n ).trim(),\n '```',\n ].join('\\n'),\n );\n\n return `${App.sourceUrl}/issues/new?title=${issueTitle}&body=${issueBody}`;\n});\nconst buttons = computed(() =>\n tap(\n [\n {\n id: 'clipboard',\n description: 'Copy to clipboard',\n iconComponent: IconCopy,\n async handler() {\n await navigator.clipboard.writeText(`${summary.value}\\n\\n${props.report.details}`);\n\n UI.showSnackbar(\n translateWithDefault('errors.copiedToClipboard', 'Debug information copied to clipboard'),\n );\n },\n },\n {\n id: 'console',\n description: 'Log to console',\n iconComponent: IconConsole,\n handler() {\n const error = props.report.error ?? props.report;\n\n (window as { error?: unknown }).error = error;\n\n // eslint-disable-next-line no-console\n console.error(error);\n\n UI.showSnackbar(\n translateWithDefault(\n 'errors.addedToConsole',\n 'You can now use the **error** variable in the console',\n ),\n );\n },\n },\n ],\n (reportButtons: IAGErrorReportModalButtonsDefaultSlotProps[]) => {\n if (!githubReportUrl.value) {\n return;\n }\n\n reportButtons.push({\n id: 'github',\n description: 'Report in GitHub',\n iconComponent: IconGitHub,\n url: githubReportUrl.value,\n });\n },\n ));\n</script>\n","<template>\n <AGMarkdown :text=\"text\" inline />\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nimport { numberProp, requiredObjectProp } from '@/utils/vue';\nimport type { ErrorReport } from '@/errors';\n\nimport AGMarkdown from '../lib/AGMarkdown.vue';\n\nconst props = defineProps({\n report: requiredObjectProp<ErrorReport>(),\n currentReport: numberProp(),\n totalReports: numberProp(),\n});\nconst text = computed(() => {\n if (!props.totalReports || props.totalReports <= 1) {\n return props.report.title;\n }\n\n return `${props.report.title} (${props.currentReport}/${props.totalReports})`;\n});\n</script>\n","<template>\n <AGModal>\n <div>\n <h2 class=\"flex items-center justify-between text-lg font-medium\">\n <div class=\"flex items-center\">\n <AGErrorReportModalTitle\n :report=\"report\"\n :current-report=\"activeReportIndex + 1\"\n :total-reports=\"reports.length\"\n />\n <template v-if=\"reports.length > 1\">\n <AGButton\n color=\"clear\"\n :disabled=\"activeReportIndex === 0\"\n :title=\"previousReportText\"\n :aria-label=\"previousReportText\"\n @click=\"activeReportIndex--\"\n >\n <IconCheveronLeft aria-hidden=\"true\" class=\"h-4 w-4\" />\n </AGButton>\n <AGButton\n color=\"clear\"\n :disabled=\"activeReportIndex === reports.length - 1\"\n :title=\"nextReportText\"\n :aria-label=\"nextReportText\"\n @click=\"activeReportIndex++\"\n >\n <IconCheveronRight aria-hidden=\"true\" class=\"h-4 w-4\" />\n </AGButton>\n </template>\n </div>\n <AGErrorReportModalButtons :report=\"report\" />\n </h2>\n <AGMarkdown v-if=\"report.description\" :text=\"report.description\" class=\"mt-2\" />\n </div>\n <pre class=\"h-full overflow-auto bg-gray-200 p-4 text-xs text-red-900\" v-text=\"details\" />\n </AGModal>\n</template>\n\n<script setup lang=\"ts\">\nimport IconCheveronRight from '~icons/zondicons/cheveron-right';\nimport IconCheveronLeft from '~icons/zondicons/cheveron-left';\n\nimport { useErrorReportModal, useErrorReportModalProps } from './AGErrorReportModal';\n\nimport AGButton from '../forms/AGButton.vue';\nimport AGErrorReportModalButtons from './AGErrorReportModalButtons.vue';\nimport AGErrorReportModalTitle from './AGErrorReportModalTitle.vue';\nimport AGMarkdown from '../lib/AGMarkdown.vue';\nimport AGModal from './AGModal.vue';\n\nconst props = defineProps(useErrorReportModalProps());\nconst { activeReportIndex, details, nextReportText, previousReportText, report } = useErrorReportModal(props);\n</script>\n","import { computed } from 'vue';\nimport type { ExtractPropTypes } from 'vue';\nimport type { ObjectWithoutEmpty } from '@noeldemartin/utils';\n\nimport { stringProp } from '@/utils';\nimport { translateWithDefault } from '@/lang';\n\nexport const loadingModalProps = {\n message: stringProp(),\n};\n\nexport type AGLoadingModalProps = ObjectWithoutEmpty<ExtractPropTypes<typeof loadingModalProps>>;\n\nexport function useLoadingModalProps(): typeof loadingModalProps {\n return loadingModalProps;\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function useLoadingModal(props: ExtractPropTypes<typeof loadingModalProps>) {\n const renderedMessage = computed(() => props.message ?? translateWithDefault('ui.loading', 'Loading...'));\n\n return { renderedMessage };\n}\n","<template>\n <AGModal :cancellable=\"false\">\n <AGMarkdown :text=\"renderedMessage\" />\n </AGModal>\n</template>\n\n<script setup lang=\"ts\">\nimport AGModal from './AGModal.vue';\nimport { useLoadingModal, useLoadingModalProps } from './AGLoadingModal';\n\nimport AGMarkdown from '../lib/AGMarkdown.vue';\n\nconst props = defineProps(useLoadingModalProps());\nconst { renderedMessage } = useLoadingModal(props);\n</script>\n","import { computed } from 'vue';\nimport type { ExtractPropTypes } from 'vue';\nimport type { ObjectWithoutEmpty } from '@noeldemartin/utils';\n\nimport { requiredStringProp, stringProp } from '@/utils';\nimport { translateWithDefault } from '@/lang';\n\nexport const promptModalProps = {\n title: stringProp(),\n message: requiredStringProp(),\n label: stringProp(),\n defaultValue: stringProp(),\n placeholder: stringProp(),\n acceptText: stringProp(),\n cancelText: stringProp(),\n};\n\nexport type AGPromptModalProps = ObjectWithoutEmpty<ExtractPropTypes<typeof promptModalProps>>;\n\nexport function usePromptModalProps(): typeof promptModalProps {\n return promptModalProps;\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function usePromptModal(props: ExtractPropTypes<typeof promptModalProps>) {\n const renderedAcceptText = computed(() => props.acceptText ?? translateWithDefault('ui.accept', 'Ok'));\n const renderedCancelText = computed(() => props.cancelText ?? translateWithDefault('ui.cancel', 'Cancel'));\n\n return { renderedAcceptText, renderedCancelText };\n}\n","<template>\n <form @submit.prevent=\"submit\">\n <slot />\n </form>\n</template>\n\n<script setup lang=\"ts\">\nimport { provide } from 'vue';\n\nimport { objectProp } from '@/utils/vue';\nimport type Form from '@/forms/Form';\n\nconst props = defineProps({ form: objectProp<Form>() });\n\nconst emit = defineEmits<{ submit: [] }>();\n\nprovide('form', props.form);\n\nfunction submit() {\n if (props.form && !props.form.submit()) {\n return;\n }\n\n emit('submit');\n}\n</script>\n","import type { ComputedRef, DeepReadonly, ExtractPropTypes, Ref } from 'vue';\n\nimport { stringProp } from '@/utils';\nimport { extractComponentProps } from '@/components/utils';\n\nexport interface IAGHeadlessInput {\n id: string;\n name: ComputedRef<string | null>;\n label: ComputedRef<string | null>;\n value: ComputedRef<string | number | boolean | null>;\n errors: DeepReadonly<Ref<string[] | null>>;\n update(value: string | number | boolean | null): void;\n}\n\nexport const inputProps = {\n name: stringProp(),\n label: stringProp(),\n};\n\nexport function useInputProps(): typeof inputProps {\n return inputProps;\n}\n\nexport function extractInputProps<T extends ExtractPropTypes<typeof inputProps>>(\n props: T,\n): Pick<T, keyof typeof inputProps> {\n return extractComponentProps(props, inputProps);\n}\n","<template>\n <component :is=\"as\" v-if=\"as\">\n <slot />\n </component>\n <slot v-else />\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, inject, provide, readonly } from 'vue';\nimport { uuid } from '@noeldemartin/utils';\n\nimport { mixedProp, stringProp } from '@/utils/vue';\nimport type Form from '@/forms/Form';\n\nimport { useInputProps } from './AGHeadlessInput';\nimport type { IAGHeadlessInput } from './AGHeadlessInput';\n\nconst emit = defineEmits(['update:modelValue']);\nconst props = defineProps({\n as: stringProp('div'),\n modelValue: mixedProp<string | number | boolean>([String, Number, Boolean]),\n ...useInputProps(),\n});\nconst errors = computed(() => {\n if (!form || !props.name) {\n return null;\n }\n\n return form.errors[props.name] ?? null;\n});\nconst form = inject<Form | null>('form', null);\nconst api: IAGHeadlessInput = {\n id: `input-${uuid()}`,\n name: computed(() => props.name),\n label: computed(() => props.label),\n value: computed(() => {\n if (form && props.name) {\n return form.getFieldValue(props.name) as string | number | boolean | null;\n }\n\n return props.modelValue;\n }),\n errors: readonly(errors),\n update(value) {\n if (form && props.name) {\n form.setFieldValue(props.name, value);\n\n return;\n }\n\n emit('update:modelValue', value);\n },\n};\n\nprovide<IAGHeadlessInput>('input', api);\ndefineExpose<IAGHeadlessInput>(api);\n</script>\n","<template>\n <p v-if=\"errorMessage\" :id=\"`${input.id}-error`\">\n {{ errorMessage }}\n </p>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nimport { injectReactiveOrFail } from '@/utils/vue';\nimport { translateWithDefault } from '@/lang/utils';\n\nimport type { IAGHeadlessInput } from './AGHeadlessInput';\n\nconst input = injectReactiveOrFail<IAGHeadlessInput>(\n 'input',\n '<AGHeadlessInputError> must be a child of a <AGHeadlessInput>',\n);\nconst errorMessage = computed(() => {\n if (!input.errors) {\n return null;\n }\n\n return translateWithDefault(`errors.${input.errors[0]}`, `Error: ${input.errors[0]}`);\n});\n</script>\n","<template>\n <input\n :id=\"input.id\"\n ref=\"$input\"\n :type=\"type\"\n :value=\"value\"\n :aria-invalid=\"input.errors ? 'true' : 'false'\"\n :aria-describedby=\"input.errors ? `${input.id}-error` : undefined\"\n :checked=\"checked\"\n @input=\"update\"\n >\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue';\n\nimport { injectReactiveOrFail, stringProp } from '@/utils';\nimport type { IAGHeadlessInput } from '@/components/headless/forms/AGHeadlessInput';\n\nconst props = defineProps({\n type: stringProp('text'),\n});\n\nconst $input = ref<HTMLInputElement>();\nconst input = injectReactiveOrFail<IAGHeadlessInput>(\n 'input',\n '<AGHeadlessInputInput> must be a child of a <AGHeadlessInput>',\n);\nconst value = computed(() => input.value);\nconst checked = computed(() => {\n if (props.type !== 'checkbox') {\n return;\n }\n\n return !!value.value;\n});\n\nfunction update() {\n if (!$input.value) {\n return;\n }\n\n input.update(props.type === 'checkbox' ? $input.value.checked : $input.value.value);\n}\n</script>\n","<template>\n <label v-if=\"show\" :for=\"input.id\">\n <slot>\n {{ input.label }}\n </slot>\n </label>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue';\n\nimport { injectReactiveOrFail } from '@/utils/vue';\n\nimport type { IAGHeadlessInput } from './AGHeadlessInput';\n\nconst input = injectReactiveOrFail<IAGHeadlessInput>(\n 'input',\n '<AGHeadlessInputLabel> must be a child of a <AGHeadlessInput>',\n);\nconst slots = useSlots();\nconst show = computed(() => !!(input.label || slots.default));\n</script>\n","<template>\n <AGHeadlessInput\n ref=\"$input\"\n class=\"relative flex flex-col items-center\"\n :class=\"className\"\n v-bind=\"props\"\n >\n <AGHeadlessInputLabel class=\"sr-only\" />\n <AGHeadlessInputInput\n v-bind=\"attrs\"\n class=\"block w-full border-0 py-1.5 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600\"\n :class=\"{\n 'ring-1 ring-red-500': $input?.errors,\n }\"\n />\n <div class=\"absolute bottom-0 left-0 translate-y-full\">\n <AGHeadlessInputError class=\"mt-1 text-sm text-red-500\" />\n </div>\n </AGHeadlessInput>\n</template>\n\n<script setup lang=\"ts\">\nimport { componentRef } from '@/utils/vue';\nimport { useInputAttrs } from '@/utils/composition/forms';\nimport { useInputProps } from '@/components/headless/forms/AGHeadlessInput';\nimport type { IAGHeadlessInput } from '@/components/headless/forms/AGHeadlessInput';\n\nimport AGHeadlessInput from '../headless/forms/AGHeadlessInput.vue';\nimport AGHeadlessInputError from '../headless/forms/AGHeadlessInputError.vue';\nimport AGHeadlessInputInput from '../headless/forms/AGHeadlessInputInput.vue';\nimport AGHeadlessInputLabel from '../headless/forms/AGHeadlessInputLabel.vue';\n\ndefineOptions({ inheritAttrs: false });\n\nconst props = defineProps(useInputProps());\nconst $input = componentRef<IAGHeadlessInput>();\nconst [attrs, className] = useInputAttrs();\n</script>\n","import { MagicObject } from '@noeldemartin/utils';\nimport { computed, reactive, readonly, ref } from 'vue';\nimport type { ObjectValues } from '@noeldemartin/utils';\nimport type { ComputedRef, DeepReadonly, Ref, UnwrapNestedRefs } from 'vue';\n\nexport const FormFieldTypes = {\n String: 'string',\n Number: 'number',\n Boolean: 'boolean',\n Object: 'object',\n} as const;\n\nexport interface FormFieldDefinition<TType extends FormFieldType = FormFieldType, TRules extends string = string> {\n type: TType;\n default?: GetFormFieldValue<TType>;\n rules?: TRules;\n}\n\nexport type FormFieldDefinitions = Record<string, FormFieldDefinition>;\nexport type FormFieldType = ObjectValues<typeof FormFieldTypes>;\nexport type FormFieldValue = GetFormFieldValue<FormFieldType>;\n\nexport type FormData<T> = {\n -readonly [k in keyof T]: T[k] extends FormFieldDefinition<infer TType, infer TRules>\n ? TRules extends 'required'\n ? GetFormFieldValue<TType>\n : GetFormFieldValue<TType> | null\n : never;\n};\n\nexport type FormErrors<T> = {\n [k in keyof T]: string[] | null;\n};\n\nexport type GetFormFieldValue<TType> = TType extends typeof FormFieldTypes.String\n ? string\n : TType extends typeof FormFieldTypes.Number\n ? number\n : TType extends typeof FormFieldTypes.Boolean\n ? boolean\n : TType extends typeof FormFieldTypes.Object\n ? object\n : never;\n\nconst validForms: WeakMap<Form, ComputedRef<boolean>> = new WeakMap();\n\nexport default class Form<Fields extends FormFieldDefinitions = FormFieldDefinitions> extends MagicObject {\n\n public errors: DeepReadonly<UnwrapNestedRefs<FormErrors<Fields>>>;\n\n private _fields: Fields;\n private _data: FormData<Fields>;\n private _submitted: Ref<boolean>;\n private _errors: FormErrors<Fields>;\n\n constructor(fields: Fields) {\n super();\n\n this._fields = fields;\n this._submitted = ref(false);\n this._data = this.getInitialData(fields);\n this._errors = this.getInitialErrors(fields);\n\n validForms.set(\n this,\n computed(() => !Object.values(this._errors).some((error) => error !== null)),\n );\n\n this.errors = readonly(this._errors);\n }\n\n public get valid(): boolean {\n return !!validForms.get(this)?.value;\n }\n\n public get submitted(): boolean {\n return this._submitted.value;\n }\n\n public setFieldValue<T extends keyof Fields>(field: T, value: FormData<Fields>[T]): void {\n this._data[field] = value;\n\n if (this._submitted.value) {\n this.validate();\n }\n }\n\n public getFieldValue<T extends keyof Fields>(field: T): GetFormFieldValue<Fields[T]['type']> {\n return this._data[field] as unknown as GetFormFieldValue<Fields[T]['type']>;\n }\n\n public validate(): boolean {\n const errors = Object.entries(this._fields).reduce((formErrors, [name, definition]) => {\n formErrors[name] = this.getFieldErrors(name, definition);\n\n return formErrors;\n }, {} as Record<string, string[] | null>);\n\n this.resetErrors(errors);\n\n return this.valid;\n }\n\n public reset(options: { keepData?: boolean; keepErrors?: boolean } = {}): void {\n this._submitted.value = false;\n\n options.keepData || this.resetData();\n options.keepErrors || this.resetErrors();\n }\n\n public submit(): boolean {\n this._submitted.value = true;\n\n return this.validate();\n }\n\n protected __get(property: string): unknown {\n if (!(property in this._fields)) {\n return super.__get(property);\n }\n\n return this._data[property];\n }\n\n protected __set(property: string, value: unknown): void {\n if (!(property in this._fields)) {\n super.__set(property, value);\n\n return;\n }\n\n Object.assign(this._data, { [property]: value });\n }\n\n private getFieldErrors(name: keyof Fields, definition: FormFieldDefinition): string[] | null {\n const errors = [];\n\n if (definition.rules?.includes('required') && !this._data[name]) {\n errors.push('required');\n }\n\n return errors.length > 0 ? errors : null;\n }\n\n private getInitialData(fields: Fields): FormData<Fields> {\n if (this.static().isConjuring()) {\n return {} as FormData<Fields>;\n }\n\n const data = Object.entries(fields).reduce((formData, [name, definition]) => {\n formData[name as keyof Fields] = (definition.default ?? null) as FormData<Fields>[keyof Fields];\n\n return formData;\n }, {} as FormData<Fields>);\n\n return reactive(data) as FormData<Fields>;\n }\n\n private getInitialErrors(fields: Fields): FormErrors<Fields> {\n if (this.static().isConjuring()) {\n return {} as FormErrors<Fields>;\n }\n\n const errors = Object.keys(fields).reduce((formErrors, name) => {\n formErrors[name as keyof Fields] = null;\n\n return formErrors;\n }, {} as FormErrors<Fields>);\n\n return reactive(errors) as FormErrors<Fields>;\n }\n\n private resetData(): void {\n for (const [name, field] of Object.entries(this._fields)) {\n this._data[name as keyof Fields] = (field.default ?? null) as FormData<Fields>[keyof Fields];\n }\n }\n\n private resetErrors(errors?: Record<string, string[] | null>): void {\n Object.keys(this._errors).forEach((key) => delete this._errors[key as keyof Fields]);\n\n errors && Object.assign(this._errors, errors);\n }\n\n}\n","import Form from '@/forms/Form';\nimport type { FormData, FormFieldDefinitions } from '@/forms/Form';\n\nexport function useForm<const T extends FormFieldDefinitions>(fields: T): Form<T> & FormData<T> {\n return new Form(fields) as Form<T> & FormData<T>;\n}\n","import { FormFieldTypes } from './Form';\nimport type { FormFieldDefinition } from './Form';\n\nexport function booleanInput(defaultValue?: boolean): FormFieldDefinition<typeof FormFieldTypes.Boolean> {\n return {\n default: defaultValue,\n type: FormFieldTypes.Boolean,\n };\n}\n\nexport function requiredBooleanInput(\n defaultValue?: boolean,\n): FormFieldDefinition<typeof FormFieldTypes.Boolean, 'required'> {\n return {\n default: defaultValue,\n type: FormFieldTypes.Boolean,\n rules: 'required',\n };\n}\n\nexport function requiredNumberInput(\n defaultValue?: number,\n): FormFieldDefinition<typeof FormFieldTypes.Number, 'required'> {\n return {\n default: defaultValue,\n type: FormFieldTypes.Number,\n rules: 'required',\n };\n}\n\nexport function requiredStringInput(\n defaultValue?: string,\n): FormFieldDefinition<typeof FormFieldTypes.String, 'required'> {\n return {\n default: defaultValue,\n type: FormFieldTypes.String,\n rules: 'required',\n };\n}\n\nexport function numberInput(defaultValue?: number): FormFieldDefinition<typeof FormFieldTypes.Number> {\n return {\n default: defaultValue,\n type: FormFieldTypes.Number,\n };\n}\n\nexport function stringInput(defaultValue?: string): FormFieldDefinition<typeof FormFieldTypes.String> {\n return {\n default: defaultValue,\n type: FormFieldTypes.String,\n };\n}\n","<template>\n <AGModal v-slot=\"{ close }: IAGModalDefaultSlotProps\" :cancellable=\"false\" :title=\"title\">\n <AGMarkdown :text=\"message\" />\n\n <AGForm :form=\"form\" @submit=\"close(form.draft)\">\n <AGInput name=\"draft\" :placeholder=\"placeholder\" :label=\"label\" />\n\n <div class=\"mt-2 flex flex-row-reverse gap-2\">\n <AGButton submit>\n {{ renderedAcceptText }}\n </AGButton>\n <AGButton color=\"secondary\" @click=\"close()\">\n {{ renderedCancelText }}\n </AGButton>\n </div>\n </AGForm>\n </AGModal>\n</template>\n\n<script setup lang=\"ts\">\nimport AGModal from './AGModal.vue';\nimport { usePromptModal, usePromptModalProps } from './AGPromptModal';\nimport type { IAGModalDefaultSlotProps } from './AGModal';\n\nimport AGButton from '../forms/AGButton.vue';\nimport AGForm from '../forms/AGForm.vue';\nimport AGInput from '../forms/AGInput.vue';\nimport AGMarkdown from '../lib/AGMarkdown.vue';\nimport { requiredStringInput, useForm } from '../../forms';\n\nconst props = defineProps(usePromptModalProps());\nconst form = useForm({ draft: requiredStringInput(props.defaultValue ?? '') });\nconst { renderedAcceptText, renderedCancelText } = usePromptModal(props);\n</script>\n","import type { ExtractPropTypes } from 'vue';\nimport type { ObjectWithoutEmpty } from '@noeldemartin/utils';\n\nimport UI from '@/ui/UI';\nimport { arrayProp, enumProp, requiredStringProp } from '@/utils/vue';\nimport { Colors } from '@/components/constants';\nimport { objectWithout } from '@noeldemartin/utils';\n\nexport { default as AGHeadlessSnackbar } from './AGHeadlessSnackbar.vue';\n\nexport const SnackbarColors = objectWithout(Colors, ['Primary', 'Clear']);\nexport const snackbarProps = {\n id: requiredStringProp(),\n message: requiredStringProp(),\n actions: arrayProp<SnackbarAction>(() => []),\n color: enumProp(SnackbarColors, Colors.Secondary),\n};\n\nexport interface SnackbarAction {\n text: string;\n dismiss?: boolean;\n handler?(): unknown;\n}\n\nexport type SnackbarColor = (typeof SnackbarColors)[keyof typeof SnackbarColors];\nexport type AGSnackbarProps = ObjectWithoutEmpty<ExtractPropTypes<typeof snackbarProps>>;\n\nexport function useSnackbarProps(): typeof snackbarProps {\n return snackbarProps;\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function useSnackbar(props: ExtractPropTypes<typeof snackbarProps>) {\n function activate(action: SnackbarAction): void {\n action.handler?.();\n action.dismiss && UI.hideSnackbar(props.id);\n }\n\n return { activate };\n}\n","<template>\n <AGHeadlessSnackbar class=\"flex flex-row items-center justify-center gap-3 p-4\" :class=\"styleClasses\">\n <AGMarkdown :text=\"message\" inline />\n <AGButton\n v-for=\"(action, i) of actions\"\n :key=\"i\"\n :color=\"color\"\n @click=\"activate(action)\"\n >\n {{ action.text }}\n </AGButton>\n </AGHeadlessSnackbar>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nimport { Colors } from '@/components/constants';\nimport { useSnackbar, useSnackbarProps } from '@/components/headless/snackbars';\n\nimport AGButton from '../forms/AGButton.vue';\nimport AGHeadlessSnackbar from '../headless/snackbars/AGHeadlessSnackbar.vue';\nimport AGMarkdown from '../lib/AGMarkdown.vue';\n\nconst props = defineProps(useSnackbarProps());\nconst { activate } = useSnackbar(props);\nconst styleClasses = computed(() => {\n switch (props.color) {\n case Colors.Danger:\n return 'bg-red-200 text-red-900';\n default:\n case Colors.Secondary:\n return 'bg-gray-900 text-white';\n }\n});\n</script>\n","import type { Component } from 'vue';\n\nimport { bootServices } from '@/services';\nimport { definePlugin } from '@/plugins';\n\nimport UI, { UIComponents } from './UI';\nimport AGAlertModal from '../components/modals/AGAlertModal.vue';\nimport AGConfirmModal from '../components/modals/AGConfirmModal.vue';\nimport AGErrorReportModal from '../components/modals/AGErrorReportModal.vue';\nimport AGLoadingModal from '../components/modals/AGLoadingModal.vue';\nimport AGPromptModal from '../components/modals/AGPromptModal.vue';\nimport AGSnackbar from '../components/snackbars/AGSnackbar.vue';\nimport AGStartupCrash from '../components/lib/AGStartupCrash.vue';\nimport type { UIComponent } from './UI';\n\nconst services = { $ui: UI };\n\nexport * from './UI';\nexport { default as UI } from './UI';\n\nexport type UIServices = typeof services;\n\nexport default definePlugin({\n async install(app, options) {\n const defaultComponents = {\n [UIComponents.AlertModal]: AGAlertModal,\n [UIComponents.ConfirmModal]: AGConfirmModal,\n [UIComponents.ErrorReportModal]: AGErrorReportModal,\n [UIComponents.LoadingModal]: AGLoadingModal,\n [UIComponents.PromptModal]: AGPromptModal,\n [UIComponents.Snackbar]: AGSnackbar,\n [UIComponents.StartupCrash]: AGStartupCrash,\n };\n\n Object.entries({\n ...defaultComponents,\n ...options.components,\n }).forEach(([name, component]) => UI.registerComponent(name as UIComponent, component));\n\n await bootServices(app, services);\n },\n});\n\ndeclare module '@/bootstrap/options' {\n export interface AerogelOptions {\n components?: Partial<Record<UIComponent, Component>>;\n }\n}\n\ndeclare module '@/services' {\n export interface Services extends UIServices {}\n}\n","import { createApp } from 'vue';\nimport type { App, Component } from 'vue';\n\nimport directives from '@/directives';\nimport errors from '@/errors';\nimport Events from '@/services/Events';\nimport lang from '@/lang';\nimport services from '@/services';\nimport ui from '@/ui';\nimport { installPlugins } from '@/plugins';\nimport type { AerogelOptions } from '@/bootstrap/options';\n\nexport { AerogelOptions };\n\nexport async function bootstrapApplication(app: App, options: AerogelOptions = {}): Promise<void> {\n const plugins = [directives, errors, lang, services, ui, ...(options.plugins ?? [])];\n\n await installPlugins(plugins, app, options);\n await options.install?.(app);\n\n Events.emit('application-ready');\n}\n\nexport async function bootstrap(rootComponent: Component, options: AerogelOptions = {}): Promise<void> {\n const app = createApp(rootComponent);\n\n await bootstrapApplication(app, options);\n\n app.mount('#app');\n app._container?.classList.remove('loading');\n\n Events.emit('application-mounted');\n}\n\ndeclare module '@/services/Events' {\n export interface EventsPayload {\n 'application-mounted': void;\n }\n}\n","<template>\n <aside v-if=\"modal\">\n <AGModalContext :child-index=\"1\" :modal=\"modal\" />\n </aside>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nimport UI from '@/ui/UI';\n\nimport AGModalContext from './modals/AGModalContext.vue';\n\nconst modal = computed(() => UI.modals[0] ?? null);\n</script>\n","<template>\n <div aria-live=\"assertive\" class=\"z-60 pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:p-6\">\n <div class=\"flex w-full flex-col items-end space-y-4\">\n <component\n :is=\"snackbar.component\"\n v-for=\"snackbar of $ui.snackbars\"\n :id=\"snackbar.id\"\n :key=\"snackbar.id\"\n v-bind=\"snackbar.properties\"\n />\n </div>\n </div>\n</template>\n","<template>\n <div\n id=\"aerogel-overlays-backdrop\"\n ref=\"$backdrop\"\n class=\"pointer-events-none fixed inset-0 z-50 bg-black/30 opacity-0\"\n />\n <AGAppModals />\n <AGAppSnackbars />\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue';\n\nimport { useEvent } from '@/utils/composition/events';\n\nimport AGAppModals from './AGAppModals.vue';\nimport AGAppSnackbars from './AGAppSnackbars.vue';\n\nconst $backdrop = ref<HTMLElement | null>(null);\nconst backdropHidden = ref(true);\n\nuseEvent('show-overlays-backdrop', async () => {\n if (!$backdrop.value || !backdropHidden.value) {\n return;\n }\n\n backdropHidden.value = false;\n\n $backdrop.value.classList.remove('opacity-0');\n});\n\nuseEvent('hide-overlays-backdrop', async () => {\n if (!$backdrop.value || backdropHidden.value) {\n return;\n }\n\n backdropHidden.value = true;\n\n $backdrop.value.classList.add('opacity-0');\n});\n</script>\n","<template>\n <AGHeadlessInput\n ref=\"$input\"\n :name=\"name\"\n class=\"flex\"\n @update:model-value=\"$emit('update:modelValue', $event)\"\n >\n <AGHeadlessInputInput\n v-bind=\"$attrs\"\n type=\"checkbox\"\n :class=\"{\n 'text-indigo-600 focus:ring-indigo-600': !$input?.errors,\n 'border-red-200 text-red-600 focus:ring-red-600': $input?.errors,\n }\"\n />\n\n <div class=\"ml-2\">\n <AGHeadlessInputLabel v-if=\"$slots.default\">\n <slot />\n </AGHeadlessInputLabel>\n <AGHeadlessInputError class=\"text-sm text-red-600\" />\n </div>\n </AGHeadlessInput>\n</template>\n\n<script setup lang=\"ts\">\nimport { componentRef, stringProp } from '@/utils/vue';\n\nimport type { IAGHeadlessInput } from '@/components/headless/forms/AGHeadlessInput';\n\nimport AGHeadlessInput from '../headless/forms/AGHeadlessInput.vue';\nimport AGHeadlessInputError from '../headless/forms/AGHeadlessInputError.vue';\nimport AGHeadlessInputInput from '../headless/forms/AGHeadlessInputInput.vue';\nimport AGHeadlessInputLabel from '../headless/forms/AGHeadlessInputLabel.vue';\n\ndefineProps({ name: stringProp() });\ndefineOptions({ inheritAttrs: false });\ndefineEmits(['update:modelValue']);\n\nconst $input = componentRef<IAGHeadlessInput>();\n</script>\n","import type { ComputedRef, DeepReadonly, ExtractPropTypes, Ref } from 'vue';\nimport type { Writable } from '@noeldemartin/utils';\n\nimport { mixedProp, requiredArrayProp, stringProp } from '@/utils/vue';\nimport { extractComponentProps } from '@/components/utils';\nimport type { FormFieldValue } from '@/forms/Form';\n\nexport interface IAGHeadlessSelect {\n id: string;\n label: ComputedRef<string | null>;\n noSelectionText: ComputedRef<string>;\n buttonText: ComputedRef<string>;\n renderText: ComputedRef<(value: FormFieldValue) => string>;\n selectedOption: ComputedRef<FormFieldValue | null>;\n options: ComputedRef<FormFieldValue[]>;\n errors: DeepReadonly<Ref<string[] | null>>;\n update(value: FormFieldValue): void;\n}\n\nexport const selectProps = {\n name: stringProp(),\n label: stringProp(),\n options: requiredArrayProp<FormFieldValue>(),\n noSelectionText: stringProp(),\n optionsText: mixedProp<string | ((option: FormFieldValue) => string)>(),\n};\n\nexport const selectEmits = ['update:modelValue'] as const;\n\nexport function useSelectProps(): typeof selectProps {\n return selectProps;\n}\n\nexport function useSelectEmits(): Writable<typeof selectEmits> {\n return [...selectEmits];\n}\n\nexport function extractSelectProps<T extends ExtractPropTypes<typeof selectProps>>(\n props: T,\n): Pick<T, keyof typeof selectProps> {\n return extractComponentProps(props, selectProps);\n}\n","<template>\n <Listbox\n v-slot=\"{ value, open, disabled }: ComponentProps\"\n :model-value=\"selectedOption\"\n @update:model-value=\"update($event)\"\n >\n <slot :value=\"value\" :open=\"open\" :disabled=\"disabled\" />\n </Listbox>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, inject, provide } from 'vue';\nimport { toString, uuid } from '@noeldemartin/utils';\nimport { Listbox } from '@headlessui/vue';\n\nimport { mixedProp } from '@/utils/vue';\nimport { translateWithDefault } from '@/lang/utils';\nimport type Form from '@/forms/Form';\nimport type { FormFieldValue } from '@/forms/Form';\nimport type { ComponentProps } from '@/utils/vue';\n\nimport { useSelectEmits, useSelectProps } from './AGHeadlessSelect';\nimport type { IAGHeadlessSelect } from './AGHeadlessSelect';\n\nconst emit = defineEmits(useSelectEmits());\nconst props = defineProps({\n modelValue: mixedProp<FormFieldValue>(),\n ...useSelectProps(),\n});\nconst renderText = computed(() => {\n if (typeof props.optionsText === 'function') {\n return props.optionsText;\n }\n\n if (typeof props.optionsText === 'string') {\n return (option: FormFieldValue): string => toString(option[props.optionsText as keyof FormFieldValue]);\n }\n\n return (option: FormFieldValue) => toString(option);\n});\nconst form = inject<Form | null>('form', null);\nconst noSelectionText = computed(() => props.noSelectionText ?? translateWithDefault('select.noSelection', '-'));\nconst selectedOption = computed(() => (form && props.name ? form.getFieldValue(props.name) : props.modelValue));\nconst errors = computed(() => {\n if (!form || !props.name) {\n return null;\n }\n\n return form.errors[props.name] ?? null;\n});\n\nfunction update(value: FormFieldValue) {\n if (form && props.name) {\n form.setFieldValue(props.name, value);\n\n return;\n }\n\n emit('update:modelValue', value);\n}\n\nconst api: IAGHeadlessSelect = {\n id: `select-${uuid()}`,\n noSelectionText,\n selectedOption,\n errors,\n options: computed(() => props.options),\n label: computed(() => props.label),\n buttonText: computed(() =>\n selectedOption.value === null ? noSelectionText.value : renderText.value(selectedOption.value)),\n renderText,\n update,\n};\n\nprovide<IAGHeadlessSelect>('select', api);\ndefineExpose<IAGHeadlessSelect>(api);\n</script>\n","<template>\n <ListboxButton v-slot=\"{ value, open, disabled }: ComponentProps\">\n <slot :value=\"value\" :open=\"open\" :disabled=\"disabled\">\n <span :class=\"textClass\">{{ select?.buttonText }}</span>\n </slot>\n <slot name=\"icon\" />\n </ListboxButton>\n</template>\n\n<script setup lang=\"ts\">\nimport { ListboxButton } from '@headlessui/vue';\n\nimport { injectReactiveOrFail, stringProp } from '@/utils/vue';\nimport type { ComponentProps } from '@/utils/vue';\n\nimport type { IAGHeadlessSelect } from './AGHeadlessSelect';\n\ndefineProps({ textClass: stringProp() });\n\nconst select = injectReactiveOrFail<IAGHeadlessSelect>(\n 'select',\n '<AGHeadlessSelectButton> must be a child of a <AGHeadlessSelect>',\n);\n</script>\n","<template>\n <p v-if=\"errorMessage\" :id=\"`${select.id}-error`\">\n {{ errorMessage }}\n </p>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nimport { injectReactiveOrFail } from '@/utils/vue';\nimport { translateWithDefault } from '@/lang/utils';\n\nimport type { IAGHeadlessSelect } from './AGHeadlessSelect';\n\nconst select = injectReactiveOrFail<IAGHeadlessSelect>(\n 'select',\n '<AGHeadlessSelectError> must be a child of a <AGHeadlessSelect>',\n);\nconst errorMessage = computed(() => {\n if (!select.errors) {\n return null;\n }\n\n return translateWithDefault(`errors.${select.errors[0]}`, `Error: ${select.errors[0]}`);\n});\n</script>\n","<template>\n <ListboxLabel v-if=\"show\" v-slot=\"{ open, disabled }: ComponentProps\">\n <slot :open=\"open\" :disabled=\"disabled\">\n {{ select.label }}\n </slot>\n </ListboxLabel>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue';\nimport { ListboxLabel } from '@headlessui/vue';\n\nimport { injectReactiveOrFail } from '@/utils/vue';\nimport type { ComponentProps } from '@/utils/vue';\n\nimport type { IAGHeadlessSelect } from './AGHeadlessSelect';\n\nconst select = injectReactiveOrFail<IAGHeadlessSelect>(\n 'select',\n '<AGHeadlessSelectLabel> must be a child of a <AGHeadlessSelect>',\n);\nconst slots = useSlots();\nconst show = computed(() => !!(select.label || slots.default));\n</script>\n","<template>\n <ListboxOption v-slot=\"{ active, selected, disabled }: ComponentProps\" :value=\"value\" as=\"template\">\n <slot :active=\"active\" :selected=\"selected\" :disabled=\"disabled\">\n <li\n :class=\"{\n [activeClass ?? 'active']: active,\n [inactiveClass ?? 'inactive']: !active,\n [selectedClass ?? 'selected']: selected,\n [unselectedClass ?? 'unselected']: !selected,\n }\"\n >\n {{ select.renderText(value) }}\n </li>\n </slot>\n </ListboxOption>\n</template>\n\n<script setup lang=\"ts\">\nimport { ListboxOption } from '@headlessui/vue';\n\nimport { injectReactiveOrFail, requiredMixedProp, stringProp } from '@/utils/vue';\nimport type { ComponentProps } from '@/utils/vue';\nimport type { FormFieldValue } from '@/forms/Form';\n\nimport type { IAGHeadlessSelect } from './AGHeadlessSelect';\n\ndefineProps({\n value: requiredMixedProp<FormFieldValue>(),\n selectedClass: stringProp(),\n unselectedClass: stringProp(),\n activeClass: stringProp(),\n inactiveClass: stringProp(),\n});\n\nconst select = injectReactiveOrFail<IAGHeadlessSelect>(\n 'select',\n '<AGHeadlessSelectOption> must be a child of a <AGHeadlessSelect>',\n);\n</script>\n","<template>\n <AGHeadlessSelect\n v-bind=\"props\"\n ref=\"$select\"\n as=\"div\"\n @update:model-value=\"$emit('update:modelValue', $event)\"\n >\n <AGHeadlessSelectLabel class=\"block text-sm font-medium leading-6 text-gray-900\" />\n <div class=\"relative\" :class=\"{ 'mt-2': $select?.label }\">\n <AGHeadlessSelectButton\n class=\"relative w-full cursor-default bg-white py-1.5 pl-3 pr-10 text-left text-gray-900 ring-1 ring-inset ring-gray-300 focus:outline-none focus:ring-2 focus:ring-indigo-600\"\n text-class=\"block truncate\"\n :class=\"{\n 'ring-1 ring-red-500': $select?.errors,\n }\"\n >\n <template #icon>\n <span class=\"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2\">\n <IconCheveronDown class=\"h-5 w-5 text-gray-400\" />\n </span>\n </template>\n </AGHeadlessSelectButton>\n <AGHeadlessSelectOptions\n class=\"absolute z-10 mt-1 max-h-60 w-full overflow-auto border bg-white py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none\"\n >\n <AGHeadlessSelectOption\n v-for=\"(option, index) in $select?.options ?? []\"\n :key=\"index\"\n :value=\"option\"\n class=\"relative block cursor-default select-none truncate py-2 pl-3 pr-9\"\n selected-class=\"font-semibold\"\n unselected-class=\"font-normal\"\n active-class=\"bg-indigo-600 text-white\"\n inactive-class=\"text-gray-900\"\n />\n </AGHeadlessSelectOptions>\n </div>\n <AGHeadlessSelectError class=\"mt-2 text-sm text-red-600\" />\n </AGHeadlessSelect>\n</template>\n\n<script setup lang=\"ts\">\nimport IconCheveronDown from '~icons/zondicons/cheveron-down';\n\nimport { componentRef } from '@/utils/vue';\nimport { useSelectEmits, useSelectProps } from '@/components/headless/forms/AGHeadlessSelect';\nimport type { IAGHeadlessSelect } from '@/components/headless/forms/AGHeadlessSelect';\n\nimport AGHeadlessSelect from '../headless/forms/AGHeadlessSelect.vue';\nimport AGHeadlessSelectButton from '../headless/forms/AGHeadlessSelectButton.vue';\nimport AGHeadlessSelectError from '../headless/forms/AGHeadlessSelectError.vue';\nimport AGHeadlessSelectLabel from '../headless/forms/AGHeadlessSelectLabel.vue';\nimport AGHeadlessSelectOption from '../headless/forms/AGHeadlessSelectOption.vue';\nimport AGHeadlessSelectOptions from '../headless/forms/AGHeadlessSelectOptions';\n\ndefineEmits(useSelectEmits());\n\nconst props = defineProps(useSelectProps());\nconst $select = componentRef<IAGHeadlessSelect>();\n</script>\n","<template>\n <AGMarkdown :text=\"message\" inline />\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\n\nimport Errors from '@/errors/Errors';\nimport { requiredObjectProp } from '@/utils/vue';\nimport type { ErrorSource } from '@/errors/Errors.state';\n\nimport AGMarkdown from './AGMarkdown.vue';\n\nconst props = defineProps({ error: requiredObjectProp<ErrorSource>() });\nconst message = computed(() => Errors.getErrorMessage(props.error));\n</script>\n","<template>\n <component :is=\"as\" v-measure=\"() => (measured = true)\" :class=\"{ '!invisible !absolute !w-auto': !measured }\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue';\n\nimport { stringProp } from '@/utils/vue';\n\ndefineProps({ as: stringProp('span') });\n\nconst measured = ref(false);\n</script>\n"],"names":["ServiceBootError","JSError","constructor","serviceNamespace","cause","super","_store","initializePiniaStore","createPinia","setActivePinia","defineServiceState","options","_class","_defineProperty","Service","usesStore","getName","name","getInitialState","initialState","getComputedStateDefinition","computed","serializePersistedState","state","serialize","persist","MagicObject","this","getters","_name","_booted","PromisedValue","_computedStateKeys","Set","Object","keys","defineStore","booted","launch","handleError","error","reject","frameworkBoot","then","boot","resolve","catch","hasState","property","$state","has","getState","store","undefined","setState","stateOrProperty","value","assign","onStateUpdated","__get","__set","persisted","objectOnly","isEmpty","storage","Storage","get","set","objectDeepClone","initializePersistedState","require","EventsService","arguments","emit","event","payload","listeners","Promise","all","map","listener","on","arr","push","off","once","onceListener","tap","eventListeners","remove","Events","facade","Service$2","plugins","environment","Aerogel","sourceUrl","development","testing","AppService","isReady","ready","isResolved","isMounted","mounted","reload","queryParameters","updateLocationQueryParameters","location","forever","plugin","App","definePlugin","async","installPlugins","_len","length","args","Array","_key","reduce","pluginsMap","install","arrayProp","defaultValue","type","default","booleanProp","Boolean","componentRef","ref","computedAsync","getter","result","asyncValue","watch","immediate","defineDirective","directive","enumProp","enumeration","values","String","validator","includes","injectReactive","key","inject","reactive","injectReactiveOrFail","errorMessage","fail","injectOrFail","mixedProp","numberProp","Number","objectProp","requiredArrayProp","required","requiredEnumProp","requiredMixedProp","requiredNumberProp","requiredObjectProp","requiredStringProp","stringProp","builtInDirectives","element","_ref","focus","measure","sizes","getBoundingClientRect","style","setProperty","width","height","directives","app","entries","defaultServices","$app","$events","bootServices","services","service","config","errorHandler","globalProperties","window","services$3","use","Service$1","modals","snackbars","UIComponents","AlertModal","ConfirmModal","ErrorReportModal","LoadingModal","PromptModal","Snackbar","StartupCrash","UIService","requireComponent","components","alert","messageOrTitle","message","openModal","title","confirm","messageOrOptions","modal","beforeClose","prompt","loading","messageOrOperation","operation","after","seconds","closeModal","id","showSnackbar","snackbar","uuid","properties","component","markRaw","concat","setTimeout","hideSnackbar","filter","registerComponent","callbacks","willClose","afterClose","closed","activeModal","at","modalCallbacks","nextTick","watchModalEvents","watchMountedEvent","_ref2","m","splash","document","getElementById","getComputedStyle","opacity","ms","UI","Lang","provider","translate","console","warn","setProvider","parameters","translateWithDefault","defaultMessageOrParameters","defaultMessage","renderedMessage","replace","RegExp","toString","bind","logs","startupErrors","hasErrors","hasNewErrors","some","seen","hasStartupErrors","_ref3","Colors","Primary","Secondary","Danger","Clear","Errors","enable","enabled","disable","inspect","reports","isArray","createErrorReport","report","logError","startupError","createStartupErrorReport","log","date","Date","color","actions","text","dismiss","handler","see","seeAll","getErrorMessage","Error","isObject","createErrorReportFromError","objectWithoutEmpty","description","defaults","details","stack","$errors","setUpErrorHandler","baseHandler","instance","frameworkHandler","globalThis","onerror","_","__","___","onunhandledrejection","reason","errors","$lang","lang","$t","$td","useEvent","unsubscribe","onUnmounted","useInputAttrs","attrs","useAttrs","className","class","objectWithout","onCleanMounted","cleanUp","noop","onMounted","removeInteractiveClasses","classes","split","test","join","trim","extractComponentProps","definitions","extracted","prop","modalProps","cancellable","useModalProps","extractModalProps","props","useModalExpose","$modal","close","__props","$root","hidden","hide","$el","show","__expose","toRef","provide","childIndex","childModal","renderMarkdown","markdown","html","marked","mangle","headerIds","renderer","Renderer","link","href","prototype","apply","DOMPurify","sanitize","ADD_ATTR","langKey","langParams","renderedHtml","inline","root","h","as","innerHTML","alertModalProps","useAlertModalProps","confirmModalProps","acceptText","cancelText","useConfirmModalProps","useConfirmModal","renderedAcceptText","renderedCancelText","url","route","routeParams","routeQuery","submit","tag","to","params","query","target","colorClasses","errorReportModalProps","useErrorReportModalProps","useErrorReportModal","activeReportIndex","previousReportText","nextReportText","summary","githubReportUrl","issueTitle","encodeURIComponent","issueBody","stringExcerpt","buttons","iconComponent","IconCopy","navigator","clipboard","writeText","IconConsole","reportButtons","IconGitHub","totalReports","currentReport","loadingModalProps","useLoadingModalProps","useLoadingModal","promptModalProps","label","placeholder","usePromptModalProps","usePromptModal","__emit","form","inputProps","useInputProps","extractInputProps","api","getFieldValue","modelValue","readonly","update","setFieldValue","input","$input","checked","slots","useSlots","FormFieldTypes","validForms","WeakMap","Form","fields","_fields","_submitted","_data","getInitialData","_errors","getInitialErrors","valid","submitted","field","validate","formErrors","definition","getFieldErrors","resetErrors","reset","keepData","resetData","keepErrors","rules","static","isConjuring","data","formData","forEach","useForm","booleanInput","requiredBooleanInput","requiredNumberInput","requiredStringInput","numberInput","stringInput","draft","SnackbarColors","snackbarProps","useSnackbarProps","useSnackbar","activate","action","styleClasses","$ui","ui","defaultComponents","AGAlertModal","AGConfirmModal","AGErrorReportModal","AGLoadingModal","AGPromptModal","AGSnackbar","AGStartupCrash","bootstrapApplication","bootstrap","rootComponent","createApp","mount","_container","classList","_hoisted_2","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_Fragment","_renderList","_ctx","_createBlock","_resolveDynamicComponent","_mergeProps","$backdrop","backdropHidden","add","selectProps","noSelectionText","optionsText","selectEmits","useSelectProps","useSelectEmits","extractSelectProps","renderText","option","selectedOption","buttonText","select","$select","measured"],"mappings":"o6FAEqB,MAAAA,yBAAyBC,EAE1CC,WAAAA,CAAYC,EAA0BC,GAClCC,kBAAkBF,oBAAoC,CAAEC,SAC5D,ECHJ,IAAIE,GAAuB,KAE3B,SAASC,KAOL,OANKD,KACDA,GAASE,KAETC,GAAeH,KAGZA,EACX,CCQM,SAAUI,GAGdC,GAMD,IAAAC,EAGG,OA0BoGC,EA1BpGD,EAAO,cAAcE,GAIPC,SAAAA,GACN,OAAO,CACX,CAEUC,OAAAA,GACN,OAAOL,EAAQM,MAAQ,IAC3B,CAEUC,eAAAA,GACN,OAAOP,EAAQQ,YACnB,CAEUC,0BA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