hazo_collab_forms 1.12.0 → 2.0.0

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 (212) hide show
  1. package/CHANGE_LOG.md +49 -0
  2. package/README.md +406 -0
  3. package/dist/components/_internal_form_set.d.ts +13 -0
  4. package/dist/components/_internal_form_set.d.ts.map +1 -1
  5. package/dist/components/_internal_form_set.js +49 -3
  6. package/dist/components/_internal_form_set.js.map +1 -1
  7. package/dist/components/clarification/clarification_badge.d.ts +16 -0
  8. package/dist/components/clarification/clarification_badge.d.ts.map +1 -0
  9. package/dist/components/clarification/clarification_badge.js +15 -0
  10. package/dist/components/clarification/clarification_badge.js.map +1 -0
  11. package/dist/components/clarification/clarification_card.d.ts +48 -0
  12. package/dist/components/clarification/clarification_card.d.ts.map +1 -0
  13. package/dist/components/clarification/clarification_card.js +46 -0
  14. package/dist/components/clarification/clarification_card.js.map +1 -0
  15. package/dist/components/clarification/clarification_dialog.d.ts +32 -0
  16. package/dist/components/clarification/clarification_dialog.d.ts.map +1 -0
  17. package/dist/components/clarification/clarification_dialog.js +63 -0
  18. package/dist/components/clarification/clarification_dialog.js.map +1 -0
  19. package/dist/components/clarification/clarification_doc_reference.d.ts +18 -0
  20. package/dist/components/clarification/clarification_doc_reference.d.ts.map +1 -0
  21. package/dist/components/clarification/clarification_doc_reference.js +22 -0
  22. package/dist/components/clarification/clarification_doc_reference.js.map +1 -0
  23. package/dist/components/clarification/clarification_response_form.d.ts +32 -0
  24. package/dist/components/clarification/clarification_response_form.d.ts.map +1 -0
  25. package/dist/components/clarification/clarification_response_form.js +38 -0
  26. package/dist/components/clarification/clarification_response_form.js.map +1 -0
  27. package/dist/components/clarification/clarification_section.d.ts +26 -0
  28. package/dist/components/clarification/clarification_section.d.ts.map +1 -0
  29. package/dist/components/clarification/clarification_section.js +46 -0
  30. package/dist/components/clarification/clarification_section.js.map +1 -0
  31. package/dist/components/clarification/index.d.ts +18 -0
  32. package/dist/components/clarification/index.d.ts.map +1 -0
  33. package/dist/components/clarification/index.js +13 -0
  34. package/dist/components/clarification/index.js.map +1 -0
  35. package/dist/components/clarification/use_clarifications.d.ts +49 -0
  36. package/dist/components/clarification/use_clarifications.d.ts.map +1 -0
  37. package/dist/components/clarification/use_clarifications.js +160 -0
  38. package/dist/components/clarification/use_clarifications.js.map +1 -0
  39. package/dist/components/collab_form_file_upload.d.ts +16 -1
  40. package/dist/components/collab_form_file_upload.d.ts.map +1 -1
  41. package/dist/components/collab_form_file_upload.js +44 -10
  42. package/dist/components/collab_form_file_upload.js.map +1 -1
  43. package/dist/components/hazo_collab_form_base.d.ts +32 -2
  44. package/dist/components/hazo_collab_form_base.d.ts.map +1 -1
  45. package/dist/components/hazo_collab_form_base.js +11 -5
  46. package/dist/components/hazo_collab_form_base.js.map +1 -1
  47. package/dist/components/hazo_collab_form_group.d.ts +12 -0
  48. package/dist/components/hazo_collab_form_group.d.ts.map +1 -1
  49. package/dist/components/hazo_collab_form_group.js +27 -4
  50. package/dist/components/hazo_collab_form_group.js.map +1 -1
  51. package/dist/components/hazo_collab_form_view/context.d.ts.map +1 -1
  52. package/dist/components/hazo_collab_form_view/context.js +19 -1
  53. package/dist/components/hazo_collab_form_view/context.js.map +1 -1
  54. package/dist/components/hazo_collab_form_view/index.d.ts +1 -1
  55. package/dist/components/hazo_collab_form_view/index.d.ts.map +1 -1
  56. package/dist/components/hazo_collab_form_view/index.js +8 -0
  57. package/dist/components/hazo_collab_form_view/index.js.map +1 -1
  58. package/dist/components/hazo_collab_form_view/types.d.ts +32 -2
  59. package/dist/components/hazo_collab_form_view/types.d.ts.map +1 -1
  60. package/dist/components/hazo_collab_form_view/views/edit_view.d.ts.map +1 -1
  61. package/dist/components/hazo_collab_form_view/views/edit_view.js +74 -8
  62. package/dist/components/hazo_collab_form_view/views/edit_view.js.map +1 -1
  63. package/dist/components/hazo_collab_form_view/views/summary_view.d.ts.map +1 -1
  64. package/dist/components/hazo_collab_form_view/views/summary_view.js +187 -10
  65. package/dist/components/hazo_collab_form_view/views/summary_view.js.map +1 -1
  66. package/dist/components/hazo_data_form/field_renderers/index.d.ts +6 -0
  67. package/dist/components/hazo_data_form/field_renderers/index.d.ts.map +1 -1
  68. package/dist/components/hazo_data_form/field_renderers/index.js +22 -1
  69. package/dist/components/hazo_data_form/field_renderers/index.js.map +1 -1
  70. package/dist/components/hazo_data_form/group_renderer.d.ts.map +1 -1
  71. package/dist/components/hazo_data_form/group_renderer.js +2 -1
  72. package/dist/components/hazo_data_form/group_renderer.js.map +1 -1
  73. package/dist/components/hazo_data_form/shared/data_form_field_layout.d.ts +1 -1
  74. package/dist/components/hazo_data_form/shared/data_form_field_layout.d.ts.map +1 -1
  75. package/dist/components/hazo_data_form/shared/data_form_field_layout.js +3 -3
  76. package/dist/components/hazo_data_form/shared/data_form_field_layout.js.map +1 -1
  77. package/dist/components/hazo_data_form/shared/data_form_reference_value.d.ts +3 -1
  78. package/dist/components/hazo_data_form/shared/data_form_reference_value.d.ts.map +1 -1
  79. package/dist/components/hazo_data_form/shared/data_form_reference_value.js +5 -2
  80. package/dist/components/hazo_data_form/shared/data_form_reference_value.js.map +1 -1
  81. package/dist/components/hazo_data_form/types.d.ts +2 -0
  82. package/dist/components/hazo_data_form/types.d.ts.map +1 -1
  83. package/dist/components/hazo_validation_rule_editor/components/clarification_settings.d.ts +10 -0
  84. package/dist/components/hazo_validation_rule_editor/components/clarification_settings.d.ts.map +1 -0
  85. package/dist/components/hazo_validation_rule_editor/components/clarification_settings.js +57 -0
  86. package/dist/components/hazo_validation_rule_editor/components/clarification_settings.js.map +1 -0
  87. package/dist/components/hazo_validation_rule_editor/components/prompt_editor.d.ts +11 -0
  88. package/dist/components/hazo_validation_rule_editor/components/prompt_editor.d.ts.map +1 -0
  89. package/dist/components/hazo_validation_rule_editor/components/prompt_editor.js +145 -0
  90. package/dist/components/hazo_validation_rule_editor/components/prompt_editor.js.map +1 -0
  91. package/dist/components/hazo_validation_rule_editor/components/rule_editor.d.ts +6 -0
  92. package/dist/components/hazo_validation_rule_editor/components/rule_editor.d.ts.map +1 -0
  93. package/dist/components/hazo_validation_rule_editor/components/rule_editor.js +149 -0
  94. package/dist/components/hazo_validation_rule_editor/components/rule_editor.js.map +1 -0
  95. package/dist/components/hazo_validation_rule_editor/components/rule_list.d.ts +6 -0
  96. package/dist/components/hazo_validation_rule_editor/components/rule_list.d.ts.map +1 -0
  97. package/dist/components/hazo_validation_rule_editor/components/rule_list.js +57 -0
  98. package/dist/components/hazo_validation_rule_editor/components/rule_list.js.map +1 -0
  99. package/dist/components/hazo_validation_rule_editor/context.d.ts +19 -0
  100. package/dist/components/hazo_validation_rule_editor/context.d.ts.map +1 -0
  101. package/dist/components/hazo_validation_rule_editor/context.js +95 -0
  102. package/dist/components/hazo_validation_rule_editor/context.js.map +1 -0
  103. package/dist/components/hazo_validation_rule_editor/hooks/use_file_validation.d.ts +20 -0
  104. package/dist/components/hazo_validation_rule_editor/hooks/use_file_validation.d.ts.map +1 -0
  105. package/dist/components/hazo_validation_rule_editor/hooks/use_file_validation.js +127 -0
  106. package/dist/components/hazo_validation_rule_editor/hooks/use_file_validation.js.map +1 -0
  107. package/dist/components/hazo_validation_rule_editor/hooks/use_validation_rules.d.ts +30 -0
  108. package/dist/components/hazo_validation_rule_editor/hooks/use_validation_rules.d.ts.map +1 -0
  109. package/dist/components/hazo_validation_rule_editor/hooks/use_validation_rules.js +216 -0
  110. package/dist/components/hazo_validation_rule_editor/hooks/use_validation_rules.js.map +1 -0
  111. package/dist/components/hazo_validation_rule_editor/index.d.ts +14 -0
  112. package/dist/components/hazo_validation_rule_editor/index.d.ts.map +1 -0
  113. package/dist/components/hazo_validation_rule_editor/index.js +12 -0
  114. package/dist/components/hazo_validation_rule_editor/index.js.map +1 -0
  115. package/dist/components/hazo_validation_rule_editor/types.d.ts +53 -0
  116. package/dist/components/hazo_validation_rule_editor/types.d.ts.map +1 -0
  117. package/dist/components/hazo_validation_rule_editor/types.js +5 -0
  118. package/dist/components/hazo_validation_rule_editor/types.js.map +1 -0
  119. package/dist/components/hazo_validation_rule_editor/validation_rule_editor.d.ts +3 -0
  120. package/dist/components/hazo_validation_rule_editor/validation_rule_editor.d.ts.map +1 -0
  121. package/dist/components/hazo_validation_rule_editor/validation_rule_editor.js +14 -0
  122. package/dist/components/hazo_validation_rule_editor/validation_rule_editor.js.map +1 -0
  123. package/dist/components/index.d.ts +9 -2
  124. package/dist/components/index.d.ts.map +1 -1
  125. package/dist/components/index.js +9 -1
  126. package/dist/components/index.js.map +1 -1
  127. package/dist/components/shared/field_state/normalize.d.ts.map +1 -1
  128. package/dist/components/shared/field_state/normalize.js +1 -0
  129. package/dist/components/shared/field_state/normalize.js.map +1 -1
  130. package/dist/components/shared/field_state/types.d.ts +6 -0
  131. package/dist/components/shared/field_state/types.d.ts.map +1 -1
  132. package/dist/components/shared/field_utils/types.d.ts +1 -1
  133. package/dist/components/shared/field_utils/types.d.ts.map +1 -1
  134. package/dist/components/shared/strip_base_props.d.ts.map +1 -1
  135. package/dist/components/shared/strip_base_props.js +2 -0
  136. package/dist/components/shared/strip_base_props.js.map +1 -1
  137. package/dist/components/shared/summary_files/summary_files.d.ts +9 -1
  138. package/dist/components/shared/summary_files/summary_files.d.ts.map +1 -1
  139. package/dist/components/shared/summary_files/summary_files.js +11 -5
  140. package/dist/components/shared/summary_files/summary_files.js.map +1 -1
  141. package/dist/components/shared/unified_field_controls/types.d.ts +8 -0
  142. package/dist/components/shared/unified_field_controls/types.d.ts.map +1 -1
  143. package/dist/components/shared/unified_field_controls/unified_field_controls.d.ts +1 -1
  144. package/dist/components/shared/unified_field_controls/unified_field_controls.d.ts.map +1 -1
  145. package/dist/components/shared/unified_field_controls/unified_field_controls.js +3 -2
  146. package/dist/components/shared/unified_field_controls/unified_field_controls.js.map +1 -1
  147. package/dist/components/shared/use_base_form_field.d.ts +14 -0
  148. package/dist/components/shared/use_base_form_field.d.ts.map +1 -1
  149. package/dist/components/shared/use_base_form_field.js +41 -2
  150. package/dist/components/shared/use_base_form_field.js.map +1 -1
  151. package/dist/components/status_badges.d.ts +33 -0
  152. package/dist/components/status_badges.d.ts.map +1 -1
  153. package/dist/components/status_badges.js +27 -2
  154. package/dist/components/status_badges.js.map +1 -1
  155. package/dist/config/clarification_templates.d.ts +24 -0
  156. package/dist/config/clarification_templates.d.ts.map +1 -0
  157. package/dist/config/clarification_templates.js +66 -0
  158. package/dist/config/clarification_templates.js.map +1 -0
  159. package/dist/config/defaults.d.ts +4 -0
  160. package/dist/config/defaults.d.ts.map +1 -1
  161. package/dist/config/defaults.js +4 -0
  162. package/dist/config/defaults.js.map +1 -1
  163. package/dist/config/index.d.ts +3 -1
  164. package/dist/config/index.d.ts.map +1 -1
  165. package/dist/config/index.js +3 -1
  166. package/dist/config/index.js.map +1 -1
  167. package/dist/config/validation_rule_commands.d.ts +12 -0
  168. package/dist/config/validation_rule_commands.d.ts.map +1 -0
  169. package/dist/config/validation_rule_commands.js +106 -0
  170. package/dist/config/validation_rule_commands.js.map +1 -0
  171. package/dist/lib/autofill_handler.d.ts +34 -0
  172. package/dist/lib/autofill_handler.d.ts.map +1 -0
  173. package/dist/lib/autofill_handler.js +330 -0
  174. package/dist/lib/autofill_handler.js.map +1 -0
  175. package/dist/lib/index.d.ts +9 -0
  176. package/dist/lib/index.d.ts.map +1 -1
  177. package/dist/lib/index.js +5 -0
  178. package/dist/lib/index.js.map +1 -1
  179. package/dist/lib/validation_handler.d.ts +27 -0
  180. package/dist/lib/validation_handler.d.ts.map +1 -0
  181. package/dist/lib/validation_handler.js +341 -0
  182. package/dist/lib/validation_handler.js.map +1 -0
  183. package/dist/types/clarification.d.ts +126 -0
  184. package/dist/types/clarification.d.ts.map +1 -0
  185. package/dist/types/clarification.js +8 -0
  186. package/dist/types/clarification.js.map +1 -0
  187. package/dist/types/file_attachment.d.ts +2 -0
  188. package/dist/types/file_attachment.d.ts.map +1 -1
  189. package/dist/types/file_attachment.js.map +1 -1
  190. package/dist/types/file_manager.d.ts +36 -0
  191. package/dist/types/file_manager.d.ts.map +1 -1
  192. package/dist/types/index.d.ts +3 -1
  193. package/dist/types/index.d.ts.map +1 -1
  194. package/dist/types/index.js.map +1 -1
  195. package/dist/types/validation.d.ts +192 -0
  196. package/dist/types/validation.d.ts.map +1 -0
  197. package/dist/types/validation.js +9 -0
  198. package/dist/types/validation.js.map +1 -0
  199. package/dist/utils/build_rule_field_map.d.ts +31 -0
  200. package/dist/utils/build_rule_field_map.d.ts.map +1 -0
  201. package/dist/utils/build_rule_field_map.js +53 -0
  202. package/dist/utils/build_rule_field_map.js.map +1 -0
  203. package/dist/utils/index.d.ts +3 -0
  204. package/dist/utils/index.d.ts.map +1 -1
  205. package/dist/utils/index.js +4 -0
  206. package/dist/utils/index.js.map +1 -1
  207. package/dist/utils/slugify.d.ts +10 -0
  208. package/dist/utils/slugify.d.ts.map +1 -0
  209. package/dist/utils/slugify.js +17 -0
  210. package/dist/utils/slugify.js.map +1 -0
  211. package/package.json +15 -3
  212. package/templates/config/hazo_collab_forms_config.ini +7 -0
@@ -0,0 +1,32 @@
1
+ /**
2
+ * ClarificationDialog - Modal dialog showing clarifications for a specific field.
3
+ *
4
+ * Opens when clicking the red badge on a field/group.
5
+ * Uses built-in Dialog/DialogContent for proper portal/overlay behavior.
6
+ * When "View" is clicked on a referenced document, expands to show a side panel
7
+ * with the PDF viewer alongside the clarification cards.
8
+ */
9
+ import React from 'react';
10
+ import type { ClarificationItem, ClarificationCallbacks } from '../../types/clarification.js';
11
+ export interface ClarificationDialogProps {
12
+ /** Whether dialog is open */
13
+ open: boolean;
14
+ /** Close handler */
15
+ on_open_change: (open: boolean) => void;
16
+ /** Field label for the dialog title */
17
+ field_label: string;
18
+ /** Clarifications filtered for this field */
19
+ items: ClarificationItem[];
20
+ /** Whether response forms are read-only */
21
+ read_only?: boolean;
22
+ /** Lifecycle callbacks */
23
+ callbacks?: ClarificationCallbacks;
24
+ /** Callback when a doc reference is clicked */
25
+ on_doc_click?: (file_id: string) => void;
26
+ /** Callback to get a download URL for a file (enables View button on doc references) */
27
+ get_download_url?: (file_id: string) => string;
28
+ /** Callback to delete a doc reference from a clarification */
29
+ on_doc_delete?: (clarification_id: string, file_id: string) => void;
30
+ }
31
+ export declare const ClarificationDialog: React.NamedExoticComponent<ClarificationDialogProps>;
32
+ //# sourceMappingURL=clarification_dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clarification_dialog.d.ts","sourceRoot":"","sources":["../../../src/components/clarification/clarification_dialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAA2C,MAAM,OAAO,CAAC;AAUhE,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,8BAA8B,CAAC;AAEtC,MAAM,WAAW,wBAAwB;IACvC,6BAA6B;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,oBAAoB;IACpB,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,sBAAsB,CAAC;IACnC,+CAA+C;IAC/C,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,wFAAwF;IACxF,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,8DAA8D;IAC9D,aAAa,CAAC,EAAE,CAAC,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACrE;AAED,eAAO,MAAM,mBAAmB,sDAgK9B,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * ClarificationDialog - Modal dialog showing clarifications for a specific field.
3
+ *
4
+ * Opens when clicking the red badge on a field/group.
5
+ * Uses built-in Dialog/DialogContent for proper portal/overlay behavior.
6
+ * When "View" is clicked on a referenced document, expands to show a side panel
7
+ * with the PDF viewer alongside the clarification cards.
8
+ */
9
+ 'use client';
10
+ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
11
+ import React, { useState, useCallback, useEffect } from 'react';
12
+ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, } from '../shared/dialog/index.js';
13
+ import { IoClose } from 'react-icons/io5';
14
+ import { ClarificationCard } from './clarification_card.js';
15
+ export const ClarificationDialog = React.memo(function ClarificationDialog({ open, on_open_change, field_label, items, read_only = false, callbacks, on_doc_click, get_download_url, on_doc_delete, }) {
16
+ const pending_count = items.filter(i => i.status === 'pending').length;
17
+ const resolved_on_doc_delete = on_doc_delete ?? callbacks?.on_doc_delete;
18
+ // PDF viewer state
19
+ const [preview_file, set_preview_file] = useState(null);
20
+ const [PdfViewer, set_pdf_viewer] = useState(null);
21
+ // Load PdfViewer from hazo_pdf (optional peer dependency)
22
+ useEffect(() => {
23
+ if (!get_download_url)
24
+ return;
25
+ import('hazo_pdf').then((mod) => {
26
+ if (mod.PdfViewer) {
27
+ set_pdf_viewer(() => mod.PdfViewer);
28
+ }
29
+ }).catch(() => { });
30
+ }, [get_download_url]);
31
+ // Handle "View" button click on a doc reference
32
+ const handle_doc_view = useCallback((file_id, file_name) => {
33
+ if (!get_download_url)
34
+ return;
35
+ set_preview_file({ file_id, file_name });
36
+ }, [get_download_url]);
37
+ const close_preview = useCallback(() => {
38
+ set_preview_file(null);
39
+ }, []);
40
+ // Reset preview when dialog closes
41
+ useEffect(() => {
42
+ if (!open) {
43
+ set_preview_file(null);
44
+ }
45
+ }, [open]);
46
+ // Only offer view if both PdfViewer and get_download_url are available
47
+ const can_view = !!(PdfViewer && get_download_url);
48
+ const is_previewing = !!(preview_file && can_view);
49
+ // Dialog width adapts: normal when no preview, wider with side panel
50
+ const dialog_class = is_previewing
51
+ ? 'max-w-6xl max-h-[85vh]'
52
+ : 'max-w-2xl max-h-[80vh] overflow-y-auto';
53
+ return (_jsx(Dialog, { open: open, onOpenChange: on_open_change, children: _jsx(DialogContent, { className: dialog_class, children: !is_previewing ? (
54
+ /* Standard layout - clarification cards only */
55
+ _jsxs(_Fragment, { children: [_jsxs(DialogHeader, { children: [_jsxs(DialogTitle, { children: ["Clarifications for ", field_label] }), _jsx(DialogDescription, { children: pending_count > 0
56
+ ? `${pending_count} pending clarification${pending_count !== 1 ? 's' : ''} requiring attention`
57
+ : `${items.length} clarification${items.length !== 1 ? 's' : ''}` })] }), _jsxs("div", { className: "space-y-4 mt-4", children: [items.length === 0 && (_jsx("p", { className: "text-sm text-muted-foreground italic text-center py-4", children: "No clarifications for this field." })), items.map((item) => (_jsx(ClarificationCard, { item: item, read_only: read_only, on_respond: callbacks?.on_respond, on_resolve: callbacks?.on_resolve, on_dismiss: callbacks?.on_dismiss, on_reopen: callbacks?.on_reopen, on_doc_click: on_doc_click, on_doc_view: can_view ? handle_doc_view : undefined, on_doc_delete: resolved_on_doc_delete }, item.id)))] })] })) : (
58
+ /* Side panel layout - cards on left, PDF viewer on right */
59
+ _jsxs(_Fragment, { children: [_jsxs(DialogHeader, { children: [_jsxs(DialogTitle, { children: ["Clarifications for ", field_label] }), _jsx(DialogDescription, { children: pending_count > 0
60
+ ? `${pending_count} pending clarification${pending_count !== 1 ? 's' : ''} requiring attention`
61
+ : `${items.length} clarification${items.length !== 1 ? 's' : ''}` })] }), _jsxs("div", { className: "flex gap-4 mt-4 min-h-0", style: { height: 'calc(85vh - 120px)' }, children: [_jsx("div", { className: "w-1/2 overflow-y-auto space-y-4 pr-2", children: items.map((item) => (_jsx(ClarificationCard, { item: item, read_only: read_only, on_respond: callbacks?.on_respond, on_resolve: callbacks?.on_resolve, on_dismiss: callbacks?.on_dismiss, on_reopen: callbacks?.on_reopen, on_doc_click: on_doc_click, on_doc_view: can_view ? handle_doc_view : undefined }, item.id))) }), _jsxs("div", { className: "w-1/2 border rounded-lg overflow-hidden flex flex-col bg-muted/20", children: [_jsxs("div", { className: "flex items-center justify-between px-3 py-2 border-b bg-muted/30", children: [_jsx("span", { className: "text-sm font-medium truncate", title: preview_file.file_name, children: preview_file.file_name }), _jsx("button", { type: "button", onClick: close_preview, className: "rounded-sm p-1 hover:bg-muted transition-colors flex-shrink-0", title: "Close preview", children: _jsx(IoClose, { className: "h-4 w-4" }) })] }), _jsx("div", { className: "flex-1 min-h-0", children: _jsx(PdfViewer, { url: get_download_url(preview_file.file_id), fit_to_width: true, toolbar_enabled: true, on_close: close_preview, className: "h-full w-full" }) })] })] })] })) }) }));
62
+ });
63
+ //# sourceMappingURL=clarification_dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clarification_dialog.js","sourceRoot":"","sources":["../../../src/components/clarification/clarification_dialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EACL,MAAM,EACN,aAAa,EACb,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AA2B5D,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,mBAAmB,CAAC,EACzE,IAAI,EACJ,cAAc,EACd,WAAW,EACX,KAAK,EACL,SAAS,GAAG,KAAK,EACjB,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,aAAa,GACY;IACzB,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC;IAC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,EACb,OAAO,EAAE,aAAa,EACtB,SAAS,EAAC,+DAA+D,EACzE,KAAK,EAAC,eAAe,YAErB,KAAC,OAAO,IAAC,SAAS,EAAC,SAAS,GAAG,GACxB,IACL,EAEN,cAAK,SAAS,EAAC,gBAAgB,YAC7B,KAAC,SAAS,IACR,GAAG,EAAE,gBAAiB,CAAC,YAAY,CAAC,OAAO,CAAC,EAC5C,YAAY,EAAE,IAAI,EAClB,eAAe,EAAE,IAAI,EACrB,QAAQ,EAAE,aAAa,EACvB,SAAS,EAAC,eAAe,GACzB,GACE,IACF,IACF,IACL,CACJ,GACa,GACT,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * ClarificationDocReference - Renders a list of referenced documents
3
+ * in the grey (issue) zone of a clarification card.
4
+ */
5
+ import React from 'react';
6
+ import type { ClarificationDocReference as DocRef } from '../../types/clarification.js';
7
+ export interface ClarificationDocReferenceListProps {
8
+ /** Document references to display */
9
+ references: DocRef[];
10
+ /** Optional callback when a doc reference is clicked */
11
+ on_click?: (file_id: string) => void;
12
+ /** Callback to open a file in the PDF viewer */
13
+ on_view?: (file_id: string, file_name: string) => void;
14
+ /** Callback to delete a doc reference (removes it and resolves the clarification) */
15
+ on_delete?: (file_id: string) => void;
16
+ }
17
+ export declare const ClarificationDocReferenceList: React.NamedExoticComponent<ClarificationDocReferenceListProps>;
18
+ //# sourceMappingURL=clarification_doc_reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clarification_doc_reference.d.ts","sourceRoot":"","sources":["../../../src/components/clarification/clarification_doc_reference.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,yBAAyB,IAAI,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAExF,MAAM,WAAW,kCAAkC;IACjD,qCAAqC;IACrC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,gDAAgD;IAChD,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,qFAAqF;IACrF,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED,eAAO,MAAM,6BAA6B,gEAoExC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * ClarificationDocReference - Renders a list of referenced documents
3
+ * in the grey (issue) zone of a clarification card.
4
+ */
5
+ 'use client';
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ import React from 'react';
8
+ import { IoDocumentOutline } from 'react-icons/io5';
9
+ import { HiEye, HiTrash } from 'react-icons/hi';
10
+ export const ClarificationDocReferenceList = React.memo(function ClarificationDocReferenceList({ references, on_click, on_view, on_delete, }) {
11
+ if (references.length === 0)
12
+ return null;
13
+ return (_jsxs("div", { className: "cls_clarification_doc_refs mt-3", children: [_jsx("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide mb-1.5", children: "Referenced Documents" }), _jsx("div", { className: "space-y-1.5", children: references.map((ref) => (_jsxs("div", { className: "flex items-center gap-2 text-sm hover:bg-muted/50 rounded px-2 py-1 -mx-2 transition-colors", children: [_jsx(IoDocumentOutline, { className: "w-4 h-4 flex-shrink-0 text-muted-foreground" }), _jsxs("div", { className: "min-w-0 flex-1 cursor-pointer", onClick: () => on_click?.(ref.file_id), role: "button", tabIndex: 0, onKeyDown: (e) => { if (e.key === 'Enter' || e.key === ' ')
14
+ on_click?.(ref.file_id); }, children: [_jsx("span", { className: "text-foreground font-medium truncate block", children: ref.file_name }), ref.comment && (_jsxs("span", { className: "text-muted-foreground text-xs italic block mt-0.5", children: ["\u201C", ref.comment, "\u201D"] }))] }), on_view && (_jsxs("button", { type: "button", onClick: (e) => {
15
+ e.stopPropagation();
16
+ on_view(ref.file_id, ref.file_name);
17
+ }, className: "flex items-center gap-1 px-2 py-1 text-xs font-medium rounded bg-blue-100 text-blue-700 hover:bg-blue-200 dark:bg-blue-900/30 dark:text-blue-400 dark:hover:bg-blue-900/50 transition-colors flex-shrink-0", title: `View ${ref.file_name}`, children: [_jsx(HiEye, { className: "h-3 w-3 flex-shrink-0" }), "View"] })), on_delete && (_jsx("button", { type: "button", onClick: (e) => {
18
+ e.stopPropagation();
19
+ on_delete(ref.file_id);
20
+ }, className: "flex items-center gap-1 px-2 py-1 text-xs font-medium rounded bg-red-100 text-red-700 hover:bg-red-200 dark:bg-red-900/30 dark:text-red-400 dark:hover:bg-red-900/50 transition-colors flex-shrink-0", title: `Delete ${ref.file_name}`, children: _jsx(HiTrash, { className: "h-3 w-3 flex-shrink-0" }) }))] }, ref.file_id))) })] }));
21
+ });
22
+ //# sourceMappingURL=clarification_doc_reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clarification_doc_reference.js","sourceRoot":"","sources":["../../../src/components/clarification/clarification_doc_reference.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAchD,MAAM,CAAC,MAAM,6BAA6B,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,6BAA6B,CAAC,EAC7F,UAAU,EACV,QAAQ,EACR,OAAO,EACP,SAAS,GAC0B;IACnC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEzC,OAAO,CACL,eAAK,SAAS,EAAC,iCAAiC,aAC9C,YAAG,SAAS,EAAC,0EAA0E,qCAEnF,EACJ,cAAK,SAAS,EAAC,aAAa,YACzB,UAAU,CAAC,GAAG,CAAC,CAAC,GA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AEhC,KAAC,OAAO,IAAC,SAAS,EAAC,uBAAuB,GAAG,GACtC,CACV,KA9CI,GAAG,CAAC,OAAO,CA+CZ,CACP,CAAC,GACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * ClarificationResponseForm - Input form in the green (action) zone.
3
+ *
4
+ * Renders:
5
+ * - Action description text
6
+ * - Comment textarea
7
+ * - Radio options for response choices
8
+ * - Conditional file upload dropzone when selected option has shows_file_upload
9
+ */
10
+ import React from 'react';
11
+ import type { ClarificationResponseOption, ClarificationResponse } from '../../types/clarification.js';
12
+ import type { FormFileAttachment } from '../../types/file_attachment.js';
13
+ export interface ClarificationResponseFormProps {
14
+ /** Action description shown above the options */
15
+ action_description?: string;
16
+ /** Available response options */
17
+ response_options: ClarificationResponseOption[];
18
+ /** Whether to show the comment textarea */
19
+ enable_comment: boolean;
20
+ /** Pre-filled response choice (for responded items) */
21
+ initial_choice?: string;
22
+ /** Pre-filled comment (for responded items) */
23
+ initial_comment?: string;
24
+ /** Pre-filled response files (for responded items) */
25
+ initial_files?: FormFileAttachment[];
26
+ /** Whether form is read-only */
27
+ read_only?: boolean;
28
+ /** Submit callback */
29
+ on_submit?: (response: ClarificationResponse) => void;
30
+ }
31
+ export declare const ClarificationResponseForm: React.NamedExoticComponent<ClarificationResponseFormProps>;
32
+ //# sourceMappingURL=clarification_response_form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clarification_response_form.d.ts","sourceRoot":"","sources":["../../../src/components/clarification/clarification_response_form.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAgC,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACvG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,MAAM,WAAW,8BAA8B;IAC7C,iDAAiD;IACjD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iCAAiC;IACjC,gBAAgB,EAAE,2BAA2B,EAAE,CAAC;IAChD,2CAA2C;IAC3C,cAAc,EAAE,OAAO,CAAC;IACxB,uDAAuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sDAAsD;IACtD,aAAa,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACrC,gCAAgC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sBAAsB;IACtB,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACvD;AAED,eAAO,MAAM,yBAAyB,4DA8HpC,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * ClarificationResponseForm - Input form in the green (action) zone.
3
+ *
4
+ * Renders:
5
+ * - Action description text
6
+ * - Comment textarea
7
+ * - Radio options for response choices
8
+ * - Conditional file upload dropzone when selected option has shows_file_upload
9
+ */
10
+ 'use client';
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ import React, { useState, useCallback } from 'react';
13
+ import { IoCloudUploadOutline } from 'react-icons/io5';
14
+ export const ClarificationResponseForm = React.memo(function ClarificationResponseForm({ action_description, response_options, enable_comment, initial_choice, initial_comment, initial_files, read_only = false, on_submit, }) {
15
+ const [choice, set_choice] = useState(initial_choice ?? '');
16
+ const [comment, set_comment] = useState(initial_comment ?? '');
17
+ const [files, set_files] = useState(initial_files ?? []);
18
+ // Find the selected option to check for conditional UI
19
+ const selected_option = response_options.find(opt => opt.value === choice);
20
+ const show_file_upload = selected_option?.shows_file_upload === true;
21
+ const show_additional_input = selected_option?.shows_additional_input === true;
22
+ const handle_submit = useCallback(() => {
23
+ if (!on_submit || !choice)
24
+ return;
25
+ on_submit({
26
+ response_choice: choice,
27
+ user_comment: comment || undefined,
28
+ response_files: files.length > 0 ? files : undefined,
29
+ });
30
+ }, [on_submit, choice, comment, files]);
31
+ const handle_file_drop = useCallback((e) => {
32
+ e.preventDefault();
33
+ // File upload would integrate with file_manager callbacks in future
34
+ // For now, show the drop zone UI only
35
+ }, []);
36
+ return (_jsxs("div", { className: "cls_clarification_response_form space-y-3", children: [action_description && (_jsx("p", { className: "text-sm text-foreground", children: action_description })), enable_comment && (_jsxs("div", { children: [_jsx("label", { className: "text-xs font-medium text-muted-foreground block mb-1", children: "Comments" }), _jsx("textarea", { className: "w-full px-3 py-2 text-sm border rounded-md bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-y min-h-[60px]", placeholder: "Add a comment...", value: comment, onChange: (e) => set_comment(e.target.value), disabled: read_only, rows: 2 })] })), _jsx("div", { className: "space-y-2", children: response_options.map((option) => (_jsxs("label", { className: "flex items-start gap-2.5 cursor-pointer text-sm group", children: [_jsx("input", { type: "radio", name: "clarification_response", value: option.value, checked: choice === option.value, onChange: () => set_choice(option.value), disabled: read_only, className: "mt-0.5 accent-green-600" }), _jsx("span", { className: "text-foreground group-hover:text-foreground/80", children: option.label })] }, option.value))) }), show_file_upload && (_jsxs("div", { className: "border-2 border-dashed border-green-300 dark:border-green-700 rounded-md p-4 text-center cursor-pointer hover:bg-green-50/50 dark:hover:bg-green-900/20 transition-colors", onDrop: handle_file_drop, onDragOver: (e) => e.preventDefault(), children: [_jsx(IoCloudUploadOutline, { className: "w-6 h-6 mx-auto text-green-500 mb-1" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "Drag & drop files here, or click to browse" }), files.length > 0 && (_jsx("div", { className: "mt-2 space-y-1", children: files.map((f) => (_jsx("p", { className: "text-xs text-foreground", children: f.file_name }, f.file_id))) }))] })), show_additional_input && (_jsx("textarea", { className: "w-full px-3 py-2 text-sm border rounded-md bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring resize-y min-h-[60px]", placeholder: "Additional information...", disabled: read_only, rows: 2 })), !read_only && on_submit && (_jsx("button", { onClick: handle_submit, disabled: !choice, className: "px-4 py-2 text-sm font-medium rounded-md bg-green-600 text-white hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors", children: "Submit Response" }))] }));
37
+ });
38
+ //# sourceMappingURL=clarification_response_form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clarification_response_form.js","sourceRoot":"","sources":["../../../src/components/clarification/clarification_response_form.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAuBvD,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,yBAAyB,CAAC,EACrF,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,eAAe,EACf,aAAa,EACb,SAAS,GAAG,KAAK,EACjB,SAAS,GACsB;IAC/B,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC;IAC5D,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC;IAC/D,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAuB,aAAa,IAAI,EAAE,CAAC,CAAC;IAE/E,uDAAuD;IACvD,MAAM,eAAe,GAAG,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC;IAC3E,MAAM,gBAAgB,GAAG,eAAe,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACrE,MAAM,qBAAqB,GAAG,eAAe,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAE/E,MAAM,aAAa,GAAG,WAAW,CAAC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AAG,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,EACxC,QAAQ,EAAE,SAAS,EACnB,SAAS,EAAC,yBAAyB,GACnC,EACF,eAAM,SAAS,EAAC,gDAAgD,YAC7D,MAAM,CAAC,KAAK,GACR,KAdF,MAAM,CAAC,KAAK,CAeX,CACT,CAAC,GACE,EAGL,gBAAgB,IAAI,CACnB,eACE,SAAS,EAAC,2KAA2K,EACrL,MAAM,EAAE,gBAAgB,EACxB,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE,aAErC,KAAC,oBAAoB,IAAC,SAAS,EAAC,qCAAqC,GAAG,EACxE,YAAG,SAAS,EAAC,+BAA+B,2DAExC,EACH,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACnB,cAAK,SAAS,EAAC,gBAAgB,YAC5B,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAChB,YAAmB,SAAS,EAAC,yBAAyB,YAAE,CAAC,CAAC,SAAS,IAA3D,CAAC,CAAC,OAAO,CAAuD,CACzE,CAAC,GACE,CACP,IACG,CACP,EAGA,qBAAqB,IAAI,CACxB,mBACE,SAAS,EAAC,kLAAkL,EAC5L,WAAW,EAAC,2BAA2B,EACvC,QAAQ,EAAE,SAAS,EACnB,IAAI,EAAE,CAAC,GACP,CACH,EAGA,CAAC,SAAS,IAAI,SAAS,IAAI,CAC1B,iBACE,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,CAAC,MAAM,EACjB,SAAS,EAAC,uJAAuJ,gCAG1J,CACV,IACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * ClarificationSection - Renders as a form section after regular sections.
3
+ *
4
+ * Groups clarification items by status: pending first, then responded, then resolved/dismissed (collapsed).
5
+ * Only visible when enable_clarifications=true AND clarifications exist.
6
+ */
7
+ import React from 'react';
8
+ import type { ClarificationItem, ClarificationCallbacks, ClarificationCounts } from '../../types/clarification.js';
9
+ export interface ClarificationSectionProps {
10
+ /** All clarification items */
11
+ items: ClarificationItem[];
12
+ /** Aggregate counts */
13
+ counts: ClarificationCounts;
14
+ /** Whether response forms are read-only */
15
+ read_only?: boolean;
16
+ /** Callbacks for clarification lifecycle */
17
+ callbacks?: ClarificationCallbacks;
18
+ /** Callback when a doc reference is clicked */
19
+ on_doc_click?: (file_id: string) => void;
20
+ /** Callback when the target field label is clicked (scrolls to field) */
21
+ on_field_click?: (field_id: string) => void;
22
+ /** Optional className */
23
+ class_name?: string;
24
+ }
25
+ export declare const ClarificationSection: React.NamedExoticComponent<ClarificationSectionProps>;
26
+ //# sourceMappingURL=clarification_section.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clarification_section.d.ts","sourceRoot":"","sources":["../../../src/components/clarification/clarification_section.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAEtC,MAAM,WAAW,yBAAyB;IACxC,8BAA8B;IAC9B,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,uBAAuB;IACvB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,sBAAsB,CAAC;IACnC,+CAA+C;IAC/C,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,yEAAyE;IACzE,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAUD,eAAO,MAAM,oBAAoB,uDAmH/B,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * ClarificationSection - Renders as a form section after regular sections.
3
+ *
4
+ * Groups clarification items by status: pending first, then responded, then resolved/dismissed (collapsed).
5
+ * Only visible when enable_clarifications=true AND clarifications exist.
6
+ */
7
+ 'use client';
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ import React, { useMemo, useState } from 'react';
10
+ import { IoAlertCircle, IoChevronDown, IoChevronForward } from 'react-icons/io5';
11
+ import { cn } from '../../utils/cn.js';
12
+ import { ClarificationCard } from './clarification_card.js';
13
+ /** Status sort order: pending → responded → resolved → dismissed */
14
+ const STATUS_ORDER = {
15
+ pending: 0,
16
+ responded: 1,
17
+ resolved: 2,
18
+ dismissed: 3,
19
+ };
20
+ export const ClarificationSection = React.memo(function ClarificationSection({ items, counts, read_only = false, callbacks, on_doc_click, on_field_click, class_name, }) {
21
+ const [collapsed_expanded, set_collapsed_expanded] = useState(false);
22
+ // Don't render if no clarifications
23
+ if (items.length === 0)
24
+ return null;
25
+ // Split into active (pending + responded) and closed (resolved + dismissed)
26
+ const { active_items, closed_items } = useMemo(() => {
27
+ const sorted = [...items].sort((a, b) => (STATUS_ORDER[a.status] ?? 9) - (STATUS_ORDER[b.status] ?? 9));
28
+ const active = [];
29
+ const closed = [];
30
+ for (const item of sorted) {
31
+ if (item.status === 'resolved' || item.status === 'dismissed') {
32
+ closed.push(item);
33
+ }
34
+ else {
35
+ active.push(item);
36
+ }
37
+ }
38
+ return { active_items: active, closed_items: closed };
39
+ }, [items]);
40
+ // Build header label
41
+ const header_label = counts.pending > 0
42
+ ? `Clarifications (${counts.pending} pending)`
43
+ : `Clarifications (${counts.total})`;
44
+ return (_jsxs("div", { className: cn('cls_clarification_section border rounded-lg bg-card shadow-sm overflow-hidden', class_name), children: [_jsxs("div", { className: "flex items-center gap-3 p-4 border-b bg-amber-50/50 dark:bg-amber-900/10", children: [_jsx("div", { className: "flex items-center justify-center w-10 h-10 rounded-full bg-amber-100 dark:bg-amber-900/30", children: _jsx(IoAlertCircle, { className: "w-5 h-5 text-amber-600 dark:text-amber-400" }) }), _jsxs("div", { children: [_jsx("h3", { className: "font-semibold text-lg text-foreground", children: header_label }), counts.responded > 0 && (_jsxs("p", { className: "text-xs text-muted-foreground", children: [counts.responded, " responded, awaiting review"] }))] })] }), _jsxs("div", { className: "p-4 space-y-4", children: [active_items.map((item) => (_jsx(ClarificationCard, { item: item, read_only: read_only, on_respond: callbacks?.on_respond, on_resolve: callbacks?.on_resolve, on_dismiss: callbacks?.on_dismiss, on_reopen: callbacks?.on_reopen, on_doc_click: on_doc_click, on_doc_delete: callbacks?.on_doc_delete, on_field_click: on_field_click }, item.id))), active_items.length === 0 && closed_items.length > 0 && (_jsx("p", { className: "text-sm text-muted-foreground italic", children: "No active clarifications. All items have been resolved or dismissed." })), closed_items.length > 0 && (_jsxs("div", { className: "mt-2", children: [_jsxs("button", { type: "button", onClick: () => set_collapsed_expanded(!collapsed_expanded), className: "flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors", children: [collapsed_expanded ? (_jsx(IoChevronDown, { className: "w-4 h-4" })) : (_jsx(IoChevronForward, { className: "w-4 h-4" })), closed_items.length, " resolved/dismissed"] }), collapsed_expanded && (_jsx("div", { className: "mt-3 space-y-3", children: closed_items.map((item) => (_jsx(ClarificationCard, { item: item, read_only: true, on_reopen: callbacks?.on_reopen, on_doc_click: on_doc_click }, item.id))) }))] }))] })] }));
45
+ });
46
+ //# sourceMappingURL=clarification_section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clarification_section.js","sourceRoot":"","sources":["../../../src/components/clarification/clarification_section.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,EAAE,EAAE,MAAM,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C,sCAAsC,qFAE/C,CACL,EAGA,YAAY,CAAC,MAAM,GAAG,CAAC,IAAI,CAC1B,eAAK,SAAS,EAAC,MAAM,aACnB,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,CAAC,kBAAkB,CAAC,EAC1D,SAAS,EAAC,iGAAiG,aAE1G,kBAAkB,CAAC,CAAC,CAAC,CACpB,KAAC,aAAa,IAAC,SAAS,EAAC,SAAS,GAAG,CACtC,CAAC,CAAC,CAAC,CACF,KAAC,gBAAgB,IAAC,SAAS,EAAC,SAAS,GAAG,CACzC,EACA,YAAY,CAAC,MAAM,2BACb,EAER,kBAAkB,IAAI,CACrB,cAAK,SAAS,EAAC,gBAAgB,YAC5B,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC1B,KAAC,iBAAiB,IAEhB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,IAAI,EACf,SAAS,EAAE,SAAS,EAAE,SAAS,EAC/B,YAAY,EAAE,YAAY,IAJrB,IAAI,CAAC,EAAE,CAKZ,CACH,CAAC,GACE,CACP,IACG,CACP,IACG,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Clarification components for document validation workflows.
3
+ */
4
+ export { use_clarifications, get_clarifications, CLARIFICATIONS_KEY, } from './use_clarifications.js';
5
+ export type { UseClarificationsReturn } from './use_clarifications.js';
6
+ export { ClarificationCard } from './clarification_card.js';
7
+ export type { ClarificationCardProps } from './clarification_card.js';
8
+ export { ClarificationSection } from './clarification_section.js';
9
+ export type { ClarificationSectionProps } from './clarification_section.js';
10
+ export { ClarificationBadge } from './clarification_badge.js';
11
+ export type { ClarificationBadgeProps } from './clarification_badge.js';
12
+ export { ClarificationDocReferenceList } from './clarification_doc_reference.js';
13
+ export type { ClarificationDocReferenceListProps } from './clarification_doc_reference.js';
14
+ export { ClarificationResponseForm } from './clarification_response_form.js';
15
+ export type { ClarificationResponseFormProps } from './clarification_response_form.js';
16
+ export { ClarificationDialog } from './clarification_dialog.js';
17
+ export type { ClarificationDialogProps } from './clarification_dialog.js';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/clarification/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAGvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,YAAY,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAE5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,YAAY,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,YAAY,EAAE,kCAAkC,EAAE,MAAM,kCAAkC,CAAC;AAE3F,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,YAAY,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAEvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,YAAY,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Clarification components for document validation workflows.
3
+ */
4
+ // Hook
5
+ export { use_clarifications, get_clarifications, CLARIFICATIONS_KEY, } from './use_clarifications.js';
6
+ // Components
7
+ export { ClarificationCard } from './clarification_card.js';
8
+ export { ClarificationSection } from './clarification_section.js';
9
+ export { ClarificationBadge } from './clarification_badge.js';
10
+ export { ClarificationDocReferenceList } from './clarification_doc_reference.js';
11
+ export { ClarificationResponseForm } from './clarification_response_form.js';
12
+ export { ClarificationDialog } from './clarification_dialog.js';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/clarification/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO;AACP,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AAGjC,aAAa;AACb,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAG9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAGjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAG7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * use_clarifications - Hook for reading/writing clarification state from form_data.
3
+ *
4
+ * Clarifications are stored at form_data['__clarifications'] as ClarificationItem[].
5
+ * This follows the existing __files_* pattern for metadata stored alongside field values.
6
+ */
7
+ import type { ClarificationItem, ClarificationResponse, ClarificationCounts } from '../../types/clarification.js';
8
+ /** Storage key in form_data */
9
+ export declare const CLARIFICATIONS_KEY = "__clarifications";
10
+ /** Return type for the use_clarifications hook */
11
+ export interface UseClarificationsReturn {
12
+ /** All clarification items */
13
+ items: ClarificationItem[];
14
+ /** Get clarifications for a specific field */
15
+ get_field_clarifications: (field_id: string) => ClarificationItem[];
16
+ /** Get count of pending clarifications for a field */
17
+ get_pending_count: (field_id: string) => number;
18
+ /** Whether there are any pending clarifications */
19
+ has_pending: boolean;
20
+ /** Aggregate counts by status */
21
+ counts: ClarificationCounts;
22
+ /** Set of file_ids from active (pending/responded) clarification doc_references */
23
+ error_file_ids: Set<string>;
24
+ /** Add a new clarification item */
25
+ add_clarification: (item: ClarificationItem) => void;
26
+ /** Submit a response to a clarification */
27
+ update_response: (id: string, response: ClarificationResponse) => void;
28
+ /** Resolve a clarification */
29
+ resolve: (id: string) => void;
30
+ /** Dismiss a clarification */
31
+ dismiss: (id: string) => void;
32
+ /** Re-open a resolved/dismissed clarification */
33
+ reopen: (id: string) => void;
34
+ /** Remove a doc reference from a clarification; resolves it if no references remain */
35
+ remove_doc_reference: (clarification_id: string, file_id: string) => void;
36
+ }
37
+ /**
38
+ * Extract clarification items from form_data.
39
+ * Returns empty array if key doesn't exist or isn't an array.
40
+ */
41
+ export declare function get_clarifications(form_data: Record<string, unknown>): ClarificationItem[];
42
+ /**
43
+ * Hook for managing clarification state stored in form_data.
44
+ *
45
+ * @param form_data - Current form data object
46
+ * @param on_form_data_change - Callback to update form_data (from FormView context)
47
+ */
48
+ export declare function use_clarifications(form_data: Record<string, unknown>, on_form_data_change?: (data: Record<string, unknown>) => void): UseClarificationsReturn;
49
+ //# sourceMappingURL=use_clarifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use_clarifications.d.ts","sourceRoot":"","sources":["../../../src/components/clarification/use_clarifications.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EAEpB,MAAM,8BAA8B,CAAC;AAEtC,+BAA+B;AAC/B,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAErD,kDAAkD;AAClD,MAAM,WAAW,uBAAuB;IACtC,8BAA8B;IAC9B,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,8CAA8C;IAC9C,wBAAwB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,iBAAiB,EAAE,CAAC;IACpE,sDAAsD;IACtD,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAChD,mDAAmD;IACnD,WAAW,EAAE,OAAO,CAAC;IACrB,iCAAiC;IACjC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,mFAAmF;IACnF,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,mCAAmC;IACnC,iBAAiB,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACrD,2CAA2C;IAC3C,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACvE,8BAA8B;IAC9B,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,8BAA8B;IAC9B,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,iDAAiD;IACjD,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,uFAAuF;IACvF,oBAAoB,EAAE,CAAC,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,iBAAiB,EAAE,CAI1F;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,GAC5D,uBAAuB,CA2IzB"}
@@ -0,0 +1,160 @@
1
+ /**
2
+ * use_clarifications - Hook for reading/writing clarification state from form_data.
3
+ *
4
+ * Clarifications are stored at form_data['__clarifications'] as ClarificationItem[].
5
+ * This follows the existing __files_* pattern for metadata stored alongside field values.
6
+ */
7
+ 'use client';
8
+ import { useMemo, useCallback } from 'react';
9
+ /** Storage key in form_data */
10
+ export const CLARIFICATIONS_KEY = '__clarifications';
11
+ /**
12
+ * Extract clarification items from form_data.
13
+ * Returns empty array if key doesn't exist or isn't an array.
14
+ */
15
+ export function get_clarifications(form_data) {
16
+ const raw = form_data[CLARIFICATIONS_KEY];
17
+ if (!Array.isArray(raw))
18
+ return [];
19
+ return raw;
20
+ }
21
+ /**
22
+ * Hook for managing clarification state stored in form_data.
23
+ *
24
+ * @param form_data - Current form data object
25
+ * @param on_form_data_change - Callback to update form_data (from FormView context)
26
+ */
27
+ export function use_clarifications(form_data, on_form_data_change) {
28
+ // Extract items from form_data
29
+ const items = useMemo(() => get_clarifications(form_data), [form_data]);
30
+ // Compute counts by status
31
+ const counts = useMemo(() => {
32
+ const result = { pending: 0, responded: 0, resolved: 0, dismissed: 0, total: 0 };
33
+ for (const item of items) {
34
+ result.total++;
35
+ if (item.status in result) {
36
+ result[item.status]++;
37
+ }
38
+ }
39
+ return result;
40
+ }, [items]);
41
+ const has_pending = counts.pending > 0;
42
+ // Collect file IDs referenced by active (pending/responded) clarifications
43
+ const error_file_ids = useMemo(() => {
44
+ const ids = new Set();
45
+ for (const item of items) {
46
+ if (item.status === 'pending' || item.status === 'responded') {
47
+ for (const ref of item.doc_references) {
48
+ ids.add(ref.file_id);
49
+ }
50
+ }
51
+ }
52
+ return ids;
53
+ }, [items]);
54
+ // Helper to persist updated items
55
+ const persist = useCallback((updated_items) => {
56
+ if (!on_form_data_change)
57
+ return;
58
+ on_form_data_change({
59
+ ...form_data,
60
+ [CLARIFICATIONS_KEY]: updated_items,
61
+ });
62
+ }, [form_data, on_form_data_change]);
63
+ // Get clarifications for a specific field
64
+ const get_field_clarifications = useCallback((field_id) => {
65
+ return items.filter(item => item.target_field_id === field_id);
66
+ }, [items]);
67
+ // Get pending count for a field
68
+ const get_pending_count = useCallback((field_id) => {
69
+ return items.filter(item => item.target_field_id === field_id && item.status === 'pending').length;
70
+ }, [items]);
71
+ // Add a new clarification
72
+ const add_clarification = useCallback((item) => {
73
+ persist([...items, item]);
74
+ }, [items, persist]);
75
+ // Update with a response
76
+ const update_response = useCallback((id, response) => {
77
+ const updated = items.map(item => {
78
+ if (item.id !== id)
79
+ return item;
80
+ return {
81
+ ...item,
82
+ status: 'responded',
83
+ response_choice: response.response_choice ?? item.response_choice,
84
+ user_comment: response.user_comment ?? item.user_comment,
85
+ response_files: response.response_files ?? item.response_files,
86
+ updated_at: new Date().toISOString(),
87
+ };
88
+ });
89
+ persist(updated);
90
+ }, [items, persist]);
91
+ // Resolve a clarification
92
+ const resolve = useCallback((id) => {
93
+ const updated = items.map(item => {
94
+ if (item.id !== id)
95
+ return item;
96
+ return {
97
+ ...item,
98
+ status: 'resolved',
99
+ updated_at: new Date().toISOString(),
100
+ };
101
+ });
102
+ persist(updated);
103
+ }, [items, persist]);
104
+ // Dismiss a clarification
105
+ const dismiss = useCallback((id) => {
106
+ const updated = items.map(item => {
107
+ if (item.id !== id)
108
+ return item;
109
+ return {
110
+ ...item,
111
+ status: 'dismissed',
112
+ updated_at: new Date().toISOString(),
113
+ };
114
+ });
115
+ persist(updated);
116
+ }, [items, persist]);
117
+ // Re-open a resolved/dismissed clarification
118
+ const reopen = useCallback((id) => {
119
+ const updated = items.map(item => {
120
+ if (item.id !== id)
121
+ return item;
122
+ return {
123
+ ...item,
124
+ status: 'pending',
125
+ updated_at: new Date().toISOString(),
126
+ };
127
+ });
128
+ persist(updated);
129
+ }, [items, persist]);
130
+ // Remove a doc reference; resolve the clarification if no references remain
131
+ const remove_doc_reference = useCallback((clarification_id, file_id) => {
132
+ const updated = items.map(item => {
133
+ if (item.id !== clarification_id)
134
+ return item;
135
+ const remaining_refs = item.doc_references.filter(ref => ref.file_id !== file_id);
136
+ return {
137
+ ...item,
138
+ doc_references: remaining_refs,
139
+ status: (remaining_refs.length === 0 ? 'resolved' : item.status),
140
+ updated_at: new Date().toISOString(),
141
+ };
142
+ });
143
+ persist(updated);
144
+ }, [items, persist]);
145
+ return {
146
+ items,
147
+ get_field_clarifications,
148
+ get_pending_count,
149
+ has_pending,
150
+ counts,
151
+ error_file_ids,
152
+ add_clarification,
153
+ update_response,
154
+ resolve,
155
+ dismiss,
156
+ reopen,
157
+ remove_doc_reference,
158
+ };
159
+ }
160
+ //# sourceMappingURL=use_clarifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use_clarifications.js","sourceRoot":"","sources":["../../../src/components/clarification/use_clarifications.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAQ7C,+BAA+B;AAC/B,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AA8BrD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAkC;IACnE,MAAM,GAAG,GAAG,SAAS,CAAC,kBAAkB,CAAC,CAAC;IAC1C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,OAAO,GAA0B,CAAC;AACpC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,SAAkC,EAClC,mBAA6D;IAE7D,+BAA+B;IAC/B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAExE,2BAA2B;IAC3B,MAAM,MAAM,GAAG,OAAO,CAAsB,GAAG,EAAE;QAC/C,MAAM,MAAM,GAAwB,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QACtG,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,IAAI,IAAI,CAAC,MAAM,IA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