@almadar/cli 1.0.6 → 1.0.8

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 (605) hide show
  1. package/package.json +6 -6
  2. package/shells/python-shell/.dockerignore +0 -50
  3. package/shells/python-shell/.env.example +0 -55
  4. package/shells/python-shell/Dockerfile +0 -56
  5. package/shells/python-shell/README.md +0 -253
  6. package/shells/python-shell/cloudbuild.yaml +0 -76
  7. package/shells/python-shell/docker-compose.yaml +0 -57
  8. package/shells/python-shell/pyproject.toml +0 -28
  9. package/shells/python-shell/scripts/deploy.sh +0 -108
  10. package/shells/python-shell/scripts/setup-secrets.sh +0 -104
  11. package/shells/python-shell/src/orbital_app/__init__.py +0 -8
  12. package/shells/python-shell/src/orbital_app/core/__init__.py +0 -40
  13. package/shells/python-shell/src/orbital_app/core/bindings.py +0 -75
  14. package/shells/python-shell/src/orbital_app/core/effect_executor.py +0 -196
  15. package/shells/python-shell/src/orbital_app/core/event_bus.py +0 -119
  16. package/shells/python-shell/src/orbital_app/core/event_router.py +0 -38
  17. package/shells/python-shell/src/orbital_app/core/firebase.py +0 -112
  18. package/shells/python-shell/src/orbital_app/core/repository.py +0 -257
  19. package/shells/python-shell/src/orbital_app/core/settings.py +0 -74
  20. package/shells/python-shell/src/orbital_app/core/websocket.py +0 -202
  21. package/shells/python-shell/src/orbital_app/main.py +0 -108
  22. package/shells/python-shell/src/orbital_app/middleware/__init__.py +0 -18
  23. package/shells/python-shell/src/orbital_app/middleware/auth.py +0 -126
  24. package/shells/python-shell/src/orbital_app/nn/__init__.py +0 -28
  25. package/shells/python-shell/src/orbital_app/nn/constraints.py +0 -104
  26. package/shells/python-shell/src/orbital_app/nn/forward.py +0 -34
  27. package/shells/python-shell/src/orbital_app/nn/training.py +0 -101
  28. package/shells/python-shell/src/orbital_app/tensor/__init__.py +0 -46
  29. package/shells/python-shell/src/orbital_app/tensor/contracts.py +0 -112
  30. package/shells/python-shell/src/orbital_app/tensor/ops.py +0 -196
  31. package/shells/python-shell/tests/conftest.py +0 -63
  32. package/shells/python-shell/tests/test_effect_executor.py +0 -197
  33. package/shells/python-shell/tests/test_event_bus.py +0 -194
  34. package/shells/python-shell/tests/test_generated_traits.py +0 -268
  35. package/shells/python-shell/tests/test_integration.py +0 -347
  36. package/shells/python-shell/tests/test_nn_builder.py +0 -113
  37. package/shells/python-shell/tests/test_nn_constraints.py +0 -187
  38. package/shells/python-shell/tests/test_nn_forward.py +0 -98
  39. package/shells/python-shell/tests/test_nn_training.py +0 -130
  40. package/shells/python-shell/tests/test_repository.py +0 -151
  41. package/shells/python-shell/tests/test_tensor_contracts.py +0 -168
  42. package/shells/python-shell/tests/test_tensor_ops.py +0 -260
  43. package/shells/typescript-shell/.env.example +0 -30
  44. package/shells/typescript-shell/.firebaserc.template +0 -14
  45. package/shells/typescript-shell/.prettierrc +0 -7
  46. package/shells/typescript-shell/Dockerfile +0 -0
  47. package/shells/typescript-shell/apphosting.yaml.template +0 -0
  48. package/shells/typescript-shell/firebase.json.template +0 -0
  49. package/shells/typescript-shell/firestore.indexes.json +0 -4
  50. package/shells/typescript-shell/firestore.rules.template +0 -0
  51. package/shells/typescript-shell/infra/aws/alb.tf +0 -0
  52. package/shells/typescript-shell/infra/aws/cloudfront.tf +0 -0
  53. package/shells/typescript-shell/infra/aws/ecs.tf +0 -0
  54. package/shells/typescript-shell/infra/aws/main.tf +0 -0
  55. package/shells/typescript-shell/infra/aws/rds.tf +0 -0
  56. package/shells/typescript-shell/infra/docker/Dockerfile.client +0 -0
  57. package/shells/typescript-shell/infra/docker/Dockerfile.server +0 -0
  58. package/shells/typescript-shell/infra/docker/docker-compose.prod.yml +0 -45
  59. package/shells/typescript-shell/infra/docker/docker-compose.yml +0 -57
  60. package/shells/typescript-shell/infra/docker/nginx.conf +0 -0
  61. package/shells/typescript-shell/infra/main.tf +0 -0
  62. package/shells/typescript-shell/infra/terraform/aws/alb.tf +0 -0
  63. package/shells/typescript-shell/infra/terraform/aws/cloudfront.tf +0 -0
  64. package/shells/typescript-shell/infra/terraform/aws/ecs.tf +0 -0
  65. package/shells/typescript-shell/infra/terraform/aws/main.tf +0 -0
  66. package/shells/typescript-shell/infra/terraform/aws/rds.tf +0 -0
  67. package/shells/typescript-shell/infra/terraform/main.tf +0 -0
  68. package/shells/typescript-shell/infra/terraform/variables.tf +0 -0
  69. package/shells/typescript-shell/infra/variables.tf +0 -0
  70. package/shells/typescript-shell/package-lock.json +0 -15210
  71. package/shells/typescript-shell/package.json +0 -64
  72. package/shells/typescript-shell/packages/client/.env.example +0 -30
  73. package/shells/typescript-shell/packages/client/index.html +0 -13
  74. package/shells/typescript-shell/packages/client/package.json +0 -52
  75. package/shells/typescript-shell/packages/client/postcss.config.js +0 -6
  76. package/shells/typescript-shell/packages/client/src/App.tsx +0 -56
  77. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/atoms/CreditExpirationAlert.stories.tsx +0 -75
  78. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/atoms/CreditExpirationAlert.tsx +0 -157
  79. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/atoms/CreditMeter.stories.tsx +0 -155
  80. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/atoms/CreditMeter.tsx +0 -370
  81. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/atoms/ExerciseVideoLink.stories.tsx +0 -50
  82. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/atoms/ExerciseVideoLink.tsx +0 -143
  83. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/atoms/ShareableLinkGenerator.stories.tsx +0 -54
  84. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/atoms/ShareableLinkGenerator.tsx +0 -210
  85. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/atoms/index.ts +0 -4
  86. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/index.ts +0 -83
  87. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/BodyMeasurementInput.stories.tsx +0 -117
  88. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/BodyMeasurementInput.tsx +0 -343
  89. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/DailyProgressInput.stories.tsx +0 -82
  90. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/DailyProgressInput.tsx +0 -345
  91. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/GroupSessionCard.stories.tsx +0 -155
  92. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/GroupSessionCard.tsx +0 -319
  93. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/LiftTracker.stories.tsx +0 -110
  94. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/LiftTracker.tsx +0 -395
  95. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/MealPlanCard.stories.tsx +0 -132
  96. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/MealPlanCard.tsx +0 -394
  97. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/NutritionSummary.stories.tsx +0 -127
  98. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/NutritionSummary.tsx +0 -360
  99. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/ProgressChart.stories.tsx +0 -119
  100. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/ProgressChart.tsx +0 -377
  101. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/SpecialExerciseCard.stories.tsx +0 -115
  102. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/SpecialExerciseCard.tsx +0 -294
  103. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/TraineeCard.stories.tsx +0 -139
  104. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/TraineeCard.tsx +0 -306
  105. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/WorkoutPlanCard.stories.tsx +0 -140
  106. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/WorkoutPlanCard.tsx +0 -379
  107. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/molecules/index.ts +0 -10
  108. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/organisms/AIAnalysisPanel.stories.tsx +0 -171
  109. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/organisms/AIAnalysisPanel.tsx +0 -257
  110. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/organisms/KinesiologyExamForm.stories.tsx +0 -157
  111. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/organisms/KinesiologyExamForm.tsx +0 -383
  112. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/organisms/SessionScheduler.stories.tsx +0 -249
  113. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/organisms/SessionScheduler.tsx +0 -637
  114. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/organisms/TraineeComparison.stories.tsx +0 -221
  115. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/organisms/TraineeComparison.tsx +0 -438
  116. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/organisms/WeeklyCalendar.stories.tsx +0 -208
  117. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/organisms/WeeklyCalendar.tsx +0 -380
  118. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/organisms/index.ts +0 -5
  119. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/CreditsTemplate.stories.tsx +0 -243
  120. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/CreditsTemplate.tsx +0 -496
  121. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/FitnessTemplate.stories.tsx +0 -237
  122. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/FitnessTemplate.tsx +0 -457
  123. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/MealPlanDetailTemplate.stories.tsx +0 -184
  124. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/MealPlanDetailTemplate.tsx +0 -414
  125. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/MealPlansTemplate.stories.tsx +0 -198
  126. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/MealPlansTemplate.tsx +0 -296
  127. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/ProgressTemplate.stories.tsx +0 -242
  128. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/ProgressTemplate.tsx +0 -497
  129. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/ScheduleTemplate.stories.tsx +0 -267
  130. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/ScheduleTemplate.tsx +0 -424
  131. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/SessionDetailTemplate.stories.tsx +0 -214
  132. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/SessionDetailTemplate.tsx +0 -518
  133. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/SessionsTemplate.stories.tsx +0 -207
  134. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/SessionsTemplate.tsx +0 -508
  135. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/TraineeDetailTemplate.stories.tsx +0 -178
  136. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/TraineeDetailTemplate.tsx +0 -396
  137. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/TraineesTemplate.stories.tsx +0 -168
  138. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/TraineesTemplate.tsx +0 -429
  139. package/shells/typescript-shell/packages/client/src/clients/blaz-kelemnc/templates/index.ts +0 -44
  140. package/shells/typescript-shell/packages/client/src/clients/inspection-system/atoms/LawReferenceBadge.stories.tsx +0 -78
  141. package/shells/typescript-shell/packages/client/src/clients/inspection-system/atoms/LawReferenceBadge.tsx +0 -87
  142. package/shells/typescript-shell/packages/client/src/clients/inspection-system/atoms/PhaseIndicator.stories.tsx +0 -91
  143. package/shells/typescript-shell/packages/client/src/clients/inspection-system/atoms/PhaseIndicator.tsx +0 -142
  144. package/shells/typescript-shell/packages/client/src/clients/inspection-system/atoms/index.ts +0 -8
  145. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/index.ts +0 -79
  146. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-001-uvod.json +0 -361
  147. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-001-uvod.ts +0 -361
  148. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-002-podjetje.json +0 -115
  149. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-002-podjetje.ts +0 -115
  150. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-003-udelezenci.json +0 -78
  151. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-003-udelezenci.ts +0 -78
  152. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-004-izbira-podrocja.json +0 -85
  153. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-004-izbira-podrocja.ts +0 -94
  154. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-005-trgovina.json +0 -1056
  155. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-005-trgovina.ts +0 -1056
  156. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-006-ugotovitve.json +0 -128
  157. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-006-ugotovitve.ts +0 -128
  158. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-007-odlocbe.json +0 -136
  159. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-007-odlocbe.ts +0 -136
  160. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-008-pripombe.json +0 -148
  161. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-008-pripombe.ts +0 -148
  162. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-009-zakljucek.json +0 -207
  163. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T-009-zakljucek.ts +0 -207
  164. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T2-1-oznacevanje-cen.json +0 -1265
  165. package/shells/typescript-shell/packages/client/src/clients/inspection-system/configs/tabs/T2-1-oznacevanje-cen.ts +0 -1265
  166. package/shells/typescript-shell/packages/client/src/clients/inspection-system/index.ts +0 -137
  167. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/CardSelector.stories.tsx +0 -128
  168. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/CardSelector.tsx +0 -174
  169. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/ComplianceSummary.stories.tsx +0 -115
  170. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/ComplianceSummary.tsx +0 -263
  171. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/ConditionalField.tsx +0 -254
  172. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/DocumentPreview.tsx +0 -249
  173. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/EntitySearch.tsx +0 -290
  174. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/InspectionTimeline.stories.tsx +0 -138
  175. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/InspectionTimeline.tsx +0 -253
  176. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/ObjectionRecorder.tsx +0 -213
  177. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/ParticipantList.stories.tsx +0 -86
  178. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/ParticipantList.tsx +0 -227
  179. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/PhotoAttachment.tsx +0 -276
  180. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/ProgressHeader.stories.tsx +0 -89
  181. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/ProgressHeader.tsx +0 -157
  182. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/RepeatableFormSection.tsx +0 -189
  183. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/RuleCheckItem.stories.tsx +0 -118
  184. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/RuleCheckItem.tsx +0 -237
  185. package/shells/typescript-shell/packages/client/src/clients/inspection-system/molecules/index.ts +0 -18
  186. package/shells/typescript-shell/packages/client/src/clients/inspection-system/organisms/FloatingActionMenu.stories.tsx +0 -75
  187. package/shells/typescript-shell/packages/client/src/clients/inspection-system/organisms/FloatingActionMenu.tsx +0 -197
  188. package/shells/typescript-shell/packages/client/src/clients/inspection-system/organisms/SignatureCapture.stories.tsx +0 -96
  189. package/shells/typescript-shell/packages/client/src/clients/inspection-system/organisms/SignatureCapture.tsx +0 -278
  190. package/shells/typescript-shell/packages/client/src/clients/inspection-system/organisms/index.ts +0 -8
  191. package/shells/typescript-shell/packages/client/src/clients/inspection-system/templates/CompaniesTemplate.stories.tsx +0 -107
  192. package/shells/typescript-shell/packages/client/src/clients/inspection-system/templates/CompaniesTemplate.tsx +0 -266
  193. package/shells/typescript-shell/packages/client/src/clients/inspection-system/templates/InspectionFormDemoTemplate.stories.tsx +0 -607
  194. package/shells/typescript-shell/packages/client/src/clients/inspection-system/templates/InspectionFormDemoTemplate.tsx +0 -1428
  195. package/shells/typescript-shell/packages/client/src/clients/inspection-system/templates/InspectionProcessTemplate.stories.tsx +0 -713
  196. package/shells/typescript-shell/packages/client/src/clients/inspection-system/templates/InspectionProcessTemplate.tsx +0 -1582
  197. package/shells/typescript-shell/packages/client/src/clients/inspection-system/templates/InspectionWizardTemplate.stories.tsx +0 -174
  198. package/shells/typescript-shell/packages/client/src/clients/inspection-system/templates/InspectionWizardTemplate.tsx +0 -264
  199. package/shells/typescript-shell/packages/client/src/clients/inspection-system/templates/InspectionsTemplate.stories.tsx +0 -129
  200. package/shells/typescript-shell/packages/client/src/clients/inspection-system/templates/InspectionsTemplate.tsx +0 -287
  201. package/shells/typescript-shell/packages/client/src/clients/inspection-system/templates/InspectorsTemplate.stories.tsx +0 -94
  202. package/shells/typescript-shell/packages/client/src/clients/inspection-system/templates/InspectorsTemplate.tsx +0 -255
  203. package/shells/typescript-shell/packages/client/src/clients/inspection-system/templates/index.ts +0 -47
  204. package/shells/typescript-shell/packages/client/src/clients/kflow/atoms/MindMapConnections.stories.tsx +0 -82
  205. package/shells/typescript-shell/packages/client/src/clients/kflow/atoms/MindMapConnections.tsx +0 -75
  206. package/shells/typescript-shell/packages/client/src/clients/kflow/atoms/index.ts +0 -2
  207. package/shells/typescript-shell/packages/client/src/clients/kflow/index.ts +0 -96
  208. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/ConceptMetaTags.stories.tsx +0 -64
  209. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/ConceptMetaTags.tsx +0 -77
  210. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/GraphLegend.stories.tsx +0 -100
  211. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/GraphLegend.tsx +0 -120
  212. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/LayerNavigator.stories.tsx +0 -109
  213. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/LayerNavigator.tsx +0 -157
  214. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/LearningGoalDisplay.stories.tsx +0 -62
  215. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/LearningGoalDisplay.tsx +0 -138
  216. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/MindMapHeader.tsx +0 -47
  217. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/MindMapNode.stories.tsx +0 -212
  218. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/MindMapNode.tsx +0 -294
  219. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/NoteContent.stories.tsx +0 -98
  220. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/NoteContent.tsx +0 -163
  221. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/NoteListItem.stories.tsx +0 -196
  222. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/NoteListItem.tsx +0 -239
  223. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/QuizBlock.tsx +0 -3
  224. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/StreamingDisplay.stories.tsx +0 -132
  225. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/StreamingDisplay.tsx +0 -232
  226. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/index.ts +0 -28
  227. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/learning/ActivationBlock.stories.tsx +0 -71
  228. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/learning/ActivationBlock.tsx +0 -127
  229. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/learning/BloomQuizBlock.stories.tsx +0 -154
  230. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/learning/BloomQuizBlock.tsx +0 -232
  231. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/learning/ConnectionBlock.stories.tsx +0 -57
  232. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/learning/ConnectionBlock.tsx +0 -60
  233. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/learning/QuizBlock.tsx +0 -138
  234. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/learning/ReflectionBlock.stories.tsx +0 -90
  235. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/learning/ReflectionBlock.tsx +0 -151
  236. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/learning/index.ts +0 -14
  237. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/markdown/CodeBlock.stories.tsx +0 -188
  238. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/markdown/CodeBlock.tsx +0 -165
  239. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/markdown/MarkdownContent.stories.tsx +0 -160
  240. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/markdown/MarkdownContent.tsx +0 -131
  241. package/shells/typescript-shell/packages/client/src/clients/kflow/molecules/markdown/index.ts +0 -5
  242. package/shells/typescript-shell/packages/client/src/clients/kflow/organisms/ConceptCard.stories.tsx +0 -155
  243. package/shells/typescript-shell/packages/client/src/clients/kflow/organisms/ConceptCard.tsx +0 -301
  244. package/shells/typescript-shell/packages/client/src/clients/kflow/organisms/FlashCard.stories.tsx +0 -105
  245. package/shells/typescript-shell/packages/client/src/clients/kflow/organisms/FlashCard.tsx +0 -200
  246. package/shells/typescript-shell/packages/client/src/clients/kflow/organisms/FlashCardStack.stories.tsx +0 -97
  247. package/shells/typescript-shell/packages/client/src/clients/kflow/organisms/FlashCardStack.tsx +0 -163
  248. package/shells/typescript-shell/packages/client/src/clients/kflow/organisms/FlashCardsDisplay.tsx +0 -236
  249. package/shells/typescript-shell/packages/client/src/clients/kflow/organisms/ForceDirectedGraph.stories.tsx +0 -230
  250. package/shells/typescript-shell/packages/client/src/clients/kflow/organisms/ForceDirectedGraph.tsx +0 -488
  251. package/shells/typescript-shell/packages/client/src/clients/kflow/organisms/MindMapCanvas.stories.tsx +0 -256
  252. package/shells/typescript-shell/packages/client/src/clients/kflow/organisms/MindMapCanvas.tsx +0 -185
  253. package/shells/typescript-shell/packages/client/src/clients/kflow/organisms/NoteList.stories.tsx +0 -178
  254. package/shells/typescript-shell/packages/client/src/clients/kflow/organisms/NoteList.tsx +0 -209
  255. package/shells/typescript-shell/packages/client/src/clients/kflow/organisms/SegmentRenderer.stories.tsx +0 -238
  256. package/shells/typescript-shell/packages/client/src/clients/kflow/organisms/SegmentRenderer.tsx +0 -196
  257. package/shells/typescript-shell/packages/client/src/clients/kflow/organisms/index.ts +0 -18
  258. package/shells/typescript-shell/packages/client/src/clients/kflow/patterns/component-mapping.json +0 -122
  259. package/shells/typescript-shell/packages/client/src/clients/kflow/patterns/event-contracts.json +0 -145
  260. package/shells/typescript-shell/packages/client/src/clients/kflow/patterns/index.ts +0 -46
  261. package/shells/typescript-shell/packages/client/src/clients/kflow/templates/ConceptDetailTemplate.stories.tsx +0 -148
  262. package/shells/typescript-shell/packages/client/src/clients/kflow/templates/ConceptDetailTemplate.tsx +0 -266
  263. package/shells/typescript-shell/packages/client/src/clients/kflow/templates/KnowledgeGraphTemplate.stories.tsx +0 -215
  264. package/shells/typescript-shell/packages/client/src/clients/kflow/templates/KnowledgeGraphTemplate.tsx +0 -302
  265. package/shells/typescript-shell/packages/client/src/clients/kflow/templates/LessonTemplate.stories.tsx +0 -161
  266. package/shells/typescript-shell/packages/client/src/clients/kflow/templates/LessonTemplate.tsx +0 -264
  267. package/shells/typescript-shell/packages/client/src/clients/kflow/templates/index.ts +0 -4
  268. package/shells/typescript-shell/packages/client/src/clients/kflow/types/index.ts +0 -9
  269. package/shells/typescript-shell/packages/client/src/clients/kflow/types/mindMapTypes.ts +0 -13
  270. package/shells/typescript-shell/packages/client/src/clients/kflow/utils/index.ts +0 -6
  271. package/shells/typescript-shell/packages/client/src/clients/kflow/utils/parseLessonSegments.ts +0 -191
  272. package/shells/typescript-shell/packages/client/src/clients/winning-11/atoms/CareIndicator.tsx +0 -113
  273. package/shells/typescript-shell/packages/client/src/clients/winning-11/atoms/GrowthMeter.tsx +0 -216
  274. package/shells/typescript-shell/packages/client/src/clients/winning-11/atoms/SeasonIndicator.tsx +0 -140
  275. package/shells/typescript-shell/packages/client/src/clients/winning-11/atoms/TrustMeter.tsx +0 -221
  276. package/shells/typescript-shell/packages/client/src/clients/winning-11/atoms/index.ts +0 -15
  277. package/shells/typescript-shell/packages/client/src/clients/winning-11/index.ts +0 -159
  278. package/shells/typescript-shell/packages/client/src/clients/winning-11/molecules/HarvestCard.tsx +0 -254
  279. package/shells/typescript-shell/packages/client/src/clients/winning-11/molecules/PlantCard.tsx +0 -412
  280. package/shells/typescript-shell/packages/client/src/clients/winning-11/molecules/WeatherWidget.tsx +0 -229
  281. package/shells/typescript-shell/packages/client/src/clients/winning-11/molecules/index.ts +0 -12
  282. package/shells/typescript-shell/packages/client/src/clients/winning-11/organisms/GardenView.tsx +0 -344
  283. package/shells/typescript-shell/packages/client/src/clients/winning-11/organisms/index.ts +0 -6
  284. package/shells/typescript-shell/packages/client/src/clients/winning-11/templates/AdminDashboardTemplate.tsx +0 -423
  285. package/shells/typescript-shell/packages/client/src/clients/winning-11/templates/AssessmentTemplate.tsx +0 -409
  286. package/shells/typescript-shell/packages/client/src/clients/winning-11/templates/ConnectionsTemplate.tsx +0 -465
  287. package/shells/typescript-shell/packages/client/src/clients/winning-11/templates/GraphIntelligenceTemplate.tsx +0 -388
  288. package/shells/typescript-shell/packages/client/src/clients/winning-11/templates/InvitesTemplate.tsx +0 -359
  289. package/shells/typescript-shell/packages/client/src/clients/winning-11/templates/ProjectDetailTemplate.tsx +0 -483
  290. package/shells/typescript-shell/packages/client/src/clients/winning-11/templates/ProjectsTemplate.tsx +0 -474
  291. package/shells/typescript-shell/packages/client/src/clients/winning-11/templates/RelationshipGardenTemplate.tsx +0 -198
  292. package/shells/typescript-shell/packages/client/src/clients/winning-11/templates/SeedNetworkTemplate.tsx +0 -410
  293. package/shells/typescript-shell/packages/client/src/clients/winning-11/templates/SuggestionsTemplate.tsx +0 -352
  294. package/shells/typescript-shell/packages/client/src/clients/winning-11/templates/TeamDetailTemplate.tsx +0 -494
  295. package/shells/typescript-shell/packages/client/src/clients/winning-11/templates/TeamMembersTemplate.tsx +0 -427
  296. package/shells/typescript-shell/packages/client/src/clients/winning-11/templates/TeamsTemplate.tsx +0 -424
  297. package/shells/typescript-shell/packages/client/src/clients/winning-11/templates/TrustIntelligenceTemplate.tsx +0 -312
  298. package/shells/typescript-shell/packages/client/src/clients/winning-11/templates/UserProfileTemplate.tsx +0 -308
  299. package/shells/typescript-shell/packages/client/src/clients/winning-11/templates/UsersTemplate.tsx +0 -303
  300. package/shells/typescript-shell/packages/client/src/components/atoms/Avatar.tsx +0 -226
  301. package/shells/typescript-shell/packages/client/src/components/atoms/Badge.tsx +0 -79
  302. package/shells/typescript-shell/packages/client/src/components/atoms/Box.tsx +0 -262
  303. package/shells/typescript-shell/packages/client/src/components/atoms/Button.tsx +0 -150
  304. package/shells/typescript-shell/packages/client/src/components/atoms/Card.tsx +0 -151
  305. package/shells/typescript-shell/packages/client/src/components/atoms/Center.tsx +0 -67
  306. package/shells/typescript-shell/packages/client/src/components/atoms/Checkbox.tsx +0 -46
  307. package/shells/typescript-shell/packages/client/src/components/atoms/ConditionalWrapper.tsx +0 -139
  308. package/shells/typescript-shell/packages/client/src/components/atoms/Divider.tsx +0 -102
  309. package/shells/typescript-shell/packages/client/src/components/atoms/Icon.tsx +0 -224
  310. package/shells/typescript-shell/packages/client/src/components/atoms/Input.tsx +0 -192
  311. package/shells/typescript-shell/packages/client/src/components/atoms/Label.tsx +0 -26
  312. package/shells/typescript-shell/packages/client/src/components/atoms/LawReferenceTooltip.tsx +0 -190
  313. package/shells/typescript-shell/packages/client/src/components/atoms/Overlay.tsx +0 -37
  314. package/shells/typescript-shell/packages/client/src/components/atoms/ProgressBar.tsx +0 -256
  315. package/shells/typescript-shell/packages/client/src/components/atoms/Radio.tsx +0 -164
  316. package/shells/typescript-shell/packages/client/src/components/atoms/Select.tsx +0 -62
  317. package/shells/typescript-shell/packages/client/src/components/atoms/Spacer.tsx +0 -68
  318. package/shells/typescript-shell/packages/client/src/components/atoms/Spinner.tsx +0 -32
  319. package/shells/typescript-shell/packages/client/src/components/atoms/Stack.tsx +0 -151
  320. package/shells/typescript-shell/packages/client/src/components/atoms/Switch.tsx +0 -91
  321. package/shells/typescript-shell/packages/client/src/components/atoms/TextHighlight.tsx +0 -111
  322. package/shells/typescript-shell/packages/client/src/components/atoms/Textarea.tsx +0 -32
  323. package/shells/typescript-shell/packages/client/src/components/atoms/ThemeSelector.tsx +0 -128
  324. package/shells/typescript-shell/packages/client/src/components/atoms/ThemeToggle.tsx +0 -91
  325. package/shells/typescript-shell/packages/client/src/components/atoms/Typography.tsx +0 -207
  326. package/shells/typescript-shell/packages/client/src/components/atoms/game/ControlButton.tsx +0 -118
  327. package/shells/typescript-shell/packages/client/src/components/atoms/game/HealthBar.tsx +0 -93
  328. package/shells/typescript-shell/packages/client/src/components/atoms/game/ScoreDisplay.tsx +0 -86
  329. package/shells/typescript-shell/packages/client/src/components/atoms/game/Sprite.tsx +0 -188
  330. package/shells/typescript-shell/packages/client/src/components/atoms/game/index.ts +0 -12
  331. package/shells/typescript-shell/packages/client/src/components/atoms/index.ts +0 -88
  332. package/shells/typescript-shell/packages/client/src/components/index.ts +0 -4
  333. package/shells/typescript-shell/packages/client/src/components/molecules/Accordion.tsx +0 -223
  334. package/shells/typescript-shell/packages/client/src/components/molecules/Alert.tsx +0 -117
  335. package/shells/typescript-shell/packages/client/src/components/molecules/Breadcrumb.tsx +0 -159
  336. package/shells/typescript-shell/packages/client/src/components/molecules/ButtonGroup.tsx +0 -226
  337. package/shells/typescript-shell/packages/client/src/components/molecules/Card.tsx +0 -135
  338. package/shells/typescript-shell/packages/client/src/components/molecules/Container.tsx +0 -78
  339. package/shells/typescript-shell/packages/client/src/components/molecules/Drawer.tsx +0 -254
  340. package/shells/typescript-shell/packages/client/src/components/molecules/EmptyState.tsx +0 -132
  341. package/shells/typescript-shell/packages/client/src/components/molecules/ErrorState.tsx +0 -48
  342. package/shells/typescript-shell/packages/client/src/components/molecules/FilterGroup.tsx +0 -529
  343. package/shells/typescript-shell/packages/client/src/components/molecules/Flex.tsx +0 -131
  344. package/shells/typescript-shell/packages/client/src/components/molecules/FloatingActionButton.tsx +0 -264
  345. package/shells/typescript-shell/packages/client/src/components/molecules/FormField.tsx +0 -48
  346. package/shells/typescript-shell/packages/client/src/components/molecules/FormSectionHeader.tsx +0 -139
  347. package/shells/typescript-shell/packages/client/src/components/molecules/Grid.tsx +0 -194
  348. package/shells/typescript-shell/packages/client/src/components/molecules/InputGroup.tsx +0 -109
  349. package/shells/typescript-shell/packages/client/src/components/molecules/LoadingState.tsx +0 -39
  350. package/shells/typescript-shell/packages/client/src/components/molecules/Menu.tsx +0 -266
  351. package/shells/typescript-shell/packages/client/src/components/molecules/Modal.tsx +0 -171
  352. package/shells/typescript-shell/packages/client/src/components/molecules/Pagination.tsx +0 -254
  353. package/shells/typescript-shell/packages/client/src/components/molecules/Popover.tsx +0 -201
  354. package/shells/typescript-shell/packages/client/src/components/molecules/RelationSelect.tsx +0 -328
  355. package/shells/typescript-shell/packages/client/src/components/molecules/RepeatableFormSection.tsx +0 -236
  356. package/shells/typescript-shell/packages/client/src/components/molecules/SearchInput.tsx +0 -196
  357. package/shells/typescript-shell/packages/client/src/components/molecules/SidePanel.tsx +0 -116
  358. package/shells/typescript-shell/packages/client/src/components/molecules/SimpleGrid.tsx +0 -90
  359. package/shells/typescript-shell/packages/client/src/components/molecules/Tabs.tsx +0 -208
  360. package/shells/typescript-shell/packages/client/src/components/molecules/Toast.tsx +0 -154
  361. package/shells/typescript-shell/packages/client/src/components/molecules/Tooltip.tsx +0 -172
  362. package/shells/typescript-shell/packages/client/src/components/molecules/ViolationAlert.tsx +0 -253
  363. package/shells/typescript-shell/packages/client/src/components/molecules/WizardNavigation.tsx +0 -166
  364. package/shells/typescript-shell/packages/client/src/components/molecules/WizardProgress.tsx +0 -140
  365. package/shells/typescript-shell/packages/client/src/components/molecules/game/ActionButtons.tsx +0 -148
  366. package/shells/typescript-shell/packages/client/src/components/molecules/game/DPad.tsx +0 -98
  367. package/shells/typescript-shell/packages/client/src/components/molecules/game/StatBadge.tsx +0 -104
  368. package/shells/typescript-shell/packages/client/src/components/molecules/game/index.ts +0 -11
  369. package/shells/typescript-shell/packages/client/src/components/molecules/index.ts +0 -36
  370. package/shells/typescript-shell/packages/client/src/components/organisms/CardGrid.tsx +0 -479
  371. package/shells/typescript-shell/packages/client/src/components/organisms/ComponentPatterns.tsx +0 -1000
  372. package/shells/typescript-shell/packages/client/src/components/organisms/ConfirmDialog.tsx +0 -165
  373. package/shells/typescript-shell/packages/client/src/components/organisms/CustomPattern.tsx +0 -479
  374. package/shells/typescript-shell/packages/client/src/components/organisms/DataTable.tsx +0 -816
  375. package/shells/typescript-shell/packages/client/src/components/organisms/DetailPanel.tsx +0 -626
  376. package/shells/typescript-shell/packages/client/src/components/organisms/DrawerSlot.tsx +0 -86
  377. package/shells/typescript-shell/packages/client/src/components/organisms/Form.tsx +0 -968
  378. package/shells/typescript-shell/packages/client/src/components/organisms/FormSection.tsx +0 -168
  379. package/shells/typescript-shell/packages/client/src/components/organisms/Header.tsx +0 -263
  380. package/shells/typescript-shell/packages/client/src/components/organisms/LayoutPatterns.tsx +0 -325
  381. package/shells/typescript-shell/packages/client/src/components/organisms/List.tsx +0 -838
  382. package/shells/typescript-shell/packages/client/src/components/organisms/MasterDetail.tsx +0 -85
  383. package/shells/typescript-shell/packages/client/src/components/organisms/ModalSlot.tsx +0 -81
  384. package/shells/typescript-shell/packages/client/src/components/organisms/Navigation.tsx +0 -157
  385. package/shells/typescript-shell/packages/client/src/components/organisms/OrbitalVisualization.tsx +0 -480
  386. package/shells/typescript-shell/packages/client/src/components/organisms/PageHeader.tsx +0 -244
  387. package/shells/typescript-shell/packages/client/src/components/organisms/Section.tsx +0 -131
  388. package/shells/typescript-shell/packages/client/src/components/organisms/Sidebar.tsx +0 -270
  389. package/shells/typescript-shell/packages/client/src/components/organisms/Split.tsx +0 -121
  390. package/shells/typescript-shell/packages/client/src/components/organisms/StatCard.tsx +0 -360
  391. package/shells/typescript-shell/packages/client/src/components/organisms/Table.tsx +0 -394
  392. package/shells/typescript-shell/packages/client/src/components/organisms/ToastSlot.tsx +0 -106
  393. package/shells/typescript-shell/packages/client/src/components/organisms/UISlotRenderer.tsx +0 -647
  394. package/shells/typescript-shell/packages/client/src/components/organisms/WizardContainer.tsx +0 -369
  395. package/shells/typescript-shell/packages/client/src/components/organisms/debug/RuntimeDebugger.css +0 -102
  396. package/shells/typescript-shell/packages/client/src/components/organisms/debug/RuntimeDebugger.tsx +0 -176
  397. package/shells/typescript-shell/packages/client/src/components/organisms/debug/hooks/useDebugData.ts +0 -100
  398. package/shells/typescript-shell/packages/client/src/components/organisms/debug/index.ts +0 -10
  399. package/shells/typescript-shell/packages/client/src/components/organisms/debug/tabs/EntitiesTab.tsx +0 -130
  400. package/shells/typescript-shell/packages/client/src/components/organisms/debug/tabs/EventFlowTab.tsx +0 -135
  401. package/shells/typescript-shell/packages/client/src/components/organisms/debug/tabs/GuardsPanel.tsx +0 -124
  402. package/shells/typescript-shell/packages/client/src/components/organisms/debug/tabs/TicksTab.tsx +0 -100
  403. package/shells/typescript-shell/packages/client/src/components/organisms/debug/tabs/TraitsTab.tsx +0 -102
  404. package/shells/typescript-shell/packages/client/src/components/organisms/game/CollisionDetector.tsx +0 -195
  405. package/shells/typescript-shell/packages/client/src/components/organisms/game/DialogueBox.tsx +0 -279
  406. package/shells/typescript-shell/packages/client/src/components/organisms/game/GameCanvas.tsx +0 -550
  407. package/shells/typescript-shell/packages/client/src/components/organisms/game/GameControls.tsx +0 -173
  408. package/shells/typescript-shell/packages/client/src/components/organisms/game/GameHud.tsx +0 -135
  409. package/shells/typescript-shell/packages/client/src/components/organisms/game/GameMenu.tsx +0 -188
  410. package/shells/typescript-shell/packages/client/src/components/organisms/game/GameOverScreen.tsx +0 -241
  411. package/shells/typescript-shell/packages/client/src/components/organisms/game/GamePauseOverlay.tsx +0 -158
  412. package/shells/typescript-shell/packages/client/src/components/organisms/game/InputListener.tsx +0 -161
  413. package/shells/typescript-shell/packages/client/src/components/organisms/game/InventoryPanel.tsx +0 -230
  414. package/shells/typescript-shell/packages/client/src/components/organisms/game/LevelSelect.tsx +0 -236
  415. package/shells/typescript-shell/packages/client/src/components/organisms/game/TilemapRenderer.tsx +0 -233
  416. package/shells/typescript-shell/packages/client/src/components/organisms/game/index.ts +0 -28
  417. package/shells/typescript-shell/packages/client/src/components/organisms/index.ts +0 -83
  418. package/shells/typescript-shell/packages/client/src/components/organisms/layout/DashboardGrid.tsx +0 -94
  419. package/shells/typescript-shell/packages/client/src/components/organisms/layout/MasterDetail.tsx +0 -93
  420. package/shells/typescript-shell/packages/client/src/components/organisms/layout/SplitPane.tsx +0 -136
  421. package/shells/typescript-shell/packages/client/src/components/organisms/layout/TabbedContainer.tsx +0 -162
  422. package/shells/typescript-shell/packages/client/src/components/organisms/layout/index.ts +0 -10
  423. package/shells/typescript-shell/packages/client/src/components/templates/AuthLayout.tsx +0 -125
  424. package/shells/typescript-shell/packages/client/src/components/templates/CounterTemplate.tsx +0 -224
  425. package/shells/typescript-shell/packages/client/src/components/templates/CrudTemplate.tsx +0 -511
  426. package/shells/typescript-shell/packages/client/src/components/templates/DashboardLayout.tsx +0 -295
  427. package/shells/typescript-shell/packages/client/src/components/templates/FormTemplate.tsx +0 -328
  428. package/shells/typescript-shell/packages/client/src/components/templates/GameTemplate.tsx +0 -142
  429. package/shells/typescript-shell/packages/client/src/components/templates/GenericAppTemplate.tsx +0 -79
  430. package/shells/typescript-shell/packages/client/src/components/templates/ListTemplate.tsx +0 -361
  431. package/shells/typescript-shell/packages/client/src/components/templates/SettingsTemplate.tsx +0 -459
  432. package/shells/typescript-shell/packages/client/src/components/templates/index.ts +0 -54
  433. package/shells/typescript-shell/packages/client/src/config/firebase.ts +0 -58
  434. package/shells/typescript-shell/packages/client/src/context/DesignThemeContext.tsx +0 -40
  435. package/shells/typescript-shell/packages/client/src/context/ThemeContext.tsx +0 -321
  436. package/shells/typescript-shell/packages/client/src/context/UISlotContext.tsx +0 -143
  437. package/shells/typescript-shell/packages/client/src/context/UserContext.tsx +0 -259
  438. package/shells/typescript-shell/packages/client/src/context/index.ts +0 -44
  439. package/shells/typescript-shell/packages/client/src/evaluator/SExpressionEvaluator.ts +0 -715
  440. package/shells/typescript-shell/packages/client/src/evaluator/context.ts +0 -196
  441. package/shells/typescript-shell/packages/client/src/evaluator/index.ts +0 -52
  442. package/shells/typescript-shell/packages/client/src/evaluator/operators/arithmetic.ts +0 -120
  443. package/shells/typescript-shell/packages/client/src/evaluator/operators/collections.ts +0 -177
  444. package/shells/typescript-shell/packages/client/src/evaluator/operators/comparison.ts +0 -130
  445. package/shells/typescript-shell/packages/client/src/evaluator/operators/control.ts +0 -86
  446. package/shells/typescript-shell/packages/client/src/evaluator/operators/effects.ts +0 -285
  447. package/shells/typescript-shell/packages/client/src/evaluator/operators/index.ts +0 -69
  448. package/shells/typescript-shell/packages/client/src/evaluator/operators/logic.ts +0 -66
  449. package/shells/typescript-shell/packages/client/src/evaluator/std/array.ts +0 -657
  450. package/shells/typescript-shell/packages/client/src/evaluator/std/async.ts +0 -210
  451. package/shells/typescript-shell/packages/client/src/evaluator/std/format.ts +0 -224
  452. package/shells/typescript-shell/packages/client/src/evaluator/std/index.ts +0 -206
  453. package/shells/typescript-shell/packages/client/src/evaluator/std/math.ts +0 -219
  454. package/shells/typescript-shell/packages/client/src/evaluator/std/object.ts +0 -435
  455. package/shells/typescript-shell/packages/client/src/evaluator/std/str.ts +0 -372
  456. package/shells/typescript-shell/packages/client/src/evaluator/std/time.ts +0 -594
  457. package/shells/typescript-shell/packages/client/src/evaluator/std/validate.ts +0 -445
  458. package/shells/typescript-shell/packages/client/src/evaluator/types/expression.ts +0 -297
  459. package/shells/typescript-shell/packages/client/src/features/auth/AuthContext.tsx +0 -192
  460. package/shells/typescript-shell/packages/client/src/features/auth/authService.ts +0 -90
  461. package/shells/typescript-shell/packages/client/src/features/auth/components/Login.tsx +0 -282
  462. package/shells/typescript-shell/packages/client/src/features/auth/components/ProtectedRoute.tsx +0 -28
  463. package/shells/typescript-shell/packages/client/src/features/auth/components/UserProfile.tsx +0 -52
  464. package/shells/typescript-shell/packages/client/src/features/auth/components/index.ts +0 -3
  465. package/shells/typescript-shell/packages/client/src/features/auth/index.ts +0 -4
  466. package/shells/typescript-shell/packages/client/src/features/auth/types.ts +0 -33
  467. package/shells/typescript-shell/packages/client/src/hooks/event-bus-types.ts +0 -70
  468. package/shells/typescript-shell/packages/client/src/hooks/index.ts +0 -84
  469. package/shells/typescript-shell/packages/client/src/hooks/useEntities.ts +0 -118
  470. package/shells/typescript-shell/packages/client/src/hooks/useEntityData.ts +0 -288
  471. package/shells/typescript-shell/packages/client/src/hooks/useEntityMutations.ts +0 -258
  472. package/shells/typescript-shell/packages/client/src/hooks/useEventBus.ts +0 -166
  473. package/shells/typescript-shell/packages/client/src/hooks/useOrbitalMutations.ts +0 -234
  474. package/shells/typescript-shell/packages/client/src/hooks/useQuerySingleton.ts +0 -179
  475. package/shells/typescript-shell/packages/client/src/hooks/useUIEvents.ts +0 -228
  476. package/shells/typescript-shell/packages/client/src/hooks/useUISlots.ts +0 -320
  477. package/shells/typescript-shell/packages/client/src/index.css +0 -15
  478. package/shells/typescript-shell/packages/client/src/lib/api-client.ts +0 -134
  479. package/shells/typescript-shell/packages/client/src/lib/cn.ts +0 -10
  480. package/shells/typescript-shell/packages/client/src/lib/debug.ts +0 -114
  481. package/shells/typescript-shell/packages/client/src/lib/debugRegistry.ts +0 -108
  482. package/shells/typescript-shell/packages/client/src/lib/debugUtils.ts +0 -62
  483. package/shells/typescript-shell/packages/client/src/lib/entityDebug.ts +0 -79
  484. package/shells/typescript-shell/packages/client/src/lib/guardRegistry.ts +0 -79
  485. package/shells/typescript-shell/packages/client/src/lib/tickRegistry.ts +0 -86
  486. package/shells/typescript-shell/packages/client/src/lib/traitRegistry.ts +0 -84
  487. package/shells/typescript-shell/packages/client/src/loaders/AssetLoader.ts +0 -315
  488. package/shells/typescript-shell/packages/client/src/loaders/index.ts +0 -17
  489. package/shells/typescript-shell/packages/client/src/main.tsx +0 -24
  490. package/shells/typescript-shell/packages/client/src/pages/index.ts +0 -2
  491. package/shells/typescript-shell/packages/client/src/providers/EventBusProvider.tsx +0 -212
  492. package/shells/typescript-shell/packages/client/src/providers/FetchedDataProvider.tsx +0 -280
  493. package/shells/typescript-shell/packages/client/src/providers/OrbitalProvider.tsx +0 -136
  494. package/shells/typescript-shell/packages/client/src/providers/SelectionProvider.tsx +0 -232
  495. package/shells/typescript-shell/packages/client/src/providers/index.ts +0 -31
  496. package/shells/typescript-shell/packages/client/src/renderer/client-effect-executor.ts +0 -267
  497. package/shells/typescript-shell/packages/client/src/renderer/data-resolver.ts +0 -253
  498. package/shells/typescript-shell/packages/client/src/renderer/index.ts +0 -138
  499. package/shells/typescript-shell/packages/client/src/renderer/offline-executor.ts +0 -610
  500. package/shells/typescript-shell/packages/client/src/renderer/pattern-resolver.ts +0 -209
  501. package/shells/typescript-shell/packages/client/src/renderer/slot-definitions.ts +0 -154
  502. package/shells/typescript-shell/packages/client/src/renderer/types.ts +0 -214
  503. package/shells/typescript-shell/packages/client/src/renderer/useClientEffects.ts +0 -236
  504. package/shells/typescript-shell/packages/client/src/stores/entityStore.ts +0 -233
  505. package/shells/typescript-shell/packages/client/src/stores/filtering.ts +0 -180
  506. package/shells/typescript-shell/packages/client/src/stores/index.ts +0 -11
  507. package/shells/typescript-shell/packages/client/src/test/setup.ts +0 -126
  508. package/shells/typescript-shell/packages/client/src/themes/almadar.css +0 -196
  509. package/shells/typescript-shell/packages/client/src/themes/index.css +0 -11
  510. package/shells/typescript-shell/packages/client/src/themes/minimalist.css +0 -193
  511. package/shells/typescript-shell/packages/client/src/themes/wireframe.css +0 -188
  512. package/shells/typescript-shell/packages/client/src/types/__tests__/event-contracts.test.ts +0 -204
  513. package/shells/typescript-shell/packages/client/src/types/event-contracts.ts +0 -267
  514. package/shells/typescript-shell/packages/client/tailwind.config.js +0 -55
  515. package/shells/typescript-shell/packages/client/tsconfig.json +0 -33
  516. package/shells/typescript-shell/packages/client/tsconfig.node.json +0 -12
  517. package/shells/typescript-shell/packages/client/vite.config.d.ts +0 -3
  518. package/shells/typescript-shell/packages/client/vite.config.d.ts.map +0 -1
  519. package/shells/typescript-shell/packages/client/vite.config.js +0 -43
  520. package/shells/typescript-shell/packages/client/vite.config.js.map +0 -1
  521. package/shells/typescript-shell/packages/client/vite.config.ts +0 -48
  522. package/shells/typescript-shell/packages/server/.env.development +0 -8
  523. package/shells/typescript-shell/packages/server/.env.example +0 -22
  524. package/shells/typescript-shell/packages/server/package.json +0 -41
  525. package/shells/typescript-shell/packages/server/src/__tests__/integration.test.ts +0 -23
  526. package/shells/typescript-shell/packages/server/src/app.ts +0 -53
  527. package/shells/typescript-shell/packages/server/src/features/.gitkeep +0 -10
  528. package/shells/typescript-shell/packages/server/src/index.ts +0 -60
  529. package/shells/typescript-shell/packages/server/src/integrators/INTEGRATORS.md +0 -357
  530. package/shells/typescript-shell/packages/server/src/integrators/__tests__/registry.test.ts +0 -419
  531. package/shells/typescript-shell/packages/server/src/integrators/__tests__/types.test.ts +0 -382
  532. package/shells/typescript-shell/packages/server/src/integrators/__tests__/youtube.closed-circuit.test.ts +0 -454
  533. package/shells/typescript-shell/packages/server/src/integrators/__tests__/youtube.test.ts +0 -519
  534. package/shells/typescript-shell/packages/server/src/integrators/index.ts +0 -67
  535. package/shells/typescript-shell/packages/server/src/integrators/llm.ts +0 -585
  536. package/shells/typescript-shell/packages/server/src/integrators/registry.ts +0 -318
  537. package/shells/typescript-shell/packages/server/src/integrators/types.ts +0 -248
  538. package/shells/typescript-shell/packages/server/src/integrators/youtube.ts +0 -614
  539. package/shells/typescript-shell/packages/server/src/lib/db.ts +0 -130
  540. package/shells/typescript-shell/packages/server/src/lib/env.ts +0 -47
  541. package/shells/typescript-shell/packages/server/src/lib/eventBus.ts +0 -80
  542. package/shells/typescript-shell/packages/server/src/lib/index.ts +0 -10
  543. package/shells/typescript-shell/packages/server/src/lib/logger.ts +0 -48
  544. package/shells/typescript-shell/packages/server/src/lib/websocket.ts +0 -161
  545. package/shells/typescript-shell/packages/server/src/middleware/authenticateFirebase.ts +0 -29
  546. package/shells/typescript-shell/packages/server/src/middleware/errorHandler.ts +0 -135
  547. package/shells/typescript-shell/packages/server/src/middleware/index.ts +0 -15
  548. package/shells/typescript-shell/packages/server/src/middleware/validation.ts +0 -77
  549. package/shells/typescript-shell/packages/server/src/routes/__tests__/orbitals.e2e.test.ts +0 -405
  550. package/shells/typescript-shell/packages/server/src/routes/features/.gitkeep +0 -0
  551. package/shells/typescript-shell/packages/server/src/routes/index.ts +0 -11
  552. package/shells/typescript-shell/packages/server/src/routes/orbitals.ts +0 -138
  553. package/shells/typescript-shell/packages/server/src/routes/register.ts +0 -19
  554. package/shells/typescript-shell/packages/server/src/routes.ts +0 -58
  555. package/shells/typescript-shell/packages/server/src/seedMockData.ts +0 -27
  556. package/shells/typescript-shell/packages/server/src/services/DataService.ts +0 -402
  557. package/shells/typescript-shell/packages/server/src/services/MockDataService.ts +0 -347
  558. package/shells/typescript-shell/packages/server/src/services/index.ts +0 -8
  559. package/shells/typescript-shell/packages/server/src/types/express.d.ts +0 -13
  560. package/shells/typescript-shell/packages/server/src/utils/index.ts +0 -9
  561. package/shells/typescript-shell/packages/server/src/utils/queryFilters.ts +0 -231
  562. package/shells/typescript-shell/packages/server/tsconfig.json +0 -28
  563. package/shells/typescript-shell/packages/shared/package.json +0 -22
  564. package/shells/typescript-shell/packages/shared/src/__tests__/entities/atom-demo.test.ts +0 -61
  565. package/shells/typescript-shell/packages/shared/src/__tests__/entities/container-demo.test.ts +0 -43
  566. package/shells/typescript-shell/packages/shared/src/__tests__/entities/content-item.test.ts +0 -55
  567. package/shells/typescript-shell/packages/shared/src/__tests__/entities/game-state.test.ts +0 -67
  568. package/shells/typescript-shell/packages/shared/src/__tests__/entities/layout-demo.test.ts +0 -43
  569. package/shells/typescript-shell/packages/shared/src/__tests__/entities/modal-item.test.ts +0 -49
  570. package/shells/typescript-shell/packages/shared/src/__tests__/entities/molecule-demo.test.ts +0 -55
  571. package/shells/typescript-shell/packages/shared/src/__tests__/entities/nav-item.test.ts +0 -55
  572. package/shells/typescript-shell/packages/shared/src/__tests__/entities/product.test.ts +0 -78
  573. package/shells/typescript-shell/packages/shared/src/__tests__/entities/project.test.ts +0 -85
  574. package/shells/typescript-shell/packages/shared/src/__tests__/entities/searchable-item.test.ts +0 -61
  575. package/shells/typescript-shell/packages/shared/src/__tests__/entities/state-demo.test.ts +0 -43
  576. package/shells/typescript-shell/packages/shared/src/__tests__/entities/wizard-data.test.ts +0 -61
  577. package/shells/typescript-shell/packages/shared/src/evaluator/SExpressionEvaluator.ts +0 -715
  578. package/shells/typescript-shell/packages/shared/src/evaluator/context.ts +0 -196
  579. package/shells/typescript-shell/packages/shared/src/evaluator/index.ts +0 -52
  580. package/shells/typescript-shell/packages/shared/src/evaluator/operators/arithmetic.ts +0 -120
  581. package/shells/typescript-shell/packages/shared/src/evaluator/operators/collections.ts +0 -177
  582. package/shells/typescript-shell/packages/shared/src/evaluator/operators/comparison.ts +0 -130
  583. package/shells/typescript-shell/packages/shared/src/evaluator/operators/control.ts +0 -86
  584. package/shells/typescript-shell/packages/shared/src/evaluator/operators/effects.ts +0 -285
  585. package/shells/typescript-shell/packages/shared/src/evaluator/operators/index.ts +0 -69
  586. package/shells/typescript-shell/packages/shared/src/evaluator/operators/logic.ts +0 -66
  587. package/shells/typescript-shell/packages/shared/src/evaluator/std/array.ts +0 -657
  588. package/shells/typescript-shell/packages/shared/src/evaluator/std/async.ts +0 -210
  589. package/shells/typescript-shell/packages/shared/src/evaluator/std/format.ts +0 -224
  590. package/shells/typescript-shell/packages/shared/src/evaluator/std/index.ts +0 -206
  591. package/shells/typescript-shell/packages/shared/src/evaluator/std/math.ts +0 -219
  592. package/shells/typescript-shell/packages/shared/src/evaluator/std/object.ts +0 -435
  593. package/shells/typescript-shell/packages/shared/src/evaluator/std/str.ts +0 -372
  594. package/shells/typescript-shell/packages/shared/src/evaluator/std/time.ts +0 -594
  595. package/shells/typescript-shell/packages/shared/src/evaluator/std/validate.ts +0 -445
  596. package/shells/typescript-shell/packages/shared/src/evaluator/types/expression.ts +0 -297
  597. package/shells/typescript-shell/packages/shared/src/index.ts +0 -12
  598. package/shells/typescript-shell/packages/shared/src/schemas/entities.ts +0 -13
  599. package/shells/typescript-shell/packages/shared/src/types/entities.ts +0 -321
  600. package/shells/typescript-shell/packages/shared/src/types/events.ts +0 -82
  601. package/shells/typescript-shell/packages/shared/tsconfig.json +0 -16
  602. package/shells/typescript-shell/tests/setup.ts +0 -22
  603. package/shells/typescript-shell/tsconfig.base.json +0 -21
  604. package/shells/typescript-shell/tsconfig.json +0 -13
  605. package/shells/typescript-shell/vitest.config.ts +0 -54
@@ -1,1582 +0,0 @@
1
- /**
2
- * InspectionProcessTemplate
3
- *
4
- * Comprehensive template representing the entire inspection process.
5
- * Implements all 5 phases from the inspection-system requirements:
6
- *
7
- * 1. Introduction Phase: Case Info → Company Data → Participants → Field Selection
8
- * 2. Content Phase: Rule Checking with ad-hoc actions (add participant, collect document, pause, SOS)
9
- * 3. Preparation Phase: Findings → Decisions
10
- * 4. Record Phase: Document Generation → Merchant Review → Objections
11
- * 5. Closing Phase: End Time → Signatures → Complete
12
- *
13
- * This template composes all inspection-system atoms, molecules, and organisms
14
- * to represent the full application workflow.
15
- */
16
-
17
- import React, { useState } from "react";
18
- import { cn } from "../../../lib/cn";
19
- import { Box } from "../../../components/atoms/Box";
20
- import { VStack, HStack } from "../../../components/atoms/Stack";
21
- import { Typography } from "../../../components/atoms/Typography";
22
- import { Button } from "../../../components/atoms/Button";
23
- import { Card } from "../../../components/atoms/Card";
24
- import { Badge } from "../../../components/atoms/Badge";
25
- import { useEventBus } from "../../../hooks/useEventBus";
26
-
27
- // Atoms
28
- import { PhaseIndicator, InspectionPhase } from "../atoms/PhaseIndicator";
29
- import { LawReferenceBadge } from "../atoms/LawReferenceBadge";
30
-
31
- // Molecules
32
- import { ProgressHeader, ProgressStep } from "../molecules/ProgressHeader";
33
- import {
34
- ComplianceSummary,
35
- ComplianceStats,
36
- } from "../molecules/ComplianceSummary";
37
- import { RuleCheckItem, RuleCheckItemProps } from "../molecules/RuleCheckItem";
38
- import { EntitySearch, SearchResult } from "../molecules/EntitySearch";
39
- import { ParticipantList, Participant } from "../molecules/ParticipantList";
40
- import { CardSelector, CardSelectorOption } from "../molecules/CardSelector";
41
- import { ConditionalField } from "../molecules/ConditionalField";
42
- import { RepeatableFormSection } from "../molecules/RepeatableFormSection";
43
- import { PhotoAttachment, Photo } from "../molecules/PhotoAttachment";
44
- import { ObjectionRecorder } from "../molecules/ObjectionRecorder";
45
- import { DocumentPreview } from "../molecules/DocumentPreview";
46
- import {
47
- InspectionTimeline,
48
- TimelineItem,
49
- } from "../molecules/InspectionTimeline";
50
-
51
- // Organisms
52
- import {
53
- FloatingActionMenu,
54
- QuickAction,
55
- } from "../organisms/FloatingActionMenu";
56
- import { SignatureCapture } from "../organisms/SignatureCapture";
57
-
58
- import {
59
- ArrowLeft,
60
- ArrowRight,
61
- Save,
62
- CheckCircle,
63
- Building2,
64
- Users,
65
- ClipboardCheck,
66
- FileText,
67
- PenTool,
68
- AlertTriangle,
69
- FileCheck,
70
- Scale,
71
- Clock,
72
- Briefcase,
73
- Search,
74
- Plus,
75
- UserPlus,
76
- FilePlus,
77
- Camera,
78
- Pause,
79
- Play,
80
- } from "lucide-react";
81
-
82
- // =============================================================================
83
- // Types
84
- // =============================================================================
85
-
86
- export type ProcessPhase =
87
- | "introduction"
88
- | "content"
89
- | "preparation"
90
- | "record"
91
- | "closing";
92
-
93
- export type IntroductionStep =
94
- | "case-info"
95
- | "company-data"
96
- | "participants"
97
- | "field-selection";
98
-
99
- export type ContentStep = "rule-checking";
100
-
101
- export type PreparationStep = "findings" | "decisions";
102
-
103
- export type RecordStep =
104
- | "document-generation"
105
- | "merchant-review"
106
- | "objections";
107
-
108
- export type ClosingStep = "end-time" | "signatures" | "complete";
109
-
110
- export type ProcessStep =
111
- | IntroductionStep
112
- | ContentStep
113
- | PreparationStep
114
- | RecordStep
115
- | ClosingStep;
116
-
117
- export interface Inspector {
118
- id: string;
119
- name: string;
120
- surname: string;
121
- department: string;
122
- badgeNumber: string;
123
- }
124
-
125
- export interface Company {
126
- id: string;
127
- name: string;
128
- legalName: string;
129
- registrationNumber: string;
130
- taxNumber: string;
131
- address: {
132
- street: string;
133
- city: string;
134
- postalCode: string;
135
- };
136
- }
137
-
138
- export interface AccompanyingPerson {
139
- id: string;
140
- name: string;
141
- organization: string;
142
- role: string;
143
- }
144
-
145
- export interface InspectionField {
146
- id: string;
147
- name: string;
148
- description: string;
149
- ruleCount: number;
150
- }
151
-
152
- export interface InspectionRule {
153
- id: string;
154
- ruleText: string;
155
- lawReference: {
156
- gazetteNumber: string;
157
- article: string;
158
- };
159
- severity: "critical" | "major" | "minor";
160
- canBeSkipped: boolean;
161
- }
162
-
163
- export interface RuleCheck {
164
- ruleId: string;
165
- answer: "compliant" | "non-compliant" | "not-applicable" | null;
166
- notes?: string;
167
- photos: Photo[];
168
- }
169
-
170
- export interface Finding {
171
- id: string;
172
- description: string;
173
- severity: "critical" | "major" | "minor" | "observation";
174
- relatedRuleIds: string[];
175
- recommendation: string;
176
- }
177
-
178
- export interface Decision {
179
- id: string;
180
- orderText: string;
181
- deadline: string;
182
- relatedFindingIds: string[];
183
- status: "pending" | "acknowledged" | "completed";
184
- }
185
-
186
- export interface Objection {
187
- id: string;
188
- sectionRef: string;
189
- objectionText: string;
190
- response?: string;
191
- status: "pending" | "resolved";
192
- }
193
-
194
- export interface InspectionData {
195
- id: string;
196
- caseNumber: string;
197
- inspector?: Inspector;
198
- company?: Company;
199
- participants: Participant[];
200
- accompanyingPersons: AccompanyingPerson[];
201
- selectedField?: InspectionField;
202
- rules: InspectionRule[];
203
- ruleChecks: Record<string, RuleCheck>;
204
- findings: Finding[];
205
- decisions: Decision[];
206
- objections: Objection[];
207
- collectedDocuments: Array<{
208
- id: string;
209
- name: string;
210
- type: string;
211
- fileUrl: string;
212
- }>;
213
- startDateTime?: string;
214
- endDateTime?: string;
215
- inspectorSignature?: string;
216
- merchantSignature?: string;
217
- currentPhase: ProcessPhase;
218
- currentStep: ProcessStep;
219
- timeline: TimelineItem[];
220
- }
221
-
222
- export interface InspectionProcessTemplateProps {
223
- /** Full inspection data */
224
- data: InspectionData;
225
- /** Available inspectors for selection */
226
- availableInspectors?: Inspector[];
227
- /** Available inspection fields */
228
- availableFields?: InspectionField[];
229
- /** Company search results */
230
- companySearchResults?: SearchResult[];
231
- /** Is searching for company */
232
- isSearchingCompany?: boolean;
233
- /** Additional class names */
234
- className?: string;
235
- /** Phase change handler */
236
- onPhaseChange?: (phase: ProcessPhase) => void;
237
- /** Step change handler */
238
- onStepChange?: (step: ProcessStep) => void;
239
- /** Data update handler */
240
- onDataUpdate?: (data: Partial<InspectionData>) => void;
241
- /** Company search handler */
242
- onCompanySearch?: (query: string) => void;
243
- /** Save draft handler */
244
- onSaveDraft?: () => void;
245
- /** Complete handler */
246
- onComplete?: () => void;
247
- }
248
-
249
- // =============================================================================
250
- // Phase Configuration
251
- // =============================================================================
252
-
253
- interface PhaseConfig {
254
- id: ProcessPhase;
255
- label: string;
256
- icon: typeof Building2;
257
- steps: Array<{
258
- id: ProcessStep;
259
- label: string;
260
- documentSection?: string;
261
- }>;
262
- }
263
-
264
- const phases: PhaseConfig[] = [
265
- {
266
- id: "introduction",
267
- label: "Introduction",
268
- icon: Briefcase,
269
- steps: [
270
- {
271
- id: "case-info",
272
- label: "Case Info",
273
- documentSection: "1. SPLOŠNI PODATKI",
274
- },
275
- {
276
- id: "company-data",
277
- label: "Company Data",
278
- documentSection: "2. PODATKI O ZAVEZANCU",
279
- },
280
- {
281
- id: "participants",
282
- label: "Participants",
283
- documentSection: "3. PRISOTNE OSEBE",
284
- },
285
- {
286
- id: "field-selection",
287
- label: "Field Selection",
288
- documentSection: "4. PREDMET PREGLEDA",
289
- },
290
- ],
291
- },
292
- {
293
- id: "content",
294
- label: "Inspection",
295
- icon: ClipboardCheck,
296
- steps: [
297
- {
298
- id: "rule-checking",
299
- label: "Rule Checking",
300
- documentSection: "5. UGOTOVITVE PRI PREGLEDU",
301
- },
302
- ],
303
- },
304
- {
305
- id: "preparation",
306
- label: "Preparation",
307
- icon: FileText,
308
- steps: [
309
- { id: "findings", label: "Findings", documentSection: "6. UGOTOVITVE" },
310
- {
311
- id: "decisions",
312
- label: "Decisions",
313
- documentSection: "7. ODLOČBE IN UKREPI",
314
- },
315
- ],
316
- },
317
- {
318
- id: "record",
319
- label: "Record",
320
- icon: FileCheck,
321
- steps: [
322
- { id: "document-generation", label: "Generate Document" },
323
- { id: "merchant-review", label: "Merchant Review" },
324
- {
325
- id: "objections",
326
- label: "Objections",
327
- documentSection: "9. PRIPOMBE ZAVEZANCA",
328
- },
329
- ],
330
- },
331
- {
332
- id: "closing",
333
- label: "Closing",
334
- icon: PenTool,
335
- steps: [
336
- { id: "end-time", label: "End Time", documentSection: "10. ZAKLJUČEK" },
337
- { id: "signatures", label: "Signatures" },
338
- { id: "complete", label: "Complete" },
339
- ],
340
- },
341
- ];
342
-
343
- // =============================================================================
344
- // Helper Functions
345
- // =============================================================================
346
-
347
- function getPhaseForStep(step: ProcessStep): ProcessPhase {
348
- for (const phase of phases) {
349
- if (phase.steps.some((s) => s.id === step)) {
350
- return phase.id;
351
- }
352
- }
353
- return "introduction";
354
- }
355
-
356
- function getStepIndex(step: ProcessStep): number {
357
- let index = 0;
358
- for (const phase of phases) {
359
- for (const s of phase.steps) {
360
- if (s.id === step) return index;
361
- index++;
362
- }
363
- }
364
- return 0;
365
- }
366
-
367
- function getAllSteps(): ProcessStep[] {
368
- return phases.flatMap((p) => p.steps.map((s) => s.id));
369
- }
370
-
371
- function mapPhaseToIndicator(phase: ProcessPhase): InspectionPhase {
372
- const mapping: Record<ProcessPhase, InspectionPhase> = {
373
- introduction: "preparation",
374
- content: "execution",
375
- preparation: "documentation",
376
- record: "review",
377
- closing: "completed",
378
- };
379
- return mapping[phase];
380
- }
381
-
382
- // =============================================================================
383
- // Component
384
- // =============================================================================
385
-
386
- export const InspectionProcessTemplate: React.FC<
387
- InspectionProcessTemplateProps
388
- > = ({
389
- data,
390
- availableInspectors = [],
391
- availableFields = [],
392
- companySearchResults = [],
393
- isSearchingCompany = false,
394
- className,
395
- onPhaseChange,
396
- onStepChange,
397
- onDataUpdate,
398
- onCompanySearch,
399
- onSaveDraft,
400
- onComplete,
401
- }) => {
402
- const eventBus = useEventBus();
403
- const [isPaused, setIsPaused] = useState(false);
404
-
405
- const { currentPhase, currentStep } = data;
406
- const allSteps = getAllSteps();
407
- const currentStepIndex = getStepIndex(currentStep);
408
- const isFirstStep = currentStepIndex === 0;
409
- const isLastStep = currentStepIndex === allSteps.length - 1;
410
-
411
- // Calculate compliance stats
412
- const totalRules = data.rules.length;
413
- const checkedRules = Object.keys(data.ruleChecks).length;
414
- const compliant = Object.values(data.ruleChecks).filter(
415
- (r) => r.answer === "compliant",
416
- ).length;
417
- const nonCompliant = Object.values(data.ruleChecks).filter(
418
- (r) => r.answer === "non-compliant",
419
- ).length;
420
- const notChecked = totalRules - checkedRules;
421
-
422
- const complianceStats: ComplianceStats = {
423
- total: totalRules,
424
- compliant,
425
- nonCompliant,
426
- notChecked,
427
- critical: Object.values(data.ruleChecks).filter(
428
- (r) =>
429
- r.answer === "non-compliant" &&
430
- data.rules.find((rule) => rule.id === r.ruleId)?.severity ===
431
- "critical",
432
- ).length,
433
- major: Object.values(data.ruleChecks).filter(
434
- (r) =>
435
- r.answer === "non-compliant" &&
436
- data.rules.find((rule) => rule.id === r.ruleId)?.severity === "major",
437
- ).length,
438
- minor: Object.values(data.ruleChecks).filter(
439
- (r) =>
440
- r.answer === "non-compliant" &&
441
- data.rules.find((rule) => rule.id === r.ruleId)?.severity === "minor",
442
- ).length,
443
- };
444
-
445
- // Build progress steps for header
446
- const progressSteps: ProgressStep[] = allSteps.map((step, index) => ({
447
- id: step,
448
- label:
449
- phases.flatMap((p) => p.steps).find((s) => s.id === step)?.label || step,
450
- completed: index < currentStepIndex,
451
- current: step === currentStep,
452
- }));
453
-
454
- // Navigation handlers
455
- const handlePrevious = () => {
456
- if (isFirstStep) return;
457
- const prevStep = allSteps[currentStepIndex - 1];
458
- const prevPhase = getPhaseForStep(prevStep);
459
- if (prevPhase !== currentPhase) {
460
- onPhaseChange?.(prevPhase);
461
- }
462
- onStepChange?.(prevStep);
463
- eventBus.emit("UI:STEP_BACK", { step: prevStep, phase: prevPhase });
464
- };
465
-
466
- const handleNext = () => {
467
- if (isLastStep) {
468
- onComplete?.();
469
- eventBus.emit("UI:INSPECTION_COMPLETE", { inspectionId: data.id });
470
- return;
471
- }
472
- const nextStep = allSteps[currentStepIndex + 1];
473
- const nextPhase = getPhaseForStep(nextStep);
474
- if (nextPhase !== currentPhase) {
475
- onPhaseChange?.(nextPhase);
476
- }
477
- onStepChange?.(nextStep);
478
- eventBus.emit("UI:STEP_NEXT", { step: nextStep, phase: nextPhase });
479
- };
480
-
481
- const handleSaveDraft = () => {
482
- onSaveDraft?.();
483
- eventBus.emit("UI:SAVE_DRAFT", { inspectionId: data.id, currentStep });
484
- };
485
-
486
- // Floating action menu actions
487
- const floatingActions: QuickAction[] = [
488
- {
489
- id: "add-participant",
490
- label: "Add Participant",
491
- icon: UserPlus,
492
- },
493
- {
494
- id: "collect-document",
495
- label: "Collect Document",
496
- icon: FilePlus,
497
- },
498
- {
499
- id: "take-photo",
500
- label: "Take Photo",
501
- icon: Camera,
502
- },
503
- {
504
- id: "pause",
505
- label: isPaused ? "Resume" : "Pause",
506
- icon: isPaused ? Play : Pause,
507
- },
508
- {
509
- id: "sos",
510
- label: "SOS Exception",
511
- icon: AlertTriangle,
512
- color: "text-red-600",
513
- bgColor: "bg-red-100",
514
- },
515
- ];
516
-
517
- // ==========================================================================
518
- // Step Content Renderers
519
- // ==========================================================================
520
-
521
- const renderCaseInfo = () => (
522
- <VStack gap="lg" align="stretch">
523
- <Typography variant="h3">Case Information</Typography>
524
- <Card className="p-4">
525
- <VStack gap="md" align="stretch">
526
- <Box>
527
- <Typography variant="small" className="text-neutral-500 mb-1">
528
- Case Number
529
- </Typography>
530
- <Typography variant="h4">
531
- {data.caseNumber || "Auto-generated"}
532
- </Typography>
533
- </Box>
534
-
535
- <Box>
536
- <Typography variant="small" className="text-neutral-500 mb-1">
537
- Inspector
538
- </Typography>
539
- <EntitySearch
540
- label="Select Inspector"
541
- placeholder="Search inspectors..."
542
- results={availableInspectors.map((i) => ({
543
- id: i.id,
544
- label: `${i.name} ${i.surname}`,
545
- sublabel: `${i.department} - ${i.badgeNumber}`,
546
- }))}
547
- selectedId={data.inspector?.id}
548
- onSearch={(q) =>
549
- eventBus.emit("UI:SEARCH_INSPECTOR", { query: q })
550
- }
551
- onSelect={(result) => {
552
- if (result) {
553
- onDataUpdate?.({
554
- inspector: availableInspectors.find(
555
- (i) => i.id === result.id,
556
- ),
557
- });
558
- }
559
- }}
560
- allowCreate={false}
561
- />
562
- </Box>
563
-
564
- <Box>
565
- <Typography variant="small" className="text-neutral-500 mb-1">
566
- Start Date/Time
567
- </Typography>
568
- <input
569
- type="datetime-local"
570
- className="w-full p-2 border rounded"
571
- value={data.startDateTime || ""}
572
- onChange={(e) =>
573
- onDataUpdate?.({ startDateTime: e.target.value })
574
- }
575
- />
576
- </Box>
577
-
578
- <Box>
579
- <Typography variant="small" className="text-neutral-500 mb-1">
580
- Accompanying Persons
581
- </Typography>
582
- <RepeatableFormSection
583
- sectionType="accompanying-persons"
584
- title="Accompanying Persons"
585
- items={data.accompanyingPersons.map((p) => ({
586
- id: p.id,
587
- data: p as unknown as Record<string, unknown>,
588
- }))}
589
- renderItem={(item) => {
590
- const itemData = item.data as
591
- | { name?: string; organization?: string; role?: string }
592
- | undefined;
593
- return (
594
- <HStack gap="md" className="flex-1">
595
- <Typography>{itemData?.name}</Typography>
596
- <Badge variant="default">{itemData?.organization}</Badge>
597
- <Typography variant="small" className="text-neutral-500">
598
- {itemData?.role}
599
- </Typography>
600
- </HStack>
601
- );
602
- }}
603
- renderForm={(onAdd) => (
604
- <VStack gap="sm" align="stretch">
605
- <input
606
- type="text"
607
- placeholder="Name"
608
- className="p-2 border rounded"
609
- id="acc-name"
610
- />
611
- <input
612
- type="text"
613
- placeholder="Organization"
614
- className="p-2 border rounded"
615
- id="acc-org"
616
- />
617
- <input
618
- type="text"
619
- placeholder="Role"
620
- className="p-2 border rounded"
621
- id="acc-role"
622
- />
623
- <Button
624
- variant="primary"
625
- size="sm"
626
- onClick={() => {
627
- const name = (
628
- document.getElementById("acc-name") as HTMLInputElement
629
- )?.value;
630
- const org = (
631
- document.getElementById("acc-org") as HTMLInputElement
632
- )?.value;
633
- const role = (
634
- document.getElementById("acc-role") as HTMLInputElement
635
- )?.value;
636
- if (name && org) {
637
- onAdd({ name, organization: org, role });
638
- }
639
- }}
640
- >
641
- Add Person
642
- </Button>
643
- </VStack>
644
- )}
645
- onAdd={(person) => {
646
- const p = person as Record<string, unknown> | undefined;
647
- const newPerson: AccompanyingPerson = {
648
- id: `acc-${Date.now()}`,
649
- name: String(p?.name ?? ""),
650
- organization: String(p?.organization ?? ""),
651
- role: String(p?.role ?? ""),
652
- };
653
- onDataUpdate?.({
654
- accompanyingPersons: [...data.accompanyingPersons, newPerson],
655
- });
656
- }}
657
- onRemove={(id) => {
658
- onDataUpdate?.({
659
- accompanyingPersons: data.accompanyingPersons.filter(
660
- (p) => p.id !== id,
661
- ),
662
- });
663
- }}
664
- />
665
- </Box>
666
- </VStack>
667
- </Card>
668
- </VStack>
669
- );
670
-
671
- const renderCompanyData = () => (
672
- <VStack gap="lg" align="stretch">
673
- <Typography variant="h3">Company Data</Typography>
674
- <Card className="p-4">
675
- <VStack gap="md" align="stretch">
676
- <EntitySearch
677
- label="Search Company"
678
- placeholder="Search by name or registration number..."
679
- results={companySearchResults}
680
- isLoading={isSearchingCompany}
681
- selectedId={data.company?.id}
682
- onSearch={(q) => onCompanySearch?.(q)}
683
- onSelect={(result) =>
684
- result &&
685
- eventBus.emit("UI:COMPANY_SELECTED", { companyId: result.id })
686
- }
687
- onCreateNew={() => eventBus.emit("UI:CREATE_NEW_COMPANY", {})}
688
- allowCreate
689
- createLabel="Create New Company"
690
- />
691
-
692
- {data.company && (
693
- <Card className="p-4 bg-blue-50 border-blue-200">
694
- <VStack gap="sm" align="stretch">
695
- <HStack justify="between">
696
- <Typography variant="h4">{data.company.name}</Typography>
697
- <Badge variant="primary">Selected</Badge>
698
- </HStack>
699
- <Typography variant="small" className="text-neutral-600">
700
- Legal Name: {data.company.legalName}
701
- </Typography>
702
- <HStack gap="lg">
703
- <Box>
704
- <Typography variant="small" className="text-neutral-500">
705
- Registration #
706
- </Typography>
707
- <Typography>{data.company.registrationNumber}</Typography>
708
- </Box>
709
- <Box>
710
- <Typography variant="small" className="text-neutral-500">
711
- Tax ID
712
- </Typography>
713
- <Typography>{data.company.taxNumber}</Typography>
714
- </Box>
715
- </HStack>
716
- <Box>
717
- <Typography variant="small" className="text-neutral-500">
718
- Address
719
- </Typography>
720
- <Typography>
721
- {data.company.address.street},{" "}
722
- {data.company.address.postalCode}{" "}
723
- {data.company.address.city}
724
- </Typography>
725
- </Box>
726
- </VStack>
727
- </Card>
728
- )}
729
- </VStack>
730
- </Card>
731
- </VStack>
732
- );
733
-
734
- const renderParticipants = () => (
735
- <VStack gap="lg" align="stretch">
736
- <Typography variant="h3">Participants</Typography>
737
- <Typography variant="body" className="text-neutral-600">
738
- At least one company representative must be present during the
739
- inspection.
740
- </Typography>
741
- <Card className="p-4">
742
- <ParticipantList
743
- participants={data.participants}
744
- onAdd={(participant) => {
745
- const newParticipant: Participant = {
746
- ...participant,
747
- id: `part-${Date.now()}`,
748
- };
749
- onDataUpdate?.({
750
- participants: [...data.participants, newParticipant],
751
- });
752
- }}
753
- onRemove={(id) => {
754
- if (data.participants.length > 1) {
755
- onDataUpdate?.({
756
- participants: data.participants.filter((p) => p.id !== id),
757
- });
758
- }
759
- }}
760
- minParticipants={1}
761
- />
762
- </Card>
763
- {data.participants.length === 0 && (
764
- <Card className="p-4 bg-yellow-50 border-yellow-200">
765
- <HStack gap="sm">
766
- <AlertTriangle className="h-5 w-5 text-yellow-600" />
767
- <Typography className="text-yellow-700">
768
- At least one participant is required to proceed (ZIN Art. 22)
769
- </Typography>
770
- </HStack>
771
- </Card>
772
- )}
773
- </VStack>
774
- );
775
-
776
- const renderFieldSelection = () => (
777
- <VStack gap="lg" align="stretch">
778
- <Typography variant="h3">Inspection Field</Typography>
779
- <Typography variant="body" className="text-neutral-600">
780
- Select the type of inspection to determine which rules apply.
781
- </Typography>
782
- <CardSelector
783
- options={availableFields.map((field) => ({
784
- id: field.id,
785
- title: field.name,
786
- description: `${field.description} (${field.ruleCount} rules)`,
787
- }))}
788
- selectedId={data.selectedField?.id}
789
- onChange={(id) => {
790
- const field = availableFields.find((f) => f.id === id);
791
- if (field) {
792
- onDataUpdate?.({ selectedField: field });
793
- eventBus.emit("UI:FIELD_SELECTED", { fieldId: id });
794
- }
795
- }}
796
- />
797
- </VStack>
798
- );
799
-
800
- const renderRuleChecking = () => (
801
- <VStack gap="lg" align="stretch">
802
- <HStack justify="between" align="center">
803
- <Typography variant="h3">Rule Checking</Typography>
804
- <Badge variant="default">
805
- {checkedRules} / {totalRules} checked
806
- </Badge>
807
- </HStack>
808
-
809
- <ComplianceSummary stats={complianceStats} variant="full" />
810
-
811
- <VStack gap="md" align="stretch">
812
- {data.rules.map((rule) => {
813
- const check = data.ruleChecks[rule.id];
814
- return (
815
- <RuleCheckItem
816
- key={rule.id}
817
- ruleId={rule.id}
818
- ruleText={rule.ruleText}
819
- gazetteNumber={rule.lawReference.gazetteNumber}
820
- article={rule.lawReference.article}
821
- severity={rule.severity}
822
- answer={check?.answer || null}
823
- notes={check?.notes}
824
- photoCount={check?.photos?.length || 0}
825
- onCheck={(answer, notes) => {
826
- onDataUpdate?.({
827
- ruleChecks: {
828
- ...data.ruleChecks,
829
- [rule.id]: {
830
- ruleId: rule.id,
831
- answer,
832
- notes,
833
- photos: check?.photos || [],
834
- },
835
- },
836
- });
837
- }}
838
- onAddPhoto={() =>
839
- eventBus.emit("UI:ADD_RULE_PHOTO", { ruleId: rule.id })
840
- }
841
- />
842
- );
843
- })}
844
- </VStack>
845
- </VStack>
846
- );
847
-
848
- const renderFindings = () => (
849
- <VStack gap="lg" align="stretch">
850
- <Typography variant="h3">Findings</Typography>
851
-
852
- {/* Summary of non-compliant rules */}
853
- <Card className="p-4 bg-red-50 border-red-200">
854
- <VStack gap="sm" align="stretch">
855
- <Typography variant="h4" className="text-red-700">
856
- Non-Compliant Items ({nonCompliant})
857
- </Typography>
858
- {Object.entries(data.ruleChecks)
859
- .filter(([, check]) => check.answer === "non-compliant")
860
- .map(([ruleId, check]) => {
861
- const rule = data.rules.find((r) => r.id === ruleId);
862
- return (
863
- <HStack key={ruleId} gap="sm" className="text-red-600">
864
- <Badge
865
- variant={
866
- rule?.severity === "critical" ? "danger" : "warning"
867
- }
868
- >
869
- {rule?.severity}
870
- </Badge>
871
- <Typography variant="small">{rule?.ruleText}</Typography>
872
- </HStack>
873
- );
874
- })}
875
- </VStack>
876
- </Card>
877
-
878
- {/* Add findings */}
879
- <RepeatableFormSection
880
- sectionType="findings"
881
- title="Formal Findings"
882
- items={data.findings.map((f) => ({
883
- id: f.id,
884
- data: f as unknown as Record<string, unknown>,
885
- }))}
886
- renderItem={(item) => {
887
- const d = item.data as Record<string, unknown> | undefined;
888
- return (
889
- <VStack gap="sm" align="stretch" className="flex-1">
890
- <HStack justify="between">
891
- <Typography weight="medium">
892
- {String(d?.description ?? "")}
893
- </Typography>
894
- <Badge
895
- variant={
896
- d?.severity === "critical"
897
- ? "danger"
898
- : d?.severity === "major"
899
- ? "warning"
900
- : "default"
901
- }
902
- >
903
- {String(d?.severity ?? "")}
904
- </Badge>
905
- </HStack>
906
- <Typography variant="small" className="text-neutral-500">
907
- {String(d?.recommendation ?? "")}
908
- </Typography>
909
- </VStack>
910
- );
911
- }}
912
- renderForm={(onAdd) => (
913
- <VStack gap="sm" align="stretch">
914
- <textarea
915
- placeholder="Finding description..."
916
- className="p-2 border rounded min-h-[80px]"
917
- id="finding-desc"
918
- />
919
- <select className="p-2 border rounded" id="finding-severity">
920
- <option value="observation">Observation</option>
921
- <option value="minor">Minor</option>
922
- <option value="major">Major</option>
923
- <option value="critical">Critical</option>
924
- </select>
925
- <textarea
926
- placeholder="Recommendation..."
927
- className="p-2 border rounded"
928
- id="finding-rec"
929
- />
930
- <Button
931
- variant="primary"
932
- size="sm"
933
- onClick={() => {
934
- const desc = (
935
- document.getElementById("finding-desc") as HTMLTextAreaElement
936
- )?.value;
937
- const severity = (
938
- document.getElementById(
939
- "finding-severity",
940
- ) as HTMLSelectElement
941
- )?.value;
942
- const rec = (
943
- document.getElementById("finding-rec") as HTMLTextAreaElement
944
- )?.value;
945
- if (desc) {
946
- onAdd({ description: desc, severity, recommendation: rec });
947
- }
948
- }}
949
- >
950
- Add Finding
951
- </Button>
952
- </VStack>
953
- )}
954
- onAdd={(findingData) => {
955
- const fd = findingData as Record<string, unknown> | undefined;
956
- const newFinding: Finding = {
957
- id: `finding-${Date.now()}`,
958
- description: String(fd?.description ?? ""),
959
- severity: (fd?.severity as Finding["severity"]) ?? "observation",
960
- relatedRuleIds: [],
961
- recommendation: String(fd?.recommendation ?? ""),
962
- };
963
- onDataUpdate?.({ findings: [...data.findings, newFinding] });
964
- }}
965
- onRemove={(id) => {
966
- onDataUpdate?.({
967
- findings: data.findings.filter((f) => f.id !== id),
968
- });
969
- }}
970
- />
971
- </VStack>
972
- );
973
-
974
- const renderDecisions = () => (
975
- <VStack gap="lg" align="stretch">
976
- <Typography variant="h3">Decisions & Orders</Typography>
977
-
978
- <RepeatableFormSection
979
- sectionType="decisions"
980
- title="Required Actions"
981
- items={data.decisions.map((d) => ({
982
- id: d.id,
983
- data: d as unknown as Record<string, unknown>,
984
- }))}
985
- renderItem={(item) => {
986
- const d = item.data as Record<string, unknown> | undefined;
987
- return (
988
- <VStack gap="sm" align="stretch" className="flex-1">
989
- <Typography weight="medium">
990
- {String(d?.orderText ?? "")}
991
- </Typography>
992
- <HStack gap="md">
993
- <Badge variant="default">
994
- <Clock className="h-3 w-3 mr-1" />
995
- Due: {String(d?.deadline ?? "")}
996
- </Badge>
997
- <Badge
998
- variant={
999
- d?.status === "completed"
1000
- ? "success"
1001
- : d?.status === "acknowledged"
1002
- ? "primary"
1003
- : "warning"
1004
- }
1005
- >
1006
- {String(d?.status ?? "")}
1007
- </Badge>
1008
- </HStack>
1009
- </VStack>
1010
- );
1011
- }}
1012
- renderForm={(onAdd) => (
1013
- <VStack gap="sm" align="stretch">
1014
- <textarea
1015
- placeholder="Order/Action required..."
1016
- className="p-2 border rounded min-h-[80px]"
1017
- id="decision-text"
1018
- />
1019
- <input
1020
- type="date"
1021
- className="p-2 border rounded"
1022
- id="decision-deadline"
1023
- />
1024
- <Button
1025
- variant="primary"
1026
- size="sm"
1027
- onClick={() => {
1028
- const text = (
1029
- document.getElementById(
1030
- "decision-text",
1031
- ) as HTMLTextAreaElement
1032
- )?.value;
1033
- const deadline = (
1034
- document.getElementById(
1035
- "decision-deadline",
1036
- ) as HTMLInputElement
1037
- )?.value;
1038
- if (text && deadline) {
1039
- onAdd({ orderText: text, deadline });
1040
- }
1041
- }}
1042
- >
1043
- Add Decision
1044
- </Button>
1045
- </VStack>
1046
- )}
1047
- onAdd={(decisionData) => {
1048
- const dd = decisionData as Record<string, unknown> | undefined;
1049
- const newDecision: Decision = {
1050
- id: `decision-${Date.now()}`,
1051
- orderText: String(dd?.orderText ?? ""),
1052
- deadline: String(dd?.deadline ?? ""),
1053
- relatedFindingIds: [],
1054
- status: "pending",
1055
- };
1056
- onDataUpdate?.({ decisions: [...data.decisions, newDecision] });
1057
- }}
1058
- onRemove={(id) => {
1059
- onDataUpdate?.({
1060
- decisions: data.decisions.filter((d) => d.id !== id),
1061
- });
1062
- }}
1063
- />
1064
- </VStack>
1065
- );
1066
-
1067
- const renderDocumentGeneration = () => (
1068
- <VStack gap="lg" align="stretch">
1069
- <Typography variant="h3">Document Generation</Typography>
1070
- <Typography variant="body" className="text-neutral-600">
1071
- Review the compiled inspection document before presenting to the
1072
- merchant.
1073
- </Typography>
1074
-
1075
- <DocumentPreview
1076
- title="Inspection Record"
1077
- subtitle={`Case #${data.caseNumber}`}
1078
- previewUrl={`/api/inspections/${data.id}/preview`}
1079
- downloadUrl={`/api/inspections/${data.id}/download`}
1080
- onDownload={() =>
1081
- eventBus.emit("UI:DOWNLOAD_DOCUMENT", { inspectionId: data.id })
1082
- }
1083
- onPrint={() =>
1084
- eventBus.emit("UI:PRINT_DOCUMENT", { inspectionId: data.id })
1085
- }
1086
- />
1087
-
1088
- <Card className="p-4">
1089
- <VStack gap="md" align="stretch">
1090
- <Typography variant="h4">Document Sections</Typography>
1091
- {phases.map((phase) => (
1092
- <Box key={phase.id}>
1093
- <Typography variant="small" className="text-neutral-500 mb-1">
1094
- {phase.label}
1095
- </Typography>
1096
- {phase.steps
1097
- .filter((s) => s.documentSection)
1098
- .map((step) => (
1099
- <HStack key={step.id} gap="sm" className="ml-4">
1100
- <CheckCircle className="h-4 w-4 text-green-500" />
1101
- <Typography variant="small">
1102
- {step.documentSection}
1103
- </Typography>
1104
- </HStack>
1105
- ))}
1106
- </Box>
1107
- ))}
1108
- </VStack>
1109
- </Card>
1110
- </VStack>
1111
- );
1112
-
1113
- const renderMerchantReview = () => (
1114
- <VStack gap="lg" align="stretch">
1115
- <Typography variant="h3">Merchant Review</Typography>
1116
- <Typography variant="body" className="text-neutral-600">
1117
- Present the inspection document to the merchant for review.
1118
- </Typography>
1119
-
1120
- <Card className="p-4 bg-blue-50 border-blue-200">
1121
- <VStack gap="sm" align="stretch">
1122
- <HStack gap="sm">
1123
- <Scale className="h-5 w-5 text-blue-600" />
1124
- <Typography className="text-blue-700 font-medium">
1125
- The merchant has the right to review all findings and raise
1126
- objections.
1127
- </Typography>
1128
- </HStack>
1129
- </VStack>
1130
- </Card>
1131
-
1132
- <DocumentPreview
1133
- title="Inspection Record"
1134
- subtitle="For Merchant Review"
1135
- previewUrl={`/api/inspections/${data.id}/preview`}
1136
- isReadOnly
1137
- />
1138
- </VStack>
1139
- );
1140
-
1141
- const renderObjections = () => (
1142
- <VStack gap="lg" align="stretch">
1143
- <Typography variant="h3">Objections</Typography>
1144
-
1145
- {data.objections.length === 0 ? (
1146
- <Card className="p-4 bg-green-50 border-green-200">
1147
- <HStack gap="sm">
1148
- <CheckCircle className="h-5 w-5 text-green-600" />
1149
- <Typography className="text-green-700">
1150
- No objections have been raised by the merchant.
1151
- </Typography>
1152
- </HStack>
1153
- </Card>
1154
- ) : (
1155
- <VStack gap="md" align="stretch">
1156
- {data.objections.map((objection) => (
1157
- <Card key={objection.id} className="p-4">
1158
- <VStack gap="sm" align="stretch">
1159
- <HStack justify="between">
1160
- <Badge variant="default">
1161
- Section: {objection.sectionRef}
1162
- </Badge>
1163
- <Badge
1164
- variant={
1165
- objection.status === "resolved" ? "success" : "warning"
1166
- }
1167
- >
1168
- {objection.status}
1169
- </Badge>
1170
- </HStack>
1171
- <Typography>{objection.objectionText}</Typography>
1172
- {objection.response && (
1173
- <Box className="bg-neutral-50 p-2 rounded">
1174
- <Typography variant="small" className="text-neutral-500">
1175
- Inspector Response:
1176
- </Typography>
1177
- <Typography variant="small">
1178
- {objection.response}
1179
- </Typography>
1180
- </Box>
1181
- )}
1182
- </VStack>
1183
- </Card>
1184
- ))}
1185
- </VStack>
1186
- )}
1187
-
1188
- <ObjectionRecorder
1189
- onSubmit={(sectionRefOrObj, text) => {
1190
- const sectionRef =
1191
- typeof sectionRefOrObj === "string"
1192
- ? sectionRefOrObj
1193
- : (sectionRefOrObj?.participantId ?? "");
1194
- const objText =
1195
- typeof sectionRefOrObj === "string"
1196
- ? (text ?? "")
1197
- : (sectionRefOrObj?.text ?? "");
1198
- const newObjection: Objection = {
1199
- id: `obj-${Date.now()}`,
1200
- sectionRef,
1201
- objectionText: objText,
1202
- status: "pending",
1203
- };
1204
- onDataUpdate?.({ objections: [...data.objections, newObjection] });
1205
- }}
1206
- />
1207
- </VStack>
1208
- );
1209
-
1210
- const renderEndTime = () => (
1211
- <VStack gap="lg" align="stretch">
1212
- <Typography variant="h3">Closing Information</Typography>
1213
-
1214
- <Card className="p-4">
1215
- <VStack gap="md" align="stretch">
1216
- <Box>
1217
- <Typography variant="small" className="text-neutral-500 mb-1">
1218
- Inspection Start
1219
- </Typography>
1220
- <Typography>{data.startDateTime || "Not recorded"}</Typography>
1221
- </Box>
1222
- <Box>
1223
- <Typography variant="small" className="text-neutral-500 mb-1">
1224
- Inspection End
1225
- </Typography>
1226
- <input
1227
- type="datetime-local"
1228
- className="w-full p-2 border rounded"
1229
- value={data.endDateTime || ""}
1230
- onChange={(e) => onDataUpdate?.({ endDateTime: e.target.value })}
1231
- />
1232
- </Box>
1233
- </VStack>
1234
- </Card>
1235
-
1236
- <InspectionTimeline items={data.timeline} />
1237
- </VStack>
1238
- );
1239
-
1240
- const renderSignatures = () => (
1241
- <VStack gap="lg" align="stretch">
1242
- <Typography variant="h3">Signatures</Typography>
1243
- <Typography variant="body" className="text-neutral-600">
1244
- Both the inspector and merchant representative must sign the inspection
1245
- record.
1246
- </Typography>
1247
-
1248
- <Card className="p-4">
1249
- <VStack gap="lg" align="stretch">
1250
- <SignatureCapture
1251
- title="Inspector Signature"
1252
- subtitle={
1253
- data.inspector
1254
- ? `${data.inspector.name} ${data.inspector.surname}`
1255
- : "Inspector"
1256
- }
1257
- onCapture={(signatureData) => {
1258
- onDataUpdate?.({ inspectorSignature: signatureData });
1259
- eventBus.emit("UI:INSPECTOR_SIGNED", { inspectionId: data.id });
1260
- }}
1261
- />
1262
-
1263
- <SignatureCapture
1264
- title="Merchant Signature"
1265
- subtitle={
1266
- data.participants[0]
1267
- ? `${data.participants[0].name} ${data.participants[0].surname}`
1268
- : "Company Representative"
1269
- }
1270
- onCapture={(signatureData) => {
1271
- onDataUpdate?.({ merchantSignature: signatureData });
1272
- eventBus.emit("UI:MERCHANT_SIGNED", { inspectionId: data.id });
1273
- }}
1274
- />
1275
- </VStack>
1276
- </Card>
1277
-
1278
- {(!data.inspectorSignature || !data.merchantSignature) && (
1279
- <Card className="p-4 bg-yellow-50 border-yellow-200">
1280
- <HStack gap="sm">
1281
- <AlertTriangle className="h-5 w-5 text-yellow-600" />
1282
- <Typography className="text-yellow-700">
1283
- Both signatures are required to complete the inspection (ZIN Art.
1284
- 28)
1285
- </Typography>
1286
- </HStack>
1287
- </Card>
1288
- )}
1289
- </VStack>
1290
- );
1291
-
1292
- const renderComplete = () => (
1293
- <VStack gap="lg" align="center" className="py-8">
1294
- <Box className="p-4 rounded-full bg-green-100">
1295
- <CheckCircle className="h-16 w-16 text-green-600" />
1296
- </Box>
1297
- <Typography variant="h2">Inspection Complete</Typography>
1298
- <Typography
1299
- variant="body"
1300
- className="text-neutral-600 text-center max-w-md"
1301
- >
1302
- The inspection has been successfully completed. You can download the
1303
- final document or archive it to the information system.
1304
- </Typography>
1305
-
1306
- <Card className="p-4 w-full max-w-md">
1307
- <VStack gap="sm" align="stretch">
1308
- <HStack justify="between">
1309
- <Typography>Case Number</Typography>
1310
- <Typography weight="medium">{data.caseNumber}</Typography>
1311
- </HStack>
1312
- <HStack justify="between">
1313
- <Typography>Company</Typography>
1314
- <Typography weight="medium">{data.company?.name}</Typography>
1315
- </HStack>
1316
- <HStack justify="between">
1317
- <Typography>Rules Checked</Typography>
1318
- <Typography weight="medium">{checkedRules}</Typography>
1319
- </HStack>
1320
- <HStack justify="between">
1321
- <Typography>Findings</Typography>
1322
- <Typography weight="medium">{data.findings.length}</Typography>
1323
- </HStack>
1324
- <HStack justify="between">
1325
- <Typography>Decisions</Typography>
1326
- <Typography weight="medium">{data.decisions.length}</Typography>
1327
- </HStack>
1328
- </VStack>
1329
- </Card>
1330
-
1331
- <HStack gap="md">
1332
- <Button
1333
- variant="default"
1334
- onClick={() =>
1335
- eventBus.emit("UI:DOWNLOAD_FINAL", { inspectionId: data.id })
1336
- }
1337
- >
1338
- <FileText className="h-4 w-4 mr-2" />
1339
- Download PDF
1340
- </Button>
1341
- <Button
1342
- variant="primary"
1343
- onClick={() =>
1344
- eventBus.emit("UI:ARCHIVE_INSPECTION", { inspectionId: data.id })
1345
- }
1346
- >
1347
- <CheckCircle className="h-4 w-4 mr-2" />
1348
- Archive to System
1349
- </Button>
1350
- </HStack>
1351
- </VStack>
1352
- );
1353
-
1354
- // Step content renderer
1355
- const renderStepContent = () => {
1356
- switch (currentStep) {
1357
- case "case-info":
1358
- return renderCaseInfo();
1359
- case "company-data":
1360
- return renderCompanyData();
1361
- case "participants":
1362
- return renderParticipants();
1363
- case "field-selection":
1364
- return renderFieldSelection();
1365
- case "rule-checking":
1366
- return renderRuleChecking();
1367
- case "findings":
1368
- return renderFindings();
1369
- case "decisions":
1370
- return renderDecisions();
1371
- case "document-generation":
1372
- return renderDocumentGeneration();
1373
- case "merchant-review":
1374
- return renderMerchantReview();
1375
- case "objections":
1376
- return renderObjections();
1377
- case "end-time":
1378
- return renderEndTime();
1379
- case "signatures":
1380
- return renderSignatures();
1381
- case "complete":
1382
- return renderComplete();
1383
- default:
1384
- return null;
1385
- }
1386
- };
1387
-
1388
- // Can proceed check
1389
- const canProceed = (): boolean => {
1390
- switch (currentStep) {
1391
- case "case-info":
1392
- return !!data.caseNumber && !!data.inspector && !!data.startDateTime;
1393
- case "company-data":
1394
- return !!data.company;
1395
- case "participants":
1396
- return data.participants.length >= 1;
1397
- case "field-selection":
1398
- return !!data.selectedField;
1399
- case "rule-checking":
1400
- return checkedRules === totalRules;
1401
- case "findings":
1402
- return true; // Optional
1403
- case "decisions":
1404
- return true; // Optional
1405
- case "document-generation":
1406
- return true;
1407
- case "merchant-review":
1408
- return true;
1409
- case "objections":
1410
- return data.objections.every((o) => o.status === "resolved");
1411
- case "end-time":
1412
- return !!data.endDateTime;
1413
- case "signatures":
1414
- return !!data.inspectorSignature && !!data.merchantSignature;
1415
- case "complete":
1416
- return true;
1417
- default:
1418
- return true;
1419
- }
1420
- };
1421
-
1422
- // ==========================================================================
1423
- // Render
1424
- // ==========================================================================
1425
-
1426
- return (
1427
- <VStack gap="none" className={cn("min-h-screen bg-neutral-50", className)}>
1428
- {/* Header */}
1429
- <Box className="bg-white border-b sticky top-0 z-40">
1430
- <Box className="max-w-6xl mx-auto p-4">
1431
- <HStack justify="between" align="center">
1432
- <VStack gap="xs">
1433
- <Typography variant="h3">
1434
- Field Inspection - {data.caseNumber || "New"}
1435
- </Typography>
1436
- <Typography variant="small" className="text-neutral-500">
1437
- {data.company?.name || "No company selected"}
1438
- </Typography>
1439
- </VStack>
1440
- <PhaseIndicator phase={mapPhaseToIndicator(currentPhase)} />
1441
- </HStack>
1442
- </Box>
1443
- </Box>
1444
-
1445
- {/* Phase Navigation */}
1446
- <Box className="bg-white border-b">
1447
- <Box className="max-w-6xl mx-auto p-2">
1448
- <HStack gap="none" className="overflow-x-auto">
1449
- {phases.map((phase, phaseIndex) => {
1450
- const phaseStepIndices = phase.steps.map((s) =>
1451
- getStepIndex(s.id),
1452
- );
1453
- const isPhaseComplete = phaseStepIndices.every(
1454
- (i) => i < currentStepIndex,
1455
- );
1456
- const isCurrentPhase = phase.id === currentPhase;
1457
- const Icon = phase.icon;
1458
-
1459
- return (
1460
- <Box
1461
- key={phase.id}
1462
- className={cn(
1463
- "flex-1 p-3 border-b-2 transition-all",
1464
- isCurrentPhase && "border-blue-500 bg-blue-50",
1465
- isPhaseComplete && !isCurrentPhase && "border-green-500",
1466
- !isCurrentPhase && !isPhaseComplete && "border-transparent",
1467
- )}
1468
- >
1469
- <HStack gap="sm" justify="center">
1470
- {isPhaseComplete ? (
1471
- <CheckCircle className="h-5 w-5 text-green-500" />
1472
- ) : (
1473
- <Icon
1474
- className={cn(
1475
- "h-5 w-5",
1476
- isCurrentPhase ? "text-blue-600" : "text-neutral-400",
1477
- )}
1478
- />
1479
- )}
1480
- <Typography
1481
- variant="small"
1482
- weight={isCurrentPhase ? "semibold" : "normal"}
1483
- className={cn(
1484
- isCurrentPhase && "text-blue-700",
1485
- isPhaseComplete && !isCurrentPhase && "text-green-700",
1486
- )}
1487
- >
1488
- {phase.label}
1489
- </Typography>
1490
- </HStack>
1491
- </Box>
1492
- );
1493
- })}
1494
- </HStack>
1495
- </Box>
1496
- </Box>
1497
-
1498
- {/* Step Progress */}
1499
- <Box className="max-w-6xl mx-auto w-full px-4 py-4">
1500
- <ProgressHeader
1501
- title={phases.find((p) => p.id === currentPhase)?.label || ""}
1502
- subtitle={`Step ${currentStepIndex + 1} of ${allSteps.length}`}
1503
- phase={mapPhaseToIndicator(currentPhase)}
1504
- steps={progressSteps.slice(
1505
- getStepIndex(
1506
- phases.find((p) => p.id === currentPhase)?.steps[0].id ||
1507
- "case-info",
1508
- ),
1509
- getStepIndex(
1510
- phases.find((p) => p.id === currentPhase)?.steps[
1511
- phases.find((p) => p.id === currentPhase)!.steps.length - 1
1512
- ].id || "case-info",
1513
- ) + 1,
1514
- )}
1515
- compact
1516
- />
1517
- </Box>
1518
-
1519
- {/* Main Content */}
1520
- <Box className="max-w-6xl mx-auto w-full px-4 pb-24 flex-1">
1521
- <Card className="p-6">{renderStepContent()}</Card>
1522
- </Box>
1523
-
1524
- {/* Footer Navigation */}
1525
- <Box className="bg-white border-t fixed bottom-0 left-0 right-0 z-40">
1526
- <Box className="max-w-6xl mx-auto p-4">
1527
- <HStack justify="between" align="center">
1528
- <Button
1529
- variant="default"
1530
- onClick={handlePrevious}
1531
- disabled={isFirstStep}
1532
- className="gap-2"
1533
- >
1534
- <ArrowLeft className="h-4 w-4" />
1535
- Previous
1536
- </Button>
1537
-
1538
- <HStack gap="sm">
1539
- <Button
1540
- variant="ghost"
1541
- onClick={handleSaveDraft}
1542
- className="gap-2"
1543
- >
1544
- <Save className="h-4 w-4" />
1545
- Save Draft
1546
- </Button>
1547
- </HStack>
1548
-
1549
- <Button
1550
- variant="primary"
1551
- onClick={handleNext}
1552
- disabled={!canProceed()}
1553
- className="gap-2"
1554
- >
1555
- {isLastStep ? (
1556
- <>
1557
- <CheckCircle className="h-4 w-4" />
1558
- Archive Inspection
1559
- </>
1560
- ) : (
1561
- <>
1562
- Next
1563
- <ArrowRight className="h-4 w-4" />
1564
- </>
1565
- )}
1566
- </Button>
1567
- </HStack>
1568
- </Box>
1569
- </Box>
1570
-
1571
- {/* Floating Action Menu (only during content phase) */}
1572
- {currentPhase === "content" && (
1573
- <FloatingActionMenu
1574
- actions={floatingActions}
1575
- context={{ inspectionId: data.id, currentStep }}
1576
- />
1577
- )}
1578
- </VStack>
1579
- );
1580
- };
1581
-
1582
- InspectionProcessTemplate.displayName = "InspectionProcessTemplate";