@acorex-platform/module-workplacesafety-management-client 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.
Files changed (27) hide show
  1. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts.mjs +1646 -0
  2. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram-widget-view.component-C-qrrqOV.mjs +203 -0
  4. package/fesm2022/acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram-widget-view.component-C-qrrqOV.mjs.map +1 -0
  5. package/fesm2022/acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.service-BBhH7KP1.mjs +119 -0
  6. package/fesm2022/acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram.service-BBhH7KP1.mjs.map +1 -0
  7. package/fesm2022/acorex-platform-module-workplacesafety-management-client-hazard-ppe-rule-status.provider-o4bAwYcq.mjs +42 -0
  8. package/fesm2022/acorex-platform-module-workplacesafety-management-client-hazard-ppe-rule-status.provider-o4bAwYcq.mjs.map +1 -0
  9. package/fesm2022/acorex-platform-module-workplacesafety-management-client-hazard-risk-ppe-rule-status.provider-DtqzcWh0.mjs +42 -0
  10. package/fesm2022/acorex-platform-module-workplacesafety-management-client-hazard-risk-ppe-rule-status.provider-DtqzcWh0.mjs.map +1 -0
  11. package/fesm2022/acorex-platform-module-workplacesafety-management-client-hazard-risk-status.provider-B6IkRYbW.mjs +42 -0
  12. package/fesm2022/acorex-platform-module-workplacesafety-management-client-hazard-risk-status.provider-B6IkRYbW.mjs.map +1 -0
  13. package/fesm2022/acorex-platform-module-workplacesafety-management-client-index-kF37zgd4.mjs +1900 -0
  14. package/fesm2022/acorex-platform-module-workplacesafety-management-client-index-kF37zgd4.mjs.map +1 -0
  15. package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-control-hierarchy-diagram.command-C2X3VpEt.mjs +175 -0
  16. package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-control-hierarchy-diagram.command-C2X3VpEt.mjs.map +1 -0
  17. package/fesm2022/acorex-platform-module-workplacesafety-management-client-publish-safety-plan.command-Ci-zcrmO.mjs +106 -0
  18. package/fesm2022/acorex-platform-module-workplacesafety-management-client-publish-safety-plan.command-Ci-zcrmO.mjs.map +1 -0
  19. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-status.provider-BpWx3gIf.mjs +51 -0
  20. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-status.provider-BpWx3gIf.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-BJsg3pHZ.mjs +461 -0
  22. package/fesm2022/acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-BJsg3pHZ.mjs.map +1 -0
  23. package/fesm2022/acorex-platform-module-workplacesafety-management-client.mjs +461 -0
  24. package/fesm2022/acorex-platform-module-workplacesafety-management-client.mjs.map +1 -0
  25. package/package.json +28 -0
  26. package/types/acorex-platform-module-workplacesafety-management-client-contracts.d.ts +1111 -0
  27. package/types/acorex-platform-module-workplacesafety-management-client.d.ts +20 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-BJsg3pHZ.mjs","sources":["../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-sections-page/safety-plan-section-builder.types.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-sections-page/save-safety-plan-sections.command.ts"],"sourcesContent":["import { AXPDataGenerator } from '@acorex-platform/framework-client/core';\nimport {\n enrichSectionTypeSnapshot,\n isStepTableSectionType,\n normalizeStepTableColumns,\n normalizeStepTableRows,\n resolveEntityRefId,\n stepTableColumnTitle,\n type AXMSafetyPlanSectionBuilderItemValue,\n type AXMSafetyPlanSectionBuilderSectionValue,\n type AXMSafetyPlanSectionBuilderValue,\n type AXMSafetyPlanStepTableRowBuilderPayload,\n type AXMStepTableCellValue,\n type AXMStepTableColumnDef,\n type AXMWorkplaceSafetyManagementSafetyPlanSectionEntityModel,\n type AXMWorkplaceSafetyManagementSafetyPlanWorkStepEntityModel,\n} from '@acorex-platform/module-workplacesafety-management-client/contracts';\n\nexport function createSafetyPlanSectionBuilderDefaultValue(): AXMSafetyPlanSectionBuilderValue {\n return { sections: [] };\n}\n\nexport function normalizeSafetyPlanSectionBuilderValue(\n value: AXMSafetyPlanSectionBuilderValue | null | undefined,\n): AXMSafetyPlanSectionBuilderValue {\n if (!value || !Array.isArray(value.sections)) {\n return createSafetyPlanSectionBuilderDefaultValue();\n }\n\n return {\n sections: value.sections.map((section, index) => normalizeSection(section, index)),\n };\n}\n\nexport function safetyPlanSectionsToBuilderValue(\n rows: AXMWorkplaceSafetyManagementSafetyPlanSectionEntityModel[],\n): AXMSafetyPlanSectionBuilderValue {\n const ordered = [...rows].sort(\n (a, b) => (a.sortOrder ?? 0) - (b.sortOrder ?? 0) || String(a.code ?? '').localeCompare(String(b.code ?? '')),\n );\n return {\n sections: ordered.map((row, index) => {\n const legacyItem = row.items?.[0];\n const sectionTypeId =\n resolveEntityRefId(legacyItem?.sectionTypeId) ??\n resolveEntityRefId(legacyItem?.sectionType) ??\n '';\n const workStepTypeId =\n resolveEntityRefId(legacyItem?.workStepTypeId) ??\n resolveEntityRefId(legacyItem?.workStepType) ??\n undefined;\n return {\n id: row.id,\n sectionTypeId,\n sectionType: enrichSectionTypeSnapshot(sectionTypeId, legacyItem?.sectionType),\n title: row.title,\n description: row.description ?? '',\n safetyPlanId: row.safetyPlanId,\n code: row.code,\n sourceSafetyPlanTypeSectionId: row.sourceSafetyPlanTypeSectionId,\n sortOrder: row.sortOrder ?? index + 1,\n workStepTypeId,\n workStepType: legacyItem?.workStepType,\n columns: [],\n items: (row.items ?? []).map((item, itemIndex) => ({\n id: `${row.id}__item_${itemIndex + 1}`,\n itemIds: [...(item.itemIds ?? [])],\n items: item.items ? [...item.items] : [],\n })),\n };\n }),\n };\n}\n\n/** Merges SafetyPlanWorkStep row entities into Step Table sections. */\nexport function hydrateStepTableSectionsWithWorkSteps(\n value: AXMSafetyPlanSectionBuilderValue,\n workSteps: AXMWorkplaceSafetyManagementSafetyPlanWorkStepEntityModel[],\n columnsByWorkStepTypeId?: ReadonlyMap<string, AXMStepTableColumnDef[]>,\n): AXMSafetyPlanSectionBuilderValue {\n const bySection = new Map<string, AXMWorkplaceSafetyManagementSafetyPlanWorkStepEntityModel[]>();\n for (const step of workSteps) {\n const sectionId = resolveEntityRefId(step.safetyPlanSectionId) ?? '';\n if (!sectionId) {\n continue;\n }\n const list = bySection.get(sectionId) ?? [];\n list.push(step);\n bySection.set(sectionId, list);\n }\n\n return {\n sections: value.sections.map((section) => {\n if (!isStepTableSectionType(section.sectionTypeId, section.sectionType)) {\n return section;\n }\n const steps = [...(bySection.get(section.id) ?? [])].sort(\n (a, b) => (a.sortOrder ?? 0) - (b.sortOrder ?? 0) || String(a.code ?? '').localeCompare(String(b.code ?? '')),\n );\n const workStepTypeId =\n section.workStepTypeId ||\n (steps[0] ? resolveEntityRefId(steps[0].workStepTypeId) ?? undefined : undefined);\n const columns =\n (workStepTypeId && columnsByWorkStepTypeId?.get(workStepTypeId)) ||\n normalizeStepTableColumns(steps[0]?.columns) ||\n section.columns ||\n [];\n return {\n ...section,\n workStepTypeId,\n workStepType: section.workStepType ?? steps[0]?.workStepType,\n columns,\n items: steps.map((step) => toBuilderItemFromWorkStepRow(step, columns)),\n };\n }),\n };\n}\n\nexport function builderValueToSafetyPlanSectionPayloads(\n value: AXMSafetyPlanSectionBuilderValue,\n safetyPlanId: string,\n): Array<{\n id: string;\n safetyPlanId: string;\n title: string;\n description?: string;\n sectionTypeId: string;\n sectionType?: AXMSafetyPlanSectionBuilderSectionValue['sectionType'];\n sourceSafetyPlanTypeSectionId?: string;\n sortOrder: number;\n workStepTypeId?: string;\n workStepType?: AXMSafetyPlanSectionBuilderSectionValue['workStepType'];\n columns?: AXMStepTableColumnDef[];\n items: AXMSafetyPlanSectionBuilderItemValue[];\n}> {\n return value.sections.map((section, index) => ({\n id: section.id,\n safetyPlanId,\n title: section.title,\n description: section.description?.trim() ? section.description.trim() : undefined,\n sectionTypeId: section.sectionTypeId,\n sectionType: section.sectionType,\n sourceSafetyPlanTypeSectionId: section.sourceSafetyPlanTypeSectionId,\n sortOrder: typeof section.sortOrder === 'number' ? section.sortOrder : index + 1,\n workStepTypeId: section.workStepTypeId,\n workStepType: section.workStepType,\n columns: section.columns,\n items: section.items.map((item) => ({\n ...item,\n itemIds: [...(item.itemIds ?? [])],\n items: item.items ? [...item.items] : [],\n stepTableRow: item.stepTableRow ? normalizeStepTableRowPayload(item.stepTableRow) : undefined,\n })),\n }));\n}\n\nfunction toBuilderItemFromWorkStepRow(\n step: AXMWorkplaceSafetyManagementSafetyPlanWorkStepEntityModel,\n columns: AXMStepTableColumnDef[],\n): AXMSafetyPlanSectionBuilderItemValue {\n const normalizedColumns = normalizeStepTableColumns(columns.length ? columns : step.columns);\n const cells =\n normalizeStepTableRows(\n [{ id: step.id, sortOrder: step.sortOrder ?? 1, cells: step.cells ?? [] }],\n normalizedColumns,\n )[0]?.cells ??\n step.cells ??\n [];\n const title = step.title?.trim() || summarizeStepTableRow(cells, normalizedColumns);\n return {\n id: step.id,\n itemIds: [step.id],\n items: [{ id: step.id, title, code: step.code }],\n stepTableRow: {\n cells,\n code: step.code,\n sortOrder: step.sortOrder,\n title,\n },\n };\n}\n\nexport function summarizeStepTableRow(\n cells: AXMStepTableCellValue[],\n columns: AXMStepTableColumnDef[],\n): string {\n for (const column of columns) {\n const key = column.sectionTypeId;\n const cell = cells.find((entry) => entry.columnKey === key);\n if (!cell) {\n continue;\n }\n const fromRefs = cell.refs?.[0]?.title || cell.refs?.[0]?.code;\n if (fromRefs) {\n return fromRefs;\n }\n if (cell.textValue?.trim()) {\n return cell.textValue.trim();\n }\n }\n return columns[0] ? stepTableColumnTitle(columns[0]) : 'Row';\n}\n\nfunction normalizeSection(\n section: Partial<AXMSafetyPlanSectionBuilderSectionValue>,\n index: number,\n): AXMSafetyPlanSectionBuilderSectionValue {\n const id = typeof section.id === 'string' && section.id ? section.id : AXPDataGenerator.uuid();\n const sectionTypeId = resolveEntityRefId(section.sectionTypeId) ?? '';\n const workStepTypeId = resolveEntityRefId(section.workStepTypeId) ?? undefined;\n return {\n id,\n sectionTypeId,\n sectionType: enrichSectionTypeSnapshot(sectionTypeId, section.sectionType),\n title: typeof section.title === 'string' ? section.title : '',\n description: typeof section.description === 'string' ? section.description : '',\n safetyPlanId: typeof section.safetyPlanId === 'string' ? section.safetyPlanId : undefined,\n code: typeof section.code === 'string' ? section.code : undefined,\n sourceSafetyPlanTypeSectionId:\n typeof section.sourceSafetyPlanTypeSectionId === 'string'\n ? section.sourceSafetyPlanTypeSectionId\n : undefined,\n sortOrder: typeof section.sortOrder === 'number' ? section.sortOrder : index + 1,\n required: section.required === true,\n workStepTypeId,\n workStepType: section.workStepType,\n columns: normalizeStepTableColumns(section.columns),\n items: Array.isArray(section.items)\n ? section.items.map((item) => normalizeItem(item, id, sectionTypeId, section.sectionType))\n : [],\n };\n}\n\nfunction normalizeItem(\n item: Partial<AXMSafetyPlanSectionBuilderItemValue>,\n sectionId: string,\n sectionTypeId: string,\n sectionType: AXMSafetyPlanSectionBuilderSectionValue['sectionType'],\n): AXMSafetyPlanSectionBuilderItemValue {\n const isStepTable = isStepTableSectionType(sectionTypeId, sectionType);\n if (isStepTable && item.stepTableRow) {\n const stepTableRow = normalizeStepTableRowPayload(item.stepTableRow);\n const stepId =\n typeof item.id === 'string' && item.id && !item.id.includes('__item_') && !item.id.includes('__entity_')\n ? item.id\n : AXPDataGenerator.uuid();\n const title = stepTableRow.title?.trim() || 'Row';\n return {\n id: stepId,\n itemIds: [stepId],\n items: [{ id: stepId, title, code: stepTableRow.code }],\n stepTableRow,\n };\n }\n\n const id = typeof item.id === 'string' && item.id ? item.id : AXPDataGenerator.uuid();\n return {\n id: id.includes('__item_') || id.includes('__entity_') ? id : `${sectionId}__item_${id}`,\n itemIds: Array.isArray(item.itemIds) ? item.itemIds.filter((x): x is string => typeof x === 'string') : [],\n items: Array.isArray(item.items) ? item.items : [],\n };\n}\n\nfunction normalizeStepTableRowPayload(\n payload: AXMSafetyPlanStepTableRowBuilderPayload,\n): AXMSafetyPlanStepTableRowBuilderPayload {\n return {\n cells: Array.isArray(payload.cells) ? payload.cells : [],\n code: typeof payload.code === 'string' ? payload.code : undefined,\n sortOrder: typeof payload.sortOrder === 'number' ? payload.sortOrder : undefined,\n title: typeof payload.title === 'string' ? payload.title : undefined,\n };\n}\n\nexport type {\n AXMSafetyPlanSectionBuilderItemValue,\n AXMSafetyPlanSectionBuilderSectionValue,\n AXMSafetyPlanSectionBuilderValue,\n AXMSafetyPlanStepTableRowBuilderPayload,\n};\n","import {\n AXPEntityService,\n isAXPMiddlewareAbortError,\n mapEntityStorageErrorToCommandResult,\n} from '@acorex-platform/framework-client/layout/entity';\nimport { extractRequestErrorInfo } from '@acorex-platform/framework-client/common';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { inject, Injectable } from '@angular/core';\nimport {\n AXMSafetyPlanSectionBuilderValue,\n RootConfig,\n SAFETY_PLAN_SECTION_DUPLICATE_SECTION_TYPE_CODE,\n SAFETY_PLAN_SECTION_DUPLICATE_SECTION_TYPE_MESSAGE_KEY,\n collectBuiltInRepeatableSectionTypeIds,\n dedupeSafetyPlanSectionStructure,\n findDuplicateSafetyPlanSectionTypeId,\n isStepTableSectionType,\n normalizeStepTableColumns,\n resolveEntityRefId,\n} from '@acorex-platform/module-workplacesafety-management-client/contracts';\nimport {\n builderValueToSafetyPlanSectionPayloads,\n safetyPlanSectionsToBuilderValue,\n summarizeStepTableRow,\n} from './safety-plan-section-builder.types';\n\nexport const SAFETY_PLAN_SECTIONS_SAVE_COMMAND = 'SafetyPlan:Sections:Save';\n\nexport interface SaveSafetyPlanSectionsInput {\n id: string;\n value: AXMSafetyPlanSectionBuilderValue;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXMSaveSafetyPlanSectionsCommand implements AXPCommand<SaveSafetyPlanSectionsInput, unknown> {\n private readonly entityService = inject(AXPEntityService);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(input: SaveSafetyPlanSectionsInput): AXPCommandExecuteResultPromise<unknown> {\n const safetyPlanId = input?.id;\n const rawValue = input?.value ?? { sections: [] };\n\n if (!safetyPlanId) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n const sectionEntityRef = `${RootConfig.module.name}.${RootConfig.entities.safetyPlanSection.name}`;\n const sectionTypeEntityRef = `${RootConfig.module.name}.${RootConfig.entities.sectionType.name}`;\n const workStepEntityRef = `${RootConfig.module.name}.${RootConfig.entities.safetyPlanWorkStep.name}`;\n const sectionData = this.entityService.withEntity(sectionEntityRef).data();\n const workStepData = this.entityService.withEntity(workStepEntityRef).data();\n\n try {\n const repeatableSectionTypeIds = await this.loadRepeatableSectionTypeIds(sectionTypeEntityRef);\n\n // Dedupe accidental ghost rows first so uniqueness runs on the cleaned structure.\n const value = dedupeSafetyPlanSectionStructure(rawValue, { repeatableSectionTypeIds });\n\n const duplicateTypeId = findDuplicateSafetyPlanSectionTypeId(value.sections ?? [], {\n repeatableSectionTypeIds,\n });\n if (duplicateTypeId) {\n return {\n success: false,\n message: {\n type: 'error',\n text: SAFETY_PLAN_SECTION_DUPLICATE_SECTION_TYPE_MESSAGE_KEY,\n },\n };\n }\n\n const existing = await this.queryPlanSections(sectionData, safetyPlanId);\n const existingRows = existing.items ?? [];\n const existingIds = new Set(existingRows.map((row) => String((row as { id?: string }).id ?? '')));\n const nextIds = new Set(value.sections.map((section) => section.id));\n\n for (const row of existingRows) {\n const rowId = String((row as { id?: string }).id ?? '');\n if (rowId && !nextIds.has(rowId)) {\n await this.deleteWorkStepsForSection(workStepData, rowId);\n await sectionData.delete(rowId);\n }\n }\n\n const payloads = builderValueToSafetyPlanSectionPayloads(value, safetyPlanId);\n for (const payload of payloads) {\n const isStepTable = isStepTableSectionType(payload.sectionTypeId, payload.sectionType);\n const columns = normalizeStepTableColumns(payload.columns);\n\n if (isStepTable) {\n await this.syncWorkStepsForSection(\n workStepData,\n safetyPlanId,\n payload.id,\n payload.workStepTypeId,\n payload.workStepType,\n columns,\n payload.items,\n );\n }\n\n const itemRows = isStepTable\n ? [\n {\n sectionTypeId: payload.sectionTypeId,\n sectionType: payload.sectionType,\n workStepTypeId: payload.workStepTypeId,\n workStepType: payload.workStepType,\n itemIds: payload.items\n .map((item) => item.id)\n .filter((id): id is string => typeof id === 'string' && id.length > 0),\n items: payload.items.map((item) => ({\n id: item.id,\n title:\n item.stepTableRow?.title ??\n summarizeStepTableRow(item.stepTableRow?.cells ?? [], columns) ??\n item.items?.[0]?.title,\n code: item.stepTableRow?.code ?? item.items?.[0]?.code,\n })),\n },\n ]\n : payload.items.length > 0\n ? payload.items.map(({ itemIds, items }) => ({\n sectionTypeId: payload.sectionTypeId,\n sectionType: payload.sectionType,\n itemIds,\n items,\n }))\n : [\n {\n sectionTypeId: payload.sectionTypeId,\n sectionType: payload.sectionType,\n itemIds: [] as string[],\n items: [] as { id: string; title?: string; code?: string }[],\n },\n ];\n\n const entityPayload = {\n safetyPlanId: payload.safetyPlanId,\n title: payload.title,\n description: payload.description,\n sourceSafetyPlanTypeSectionId: payload.sourceSafetyPlanTypeSectionId,\n sortOrder: payload.sortOrder,\n items: itemRows,\n };\n\n if (existingIds.has(payload.id)) {\n await sectionData.update(payload.id, entityPayload as never);\n } else {\n await sectionData.create({ ...entityPayload, id: payload.id } as never);\n }\n }\n\n const refreshed = await this.queryPlanSections(sectionData, safetyPlanId);\n const deduped = dedupeSafetyPlanSectionStructure(\n safetyPlanSectionsToBuilderValue(\n (refreshed.items ?? []) as Parameters<typeof safetyPlanSectionsToBuilderValue>[0],\n ),\n { repeatableSectionTypeIds },\n );\n const keepIds = new Set(deduped.sections.map((section) => section.id));\n\n for (const row of refreshed.items ?? []) {\n const rowId = String((row as { id?: string }).id ?? '');\n if (rowId && !keepIds.has(rowId)) {\n await this.deleteWorkStepsForSection(workStepData, rowId);\n await sectionData.delete(rowId);\n }\n }\n\n const cleaned =\n keepIds.size === (refreshed.items ?? []).length\n ? refreshed\n : await this.queryPlanSections(sectionData, safetyPlanId);\n\n const sections = (cleaned.items ?? []).filter((row) =>\n keepIds.has(String((row as { id?: string }).id ?? '')),\n );\n\n return {\n success: true,\n kind: 'object',\n data: { id: safetyPlanId, value, sections },\n message: {\n text: await this.translationService.translateAsync('@general:messages.generic.success.description'),\n },\n };\n } catch (error) {\n if (isAXPMiddlewareAbortError(error)) {\n return mapEntityStorageErrorToCommandResult(error);\n }\n\n const httpInfo = extractRequestErrorInfo(error);\n if (httpInfo?.code === SAFETY_PLAN_SECTION_DUPLICATE_SECTION_TYPE_CODE) {\n return {\n success: false,\n message: {\n type: 'error',\n code: SAFETY_PLAN_SECTION_DUPLICATE_SECTION_TYPE_CODE,\n text: SAFETY_PLAN_SECTION_DUPLICATE_SECTION_TYPE_MESSAGE_KEY,\n },\n };\n }\n\n const text =\n (typeof httpInfo?.message === 'string' && httpInfo.message.startsWith('@')\n ? httpInfo.message\n : null) ??\n (error instanceof Error && error.message.startsWith('@') ? error.message : null) ??\n (await this.translationService.translateAsync('@general:messages.generic.error.description'));\n\n return {\n success: false,\n message: { type: 'error', text },\n };\n }\n }\n\n private async syncWorkStepsForSection(\n workStepData: ReturnType<ReturnType<AXPEntityService['withEntity']>['data']>,\n safetyPlanId: string,\n sectionId: string,\n workStepTypeId: string | undefined,\n workStepType: { id: string; title?: string; code?: string } | undefined,\n columns: ReturnType<typeof normalizeStepTableColumns>,\n items: ReturnType<typeof builderValueToSafetyPlanSectionPayloads>[number]['items'],\n ): Promise<void> {\n const existing = await workStepData.query({\n skip: 0,\n take: 1000,\n filter: {\n logic: 'and',\n filters: [{ field: 'safetyPlanSectionId', operator: { type: 'equal' }, value: sectionId }],\n },\n } as never);\n\n const existingRows = existing.items ?? [];\n const existingIds = new Set(existingRows.map((row) => String((row as { id?: string }).id ?? '')));\n const nextIds = new Set(\n items.map((item) => item.id).filter((id): id is string => typeof id === 'string' && id.length > 0),\n );\n\n for (const row of existingRows) {\n const rowId = String((row as { id?: string }).id ?? '');\n if (rowId && !nextIds.has(rowId)) {\n await workStepData.delete(rowId);\n }\n }\n\n if (!workStepTypeId) {\n return;\n }\n\n for (const [index, item] of items.entries()) {\n const stepTableRow = item.stepTableRow;\n if (!stepTableRow || !item.id) {\n continue;\n }\n const title =\n stepTableRow.title?.trim() ||\n summarizeStepTableRow(stepTableRow.cells ?? [], columns) ||\n item.items?.[0]?.title;\n const entityPayload = {\n safetyPlanId,\n safetyPlanSectionId: sectionId,\n workStepTypeId,\n workStepType: workStepType ?? { id: workStepTypeId },\n title,\n columns,\n cells: stepTableRow.cells ?? [],\n sortOrder: stepTableRow.sortOrder ?? index + 1,\n };\n\n if (existingIds.has(item.id)) {\n await workStepData.update(item.id, entityPayload as never);\n } else {\n await workStepData.create({ ...entityPayload, id: item.id } as never);\n }\n }\n }\n\n private async deleteWorkStepsForSection(\n workStepData: ReturnType<ReturnType<AXPEntityService['withEntity']>['data']>,\n sectionId: string,\n ): Promise<void> {\n const existing = await workStepData.query({\n skip: 0,\n take: 1000,\n filter: {\n logic: 'and',\n filters: [{ field: 'safetyPlanSectionId', operator: { type: 'equal' }, value: sectionId }],\n },\n } as never);\n for (const row of existing.items ?? []) {\n const rowId = String((row as { id?: string }).id ?? '');\n if (rowId) {\n await workStepData.delete(rowId);\n }\n }\n }\n\n private async loadRepeatableSectionTypeIds(sectionTypeEntityRef: string): Promise<string[]> {\n const builtIn = collectBuiltInRepeatableSectionTypeIds();\n try {\n // Prefer client-side filtering — boolean equality filters can miss stored values.\n const result = await this.entityService.withEntity(sectionTypeEntityRef).data().query({\n skip: 0,\n take: 1000,\n } as never);\n const fromQuery = (result.items ?? [])\n .filter((row) => (row as { isRepeatable?: unknown }).isRepeatable === true)\n .map((row) => resolveEntityRefId((row as { id?: unknown }).id))\n .filter((id): id is string => !!id);\n return [...new Set([...fromQuery, ...builtIn])];\n } catch {\n return builtIn;\n }\n }\n\n private queryPlanSections(\n sectionData: ReturnType<ReturnType<AXPEntityService['withEntity']>['data']>,\n safetyPlanId: string,\n ) {\n return sectionData.query({\n skip: 0,\n take: 1000,\n filter: {\n logic: 'and',\n filters: [{ field: 'safetyPlanId', operator: { type: 'equal' }, value: safetyPlanId }],\n },\n } as never);\n }\n}\n"],"names":[],"mappings":";;;;;;;;SAkBgB,0CAA0C,GAAA;AACxD,IAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;AACzB;AAEM,SAAU,sCAAsC,CACpD,KAA0D,EAAA;AAE1D,IAAA,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;QAC5C,OAAO,0CAA0C,EAAE;IACrD;IAEA,OAAO;QACL,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,KAAK,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACnF;AACH;AAEM,SAAU,gCAAgC,CAC9C,IAAgE,EAAA;IAEhE,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAC5B,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAC9G;IACD,OAAO;QACL,QAAQ,EAAE,OAAO,CAAC,GAAG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;AACvB,YAAA,IAAI,EAAE,CAAC;AACP,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,MAAM,EAAE;AACN,gBAAA,KAAK,EAAE,KAAK;AACZ,gBAAA,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;AACvF,aAAA;AACO,SAAA,CAAC;IACb;8GA9SW,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAhC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,cAF/B,MAAM,EAAA,CAAA,CAAA;;2FAEP,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAH5C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;;;;;;;"}
@@ -0,0 +1,461 @@
1
+ import { AXPSessionService, AXP_PERMISSION_DEFINITION_PROVIDER } from '@acorex-platform/framework-client/auth';
2
+ import { AXPSearchCommandProvider, AXP_MENU_PROVIDER, AXP_SEARCH_PROVIDER, AXP_STATUS_PROVIDERS } from '@acorex-platform/framework-client/common';
3
+ import { AXP_MODULE_MANIFEST_PROVIDER, provideLazyProvider } from '@acorex-platform/framework-client/core';
4
+ import { AXP_PAGE_COMPONENT_PROVIDER } from '@acorex-platform/framework-client/layout/components';
5
+ import { AXPEntityService, AXP_ENTITY_STORAGE_MIDDLEWARE } from '@acorex-platform/framework-client/layout/entity';
6
+ import { AXP_WIDGETS_EDITOR_CATEGORY, AXPWidgetCoreModule, AXP_WIDGET_DEFINITION_PROVIDER } from '@acorex-platform/framework-client/layout/widget-core';
7
+ import { provideCommand, provideCommandSetups } from '@acorex-platform/framework-client/runtime';
8
+ import * as i0 from '@angular/core';
9
+ import { inject, Injectable, NgModule } from '@angular/core';
10
+ import { RootConfig, AXPSafetyRiskPermissionKeys, AXMWorkplaceSafetyManagementMenuKeys } from '@acorex-platform/module-workplacesafety-management-client/contracts';
11
+ import { AXPCommonMenuKeys, AXPCommonPermissionGroupKeys } from '@acorex-platform/module-common-client/contracts';
12
+ import { createSelectProperty, AXPWidgetGroupEnum } from '@acorex-platform/framework-shared/widget-core';
13
+ import { AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY, AXP_BEHAVIOR_PROPERTY_GROUP } from '@acorex-platform/framework-client/layout/widgets';
14
+ import { unset, isEmpty } from 'lodash';
15
+ import { AXPSystemStatusType } from '@acorex-platform/framework-shared/core';
16
+
17
+ const WorkplaceSafetyManagementManifest = {
18
+ name: RootConfig.module.name,
19
+ version: '1.0.0',
20
+ title: RootConfig.module.title,
21
+ icon: RootConfig.module.icon,
22
+ i18n: RootConfig.config.i18n,
23
+ type: 'domain',
24
+ domain: 'workplace-safety',
25
+ };
26
+
27
+ //#region ---- Imports ----
28
+ //#endregion
29
+ //#region ---- Menu provider ----
30
+ class AXMWorkplaceSafetyManagementMenuProvider {
31
+ constructor() {
32
+ this.entityService = inject(AXPEntityService);
33
+ }
34
+ async provide(context) {
35
+ const module = RootConfig.module;
36
+ const keys = AXPSafetyRiskPermissionKeys;
37
+ //#region ---- Main menu: Workplace Safety ----
38
+ const workplaceSafetyRoot = context.find(AXMWorkplaceSafetyManagementMenuKeys.Root);
39
+ if (!workplaceSafetyRoot.exists) {
40
+ context.addItems([
41
+ {
42
+ name: AXMWorkplaceSafetyManagementMenuKeys.Root,
43
+ priority: 8150,
44
+ text: `@${RootConfig.config.i18n}:module.menus.workplace-safety`,
45
+ icon: module.icon,
46
+ type: 'menu',
47
+ policy: {
48
+ features: [module.name],
49
+ },
50
+ children: [],
51
+ },
52
+ ]);
53
+ }
54
+ context.find(AXMWorkplaceSafetyManagementMenuKeys.Root).addItems([
55
+ {
56
+ name: AXMWorkplaceSafetyManagementMenuKeys.SafetyPlans,
57
+ text: RootConfig.entities.safetyPlan.titlePlural,
58
+ path: this.entityService.createPath(module.name, RootConfig.entities.safetyPlan.name),
59
+ icon: RootConfig.entities.safetyPlan.icon,
60
+ priority: 1,
61
+ policy: {
62
+ permissions: [keys.MaintainSafety],
63
+ },
64
+ },
65
+ ]);
66
+ //#endregion
67
+ //#region ---- Configuration: Workplace Safety ----
68
+ const workplaceSafetyConfiguration = context.find(AXMWorkplaceSafetyManagementMenuKeys.Configuration);
69
+ if (!workplaceSafetyConfiguration.exists) {
70
+ context.find(AXPCommonMenuKeys.Configuration).addItems([
71
+ {
72
+ name: AXMWorkplaceSafetyManagementMenuKeys.Configuration,
73
+ priority: 8945,
74
+ text: `@${RootConfig.config.i18n}:module.menus.workplace-safety`,
75
+ icon: module.icon,
76
+ type: 'menu',
77
+ policy: {
78
+ features: [module.name],
79
+ },
80
+ children: [],
81
+ },
82
+ ]);
83
+ }
84
+ context.find(AXMWorkplaceSafetyManagementMenuKeys.Configuration).addItems([
85
+ {
86
+ text: RootConfig.entities.hazard.titlePlural,
87
+ path: this.entityService.createPath(module.name, RootConfig.entities.hazard.name),
88
+ icon: RootConfig.entities.hazard.icon,
89
+ priority: 1,
90
+ policy: {
91
+ permissions: [keys.MaintainSafety],
92
+ },
93
+ },
94
+ {
95
+ text: RootConfig.entities.ppeItem.titlePlural,
96
+ path: this.entityService.createPath(module.name, RootConfig.entities.ppeItem.name),
97
+ icon: RootConfig.entities.ppeItem.icon,
98
+ priority: 2,
99
+ policy: {
100
+ permissions: [keys.MaintainSafety],
101
+ },
102
+ },
103
+ {
104
+ text: RootConfig.entities.controlHierarchyLevels.titlePlural,
105
+ path: this.entityService.createPath(module.name, RootConfig.entities.controlHierarchyLevels.name),
106
+ icon: RootConfig.entities.controlHierarchyLevels.icon,
107
+ priority: 3,
108
+ policy: {
109
+ permissions: [keys.Setup],
110
+ },
111
+ },
112
+ {
113
+ text: RootConfig.entities.controlMeasure.titlePlural,
114
+ path: this.entityService.createPath(module.name, RootConfig.entities.controlMeasure.name),
115
+ icon: RootConfig.entities.controlMeasure.icon,
116
+ priority: 4,
117
+ policy: {
118
+ permissions: [keys.MaintainSafety],
119
+ },
120
+ },
121
+ {
122
+ name: AXMWorkplaceSafetyManagementMenuKeys.SafetyPlanTypes,
123
+ text: RootConfig.entities.safetyPlanType.titlePlural,
124
+ path: this.entityService.createPath(module.name, RootConfig.entities.safetyPlanType.name),
125
+ icon: RootConfig.entities.safetyPlanType.icon,
126
+ priority: 5,
127
+ policy: {
128
+ permissions: [keys.Setup],
129
+ },
130
+ },
131
+ {
132
+ name: AXMWorkplaceSafetyManagementMenuKeys.SectionTypes,
133
+ text: RootConfig.entities.sectionType.titlePlural,
134
+ path: this.entityService.createPath(module.name, RootConfig.entities.sectionType.name),
135
+ icon: RootConfig.entities.sectionType.icon,
136
+ priority: 6,
137
+ policy: {
138
+ permissions: [keys.Setup],
139
+ },
140
+ },
141
+ {
142
+ name: AXMWorkplaceSafetyManagementMenuKeys.WorkStepTypes,
143
+ text: RootConfig.entities.workStepType.titlePlural,
144
+ path: this.entityService.createPath(module.name, RootConfig.entities.workStepType.name),
145
+ icon: RootConfig.entities.workStepType.icon,
146
+ priority: 7,
147
+ policy: {
148
+ permissions: [keys.Setup],
149
+ },
150
+ },
151
+ ]);
152
+ //#endregion
153
+ }
154
+ }
155
+ //#endregion
156
+
157
+ //#endregion
158
+ //#region ---- Permission Definition Provider ----
159
+ /**
160
+ * Registers workplace safety capabilities into the shared Safety & Risk group.
161
+ */
162
+ class AXMWorkplaceSafetyManagementPermissionDefinitionProvider {
163
+ async define(context) {
164
+ const keys = AXPSafetyRiskPermissionKeys;
165
+ const groups = AXPCommonPermissionGroupKeys;
166
+ const P = '@common:safety-risk.permissions';
167
+ const G = '@common:permission-groups';
168
+ context.addGroup(groups.SafetyRisk.Root, `${G}.safety-risk.title`, `${G}.safety-risk.description`, { order: 30 });
169
+ context
170
+ .addGroup(groups.SafetyRisk.WorkplaceSafety, `${G}.safety-risk-workplace-safety.title`, `${G}.safety-risk-workplace-safety.description`, { parent: groups.SafetyRisk.Root, order: 10 })
171
+ .addPermission(keys.Access, `${P}.access.title`, `${P}.access.description`)
172
+ .endPermission()
173
+ .addPermission(keys.MaintainSafety, `${P}.maintain-safety.title`, `${P}.maintain-safety.description`)
174
+ .endPermission()
175
+ .addPermission(keys.Setup, `${P}.setup.title`, `${P}.setup.description`)
176
+ .endPermission()
177
+ .endGroup();
178
+ }
179
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkplaceSafetyManagementPermissionDefinitionProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
180
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkplaceSafetyManagementPermissionDefinitionProvider }); }
181
+ }
182
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkplaceSafetyManagementPermissionDefinitionProvider, decorators: [{
183
+ type: Injectable
184
+ }] });
185
+
186
+ class AXMWorkplaceSafetyManagementSearchCommandProvider extends AXPSearchCommandProvider {
187
+ constructor() {
188
+ super(...arguments);
189
+ this.commands = [];
190
+ }
191
+ }
192
+
193
+ //#region ---- Imports ----
194
+ //#endregion
195
+ //#region ---- Widget Config ----
196
+ const AXMControlHierarchyDiagramWidget = {
197
+ name: 'control-hierarchy-diagram-editor',
198
+ title: '@workplacesafety-management:control-measure-types.components.control-hierarchy-diagram.widget-title',
199
+ description: '@workplacesafety-management:control-measure-types.components.control-hierarchy-diagram.widget-description',
200
+ icon: 'fa-light fa-layer-group',
201
+ categories: AXP_WIDGETS_EDITOR_CATEGORY,
202
+ groups: [AXPWidgetGroupEnum.UtilityWidget],
203
+ type: 'view',
204
+ options: {
205
+ needLabel: false,
206
+ },
207
+ properties: [
208
+ AXP_NAME_PROPERTY,
209
+ AXP_DATA_PATH_PROPERTY,
210
+ createSelectProperty({
211
+ name: 'viewType',
212
+ title: '@workplacesafety-management:control-measure-types.components.control-hierarchy-diagram.fields.view-type.title',
213
+ group: AXP_BEHAVIOR_PROPERTY_GROUP,
214
+ path: 'options.viewType',
215
+ defaultValue: { id: 'horizontal', title: 'Horizontal cards' },
216
+ dataSource: [
217
+ {
218
+ id: 'horizontal',
219
+ title: '@workplacesafety-management:control-measure-types.components.control-hierarchy-diagram.view-types.horizontal',
220
+ },
221
+ {
222
+ id: 'vertical',
223
+ title: '@workplacesafety-management:control-measure-types.components.control-hierarchy-diagram.view-types.vertical',
224
+ },
225
+ {
226
+ id: 'horizontal-chevron',
227
+ title: '@workplacesafety-management:control-measure-types.components.control-hierarchy-diagram.view-types.horizontal-chevron',
228
+ },
229
+ ],
230
+ }),
231
+ ],
232
+ components: {
233
+ view: {
234
+ component: () => import('./acorex-platform-module-workplacesafety-management-client-control-hierarchy-diagram-widget-view.component-C-qrrqOV.mjs').then((c) => c.AXMControlHierarchyDiagramWidgetViewComponent),
235
+ },
236
+ },
237
+ };
238
+ //#endregion
239
+
240
+ //#endregion
241
+ //#region ---- Widget Provider ----
242
+ class AXMWorkplaceSafetyManagementWidgetsProvider {
243
+ getWidgets() {
244
+ return [AXMControlHierarchyDiagramWidget];
245
+ }
246
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkplaceSafetyManagementWidgetsProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
247
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkplaceSafetyManagementWidgetsProvider }); }
248
+ }
249
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkplaceSafetyManagementWidgetsProvider, decorators: [{
250
+ type: Injectable
251
+ }] });
252
+
253
+ //#region ---- Imports ----
254
+ //#endregion
255
+ //#region ---- Middleware ----
256
+ /**
257
+ * Strips transient hierarchy diagram UI fields before persisting Control Hierarchy records.
258
+ * View type and diagram preview exist only on the entity form and must not be stored.
259
+ */
260
+ const controlHierarchyLevelsUiCleanupMiddleware = {
261
+ target: {
262
+ ops: ['create', 'update'],
263
+ order: 10,
264
+ },
265
+ execute: async (ctx, next) => {
266
+ const entityFullName = `${RootConfig.module.name}.${RootConfig.entities.controlHierarchyLevels.name}`;
267
+ if (ctx.entityName !== entityFullName || !ctx.data) {
268
+ await next();
269
+ return;
270
+ }
271
+ unset(ctx.data, 'hierarchyDiagramViewType');
272
+ unset(ctx.data, 'hierarchyDiagram');
273
+ await next();
274
+ },
275
+ };
276
+ //#endregion
277
+
278
+ //#region ---- Imports ----
279
+ //#endregion
280
+ //#region ---- Middleware ----
281
+ const safetyPlanEntityName = `${RootConfig.module.name}.${RootConfig.entities.safetyPlan.name}`;
282
+ /**
283
+ * Safety plan publication metadata is system-managed: stamped when status transitions to Published.
284
+ */
285
+ const safetyPlanPublicationMiddleware = {
286
+ target: {
287
+ ops: ['create', 'update'],
288
+ entity: safetyPlanEntityName,
289
+ order: 15,
290
+ },
291
+ execute: async (ctx, next) => {
292
+ if (!ctx.data || typeof ctx.data !== 'object') {
293
+ await next();
294
+ return;
295
+ }
296
+ const data = ctx.data;
297
+ if (ctx.op === 'create') {
298
+ unset(data, 'publishedAt');
299
+ unset(data, 'publishedById');
300
+ unset(data, 'publishedBy');
301
+ if (!data['status']) {
302
+ data['status'] = AXPSystemStatusType.Draft;
303
+ }
304
+ await next();
305
+ return;
306
+ }
307
+ const previous = ctx.previous ??
308
+ (ctx.id != null ? await ctx.backend.getOne(ctx.entityName, ctx.id).catch(() => null) : null);
309
+ const previousRecord = (previous ?? {});
310
+ const previousStatus = typeof previousRecord['status'] === 'string' ? previousRecord['status'] : undefined;
311
+ const nextStatus = typeof data['status'] === 'string' ? data['status'] : previousStatus;
312
+ unset(data, 'publishedAt');
313
+ unset(data, 'publishedById');
314
+ unset(data, 'publishedBy');
315
+ if (nextStatus === AXPSystemStatusType.Published &&
316
+ previousStatus !== AXPSystemStatusType.Published) {
317
+ data['publishedAt'] = new Date().toISOString();
318
+ const currentUserId = inject(AXPSessionService, { optional: true })?.user?.id;
319
+ if (!isEmpty(currentUserId)) {
320
+ data['publishedById'] = currentUserId;
321
+ }
322
+ }
323
+ else if (previousStatus === AXPSystemStatusType.Published) {
324
+ if (previousRecord['publishedAt']) {
325
+ data['publishedAt'] = previousRecord['publishedAt'];
326
+ }
327
+ if (previousRecord['publishedById']) {
328
+ data['publishedById'] = previousRecord['publishedById'];
329
+ }
330
+ if (previousRecord['publishedBy']) {
331
+ data['publishedBy'] = previousRecord['publishedBy'];
332
+ }
333
+ }
334
+ await next();
335
+ },
336
+ };
337
+ //#endregion
338
+
339
+ class AXMWorkplaceSafetyManagementModule {
340
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkplaceSafetyManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
341
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkplaceSafetyManagementModule, imports: [AXPWidgetCoreModule] }); }
342
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkplaceSafetyManagementModule, providers: [
343
+ {
344
+ provide: AXP_MODULE_MANIFEST_PROVIDER,
345
+ useValue: WorkplaceSafetyManagementManifest,
346
+ multi: true,
347
+ },
348
+ {
349
+ provide: AXP_PERMISSION_DEFINITION_PROVIDER,
350
+ useClass: AXMWorkplaceSafetyManagementPermissionDefinitionProvider,
351
+ multi: true,
352
+ },
353
+ {
354
+ provide: AXP_MENU_PROVIDER,
355
+ useClass: AXMWorkplaceSafetyManagementMenuProvider,
356
+ multi: true,
357
+ },
358
+ {
359
+ provide: AXP_ENTITY_STORAGE_MIDDLEWARE,
360
+ useValue: controlHierarchyLevelsUiCleanupMiddleware,
361
+ multi: true,
362
+ },
363
+ {
364
+ provide: AXP_ENTITY_STORAGE_MIDDLEWARE,
365
+ useValue: safetyPlanPublicationMiddleware,
366
+ multi: true,
367
+ },
368
+ {
369
+ provide: AXP_SEARCH_PROVIDER,
370
+ useClass: AXMWorkplaceSafetyManagementSearchCommandProvider,
371
+ multi: true,
372
+ },
373
+ provideLazyProvider(AXP_STATUS_PROVIDERS, () => import('./acorex-platform-module-workplacesafety-management-client-hazard-ppe-rule-status.provider-o4bAwYcq.mjs').then((m) => m.AXMWorkplaceSafetyManagementHazardPpeRuleStatusProvider)),
374
+ provideLazyProvider(AXP_STATUS_PROVIDERS, () => import('./acorex-platform-module-workplacesafety-management-client-hazard-risk-status.provider-B6IkRYbW.mjs').then((m) => m.AXMWorkplaceSafetyManagementHazardRiskStatusProvider)),
375
+ provideLazyProvider(AXP_STATUS_PROVIDERS, () => import('./acorex-platform-module-workplacesafety-management-client-hazard-risk-ppe-rule-status.provider-DtqzcWh0.mjs').then((m) => m.AXMWorkplaceSafetyManagementHazardRiskPpeRuleStatusProvider)),
376
+ provideLazyProvider(AXP_STATUS_PROVIDERS, () => import('./acorex-platform-module-workplacesafety-management-client-safety-plan-status.provider-BpWx3gIf.mjs').then((m) => m.AXMWorkplaceSafetyManagementSafetyPlanStatusProvider)),
377
+ provideLazyProvider(AXP_PAGE_COMPONENT_PROVIDER, () => import('./acorex-platform-module-workplacesafety-management-client-index-kF37zgd4.mjs').then((m) => m.AXMSafetyPlanSectionsPageComponentProvider)),
378
+ provideCommand('SafetyPlan:Sections:Save', () => import('./acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-BJsg3pHZ.mjs').then(function (n) { return n.b; }).then((m) => m.AXMSaveSafetyPlanSectionsCommand)),
379
+ {
380
+ provide: AXP_WIDGET_DEFINITION_PROVIDER,
381
+ useClass: AXMWorkplaceSafetyManagementWidgetsProvider,
382
+ multi: true,
383
+ },
384
+ provideCommandSetups([
385
+ {
386
+ key: `${RootConfig.module.name}.${RootConfig.entities.controlHierarchyLevels.name}:Preview`,
387
+ command: () => import('./acorex-platform-module-workplacesafety-management-client-preview-control-hierarchy-diagram.command-C2X3VpEt.mjs').then((c) => c.AXMPreviewControlHierarchyDiagramCommand),
388
+ },
389
+ {
390
+ key: `${RootConfig.module.name}.${RootConfig.entities.safetyPlan.name}:Publish`,
391
+ command: () => import('./acorex-platform-module-workplacesafety-management-client-publish-safety-plan.command-Ci-zcrmO.mjs').then((c) => c.AXMPublishSafetyPlanCommand),
392
+ },
393
+ ]),
394
+ ], imports: [AXPWidgetCoreModule] }); }
395
+ }
396
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMWorkplaceSafetyManagementModule, decorators: [{
397
+ type: NgModule,
398
+ args: [{
399
+ imports: [AXPWidgetCoreModule],
400
+ providers: [
401
+ {
402
+ provide: AXP_MODULE_MANIFEST_PROVIDER,
403
+ useValue: WorkplaceSafetyManagementManifest,
404
+ multi: true,
405
+ },
406
+ {
407
+ provide: AXP_PERMISSION_DEFINITION_PROVIDER,
408
+ useClass: AXMWorkplaceSafetyManagementPermissionDefinitionProvider,
409
+ multi: true,
410
+ },
411
+ {
412
+ provide: AXP_MENU_PROVIDER,
413
+ useClass: AXMWorkplaceSafetyManagementMenuProvider,
414
+ multi: true,
415
+ },
416
+ {
417
+ provide: AXP_ENTITY_STORAGE_MIDDLEWARE,
418
+ useValue: controlHierarchyLevelsUiCleanupMiddleware,
419
+ multi: true,
420
+ },
421
+ {
422
+ provide: AXP_ENTITY_STORAGE_MIDDLEWARE,
423
+ useValue: safetyPlanPublicationMiddleware,
424
+ multi: true,
425
+ },
426
+ {
427
+ provide: AXP_SEARCH_PROVIDER,
428
+ useClass: AXMWorkplaceSafetyManagementSearchCommandProvider,
429
+ multi: true,
430
+ },
431
+ provideLazyProvider(AXP_STATUS_PROVIDERS, () => import('./acorex-platform-module-workplacesafety-management-client-hazard-ppe-rule-status.provider-o4bAwYcq.mjs').then((m) => m.AXMWorkplaceSafetyManagementHazardPpeRuleStatusProvider)),
432
+ provideLazyProvider(AXP_STATUS_PROVIDERS, () => import('./acorex-platform-module-workplacesafety-management-client-hazard-risk-status.provider-B6IkRYbW.mjs').then((m) => m.AXMWorkplaceSafetyManagementHazardRiskStatusProvider)),
433
+ provideLazyProvider(AXP_STATUS_PROVIDERS, () => import('./acorex-platform-module-workplacesafety-management-client-hazard-risk-ppe-rule-status.provider-DtqzcWh0.mjs').then((m) => m.AXMWorkplaceSafetyManagementHazardRiskPpeRuleStatusProvider)),
434
+ provideLazyProvider(AXP_STATUS_PROVIDERS, () => import('./acorex-platform-module-workplacesafety-management-client-safety-plan-status.provider-BpWx3gIf.mjs').then((m) => m.AXMWorkplaceSafetyManagementSafetyPlanStatusProvider)),
435
+ provideLazyProvider(AXP_PAGE_COMPONENT_PROVIDER, () => import('./acorex-platform-module-workplacesafety-management-client-index-kF37zgd4.mjs').then((m) => m.AXMSafetyPlanSectionsPageComponentProvider)),
436
+ provideCommand('SafetyPlan:Sections:Save', () => import('./acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-BJsg3pHZ.mjs').then(function (n) { return n.b; }).then((m) => m.AXMSaveSafetyPlanSectionsCommand)),
437
+ {
438
+ provide: AXP_WIDGET_DEFINITION_PROVIDER,
439
+ useClass: AXMWorkplaceSafetyManagementWidgetsProvider,
440
+ multi: true,
441
+ },
442
+ provideCommandSetups([
443
+ {
444
+ key: `${RootConfig.module.name}.${RootConfig.entities.controlHierarchyLevels.name}:Preview`,
445
+ command: () => import('./acorex-platform-module-workplacesafety-management-client-preview-control-hierarchy-diagram.command-C2X3VpEt.mjs').then((c) => c.AXMPreviewControlHierarchyDiagramCommand),
446
+ },
447
+ {
448
+ key: `${RootConfig.module.name}.${RootConfig.entities.safetyPlan.name}:Publish`,
449
+ command: () => import('./acorex-platform-module-workplacesafety-management-client-publish-safety-plan.command-Ci-zcrmO.mjs').then((c) => c.AXMPublishSafetyPlanCommand),
450
+ },
451
+ ]),
452
+ ],
453
+ }]
454
+ }] });
455
+
456
+ /**
457
+ * Generated bundle index. Do not edit.
458
+ */
459
+
460
+ export { AXMWorkplaceSafetyManagementMenuProvider, AXMWorkplaceSafetyManagementModule, AXMWorkplaceSafetyManagementSearchCommandProvider };
461
+ //# sourceMappingURL=acorex-platform-module-workplacesafety-management-client.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-workplacesafety-management-client.mjs","sources":["../../../../libs/modules/workplacesafety-management/client/src/lib/manifest.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/menu.provider.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/permission-definition.provider.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/search-command.provider.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/features/control-hierarchy-diagram/control-hierarchy-diagram-widget.config.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/widget-definition.provider.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/middlewares/control-hierarchy-levels-ui-cleanup.middleware.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/middlewares/safety-plan-publication.middleware.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/workplacesafety-management.module.ts","../../../../libs/modules/workplacesafety-management/client/src/acorex-platform-module-workplacesafety-management-client.ts"],"sourcesContent":["import { AXPModuleManifest } from '@acorex-platform/framework-client/core';\nimport { RootConfig } from '@acorex-platform/module-workplacesafety-management-client/contracts';\n\nexport const WorkplaceSafetyManagementManifest: AXPModuleManifest = {\n name: RootConfig.module.name,\n version: '1.0.0',\n title: RootConfig.module.title,\n icon: RootConfig.module.icon,\n i18n: RootConfig.config.i18n,\n type: 'domain',\n domain: 'workplace-safety',\n};\n","//#region ---- Imports ----\n\nimport {\n AXPCommonMenuKeys\n} from '@acorex-platform/module-common-client/contracts';\nimport { AXPMenuProvider, AXPMenuProviderContext } from '@acorex-platform/framework-client/common';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { inject } from '@angular/core';\nimport {\n RootConfig,\n AXPSafetyRiskPermissionKeys\n} from '@acorex-platform/module-workplacesafety-management-client/contracts';\nimport { AXMWorkplaceSafetyManagementMenuKeys } from '@acorex-platform/module-workplacesafety-management-client/contracts';\n\n//#endregion\n\n//#region ---- Menu provider ----\n\nexport class AXMWorkplaceSafetyManagementMenuProvider implements AXPMenuProvider {\n private entityService = inject(AXPEntityService);\n\n public async provide(context: AXPMenuProviderContext): Promise<void> {\n const module = RootConfig.module;\n const keys = AXPSafetyRiskPermissionKeys;\n\n //#region ---- Main menu: Workplace Safety ----\n\n const workplaceSafetyRoot = context.find(AXMWorkplaceSafetyManagementMenuKeys.Root);\n if (!workplaceSafetyRoot.exists) {\n context.addItems([\n {\n name: AXMWorkplaceSafetyManagementMenuKeys.Root,\n priority: 8150,\n text: `@${RootConfig.config.i18n}:module.menus.workplace-safety`,\n icon: module.icon,\n type: 'menu',\n policy: {\n features: [module.name],\n },\n children: [],\n },\n ]);\n }\n\n context.find(AXMWorkplaceSafetyManagementMenuKeys.Root).addItems([\n {\n name: AXMWorkplaceSafetyManagementMenuKeys.SafetyPlans,\n text: RootConfig.entities.safetyPlan.titlePlural,\n path: this.entityService.createPath(module.name, RootConfig.entities.safetyPlan.name),\n icon: RootConfig.entities.safetyPlan.icon,\n priority: 1,\n policy: {\n permissions: [keys.MaintainSafety],\n },\n },\n ]);\n\n //#endregion\n\n //#region ---- Configuration: Workplace Safety ----\n\n const workplaceSafetyConfiguration = context.find(AXMWorkplaceSafetyManagementMenuKeys.Configuration);\n if (!workplaceSafetyConfiguration.exists) {\n context.find(AXPCommonMenuKeys.Configuration).addItems([\n {\n name: AXMWorkplaceSafetyManagementMenuKeys.Configuration,\n priority: 8945,\n text: `@${RootConfig.config.i18n}:module.menus.workplace-safety`,\n icon: module.icon,\n type: 'menu',\n policy: {\n features: [module.name],\n },\n children: [],\n },\n ]);\n }\n\n context.find(AXMWorkplaceSafetyManagementMenuKeys.Configuration).addItems([\n {\n text: RootConfig.entities.hazard.titlePlural,\n path: this.entityService.createPath(module.name, RootConfig.entities.hazard.name),\n icon: RootConfig.entities.hazard.icon,\n priority: 1,\n policy: {\n permissions: [keys.MaintainSafety],\n },\n },\n {\n text: RootConfig.entities.ppeItem.titlePlural,\n path: this.entityService.createPath(module.name, RootConfig.entities.ppeItem.name),\n icon: RootConfig.entities.ppeItem.icon,\n priority: 2,\n policy: {\n permissions: [keys.MaintainSafety],\n },\n },\n {\n text: RootConfig.entities.controlHierarchyLevels.titlePlural,\n path: this.entityService.createPath(module.name, RootConfig.entities.controlHierarchyLevels.name),\n icon: RootConfig.entities.controlHierarchyLevels.icon,\n priority: 3,\n policy: {\n permissions: [keys.Setup],\n },\n },\n {\n text: RootConfig.entities.controlMeasure.titlePlural,\n path: this.entityService.createPath(module.name, RootConfig.entities.controlMeasure.name),\n icon: RootConfig.entities.controlMeasure.icon,\n priority: 4,\n policy: {\n permissions: [keys.MaintainSafety],\n },\n },\n {\n name: AXMWorkplaceSafetyManagementMenuKeys.SafetyPlanTypes,\n text: RootConfig.entities.safetyPlanType.titlePlural,\n path: this.entityService.createPath(module.name, RootConfig.entities.safetyPlanType.name),\n icon: RootConfig.entities.safetyPlanType.icon,\n priority: 5,\n policy: {\n permissions: [keys.Setup],\n },\n },\n {\n name: AXMWorkplaceSafetyManagementMenuKeys.SectionTypes,\n text: RootConfig.entities.sectionType.titlePlural,\n path: this.entityService.createPath(module.name, RootConfig.entities.sectionType.name),\n icon: RootConfig.entities.sectionType.icon,\n priority: 6,\n policy: {\n permissions: [keys.Setup],\n },\n },\n {\n name: AXMWorkplaceSafetyManagementMenuKeys.WorkStepTypes,\n text: RootConfig.entities.workStepType.titlePlural,\n path: this.entityService.createPath(module.name, RootConfig.entities.workStepType.name),\n icon: RootConfig.entities.workStepType.icon,\n priority: 7,\n policy: {\n permissions: [keys.Setup],\n },\n },\n ]);\n\n //#endregion\n }\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPPermissionDefinitionProvider, AXPPermissionDefinitionProviderContext } from '@acorex-platform/framework-client/auth';\nimport { AXPCommonPermissionGroupKeys } from '@acorex-platform/module-common-client/contracts';\nimport { AXPSafetyRiskPermissionKeys } from '@acorex-platform/module-workplacesafety-management-client/contracts';\n\nimport { Injectable } from '@angular/core';\n\n//#endregion\n\n//#region ---- Permission Definition Provider ----\n\n/**\n * Registers workplace safety capabilities into the shared Safety & Risk group.\n */\n@Injectable()\nexport class AXMWorkplaceSafetyManagementPermissionDefinitionProvider implements AXPPermissionDefinitionProvider {\n async define(context: AXPPermissionDefinitionProviderContext): Promise<void> {\n const keys = AXPSafetyRiskPermissionKeys;\n const groups = AXPCommonPermissionGroupKeys;\n const P = '@common:safety-risk.permissions';\n const G = '@common:permission-groups';\n\n context.addGroup(groups.SafetyRisk.Root, `${G}.safety-risk.title`, `${G}.safety-risk.description`, { order: 30 });\n\n context\n .addGroup(groups.SafetyRisk.WorkplaceSafety, `${G}.safety-risk-workplace-safety.title`, `${G}.safety-risk-workplace-safety.description`, { parent: groups.SafetyRisk.Root, order: 10 })\n .addPermission(keys.Access, `${P}.access.title`, `${P}.access.description`)\n .endPermission()\n .addPermission(keys.MaintainSafety, `${P}.maintain-safety.title`, `${P}.maintain-safety.description`)\n .endPermission()\n .addPermission(keys.Setup, `${P}.setup.title`, `${P}.setup.description`)\n .endPermission()\n .endGroup();\n }\n}\n\n//#endregion\n","import { AXPSearchCommandProvider, AXPSearchResult } from '@acorex-platform/framework-client/common';\n\nexport class AXMWorkplaceSafetyManagementSearchCommandProvider extends AXPSearchCommandProvider {\n public commands: AXPSearchResult[] = [];\n}\n","//#region ---- Imports ----\n\nimport { AXPWidgetConfig, AXPWidgetGroupEnum, createSelectProperty } from '@acorex-platform/framework-shared/widget-core';\nimport { AXP_WIDGETS_EDITOR_CATEGORY } from '@acorex-platform/framework-client/layout/widget-core';\nimport {\n AXP_BEHAVIOR_PROPERTY_GROUP,\n AXP_DATA_PATH_PROPERTY,\n AXP_NAME_PROPERTY,\n} from '@acorex-platform/framework-client/layout/widgets';\n\nimport { type AXMControlHierarchyDiagramViewTypeOption } from './control-hierarchy-diagram.types';\n\n//#endregion\n\n//#region ---- Widget Config ----\n\nexport const AXMControlHierarchyDiagramWidget: AXPWidgetConfig = {\n name: 'control-hierarchy-diagram-editor',\n title: '@workplacesafety-management:control-measure-types.components.control-hierarchy-diagram.widget-title',\n description: '@workplacesafety-management:control-measure-types.components.control-hierarchy-diagram.widget-description',\n icon: 'fa-light fa-layer-group',\n categories: AXP_WIDGETS_EDITOR_CATEGORY,\n groups: [AXPWidgetGroupEnum.UtilityWidget],\n type: 'view',\n options: {\n needLabel: false,\n },\n properties: [\n AXP_NAME_PROPERTY,\n AXP_DATA_PATH_PROPERTY,\n createSelectProperty({\n name: 'viewType',\n title: '@workplacesafety-management:control-measure-types.components.control-hierarchy-diagram.fields.view-type.title',\n group: AXP_BEHAVIOR_PROPERTY_GROUP,\n path: 'options.viewType',\n defaultValue: { id: 'horizontal', title: 'Horizontal cards' },\n dataSource: [\n {\n id: 'horizontal',\n title:\n '@workplacesafety-management:control-measure-types.components.control-hierarchy-diagram.view-types.horizontal',\n },\n {\n id: 'vertical',\n title:\n '@workplacesafety-management:control-measure-types.components.control-hierarchy-diagram.view-types.vertical',\n },\n {\n id: 'horizontal-chevron',\n title:\n '@workplacesafety-management:control-measure-types.components.control-hierarchy-diagram.view-types.horizontal-chevron',\n },\n ],\n }),\n ],\n components: {\n view: {\n component: () =>\n import('./control-hierarchy-diagram-widget-view.component').then(\n (c) => c.AXMControlHierarchyDiagramWidgetViewComponent,\n ),\n },\n },\n};\n\nexport type AXMControlHierarchyDiagramWidgetOptions = {\n /** Default layout when context has no `hierarchyDiagramViewType`. */\n viewType?: AXMControlHierarchyDiagramViewTypeOption;\n highlightLevelId?: string;\n showTitle?: boolean;\n showViewTypeSelector?: boolean;\n};\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPWidgetDefinitionProvider } from '@acorex-platform/framework-client/layout/widget-core';\nimport { Injectable } from '@angular/core';\n\nimport { AXMControlHierarchyDiagramWidget } from './features/control-hierarchy-diagram/control-hierarchy-diagram-widget.config';\n\n//#endregion\n\n//#region ---- Widget Provider ----\n\n@Injectable()\nexport class AXMWorkplaceSafetyManagementWidgetsProvider implements AXPWidgetDefinitionProvider {\n getWidgets() {\n return [AXMControlHierarchyDiagramWidget];\n }\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPEntityStorageMiddleware } from '@acorex-platform/framework-client/layout/entity';\nimport { unset } from 'lodash';\n\nimport { RootConfig } from '@acorex-platform/module-workplacesafety-management-client/contracts';\n\n//#endregion\n\n//#region ---- Middleware ----\n\n/**\n * Strips transient hierarchy diagram UI fields before persisting Control Hierarchy records.\n * View type and diagram preview exist only on the entity form and must not be stored.\n */\nexport const controlHierarchyLevelsUiCleanupMiddleware: AXPEntityStorageMiddleware = {\n target: {\n ops: ['create', 'update'],\n order: 10,\n },\n\n execute: async (ctx, next) => {\n const entityFullName = `${RootConfig.module.name}.${RootConfig.entities.controlHierarchyLevels.name}`;\n\n if (ctx.entityName !== entityFullName || !ctx.data) {\n await next();\n return;\n }\n\n unset(ctx.data, 'hierarchyDiagramViewType');\n unset(ctx.data, 'hierarchyDiagram');\n\n await next();\n },\n};\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPEntityStorageMiddleware } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPSystemStatusType } from '@acorex-platform/framework-shared/core';\nimport { RootConfig } from '@acorex-platform/module-workplacesafety-management-client/contracts';\nimport { inject } from '@angular/core';\nimport { isEmpty, unset } from 'lodash';\n\n//#endregion\n\n//#region ---- Middleware ----\n\nconst safetyPlanEntityName = `${RootConfig.module.name}.${RootConfig.entities.safetyPlan.name}`;\n\n/**\n * Safety plan publication metadata is system-managed: stamped when status transitions to Published.\n */\nexport const safetyPlanPublicationMiddleware: AXPEntityStorageMiddleware = {\n target: {\n ops: ['create', 'update'],\n entity: safetyPlanEntityName,\n order: 15,\n },\n\n execute: async (ctx, next) => {\n if (!ctx.data || typeof ctx.data !== 'object') {\n await next();\n return;\n }\n\n const data = ctx.data as Record<string, unknown>;\n\n if (ctx.op === 'create') {\n unset(data, 'publishedAt');\n unset(data, 'publishedById');\n unset(data, 'publishedBy');\n if (!data['status']) {\n data['status'] = AXPSystemStatusType.Draft;\n }\n await next();\n return;\n }\n\n const previous =\n ctx.previous ??\n (ctx.id != null ? await ctx.backend.getOne(ctx.entityName, ctx.id).catch(() => null) : null);\n const previousRecord = (previous ?? {}) as Record<string, unknown>;\n const previousStatus =\n typeof previousRecord['status'] === 'string' ? (previousRecord['status'] as string) : undefined;\n const nextStatus = typeof data['status'] === 'string' ? (data['status'] as string) : previousStatus;\n\n unset(data, 'publishedAt');\n unset(data, 'publishedById');\n unset(data, 'publishedBy');\n\n if (\n nextStatus === AXPSystemStatusType.Published &&\n previousStatus !== AXPSystemStatusType.Published\n ) {\n data['publishedAt'] = new Date().toISOString();\n const currentUserId = inject(AXPSessionService, { optional: true })?.user?.id;\n if (!isEmpty(currentUserId)) {\n data['publishedById'] = currentUserId;\n }\n } else if (previousStatus === AXPSystemStatusType.Published) {\n if (previousRecord['publishedAt']) {\n data['publishedAt'] = previousRecord['publishedAt'];\n }\n if (previousRecord['publishedById']) {\n data['publishedById'] = previousRecord['publishedById'];\n }\n if (previousRecord['publishedBy']) {\n data['publishedBy'] = previousRecord['publishedBy'];\n }\n }\n\n await next();\n },\n};\n\n//#endregion\n","import { AXP_PERMISSION_DEFINITION_PROVIDER } from '@acorex-platform/framework-client/auth';\nimport { AXP_MENU_PROVIDER, AXP_SEARCH_PROVIDER, AXP_STATUS_PROVIDERS } from '@acorex-platform/framework-client/common';\nimport { AXP_MODULE_MANIFEST_PROVIDER, provideLazyProvider } from '@acorex-platform/framework-client/core';\nimport { AXP_PAGE_COMPONENT_PROVIDER } from '@acorex-platform/framework-client/layout/components';\nimport { AXP_ENTITY_STORAGE_MIDDLEWARE } from '@acorex-platform/framework-client/layout/entity';\nimport { AXP_WIDGET_DEFINITION_PROVIDER, AXPWidgetCoreModule } from '@acorex-platform/framework-client/layout/widget-core';\nimport { provideCommand, provideCommandSetups } from '@acorex-platform/framework-client/runtime';\nimport { NgModule } from '@angular/core';\n\nimport { RootConfig } from '@acorex-platform/module-workplacesafety-management-client/contracts';\nimport { WorkplaceSafetyManagementManifest } from './manifest';\nimport { AXMWorkplaceSafetyManagementMenuProvider } from './menu.provider';\nimport { AXMWorkplaceSafetyManagementPermissionDefinitionProvider } from './permission-definition.provider';\nimport { AXMWorkplaceSafetyManagementSearchCommandProvider } from './search-command.provider';\nimport { AXMWorkplaceSafetyManagementWidgetsProvider } from './widget-definition.provider';\nimport { controlHierarchyLevelsUiCleanupMiddleware, safetyPlanPublicationMiddleware } from './middlewares';\n\n@NgModule({\n imports: [AXPWidgetCoreModule],\n providers: [\n\n {\n provide: AXP_MODULE_MANIFEST_PROVIDER,\n useValue: WorkplaceSafetyManagementManifest,\n multi: true,\n },\n {\n provide: AXP_PERMISSION_DEFINITION_PROVIDER,\n useClass: AXMWorkplaceSafetyManagementPermissionDefinitionProvider,\n multi: true,\n },\n {\n provide: AXP_MENU_PROVIDER,\n useClass: AXMWorkplaceSafetyManagementMenuProvider,\n multi: true,\n },\n \n {\n provide: AXP_ENTITY_STORAGE_MIDDLEWARE,\n useValue: controlHierarchyLevelsUiCleanupMiddleware,\n multi: true,\n },\n {\n provide: AXP_ENTITY_STORAGE_MIDDLEWARE,\n useValue: safetyPlanPublicationMiddleware,\n multi: true,\n },\n {\n provide: AXP_SEARCH_PROVIDER,\n useClass: AXMWorkplaceSafetyManagementSearchCommandProvider,\n multi: true,\n },\n provideLazyProvider(AXP_STATUS_PROVIDERS, () =>\n import('./features/hazard-ppe-rule-status.provider').then(\n (m) => m.AXMWorkplaceSafetyManagementHazardPpeRuleStatusProvider,\n ),\n ),\n provideLazyProvider(AXP_STATUS_PROVIDERS, () =>\n import('./features/hazard-risk-status.provider').then(\n (m) => m.AXMWorkplaceSafetyManagementHazardRiskStatusProvider,\n ),\n ),\n provideLazyProvider(AXP_STATUS_PROVIDERS, () =>\n import('./features/hazard-risk-ppe-rule-status.provider').then(\n (m) => m.AXMWorkplaceSafetyManagementHazardRiskPpeRuleStatusProvider,\n ),\n ),\n provideLazyProvider(AXP_STATUS_PROVIDERS, () =>\n import('./features/safety-plan-status.provider').then(\n (m) => m.AXMWorkplaceSafetyManagementSafetyPlanStatusProvider,\n ),\n ),\n provideLazyProvider(AXP_PAGE_COMPONENT_PROVIDER, () =>\n import('./features/safety-plan-sections-page').then((m) => m.AXMSafetyPlanSectionsPageComponentProvider),\n ),\n provideCommand('SafetyPlan:Sections:Save', () =>\n import('./features/safety-plan-sections-page/save-safety-plan-sections.command').then(\n (m) => m.AXMSaveSafetyPlanSectionsCommand,\n ),\n ),\n {\n provide: AXP_WIDGET_DEFINITION_PROVIDER,\n useClass: AXMWorkplaceSafetyManagementWidgetsProvider,\n multi: true,\n },\n provideCommandSetups([\n {\n key: `${RootConfig.module.name}.${RootConfig.entities.controlHierarchyLevels.name}:Preview`,\n command: () =>\n import('./features/control-hierarchy-diagram/commands/preview-control-hierarchy-diagram.command').then(\n (c) => c.AXMPreviewControlHierarchyDiagramCommand,\n ),\n },\n {\n key: `${RootConfig.module.name}.${RootConfig.entities.safetyPlan.name}:Publish`,\n command: () =>\n import('./features/safety-plan/commands/publish-safety-plan.command').then(\n (c) => c.AXMPublishSafetyPlanCommand,\n ),\n },\n ]),\n ],\n})\nexport class AXMWorkplaceSafetyManagementModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;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