@acorex-platform/framework-client 0.0.18 → 0.0.21
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.
- package/fesm2022/acorex-platform-framework-client-auth.mjs +872 -314
- package/fesm2022/acorex-platform-framework-client-auth.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-common-common-settings.provider-Euotv9l0.mjs → acorex-platform-framework-client-common-common-settings.provider-CLm2BVk-.mjs} +88 -5
- package/fesm2022/acorex-platform-framework-client-common-common-settings.provider-CLm2BVk-.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-common.mjs +2666 -693
- package/fesm2022/acorex-platform-framework-client-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-core.mjs +685 -721
- package/fesm2022/acorex-platform-framework-client-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-domain.mjs +16 -16
- package/fesm2022/acorex-platform-framework-client-layout-builder.mjs +124 -72
- package/fesm2022/acorex-platform-framework-client-layout-builder.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-CjnQ9hAJ.mjs → acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-oE8CeLE8.mjs} +8 -6
- package/fesm2022/{acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-CjnQ9hAJ.mjs.map → acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-oE8CeLE8.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-components-file-provider-picker.popup.component-fFen8w8M.mjs → acorex-platform-framework-client-layout-components-file-provider-picker.popup.component-BtLEUWAA.mjs} +4 -4
- package/fesm2022/{acorex-platform-framework-client-layout-components-file-provider-picker.popup.component-fFen8w8M.mjs.map → acorex-platform-framework-client-layout-components-file-provider-picker.popup.component-BtLEUWAA.mjs.map} +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-components.mjs +2988 -857
- package/fesm2022/acorex-platform-framework-client-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-designer.mjs +277 -185
- package/fesm2022/acorex-platform-framework-client-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-entity-acorex-platform-framework-client-layout-entity-BXOMs6oD.mjs +29184 -0
- package/fesm2022/acorex-platform-framework-client-layout-entity-acorex-platform-framework-client-layout-entity-BXOMs6oD.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-layout-entity-attachments-page.component-BzUM-JMC.mjs → acorex-platform-framework-client-layout-entity-attachments-page.component-DCK-qb-F.mjs} +34 -20
- package/fesm2022/acorex-platform-framework-client-layout-entity-attachments-page.component-DCK-qb-F.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-layout-entity-bulk-entity.command-Cs3agnpF.mjs +162 -0
- package/fesm2022/acorex-platform-framework-client-layout-entity-bulk-entity.command-Cs3agnpF.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-layout-entity-file-list-popup.component-Ci_CTFtq.mjs → acorex-platform-framework-client-layout-entity-file-list-popup.component-p0hxDb0W.mjs} +31 -19
- package/fesm2022/acorex-platform-framework-client-layout-entity-file-list-popup.component-p0hxDb0W.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-layout-entity-gallery-page.component-DmiB__JR.mjs → acorex-platform-framework-client-layout-entity-gallery-page.component-DYV9YPyw.mjs} +30 -18
- package/fesm2022/acorex-platform-framework-client-layout-entity-gallery-page.component-DYV9YPyw.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-layout-entity.mjs +2 -27090
- package/fesm2022/acorex-platform-framework-client-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-views.mjs +382 -154
- package/fesm2022/acorex-platform-framework-client-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-widget-core.mjs +646 -280
- package/fesm2022/acorex-platform-framework-client-layout-widget-core.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-button-widget-designer.component-CIwpAXbL.mjs → acorex-platform-framework-client-layout-widgets-button-widget-designer.component-BiWerYcu.mjs} +16 -10
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-button-widget-designer.component-CIwpAXbL.mjs.map → acorex-platform-framework-client-layout-widgets-button-widget-designer.component-BiWerYcu.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-image-preview.popup-CazpERbX.mjs → acorex-platform-framework-client-layout-widgets-image-preview.popup-BOrrMm3U.mjs} +9 -8
- package/fesm2022/acorex-platform-framework-client-layout-widgets-image-preview.popup-BOrrMm3U.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-page-widget-designer.component-DKkJi40s.mjs → acorex-platform-framework-client-layout-widgets-page-widget-designer.component-WzIiwnGC.mjs} +20 -12
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-page-widget-designer.component-DKkJi40s.mjs.map → acorex-platform-framework-client-layout-widgets-page-widget-designer.component-WzIiwnGC.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-DtYZfA79.mjs → acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-3CO4xJB3.mjs} +32 -18
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-DtYZfA79.mjs.map → acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-3CO4xJB3.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-nMUtxAyy.mjs → acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-CRST84ou.mjs} +8 -7
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-nMUtxAyy.mjs.map → acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-CRST84ou.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-DvUSZ4hJ.mjs → acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-FjtSRxIX.mjs} +4 -4
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-DvUSZ4hJ.mjs.map → acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-FjtSRxIX.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-BihIfkZW.mjs → acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-D6HFPmGC.mjs} +10 -8
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-BihIfkZW.mjs.map → acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-D6HFPmGC.mjs.map} +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-widgets.mjs +4868 -2548
- package/fesm2022/acorex-platform-framework-client-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-native.mjs +7 -7
- package/fesm2022/acorex-platform-framework-client-realtime-set-presence-availability.command-CetlUjnM.mjs +29 -0
- package/fesm2022/acorex-platform-framework-client-realtime-set-presence-availability.command-CetlUjnM.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-realtime.mjs +463 -26
- package/fesm2022/acorex-platform-framework-client-realtime.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-runtime.mjs +300 -137
- package/fesm2022/acorex-platform-framework-client-runtime.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-create-view.component-QIFX11dh.mjs → acorex-platform-framework-client-themes-default-entity-master-create-view.component-yeftgJ_K.mjs} +10 -7
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-create-view.component-QIFX11dh.mjs.map → acorex-platform-framework-client-themes-default-entity-master-create-view.component-yeftgJ_K.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-modify-view.component-BBdellyL.mjs → acorex-platform-framework-client-themes-default-entity-master-modify-view.component-DWE3OWGm.mjs} +10 -7
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-modify-view.component-BBdellyL.mjs.map → acorex-platform-framework-client-themes-default-entity-master-modify-view.component-DWE3OWGm.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-single-view.component-CIf1VWNW.mjs → acorex-platform-framework-client-themes-default-entity-master-single-view.component-C2Abf7Lb.mjs} +21 -19
- package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-single-view.component-C2Abf7Lb.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-themes-default-error-401.component-C_czT_JC.mjs → acorex-platform-framework-client-themes-default-error-401.component-BrTotLx1.mjs} +5 -5
- package/fesm2022/{acorex-platform-framework-client-themes-default-error-401.component-C_czT_JC.mjs.map → acorex-platform-framework-client-themes-default-error-401.component-BrTotLx1.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-default-error-404.component-C2Wu0YtF.mjs → acorex-platform-framework-client-themes-default-error-404.component-DsC7_s59.mjs} +5 -5
- package/fesm2022/{acorex-platform-framework-client-themes-default-error-404.component-C2Wu0YtF.mjs.map → acorex-platform-framework-client-themes-default-error-404.component-DsC7_s59.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-default-error-offline.component-DRz-kVsT.mjs → acorex-platform-framework-client-themes-default-error-offline.component-CngiQycG.mjs} +6 -6
- package/fesm2022/acorex-platform-framework-client-themes-default-error-offline.component-CngiQycG.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-themes-default.mjs +421 -265
- package/fesm2022/acorex-platform-framework-client-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-shared-icon-chooser-column.component-Ci_oH7NE.mjs → acorex-platform-framework-client-themes-shared-icon-chooser-column.component-CbZALjB5.mjs} +8 -6
- package/fesm2022/{acorex-platform-framework-client-themes-shared-icon-chooser-column.component-Ci_oH7NE.mjs.map → acorex-platform-framework-client-themes-shared-icon-chooser-column.component-CbZALjB5.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-shared-icon-chooser-view.component-Lb1G2Xz7.mjs → acorex-platform-framework-client-themes-shared-icon-chooser-view.component-BRrNT6x2.mjs} +8 -6
- package/fesm2022/{acorex-platform-framework-client-themes-shared-icon-chooser-view.component-Lb1G2Xz7.mjs.map → acorex-platform-framework-client-themes-shared-icon-chooser-view.component-BRrNT6x2.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-shared-theme-color-chooser-column.component-D4ubvFYf.mjs → acorex-platform-framework-client-themes-shared-theme-color-chooser-column.component-BIsQTr6B.mjs} +4 -4
- package/fesm2022/{acorex-platform-framework-client-themes-shared-theme-color-chooser-column.component-D4ubvFYf.mjs.map → acorex-platform-framework-client-themes-shared-theme-color-chooser-column.component-BIsQTr6B.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-shared-theme-color-chooser-view.component-Br8j_BF_.mjs → acorex-platform-framework-client-themes-shared-theme-color-chooser-view.component-ZclmSbt9.mjs} +16 -10
- package/fesm2022/{acorex-platform-framework-client-themes-shared-theme-color-chooser-view.component-Br8j_BF_.mjs.map → acorex-platform-framework-client-themes-shared-theme-color-chooser-view.component-ZclmSbt9.mjs.map} +1 -1
- package/fesm2022/acorex-platform-framework-client-themes-shared.mjs +538 -133
- package/fesm2022/acorex-platform-framework-client-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-workflow.mjs +26 -66
- package/fesm2022/acorex-platform-framework-client-workflow.mjs.map +1 -1
- package/package.json +10 -10
- package/realtime/README.md +16 -0
- package/runtime/README.md +14 -0
- package/types/acorex-platform-framework-client-auth.d.ts +291 -52
- package/types/acorex-platform-framework-client-common.d.ts +613 -87
- package/types/acorex-platform-framework-client-core.d.ts +213 -206
- package/types/acorex-platform-framework-client-layout-builder.d.ts +14 -8
- package/types/acorex-platform-framework-client-layout-components.d.ts +392 -28
- package/types/acorex-platform-framework-client-layout-entity.d.ts +667 -417
- package/types/acorex-platform-framework-client-layout-views.d.ts +31 -11
- package/types/acorex-platform-framework-client-layout-widget-core.d.ts +66 -17
- package/types/acorex-platform-framework-client-layout-widgets.d.ts +294 -67
- package/types/acorex-platform-framework-client-realtime.d.ts +183 -6
- package/types/acorex-platform-framework-client-runtime.d.ts +134 -28
- package/types/acorex-platform-framework-client-themes-default.d.ts +9 -1
- package/types/acorex-platform-framework-client-themes-shared.d.ts +8 -2
- package/types/acorex-platform-framework-client-workflow.d.ts +11 -35
- package/fesm2022/acorex-platform-framework-client-common-common-settings.provider-Euotv9l0.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-entity-attachments-page.component-BzUM-JMC.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-entity-file-list-popup.component-Ci_CTFtq.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-entity-gallery-page.component-DmiB__JR.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-widgets-image-preview.popup-CazpERbX.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-themes-default-entity-master-single-view.component-CIf1VWNW.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-themes-default-error-offline.component-DRz-kVsT.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-framework-client-realtime.mjs","sources":["../../../../../libs/framework/client/realtime/src/lib/realtime.types.ts","../../../../../libs/framework/client/realtime/src/lib/realtime.topics.ts","../../../../../libs/framework/client/realtime/src/lib/realtime-url.util.ts","../../../../../libs/framework/client/realtime/src/lib/tokens.ts","../../../../../libs/framework/client/realtime/src/lib/realtime-dispatcher.service.ts","../../../../../libs/framework/client/realtime/src/lib/realtime-connection.service.ts","../../../../../libs/framework/client/realtime/src/lib/realtime.providers.ts","../../../../../libs/framework/client/realtime/src/acorex-platform-framework-client-realtime.ts"],"sourcesContent":["//#region ---- Client realtime types ----\n\nexport interface AXPRealtimeAudience {\n userIds?: string[];\n // TODO(realtime): See server realtime.types.ts — generic refType/refId scopes.\n conversationId?: string;\n /** When true, deliver to all connected users in the envelope tenant. */\n tenant?: boolean;\n}\n\nexport interface AXPRealtimeEnvelope {\n topic: string;\n tenantId: string;\n audience: AXPRealtimeAudience;\n payload: unknown;\n correlationId?: string;\n emittedAt: string;\n}\n\nexport interface AXPRealtimeInboxRefreshPayload {\n deliveryId?: string;\n}\n\nexport interface AXPRealtimeConversationMessagePayload {\n conversationId: string;\n messageId: string;\n op: 'created' | 'updated' | 'deleted';\n}\n\nexport interface AXPRealtimeEntityMutationPayload {\n entityName: string;\n operation: 'created' | 'updated' | 'deleted';\n id?: string;\n}\n\nexport interface AXPRealtimeConfig {\n /**\n * Socket.IO namespace URL, e.g. `http://localhost:5500/realtime`.\n * Derived from API baseUrl when omitted (strip trailing `/api`).\n */\n url?: string;\n /** When false, connection is not started automatically. Default true. */\n autoConnect?: boolean;\n}\n\nexport type AXPRealtimeTopicHandler = (envelope: AXPRealtimeEnvelope) => void | Promise<void>;\n\nexport interface AXPRealtimeTopicHandlerRegistration {\n topic: string;\n handle: AXPRealtimeTopicHandler;\n}\n\n//#endregion\n","//#region ---- Client topic constants (mirror server) ----\n\nexport const AXP_REALTIME_TOPIC_INBOX_REFRESH = 'inbox.refresh';\nexport const AXP_REALTIME_TOPIC_CONVERSATION_MESSAGE = 'conversation.message';\nexport const AXP_REALTIME_TOPIC_ENTITY_MUTATION = 'entity.mutation';\n\nexport const AXP_REALTIME_SOCKET_EVENT = 'realtime';\nexport const AXP_REALTIME_SUBSCRIBE_CONVERSATION = 'subscribe.conversation';\nexport const AXP_REALTIME_UNSUBSCRIBE_CONVERSATION = 'unsubscribe.conversation';\n\n//#endregion\n","//#region ---- Realtime URL helpers ----\n\n/**\n * Builds Socket.IO namespace URL from an HTTP API baseUrl (`…/api` → `…/realtime`).\n */\nexport function resolveRealtimeSocketUrl(apiBaseUrl: string): string {\n const trimmed = apiBaseUrl.trim().replace(/\\/+$/, '');\n const withoutApi = trimmed.endsWith('/api') ? trimmed.slice(0, -4) : trimmed;\n return `${withoutApi}/realtime`;\n}\n\n//#endregion\n","import { InjectionToken } from '@angular/core';\nimport type {\n AXPRealtimeConfig,\n AXPRealtimeTopicHandlerRegistration,\n} from './realtime.types';\n\n//#region ---- DI tokens ----\n\nexport const AXP_REALTIME_CONFIG = new InjectionToken<AXPRealtimeConfig>('AXP_REALTIME_CONFIG');\n\nexport const AXP_REALTIME_TOPIC_HANDLER = new InjectionToken<AXPRealtimeTopicHandlerRegistration>(\n 'AXP_REALTIME_TOPIC_HANDLER',\n);\n\n//#endregion\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport { AXP_REALTIME_TOPIC_HANDLER } from './tokens';\nimport type {\n AXPRealtimeEnvelope,\n AXPRealtimeTopicHandlerRegistration,\n} from './realtime.types';\n\n//#region ---- Topic dispatcher ----\n\n@Injectable()\nexport class AXPRealtimeDispatcherService {\n private readonly handlers = new Map<string, AXPRealtimeTopicHandlerRegistration[]>();\n\n constructor(\n @Optional()\n @Inject(AXP_REALTIME_TOPIC_HANDLER)\n registrations?: AXPRealtimeTopicHandlerRegistration[] | AXPRealtimeTopicHandlerRegistration,\n ) {\n const list = !registrations\n ? []\n : Array.isArray(registrations)\n ? registrations\n : [registrations];\n for (const registration of list) {\n this.register(registration);\n }\n }\n\n register(registration: AXPRealtimeTopicHandlerRegistration): void {\n const topic = registration.topic?.trim();\n if (!topic || typeof registration.handle !== 'function') {\n return;\n }\n const existing = this.handlers.get(topic) ?? [];\n existing.push(registration);\n this.handlers.set(topic, existing);\n }\n\n async dispatch(envelope: AXPRealtimeEnvelope): Promise<void> {\n const topic = envelope?.topic?.trim();\n if (!topic) {\n return;\n }\n const list = this.handlers.get(topic);\n if (!list?.length) {\n return;\n }\n for (const registration of list) {\n await registration.handle(envelope);\n }\n }\n}\n\n//#endregion\n","import { Inject, Injectable, OnDestroy, Optional, inject } from '@angular/core';\nimport { AXPSessionService, AXPSessionStatus } from '@acorex-platform/framework-client/auth';\nimport { io, type Socket } from 'socket.io-client';\nimport { BehaviorSubject, Subscription } from 'rxjs';\nimport { AXPRealtimeDispatcherService } from './realtime-dispatcher.service';\nimport {\n AXP_REALTIME_SOCKET_EVENT,\n AXP_REALTIME_SUBSCRIBE_CONVERSATION,\n AXP_REALTIME_UNSUBSCRIBE_CONVERSATION,\n} from './realtime.topics';\nimport type { AXPRealtimeConfig, AXPRealtimeEnvelope } from './realtime.types';\nimport { AXP_REALTIME_CONFIG } from './tokens';\n\n//#region ---- Connection service ----\n\n@Injectable()\nexport class AXPRealtimeConnectionService implements OnDestroy {\n private readonly session = inject(AXPSessionService);\n private readonly dispatcher = inject(AXPRealtimeDispatcherService);\n private socket: Socket | null = null;\n private statusSub: Subscription | null = null;\n private readonly joinedConversations = new Set<string>();\n private readonly connectionStatusSubject = new BehaviorSubject<\n 'connected' | 'connecting' | 'disconnected'\n >('disconnected');\n\n /** Latest Socket.IO connection state for feature modules (e.g. chat). */\n readonly connectionStatus$ = this.connectionStatusSubject.asObservable();\n\n constructor(\n @Optional()\n @Inject(AXP_REALTIME_CONFIG)\n private readonly config: AXPRealtimeConfig | null,\n ) {\n if (config?.autoConnect === false) {\n return;\n }\n this.statusSub = this.session.status$.subscribe((status) => {\n if (status === AXPSessionStatus.Authenticated || status === AXPSessionStatus.Authorized) {\n this.connect();\n } else {\n this.disconnect();\n }\n });\n }\n\n ngOnDestroy(): void {\n this.statusSub?.unsubscribe();\n this.disconnect();\n }\n\n connect(): void {\n const token = this.session.getToken()?.trim();\n const url = this.config?.url?.trim();\n if (!token || !url) {\n this.connectionStatusSubject.next('disconnected');\n return;\n }\n\n if (this.socket?.connected) {\n return;\n }\n\n // Avoid tearing down a socket that is still handshaking (duplicate connect calls).\n if (this.socket && !this.socket.connected) {\n return;\n }\n\n this.connectionStatusSubject.next('connecting');\n\n this.socket = io(url, {\n transports: ['websocket', 'polling'],\n auth: { token },\n autoConnect: true,\n reconnection: true,\n });\n\n this.socket.on(AXP_REALTIME_SOCKET_EVENT, (envelope: AXPRealtimeEnvelope) => {\n void this.dispatcher.dispatch(envelope);\n });\n\n this.socket.on('connect', () => {\n this.connectionStatusSubject.next('connected');\n for (const conversationId of this.joinedConversations) {\n this.socket?.emit(AXP_REALTIME_SUBSCRIBE_CONVERSATION, { conversationId });\n }\n });\n\n this.socket.on('disconnect', () => {\n this.connectionStatusSubject.next('disconnected');\n });\n\n this.socket.on('connect_error', () => {\n this.connectionStatusSubject.next('disconnected');\n });\n }\n\n disconnect(): void {\n if (this.socket) {\n this.socket.removeAllListeners();\n this.socket.disconnect();\n this.socket = null;\n }\n this.connectionStatusSubject.next('disconnected');\n }\n\n /** Re-auth with the latest access token (e.g. after refresh). */\n reconnectWithCurrentToken(): void {\n this.disconnect();\n this.connect();\n }\n\n /** Whether the underlying Socket.IO client is connected. */\n isSocketConnected(): boolean {\n return this.socket?.connected === true;\n }\n\n subscribeConversation(conversationId: string): void {\n const id = conversationId?.trim();\n if (!id) {\n return;\n }\n this.joinedConversations.add(id);\n this.socket?.emit(AXP_REALTIME_SUBSCRIBE_CONVERSATION, { conversationId: id });\n }\n\n unsubscribeConversation(conversationId: string): void {\n const id = conversationId?.trim();\n if (!id) {\n return;\n }\n this.joinedConversations.delete(id);\n this.socket?.emit(AXP_REALTIME_UNSUBSCRIBE_CONVERSATION, { conversationId: id });\n }\n}\n\n//#endregion\n","import {\n APP_INITIALIZER,\n inject,\n makeEnvironmentProviders,\n type EnvironmentProviders,\n} from '@angular/core';\nimport { AXPRealtimeConnectionService } from './realtime-connection.service';\nimport { AXPRealtimeDispatcherService } from './realtime-dispatcher.service';\nimport type { AXPRealtimeConfig } from './realtime.types';\nimport { resolveRealtimeSocketUrl } from './realtime-url.util';\nimport { AXP_REALTIME_CONFIG } from './tokens';\n\n//#region ---- provideRealtime ----\n\nexport function provideRealtime(\n config: AXPRealtimeConfig & { apiBaseUrl?: string } = {},\n): EnvironmentProviders {\n const url =\n config.url?.trim() ||\n (config.apiBaseUrl?.trim() ? resolveRealtimeSocketUrl(config.apiBaseUrl) : undefined);\n\n return makeEnvironmentProviders([\n {\n provide: AXP_REALTIME_CONFIG,\n useValue: {\n autoConnect: config.autoConnect !== false,\n url,\n } satisfies AXPRealtimeConfig,\n },\n AXPRealtimeDispatcherService,\n AXPRealtimeConnectionService,\n {\n provide: APP_INITIALIZER,\n multi: true,\n useFactory: () => {\n const connection = inject(AXPRealtimeConnectionService);\n return () => {\n // Connection lifecycle is owned by AXPRealtimeConnectionService (session.status$).\n // Eagerly invoke connect once so an already-authenticated session connects on bootstrap.\n connection.connect();\n };\n },\n },\n ]);\n}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AAoDA;;ACpDA;AAEO,MAAM,gCAAgC,GAAG;AACzC,MAAM,uCAAuC,GAAG;AAChD,MAAM,kCAAkC,GAAG;AAE3C,MAAM,yBAAyB,GAAG;AAClC,MAAM,mCAAmC,GAAG;AAC5C,MAAM,qCAAqC,GAAG;AAErD;;ACVA;AAEA;;AAEG;AACG,SAAU,wBAAwB,CAAC,UAAkB,EAAA;AACzD,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IACrD,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,OAAO;IAC5E,OAAO,CAAA,EAAG,UAAU,CAAA,SAAA,CAAW;AACjC;AAEA;;ACLA;MAEa,mBAAmB,GAAG,IAAI,cAAc,CAAoB,qBAAqB;MAEjF,0BAA0B,GAAG,IAAI,cAAc,CAC1D,4BAA4B;AAG9B;;ACPA;MAGa,4BAA4B,CAAA;AAGvC,IAAA,WAAA,CAGE,aAA2F,EAAA;AAL5E,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,GAAG,EAAiD;QAOlF,MAAM,IAAI,GAAG,C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s","sources":["../../../../../libs/framework/client/realtime/src/lib/realtime.types.ts","../../../../../libs/framework/client/realtime/src/lib/realtime.topics.ts","../../../../../libs/framework/client/realtime/src/lib/realtime-url.util.ts","../../../../../libs/framework/client/realtime/src/lib/tokens.ts","../../../../../libs/framework/client/realtime/src/lib/realtime-dispatcher.service.ts","../../../../../libs/framework/client/realtime/src/lib/realtime-connection.port.ts","../../../../../libs/framework/client/realtime/src/lib/realtime-connection.service.ts","../../../../../libs/framework/client/realtime/src/lib/presence-idle.constants.ts","../../../../../libs/framework/client/realtime/src/lib/presence/user-presence.util.ts","../../../../../libs/framework/client/realtime/src/lib/presence/user-presence.service.ts","../../../../../libs/framework/client/realtime/src/lib/presence/user-presence-idle.service.ts","../../../../../libs/framework/client/realtime/src/lib/realtime.providers.ts","../../../../../libs/framework/client/realtime/src/lib/presence/user-presence.types.ts","../../../../../libs/framework/client/realtime/src/lib/presence/user-presence-duration.util.ts","../../../../../libs/framework/client/realtime/src/acorex-platform-framework-client-realtime.ts"],"sourcesContent":["//#region ---- Client realtime types ----\n\nexport interface AXPRealtimeAudience {\n userIds?: string[];\n // TODO(realtime): See server realtime.types.ts — generic refType/refId scopes.\n conversationId?: string;\n /** When true, deliver to all connected users in the envelope tenant. */\n tenant?: boolean;\n}\n\nexport interface AXPRealtimeEnvelope {\n topic: string;\n tenantId: string;\n audience: AXPRealtimeAudience;\n payload: unknown;\n correlationId?: string;\n emittedAt: string;\n}\n\nexport interface AXPRealtimeInboxRefreshPayload {\n deliveryId?: string;\n deliveryIds?: string[];\n /** Optional hint so clients can apply deletes/archives without a fetch. */\n op?: 'created' | 'updated' | 'deleted' | 'archived';\n}\n\nexport interface AXPRealtimeConversationMessagePayload {\n conversationId: string;\n messageId: string;\n op: 'created' | 'updated' | 'deleted';\n /** Optional entity snapshot so clients can skip a follow-up GET. */\n message?: Record<string, unknown>;\n}\n\nexport interface AXPRealtimeConversationTypingPayload {\n conversationId: string;\n userId: string;\n userName?: string;\n active: boolean;\n}\n\nexport type AXPRealtimeConversationCallAction =\n | 'invite'\n | 'ring'\n | 'accept'\n | 'decline'\n | 'cancel'\n | 'end';\n\nexport type AXPRealtimeConversationCallMedia = 'voice' | 'video';\n\n/** Built-in realtime signaling for chat calls (media joins via RTC when configured). */\nexport interface AXPRealtimeConversationCallPayload {\n conversationId: string;\n action: AXPRealtimeConversationCallAction;\n media: AXPRealtimeConversationCallMedia;\n /** Caller / actor user id. */\n fromUserId: string;\n fromUserName?: string;\n /** Optional call correlation id shared across invite → accept. */\n callId?: string;\n}\n\nexport interface AXPRealtimeEntityMutationPayload {\n entityName: string;\n operation: 'created' | 'updated' | 'deleted';\n id?: string;\n /** True when the mutation originated from a server bulk command fan-out. */\n bulk?: boolean;\n /** Number of successfully mutated records in a bulk operation. */\n count?: number;\n bulkExecutionId?: string;\n}\n\nexport type AXPRealtimeUserPresenceStatus = 'online' | 'offline' | 'away' | 'busy';\nexport type AXPRealtimeUserPresenceSource = 'auto' | 'manual';\n\nexport interface AXPRealtimeUserPresencePayload {\n userId: string;\n status: AXPRealtimeUserPresenceStatus;\n lastSeen?: string;\n since?: string;\n source?: AXPRealtimeUserPresenceSource;\n}\n\nexport interface AXPRealtimeUserPresenceSnapshotItem {\n userId: string;\n status: AXPRealtimeUserPresenceStatus;\n lastSeen?: string;\n since?: string;\n source?: AXPRealtimeUserPresenceSource;\n}\n\nexport interface AXPRealtimePresenceSetResult {\n ok: boolean;\n reason?: string;\n item?: AXPRealtimeUserPresenceSnapshotItem;\n}\n\nexport interface AXPRealtimePresenceSubscribeResult {\n ok: boolean;\n reason?: string;\n items?: AXPRealtimeUserPresenceSnapshotItem[];\n}\n\nexport interface AXPRealtimeConfig {\n /**\n * Socket.IO namespace URL, e.g. `http://localhost:5500/realtime`.\n * Derived from API baseUrl when omitted (strip trailing `/api`).\n */\n url?: string;\n /** When false, connection is not started automatically. Default true. */\n autoConnect?: boolean;\n}\n\nexport type AXPRealtimeTopicHandler = (envelope: AXPRealtimeEnvelope) => void | Promise<void>;\n\nexport interface AXPRealtimeTopicHandlerRegistration {\n topic: string;\n handle: AXPRealtimeTopicHandler;\n}\n\n//#endregion\n","//#region ---- Client topic constants (mirror server) ----\n\nexport const AXP_REALTIME_TOPIC_INBOX_REFRESH = 'inbox.refresh';\nexport const AXP_REALTIME_TOPIC_CONVERSATION_MESSAGE = 'conversation.message';\nexport const AXP_REALTIME_TOPIC_CONVERSATION_TYPING = 'conversation.typing';\nexport const AXP_REALTIME_TOPIC_CONVERSATION_CALL = 'conversation.call';\nexport const AXP_REALTIME_TOPIC_ENTITY_MUTATION = 'entity.mutation';\nexport const AXP_REALTIME_TOPIC_USER_PRESENCE = 'user.presence';\n\nexport const AXP_REALTIME_SOCKET_EVENT = 'realtime';\nexport const AXP_REALTIME_SUBSCRIBE_CONVERSATION = 'subscribe.conversation';\nexport const AXP_REALTIME_UNSUBSCRIBE_CONVERSATION = 'unsubscribe.conversation';\nexport const AXP_REALTIME_SUBSCRIBE_PRESENCE = 'subscribe.presence';\nexport const AXP_REALTIME_UNSUBSCRIBE_PRESENCE = 'unsubscribe.presence';\nexport const AXP_REALTIME_PRESENCE_LEAVE = 'presence.leave';\nexport const AXP_REALTIME_PRESENCE_SET = 'presence.set';\nexport const AXP_REALTIME_EMIT_TYPING = 'conversation.typing.emit';\n\n//#endregion\n","//#region ---- Realtime URL helpers ----\n\n/**\n * Builds Socket.IO namespace URL from an HTTP API baseUrl (`…/api` → `…/realtime`).\n */\nexport function resolveRealtimeSocketUrl(apiBaseUrl: string): string {\n const trimmed = apiBaseUrl.trim().replace(/\\/+$/, '');\n const withoutApi = trimmed.endsWith('/api') ? trimmed.slice(0, -4) : trimmed;\n return `${withoutApi}/realtime`;\n}\n\n//#endregion\n","import { InjectionToken } from '@angular/core';\nimport type {\n AXPRealtimeConfig,\n AXPRealtimeTopicHandlerRegistration,\n} from './realtime.types';\n\n//#region ---- DI tokens ----\n\nexport const AXP_REALTIME_CONFIG = new InjectionToken<AXPRealtimeConfig>('AXP_REALTIME_CONFIG');\n\nexport const AXP_REALTIME_TOPIC_HANDLER = new InjectionToken<AXPRealtimeTopicHandlerRegistration>(\n 'AXP_REALTIME_TOPIC_HANDLER',\n);\n\n//#endregion\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport { AXP_REALTIME_TOPIC_HANDLER } from './tokens';\nimport type {\n AXPRealtimeEnvelope,\n AXPRealtimeTopicHandlerRegistration,\n} from './realtime.types';\n\n//#region ---- Topic dispatcher ----\n\n@Injectable()\nexport class AXPRealtimeDispatcherService {\n private readonly handlers = new Map<string, AXPRealtimeTopicHandlerRegistration[]>();\n\n constructor(\n @Optional()\n @Inject(AXP_REALTIME_TOPIC_HANDLER)\n registrations?: AXPRealtimeTopicHandlerRegistration[] | AXPRealtimeTopicHandlerRegistration,\n ) {\n const list = !registrations\n ? []\n : Array.isArray(registrations)\n ? registrations\n : [registrations];\n for (const registration of list) {\n this.register(registration);\n }\n }\n\n register(registration: AXPRealtimeTopicHandlerRegistration): void {\n const topic = registration.topic?.trim();\n if (!topic || typeof registration.handle !== 'function') {\n return;\n }\n const existing = this.handlers.get(topic) ?? [];\n existing.push(registration);\n this.handlers.set(topic, existing);\n }\n\n async dispatch(envelope: AXPRealtimeEnvelope): Promise<void> {\n const topic = envelope?.topic?.trim();\n if (!topic) {\n return;\n }\n const list = this.handlers.get(topic);\n if (!list?.length) {\n return;\n }\n for (const registration of list) {\n await registration.handle(envelope);\n }\n }\n}\n\n//#endregion\n","import type { Observable } from 'rxjs';\n\n//#region ---- Connection port ----\n\nexport type AXPRealtimeConnectionStatus = 'connected' | 'connecting' | 'disconnected';\n\n/**\n * Always-on realtime connection used by the app shell.\n * Built-in implementation uses Socket.IO; alternate backends may replace this port.\n */\nexport abstract class AXPRealtimeConnectionPort {\n abstract readonly connectionStatus$: Observable<AXPRealtimeConnectionStatus>;\n\n abstract connect(): void;\n abstract disconnect(): void;\n abstract reconnectWithCurrentToken(): void;\n abstract isSocketConnected(): boolean;\n abstract subscribeConversation(conversationId: string): void;\n abstract unsubscribeConversation(conversationId: string): void;\n abstract emitConversationTyping(conversationId: string, active: boolean): void;\n}\n\n//#endregion\n","import { Inject, Injectable, OnDestroy, Optional, inject } from '@angular/core';\nimport { AXPSessionService, AXPSessionStatus } from '@acorex-platform/framework-client/auth';\nimport { io, type Socket } from 'socket.io-client';\nimport { BehaviorSubject, Subscription } from 'rxjs';\nimport {\n AXPRealtimeConnectionPort,\n type AXPRealtimeConnectionStatus,\n} from './realtime-connection.port';\nimport { AXPRealtimeDispatcherService } from './realtime-dispatcher.service';\nimport {\n AXP_REALTIME_EMIT_TYPING,\n AXP_REALTIME_PRESENCE_LEAVE,\n AXP_REALTIME_PRESENCE_SET,\n AXP_REALTIME_SOCKET_EVENT,\n AXP_REALTIME_SUBSCRIBE_CONVERSATION,\n AXP_REALTIME_SUBSCRIBE_PRESENCE,\n AXP_REALTIME_UNSUBSCRIBE_CONVERSATION,\n AXP_REALTIME_UNSUBSCRIBE_PRESENCE,\n} from './realtime.topics';\nimport type {\n AXPRealtimeConfig,\n AXPRealtimeEnvelope,\n AXPRealtimePresenceSetResult,\n AXPRealtimePresenceSubscribeResult,\n AXPRealtimeUserPresenceSnapshotItem,\n} from './realtime.types';\nimport { AXP_REALTIME_CONFIG } from './tokens';\n\n//#region ---- Socket.IO connection (built-in) ----\n\n/**\n * Built-in always-on realtime connection via Socket.IO.\n */\n@Injectable()\nexport class AXPRealtimeConnectionService extends AXPRealtimeConnectionPort implements OnDestroy {\n private readonly session = inject(AXPSessionService);\n private readonly dispatcher = inject(AXPRealtimeDispatcherService);\n private socket: Socket | null = null;\n private statusSub: Subscription | null = null;\n private readonly joinedConversations = new Set<string>();\n private readonly connectionStatusSubject = new BehaviorSubject<AXPRealtimeConnectionStatus>(\n 'disconnected',\n );\n\n /** Latest Socket.IO connection state for feature modules (e.g. chat). */\n override readonly connectionStatus$ = this.connectionStatusSubject.asObservable();\n\n constructor(\n @Optional()\n @Inject(AXP_REALTIME_CONFIG)\n private readonly config: AXPRealtimeConfig | null,\n ) {\n super();\n if (config?.autoConnect === false) {\n return;\n }\n this.statusSub = this.session.status$.subscribe((status) => {\n if (status === AXPSessionStatus.Authorized) {\n this.connect();\n } else {\n void this.leaveAndDisconnect();\n }\n });\n }\n\n ngOnDestroy(): void {\n this.statusSub?.unsubscribe();\n this.disconnect();\n }\n\n /** Sign-out: tell the server to skip grace, then close the socket. */\n async leaveAndDisconnect(): Promise<void> {\n await this.leavePresence();\n this.disconnect();\n }\n\n connect(): void {\n const url = this.config?.url?.trim();\n if (!url || !this.session.hasSessionCredentials()) {\n this.connectionStatusSubject.next('disconnected');\n return;\n }\n\n if (this.socket?.connected) {\n return;\n }\n\n // Avoid tearing down a socket that is still handshaking (duplicate connect calls).\n if (this.socket && !this.socket.connected) {\n return;\n }\n\n this.connectionStatusSubject.next('connecting');\n\n // Auth uses HttpOnly access cookie (same-site / proxied); no token in JS.\n this.socket = io(url, {\n transports: ['websocket', 'polling'],\n withCredentials: true,\n autoConnect: true,\n reconnection: true,\n });\n\n this.socket.on(AXP_REALTIME_SOCKET_EVENT, (envelope: AXPRealtimeEnvelope) => {\n void this.dispatcher.dispatch(envelope);\n });\n\n this.socket.on('connect', () => {\n this.connectionStatusSubject.next('connected');\n for (const conversationId of this.joinedConversations) {\n this.socket?.emit(AXP_REALTIME_SUBSCRIBE_CONVERSATION, { conversationId });\n }\n });\n\n this.socket.on('disconnect', () => {\n this.connectionStatusSubject.next('disconnected');\n });\n\n this.socket.on('connect_error', () => {\n this.connectionStatusSubject.next('disconnected');\n });\n }\n\n override disconnect(): void {\n if (this.socket) {\n this.socket.removeAllListeners();\n this.socket.disconnect();\n this.socket = null;\n }\n this.connectionStatusSubject.next('disconnected');\n }\n\n /** Re-auth with the latest access token (e.g. after refresh). */\n override reconnectWithCurrentToken(): void {\n this.disconnect();\n this.connect();\n }\n\n /** Whether the underlying Socket.IO client is connected. */\n override isSocketConnected(): boolean {\n return this.socket?.connected === true;\n }\n\n override subscribeConversation(conversationId: string): void {\n const id = conversationId?.trim();\n if (!id) {\n return;\n }\n this.joinedConversations.add(id);\n this.socket?.emit(AXP_REALTIME_SUBSCRIBE_CONVERSATION, { conversationId: id });\n }\n\n override unsubscribeConversation(conversationId: string): void {\n const id = conversationId?.trim();\n if (!id) {\n return;\n }\n this.joinedConversations.delete(id);\n this.socket?.emit(AXP_REALTIME_UNSUBSCRIBE_CONVERSATION, { conversationId: id });\n }\n\n override emitConversationTyping(conversationId: string, active: boolean): void {\n const id = conversationId?.trim();\n if (!id || !this.socket?.connected) {\n return;\n }\n this.socket.emit(AXP_REALTIME_EMIT_TYPING, { conversationId: id, active });\n }\n\n subscribePresence(userIds: readonly string[]): Promise<AXPRealtimeUserPresenceSnapshotItem[]> {\n const ids = userIds.map((id) => id.trim()).filter(Boolean);\n if (ids.length === 0 || !this.socket?.connected) {\n return Promise.resolve([]);\n }\n\n return new Promise((resolve) => {\n this.socket?.emit(\n AXP_REALTIME_SUBSCRIBE_PRESENCE,\n { userIds: ids },\n (result: AXPRealtimePresenceSubscribeResult | undefined) => {\n resolve(Array.isArray(result?.items) ? result.items : []);\n },\n );\n });\n }\n\n unsubscribePresence(userIds: readonly string[]): void {\n const ids = userIds.map((id) => id.trim()).filter(Boolean);\n if (ids.length === 0) {\n return;\n }\n this.socket?.emit(AXP_REALTIME_UNSUBSCRIBE_PRESENCE, { userIds: ids });\n }\n\n leavePresence(): Promise<void> {\n if (!this.socket?.connected) {\n return Promise.resolve();\n }\n\n return new Promise((resolve) => {\n const timer = setTimeout(resolve, 400);\n this.socket?.emit(AXP_REALTIME_PRESENCE_LEAVE, {}, () => {\n clearTimeout(timer);\n resolve();\n });\n });\n }\n\n setPresence(\n status: 'online' | 'away' | 'busy',\n source: 'auto' | 'manual' = 'manual',\n ): Promise<AXPRealtimeUserPresenceSnapshotItem | undefined> {\n if (!this.socket?.connected) {\n return Promise.resolve(undefined);\n }\n\n return new Promise((resolve) => {\n this.socket?.emit(\n AXP_REALTIME_PRESENCE_SET,\n { status, source },\n (result: AXPRealtimePresenceSetResult | undefined) => {\n resolve(result?.ok ? result.item : undefined);\n },\n );\n });\n }\n}\n\n//#endregion\n","//#region ----- Constants -----\n\n/** Idle without input before automatic Away. Keep in sync with server `AXP_USER_PRESENCE_IDLE_MS`. */\nexport const AXP_USER_PRESENCE_IDLE_MS = 5 * 60_000;\n\n//#endregion\n","import type { AXPRealtimeUserPresencePayload, AXPRealtimeUserPresenceStatus } from '../realtime.types';\nimport type { AXPUserPresence, AXPUserPresenceSource } from './user-presence.types';\n\n//#region ----- Presence helpers -----\n\nconst PRESENCE_STATUSES: readonly AXPRealtimeUserPresenceStatus[] = ['online', 'offline', 'away', 'busy'];\n\nexport function isWatchablePresenceUserId(userId: string | null | undefined): boolean {\n const id = userId?.trim() ?? '';\n if (!id || id === 'system') {\n return false;\n }\n return !id.startsWith('assist-');\n}\n\nexport function parseUserPresencePayload(payload: unknown): AXPUserPresence | null {\n if (!payload || typeof payload !== 'object') {\n return null;\n }\n\n const raw = payload as AXPRealtimeUserPresencePayload;\n const userId = raw.userId?.trim();\n if (!userId) {\n return null;\n }\n\n const status = PRESENCE_STATUSES.includes(raw.status) ? raw.status : 'offline';\n const lastSeen = typeof raw.lastSeen === 'string' && raw.lastSeen.trim() ? raw.lastSeen.trim() : undefined;\n const since = typeof raw.since === 'string' && raw.since.trim() ? raw.since.trim() : undefined;\n const source: AXPUserPresenceSource | undefined =\n raw.source === 'auto' || raw.source === 'manual' ? raw.source : undefined;\n return {\n userId,\n status,\n ...(lastSeen ? { lastSeen } : {}),\n ...(since ? { since } : {}),\n ...(source ? { source } : {}),\n };\n}\n\n//#endregion\n","import { Injectable, inject } from '@angular/core';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { AXPRealtimeConnectionService } from '../realtime-connection.service';\nimport type { AXPUserPresence } from './user-presence.types';\nimport { isWatchablePresenceUserId, parseUserPresencePayload } from './user-presence.util';\n\n//#region ----- User presence store -----\n\nconst FLUSH_DEBOUNCE_MS = 40;\n\n@Injectable({ providedIn: 'root' })\nexport class AXPUserPresenceService {\n //#region ----- Services & Dependencies -----\n\n private readonly connection = inject(AXPRealtimeConnectionService, { optional: true });\n\n //#endregion\n\n //#region ----- State -----\n\n private readonly presenceByUserId = new Map<string, AXPUserPresence>();\n private readonly watchCounts = new Map<string, number>();\n private readonly subjects = new Map<string, BehaviorSubject<AXPUserPresence>>();\n private readonly updatesSubject = new Subject<AXPUserPresence>();\n private flushTimer: ReturnType<typeof setTimeout> | null = null;\n private pendingSubscribe = new Set<string>();\n private pendingUnsubscribe = new Set<string>();\n\n readonly updates$ = this.updatesSubject.asObservable();\n\n //#endregion\n\n constructor() {\n this.connection?.connectionStatus$.subscribe((status) => {\n if (status === 'connected') {\n this.resubscribeAll();\n }\n });\n }\n\n //#region ----- Public API -----\n\n get(userId: string): AXPUserPresence | undefined {\n const id = userId?.trim();\n if (!id) {\n return undefined;\n }\n return this.presenceByUserId.get(id);\n }\n\n presence$(userId: string): Observable<AXPUserPresence> {\n const id = userId?.trim();\n const fallback: AXPUserPresence = { userId: id, status: 'offline' };\n if (!id) {\n return new BehaviorSubject(fallback).asObservable();\n }\n\n let subject = this.subjects.get(id);\n if (!subject) {\n subject = new BehaviorSubject<AXPUserPresence>(this.presenceByUserId.get(id) ?? fallback);\n this.subjects.set(id, subject);\n }\n return subject.asObservable();\n }\n\n watch(userId: string): void {\n if (!isWatchablePresenceUserId(userId)) {\n return;\n }\n const id = userId.trim();\n const next = (this.watchCounts.get(id) ?? 0) + 1;\n this.watchCounts.set(id, next);\n if (next === 1) {\n this.pendingUnsubscribe.delete(id);\n this.pendingSubscribe.add(id);\n this.scheduleFlush();\n }\n }\n\n watchMany(userIds: readonly string[]): void {\n for (const userId of userIds) {\n this.watch(userId);\n }\n }\n\n /** Watch only if this user is not already in the local watch set. */\n ensureWatch(userId: string): void {\n const id = userId?.trim();\n if (!id || (this.watchCounts.get(id) ?? 0) > 0) {\n return;\n }\n this.watch(id);\n }\n\n ensureWatchMany(userIds: readonly string[]): void {\n for (const userId of userIds) {\n this.ensureWatch(userId);\n }\n }\n\n unwatch(userId: string): void {\n const id = userId?.trim();\n if (!id) {\n return;\n }\n const current = this.watchCounts.get(id) ?? 0;\n if (current <= 1) {\n this.watchCounts.delete(id);\n this.pendingSubscribe.delete(id);\n this.pendingUnsubscribe.add(id);\n this.scheduleFlush();\n return;\n }\n this.watchCounts.set(id, current - 1);\n }\n\n applySnapshot(items: readonly AXPUserPresence[]): void {\n for (const item of items) {\n this.applyPresence(item);\n }\n }\n\n applyEnvelopePayload(payload: unknown): void {\n const parsed = parseUserPresencePayload(payload);\n if (parsed) {\n this.applyPresence(parsed);\n }\n }\n\n async setAvailability(\n status: 'online' | 'away' | 'busy',\n source: 'auto' | 'manual' = 'manual',\n ): Promise<void> {\n const item = await this.connection?.setPresence(status, source);\n if (item) {\n this.applyPresence(item);\n }\n }\n\n //#endregion\n\n //#region ----- Store updates -----\n\n private applyPresence(presence: AXPUserPresence): void {\n const previous = this.presenceByUserId.get(presence.userId);\n if (\n previous &&\n previous.status === presence.status &&\n previous.lastSeen === presence.lastSeen &&\n previous.since === presence.since\n ) {\n return;\n }\n\n this.presenceByUserId.set(presence.userId, presence);\n const subject = this.subjects.get(presence.userId);\n if (subject && !subject.closed) {\n subject.next(presence);\n }\n this.updatesSubject.next(presence);\n }\n\n private scheduleFlush(): void {\n if (this.flushTimer) {\n return;\n }\n this.flushTimer = setTimeout(() => {\n this.flushTimer = null;\n void this.flush();\n }, FLUSH_DEBOUNCE_MS);\n }\n\n private async flush(): Promise<void> {\n const subscribeIds = Array.from(this.pendingSubscribe);\n const unsubscribeIds = Array.from(this.pendingUnsubscribe);\n this.pendingSubscribe.clear();\n this.pendingUnsubscribe.clear();\n\n if (unsubscribeIds.length > 0) {\n this.connection?.unsubscribePresence(unsubscribeIds);\n }\n if (subscribeIds.length === 0) {\n return;\n }\n\n const items = (await this.connection?.subscribePresence(subscribeIds)) ?? [];\n this.applySnapshot(items);\n }\n\n private resubscribeAll(): void {\n const watched = Array.from(this.watchCounts.keys());\n if (watched.length === 0) {\n return;\n }\n this.pendingUnsubscribe.clear();\n for (const id of watched) {\n this.pendingSubscribe.add(id);\n }\n this.scheduleFlush();\n }\n\n //#endregion\n}\n\n//#endregion\n","import { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Injectable, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { AXPSessionService, AXPSessionStatus } from '@acorex-platform/framework-client/auth';\nimport { AXP_USER_PRESENCE_IDLE_MS } from '../presence-idle.constants';\nimport { AXPUserPresenceService } from './user-presence.service';\n\n//#region ----- Automatic away from idle -----\n\nconst IDLE_CHECK_MS = 15_000;\nconst ACTIVITY_THROTTLE_MS = 1_000;\n\n@Injectable({ providedIn: 'root' })\nexport class AXPUserPresenceIdleService {\n //#region ----- Services & Dependencies -----\n\n private readonly document = inject(DOCUMENT);\n private readonly session = inject(AXPSessionService);\n private readonly presence = inject(AXPUserPresenceService);\n private readonly destroyRef = inject(DestroyRef);\n\n //#endregion\n\n //#region ----- State -----\n\n private lastActivityAt = Date.now();\n private lastActivityEmitAt = 0;\n private idle = false;\n private checkTimer: ReturnType<typeof setInterval> | null = null;\n private started = false;\n\n //#endregion\n\n constructor() {\n this.session.status$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((status) => {\n if (status === AXPSessionStatus.Authorized) {\n this.start();\n return;\n }\n this.stop();\n });\n }\n\n //#region ----- Lifecycle -----\n\n start(): void {\n if (this.started) {\n return;\n }\n this.started = true;\n this.lastActivityAt = Date.now();\n this.idle = false;\n const target = this.document.defaultView ?? this.document;\n target.addEventListener('mousemove', this.onActivity, { passive: true });\n target.addEventListener('keydown', this.onActivity, { passive: true });\n target.addEventListener('mousedown', this.onActivity, { passive: true });\n target.addEventListener('touchstart', this.onActivity, { passive: true });\n this.document.addEventListener('visibilitychange', this.onVisibility);\n this.checkTimer = setInterval(() => this.checkIdle(), IDLE_CHECK_MS);\n }\n\n stop(): void {\n if (!this.started) {\n return;\n }\n this.started = false;\n this.idle = false;\n const target = this.document.defaultView ?? this.document;\n target.removeEventListener('mousemove', this.onActivity);\n target.removeEventListener('keydown', this.onActivity);\n target.removeEventListener('mousedown', this.onActivity);\n target.removeEventListener('touchstart', this.onActivity);\n this.document.removeEventListener('visibilitychange', this.onVisibility);\n if (this.checkTimer) {\n clearInterval(this.checkTimer);\n this.checkTimer = null;\n }\n }\n\n //#endregion\n\n //#region ----- Activity -----\n\n private readonly onActivity = (): void => {\n const now = Date.now();\n this.lastActivityAt = now;\n if (now - this.lastActivityEmitAt < ACTIVITY_THROTTLE_MS) {\n return;\n }\n this.lastActivityEmitAt = now;\n if (this.idle) {\n this.idle = false;\n void this.presence.setAvailability('online', 'auto');\n }\n };\n\n private readonly onVisibility = (): void => {\n if (!this.document.hidden) {\n this.onActivity();\n }\n };\n\n private checkIdle(): void {\n if (!this.started || this.idle) {\n return;\n }\n if (Date.now() - this.lastActivityAt < AXP_USER_PRESENCE_IDLE_MS) {\n return;\n }\n this.idle = true;\n void this.presence.setAvailability('away', 'auto');\n }\n\n //#endregion\n}\n\n//#endregion\n","import {\n inject,\n makeEnvironmentProviders,\n type EnvironmentProviders,\n} from '@angular/core';\nimport {\n AXP_APP_STARTUP_PRIORITY,\n provideAppStartUpTask,\n} from '@acorex-platform/framework-client/core';\nimport { provideCommandSetups } from '@acorex-platform/framework-client/runtime';\nimport { PRESENCE_SET_AVAILABILITY } from '@acorex-platform/framework-shared/runtime';\nimport { AXPUserPresenceIdleService } from './presence/user-presence-idle.service';\nimport { AXPUserPresenceService } from './presence/user-presence.service';\nimport { AXPRealtimeConnectionPort } from './realtime-connection.port';\nimport { AXPRealtimeConnectionService } from './realtime-connection.service';\nimport { AXPRealtimeDispatcherService } from './realtime-dispatcher.service';\nimport type { AXPRealtimeConfig } from './realtime.types';\nimport { resolveRealtimeSocketUrl } from './realtime-url.util';\nimport { AXP_REALTIME_TOPIC_USER_PRESENCE } from './realtime.topics';\nimport { AXP_REALTIME_CONFIG } from './tokens';\n\n//#region ---- provideRealtime ----\n\nexport interface AXPProvideRealtimeOptions extends AXPRealtimeConfig {\n apiBaseUrl?: string;\n /**\n * Always-on backend. Default `builtin` (Socket.IO).\n * Call/media uses extensions/rtc when configured — not this switch.\n */\n backend?: 'builtin';\n}\n\n/**\n * Registers built-in always-on realtime (Socket.IO) + topic dispatcher.\n */\nexport function provideRealtime(config: AXPProvideRealtimeOptions = {}): EnvironmentProviders {\n const backend = config.backend ?? 'builtin';\n if (backend !== 'builtin') {\n throw new Error(`Unsupported realtime backend '${String(backend)}'. Use 'builtin'.`);\n }\n\n const url =\n config.url?.trim() ||\n (config.apiBaseUrl?.trim() ? resolveRealtimeSocketUrl(config.apiBaseUrl) : undefined);\n\n return makeEnvironmentProviders([\n {\n provide: AXP_REALTIME_CONFIG,\n useValue: {\n autoConnect: config.autoConnect !== false,\n url,\n } satisfies AXPRealtimeConfig,\n },\n AXPRealtimeDispatcherService,\n AXPRealtimeConnectionService,\n {\n provide: AXPRealtimeConnectionPort,\n useExisting: AXPRealtimeConnectionService,\n },\n provideCommandSetups([\n {\n key: PRESENCE_SET_AVAILABILITY,\n command: () =>\n import('./presence/set-presence-availability.command').then((c) => c.AXPSetPresenceAvailabilityCommand),\n },\n ]),\n provideAppStartUpTask(() => {\n inject(AXPUserPresenceIdleService);\n return {\n name: 'user-presence-idle',\n priority: AXP_APP_STARTUP_PRIORITY.realtimeSubscriptions,\n run: async () => undefined,\n };\n }),\n provideAppStartUpTask(() => {\n const dispatcher = inject(AXPRealtimeDispatcherService);\n const presence = inject(AXPUserPresenceService);\n return {\n name: 'user-presence-handler',\n priority: AXP_APP_STARTUP_PRIORITY.realtimeHandlers,\n run: async () => {\n dispatcher.register({\n topic: AXP_REALTIME_TOPIC_USER_PRESENCE,\n handle: (envelope) => {\n presence.applyEnvelopePayload(envelope.payload);\n },\n });\n },\n };\n }),\n provideAppStartUpTask(() => {\n const connection = inject(AXPRealtimeConnectionPort);\n return {\n name: 'realtime-connect',\n priority: AXP_APP_STARTUP_PRIORITY.realtimeConnect,\n run: async () => {\n // Connection lifecycle is owned by the connection service (session.status$).\n // Eagerly invoke connect once so an already-authenticated session connects on bootstrap.\n connection.connect();\n },\n };\n }),\n ]);\n}\n\n//#endregion\n","import type { AXPRealtimeUserPresenceStatus, AXPRealtimeUserPresenceSource } from '../realtime.types';\n\n//#region ----- Types -----\n\nexport type AXPUserPresenceStatus = AXPRealtimeUserPresenceStatus;\nexport type AXPUserPresenceSource = AXPRealtimeUserPresenceSource;\n\nexport interface AXPUserPresence {\n userId: string;\n status: AXPUserPresenceStatus;\n lastSeen?: string;\n since?: string;\n source?: AXPUserPresenceSource;\n}\n\nexport interface AXPUserPresenceSetInput {\n status: 'online' | 'away' | 'busy';\n source?: AXPUserPresenceSource;\n}\n\n//#endregion\n","//#region ----- Presence duration tooltip -----\n\nexport type AXPPresenceDurationBucket = {\n key:\n | 'duration.less-than-a-minute'\n | 'duration.one-minute'\n | 'duration.minutes'\n | 'duration.one-hour'\n | 'duration.hours'\n | 'duration.one-day'\n | 'duration.days';\n params?: { count: number };\n};\n\nexport function presenceDurationBucket(ms: number): AXPPresenceDurationBucket {\n const elapsed = Math.max(0, ms);\n if (elapsed < 60_000) {\n return { key: 'duration.less-than-a-minute' };\n }\n\n const minutes = Math.floor(elapsed / 60_000);\n if (minutes < 60) {\n return minutes === 1 ? { key: 'duration.one-minute' } : { key: 'duration.minutes', params: { count: minutes } };\n }\n\n const hours = Math.floor(minutes / 60);\n if (hours < 24) {\n return hours === 1 ? { key: 'duration.one-hour' } : { key: 'duration.hours', params: { count: hours } };\n }\n\n const days = Math.floor(hours / 24);\n return days === 1 ? { key: 'duration.one-day' } : { key: 'duration.days', params: { count: days } };\n}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AA0HA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