@viswa-test/test-citation 0.0.138 → 0.0.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +157 -45
- package/dist/assests/svg/PdfViewerIcons.js +1 -1
- package/dist/cjs/assests/svg/PdfViewerIcons.js +1 -1
- package/dist/cjs/features/ChatDrawer/ChatDrawer.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/CompareHeader.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/LHSSectionRow.js +1 -1
- package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
- package/dist/cjs/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/features/ChatDrawer/ChatDrawer.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/CognitiveCompare/components/CompareHeader.js +1 -1
- package/dist/features/CognitiveCompare/components/LHSSectionRow.js +1 -1
- package/dist/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
- package/dist/features/CognitiveCompare/hooks/useSideBySide.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/src/ChatDrawerTest.d.ts +0 -7
- package/dist/types/src/ChatDrawerTest.d.ts.map +1 -1
- package/dist/types/src/CommonConstants/CommonConstants.d.ts +1 -0
- package/dist/types/src/CommonConstants/CommonConstants.d.ts.map +1 -1
- package/dist/types/src/assests/svg/PdfViewerIcons.d.ts +1 -0
- package/dist/types/src/assests/svg/PdfViewerIcons.d.ts.map +1 -1
- package/dist/types/src/features/ChatDrawer/ChatDrawer.d.ts.map +1 -1
- package/dist/types/src/features/ChatDrawer/types/ChatDrawer.types.d.ts +0 -1
- package/dist/types/src/features/ChatDrawer/types/ChatDrawer.types.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts +1 -0
- package/dist/types/src/features/CognitiveCompare/CognitiveCompareTypes.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/components/CompareHeader.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useSideBySide.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -1,42 +1,41 @@
|
|
|
1
1
|
# 📚 e-llm-studio/citation
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
## Table of Contents
|
|
5
4
|
|
|
6
5
|
1. [Project Overview](#project-overview)
|
|
7
6
|
2. [Installation](#installation)
|
|
8
7
|
3. [Available Components](#available-citations)
|
|
9
8
|
- [Citation Components](#citation-components)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
- [BookCitation](#bookcitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/BookCitation/README.MD)
|
|
10
|
+
- [ChatCitation](#chatcitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ChatCitation/ChatCitationReadme.md)
|
|
11
|
+
- [CitationRenderer](#citationrenderer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CitationRenderer/CitationRendererReadme.md)
|
|
12
|
+
- [EmailCitation](#emailcitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/EmailCitation/EmailCitation.md)
|
|
13
|
+
- [CognitiveDecisioningCard](#cognitivedecisioningcard) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CognitiveDecisioning/CognitiveDecisioningReadme.md)
|
|
14
|
+
- [CognitiveCompare](#cognitivecompare) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/new-compare-ui/citation/src/features/CognitiveCompare/README.md)
|
|
15
|
+
- [CognitiveInternalGPTReasoning](#cognitiveinternalgptreasoning) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CognitiveInternalgptReasoning/README.md)
|
|
16
|
+
- [CodeCitation](#codecitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CodeCitation/README.md)
|
|
17
|
+
- [ChatDrawer](#chatdrawer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ChatDrawer/ChatDrawerReadme.md)
|
|
18
|
+
- [CitationsViewer](#citationsviewer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/CitationViewer/CitationViewerReadme.md)
|
|
19
|
+
- [PdfEditorCitation](#pdfeditorcitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/PdfEditorCitation/README.md)
|
|
20
|
+
- [RequirementAICitation](#requirementaicitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/RequirementAiCitations/RequirementAiCitationsReadme.md)
|
|
21
|
+
- [VideoCitationContent](#videocitationcontent) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/RequirementAiCitations/RequirementAiCitationsReadme.md)
|
|
22
|
+
- [MarkdownWithImageCitation](#markdownwithimagecitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/MarkdownWithImageCitation/README.md)
|
|
23
|
+
- [ScannedDocCitation](#scanneddoccitation) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ScannedDocCitation/README.md)
|
|
24
24
|
- [Other Components](#other-components)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
- [Bookemon](#bookemon) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/Bookemon/BookemonReadme.md)
|
|
26
|
+
- [DatagestMon](#datagestmon) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/DatagestMon/README.md)
|
|
27
|
+
- [DataSelector](#dataselector)[<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/DataSelector/DataSelectorReadme.md)
|
|
28
|
+
- [PaginatedTable](#paginatedtable) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/PaginatedTable/PaginatedTableReadme.md)
|
|
29
|
+
- [PdfViewer](#pdfviewer) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/PdfViewer/PdfViewerReadme.md)
|
|
30
|
+
- [ProjectAccordion](#projectaccordion) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ProjectAccordion/README.md)
|
|
31
|
+
- [UploadData](#uploaddata) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/UploadData/README.md)
|
|
32
|
+
- [ReviewPanel](#reviewpanel) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/ReviewPanel/README.md)
|
|
33
|
+
- [TableCitationContent](#tablecitationcontent) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/TableCitation/README.md)
|
|
34
|
+
- [SplitterCitationsComponent](#splittercitationscomponent) [<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" width="18" height="18">](https://github.com/Techolution/e-llm-studio-lib/blob/dev/citation/src/features/SplitterCitations/README.md)
|
|
35
35
|
4. [Common Use Cases](#common-use-cases)
|
|
36
36
|
5. [Development & Contribution](#development--contribution)
|
|
37
37
|
6. [License](#license)
|
|
38
38
|
|
|
39
|
-
|
|
40
39
|
## Project Overview
|
|
41
40
|
|
|
42
41
|
The @e-llm-studio/citation library is a comprehensive React component library designed to render various types of citations and related UI elements within the e-LLM Studio ecosystem. It provides a robust set of reusable, production-ready components that enable developers to display citations, reasoning chains, code snippets, PDFs, and other content types with rich interactive features and highly customizable styling.
|
|
@@ -136,8 +135,8 @@ pnpm add @e-llm-studio/citation
|
|
|
136
135
|
|
|
137
136
|
---
|
|
138
137
|
|
|
139
|
-
|
|
140
138
|
# Citation Components
|
|
139
|
+
|
|
141
140
|
## BookCitation
|
|
142
141
|
|
|
143
142
|
### Overview
|
|
@@ -190,7 +189,136 @@ import BookCitation from '@e-llm-studio/citation/BookCitation'
|
|
|
190
189
|
| `useDropdown` | `boolean` | Optional flag to render the citation as a dropdown (default: `true`) |
|
|
191
190
|
|
|
192
191
|
---
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
### CognitiveCompare (Main Component)
|
|
195
|
+
|
|
196
|
+
A side-by-side document comparison component with cognitive analysis, deviation badges, citation-linked PDF previews, and two layout modes (Standard and Relative Order). For full documentation see the [dedicated README](https://github.com/Techolution/e-llm-studio-lib/blob/new-compare-ui/citation/src/features/CognitiveCompare/README.md).
|
|
197
|
+
|
|
198
|
+
### Props
|
|
199
|
+
|
|
200
|
+
| Prop | Type | Default | Description |
|
|
201
|
+
| --------------------- | ----------------------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
202
|
+
| `treeData` | `Record<string, any> \| null` | — | **Required.** Backend tree structure powering both columns. |
|
|
203
|
+
| `displayConfig` | [`IDisplayConfig`](#idisplayconfig) | — | **Required.** Controls header/toggle visibility and initial layout mode. |
|
|
204
|
+
| `componentHeaderText` | `string` | `"Contract Comparison"` | Text shown in the top header bar. |
|
|
205
|
+
| `deviationData` | `Record<string, any>` | `{}` | Per-node deviation analysis results keyed by node ID. Populates the Deviation Analysis tab in the cognitive popup and drives inline text highlights within section content. |
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
#### IDisplayConfig
|
|
210
|
+
|
|
211
|
+
| Property | Type | Default | Description |
|
|
212
|
+
| ----------------------- | --------- | ------- | ---------------------------------------------------------------------- |
|
|
213
|
+
| `isHeaderVisible` | `boolean` | `true` | Show or hide the top header bar. |
|
|
214
|
+
| `isToggleVisible` | `boolean` | `true` | Show or hide the Standard / Relative Order toggle switch. |
|
|
215
|
+
| `maintainRelativeOrder` | `boolean` | `false` | Initial layout mode — `true` for Relative Order, `false` for Standard. |
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
### treeData Shape
|
|
220
|
+
|
|
221
|
+
`treeData` is the primary data contract. It must be a flat object where every key is a node ID, plus four reserved keys.
|
|
222
|
+
|
|
223
|
+
```ts
|
|
224
|
+
{
|
|
225
|
+
// Top-level metadata keys
|
|
226
|
+
base_root_id: string, // ID of the root node (looked up inside nodes)
|
|
227
|
+
input_index_map: { // Maps side index to document UUID
|
|
228
|
+
"0": string, // left side UUID
|
|
229
|
+
"1": string, // right side UUID
|
|
230
|
+
},
|
|
231
|
+
documents: { // Document metadata keyed by UUID
|
|
232
|
+
[uuid: string]: {
|
|
233
|
+
title: string,
|
|
234
|
+
signed_url: string, // PDF URL used by CitationAnchor / PdfViewer
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
// All node data lives under the `nodes` key
|
|
239
|
+
nodes: {
|
|
240
|
+
// Root node (identified by base_root_id)
|
|
241
|
+
[rootId: string]: {
|
|
242
|
+
display_node?: boolean,
|
|
243
|
+
comparison_inputs: {
|
|
244
|
+
[uuid: string]: { title: string } // column titles
|
|
245
|
+
},
|
|
246
|
+
decision_scope_description?: string,
|
|
247
|
+
next?: Record<string, string>, // child node IDs
|
|
248
|
+
},
|
|
249
|
+
|
|
250
|
+
// Section nodes
|
|
251
|
+
[nodeId: string]: {
|
|
252
|
+
display_node?: boolean, // set false to hide the node
|
|
253
|
+
evaluation_result?: DeviationDataEntry, // deviation result attached directly to node
|
|
254
|
+
comparison_inputs: {
|
|
255
|
+
[uuid: string]: {
|
|
256
|
+
title: string,
|
|
257
|
+
content: string,
|
|
258
|
+
additional_attributes?: {
|
|
259
|
+
display_index?: number, // used in Relative Order mode for sorting
|
|
260
|
+
display_title?: boolean, // set false to suppress rendering the title
|
|
261
|
+
display_content?: boolean, // set false to suppress rendering the content
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
next?: Record<string, string>, // child node IDs (for subsections)
|
|
266
|
+
mapping_rationale?: {
|
|
267
|
+
decision_strength?: string, // numeric string, e.g. "72"
|
|
268
|
+
decisioning_factors?: string[],
|
|
269
|
+
gaps_in_decision?: string[],
|
|
270
|
+
citations?: Record<string, Record<string, CitationEntry>>
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
```
|
|
193
276
|
|
|
277
|
+
> All node data (root and section nodes) lives under the `nodes` key. The top-level `base_root_id`, `input_index_map`, and `documents` keys remain directly on `treeData`.
|
|
278
|
+
|
|
279
|
+
#### deviationData Shape
|
|
280
|
+
|
|
281
|
+
```ts
|
|
282
|
+
// deviationData[nodeId]
|
|
283
|
+
{
|
|
284
|
+
evaluation_outputs?: {
|
|
285
|
+
output_value?: string, // badge label text
|
|
286
|
+
metadata?: { label_color?: string } // hex — drives badge/highlight colors
|
|
287
|
+
},
|
|
288
|
+
cognitive_decisioning?: {
|
|
289
|
+
decisioning_factors?: string[],
|
|
290
|
+
gaps_in_decision?: string[],
|
|
291
|
+
citations?: Record<string, any>,
|
|
292
|
+
decision_strength?: string | null,
|
|
293
|
+
},
|
|
294
|
+
deviations?: Record<string, any>, // { devKey: { [docUuid]: highlightText } }
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
#### Usage
|
|
299
|
+
|
|
300
|
+
```tsx
|
|
301
|
+
import CognitiveCompare from "@e-llm-studio/citation/CognitiveCompare";
|
|
302
|
+
|
|
303
|
+
<CognitiveCompare
|
|
304
|
+
treeData={myTreeData}
|
|
305
|
+
displayConfig={{
|
|
306
|
+
isHeaderVisible: true,
|
|
307
|
+
isToggleVisible: true,
|
|
308
|
+
maintainRelativeOrder: false,
|
|
309
|
+
}}
|
|
310
|
+
deviationData={myDeviationData}
|
|
311
|
+
/>;
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
#### Key Behaviours
|
|
315
|
+
|
|
316
|
+
- Badge and highlight colors are generated dynamically from `evaluation_outputs.metadata.label_color` via `generateColorPalette()`. The static `relationStyles` map has been removed.
|
|
317
|
+
- Clicking a badge in **Standard mode** opens `CognitivePopup` directly. In **Relative Order mode** it opens `MoreFunctionsPopup` offering Connect, Side by Side, and Cognitive Decisioning actions.
|
|
318
|
+
- The **Deviation Analysis** tab is shown first in the popup and displays `cognitive_decisioning.decisioning_factors` and `gaps_in_decision` with inline citation anchors that open split PDF viewers.
|
|
319
|
+
- `deviations` entries drive inline `<mark>` highlights inside section content, colored using the same `label_color`-derived palette.
|
|
320
|
+
|
|
321
|
+
---
|
|
194
322
|
|
|
195
323
|
## ChatCitation
|
|
196
324
|
|
|
@@ -287,23 +415,6 @@ const [drawerHeight, setDrawerHeight] = useState(300);
|
|
|
287
415
|
</ChatDrawer>
|
|
288
416
|
```
|
|
289
417
|
|
|
290
|
-
|
|
291
|
-
### With drawer summary
|
|
292
|
-
```tsx
|
|
293
|
-
<ChatDrawer
|
|
294
|
-
uploadListTopContent="Custom Notch"
|
|
295
|
-
isExpanded={isOpen}
|
|
296
|
-
onToggle={() => setIsOpen(v => !v)}
|
|
297
|
-
styles={{
|
|
298
|
-
notch: { backgroundColor: '#6d28d9', border: '1px solid #5b21b6' },
|
|
299
|
-
notchArrowColor: '#fff',
|
|
300
|
-
}}
|
|
301
|
-
drawerSummaryComponent={<RedliningFixesSummaryUI approved={5} rejected={2} pending={3} />}
|
|
302
|
-
>
|
|
303
|
-
<YourComponent />
|
|
304
|
-
</ChatDrawer>
|
|
305
|
-
```
|
|
306
|
-
|
|
307
418
|
**With styles (theme customization):**
|
|
308
419
|
```tsx
|
|
309
420
|
<ChatDrawer
|
|
@@ -943,6 +1054,7 @@ This visual captures a clean product collaboration workspace prepared for planni
|
|
|
943
1054
|
```
|
|
944
1055
|
|
|
945
1056
|
**With CitationRenderer (Expandable Pill):**
|
|
1057
|
+
|
|
946
1058
|
```tsx
|
|
947
1059
|
import { CitationRenderer } from '@e-llm-studio/citation/CitationRenderer'
|
|
948
1060
|
import { MarkdownWithImageCitation } from '@e-llm-studio/citation/MarkdownWithImageCitation'
|
|
@@ -2280,4 +2392,4 @@ npm install @e-llm-studio/citation@latest
|
|
|
2280
2392
|
|
|
2281
2393
|
This library is released under the MIT License. See the LICENSE file for more details.
|
|
2282
2394
|
|
|
2283
|
-
The license information is also available in the `citation/package.json` file under the 'license' field.
|
|
2395
|
+
The license information is also available in the `citation/package.json` file under the 'license' field.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as n,jsxs as i}from"react/jsx-runtime";var t=function(){return n("svg",e({xmlns:"http://www.w3.org/2000/svg",style:{width:"12px",height:"15px"},viewBox:"0 0 14 17",fill:"none"},{children:n("path",{d:"M8.25 0.952148V4.05005C8.25 4.47009 8.25 4.68011 8.33175 4.84055C8.40365 4.98167 8.51839 5.0964 8.65951 5.16831C8.81994 5.25005 9.02996 5.25005 9.45 5.25005H12.5479M9.75 9H3.75M9.75 12H3.75M5.25 6H3.75M8.25 0.75H4.35C3.08988 0.75 2.45982 0.75 1.97852 0.995235C1.55516 1.21095 1.21095 1.55516 0.995235 1.97852C0.75 2.45982 0.75 3.08988 0.75 4.35V12.15C0.75 13.4101 0.75 14.0402 0.995235 14.5215C1.21095 14.9448 1.55516 15.289 1.97852 15.5048C2.45982 15.75 3.08988 15.75 4.35 15.75H9.15C10.4101 15.75 11.0402 15.75 11.5215 15.5048C11.9448 15.289 12.289 14.9448 12.5048 14.5215C12.75 14.0402 12.75 13.4101 12.75 12.15V5.25L8.25 0.75Z",stroke:"#0019FF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},o=function(){return n("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})}))},r=function(){return i("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n("polyline",{points:"7 10 12 15 17 10"}),n("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}))},h=function(){return i("svg",e({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}))};export{h as DefaultCloseIcon,r as DefaultDownloadIcon,o as DefaultFullScreenIcon,t as DefaultPdfIcon};
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as n,jsxs as i}from"react/jsx-runtime";var t=function(){return n("svg",e({xmlns:"http://www.w3.org/2000/svg",style:{width:"12px",height:"15px"},viewBox:"0 0 14 17",fill:"none"},{children:n("path",{d:"M8.25 0.952148V4.05005C8.25 4.47009 8.25 4.68011 8.33175 4.84055C8.40365 4.98167 8.51839 5.0964 8.65951 5.16831C8.81994 5.25005 9.02996 5.25005 9.45 5.25005H12.5479M9.75 9H3.75M9.75 12H3.75M5.25 6H3.75M8.25 0.75H4.35C3.08988 0.75 2.45982 0.75 1.97852 0.995235C1.55516 1.21095 1.21095 1.55516 0.995235 1.97852C0.75 2.45982 0.75 3.08988 0.75 4.35V12.15C0.75 13.4101 0.75 14.0402 0.995235 14.5215C1.21095 14.9448 1.55516 15.289 1.97852 15.5048C2.45982 15.75 3.08988 15.75 4.35 15.75H9.15C10.4101 15.75 11.0402 15.75 11.5215 15.5048C11.9448 15.289 12.289 14.9448 12.5048 14.5215C12.75 14.0402 12.75 13.4101 12.75 12.15V5.25L8.25 0.75Z",stroke:"#0019FF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},o=function(){return n("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})}))},r=function(){return i("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n("polyline",{points:"7 10 12 15 17 10"}),n("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}))},h=function(){return i("svg",e({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}))},s=function(){return n("svg",e({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})}))};export{h as DefaultCloseIcon,r as DefaultDownloadIcon,s as DefaultFullScreenCloseIcon,o as DefaultFullScreenIcon,t as DefaultPdfIcon};
|
|
2
2
|
//# sourceMappingURL=PdfViewerIcons.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime");exports.DefaultCloseIcon=function(){return n.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}))},exports.DefaultDownloadIcon=function(){return n.jsxs("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n.jsx("polyline",{points:"7 10 12 15 17 10"}),n.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}))},exports.DefaultFullScreenIcon=function(){return n.jsx("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})}))},exports.DefaultPdfIcon=function(){return n.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",style:{width:"12px",height:"15px"},viewBox:"0 0 14 17",fill:"none"},{children:n.jsx("path",{d:"M8.25 0.952148V4.05005C8.25 4.47009 8.25 4.68011 8.33175 4.84055C8.40365 4.98167 8.51839 5.0964 8.65951 5.16831C8.81994 5.25005 9.02996 5.25005 9.45 5.25005H12.5479M9.75 9H3.75M9.75 12H3.75M5.25 6H3.75M8.25 0.75H4.35C3.08988 0.75 2.45982 0.75 1.97852 0.995235C1.55516 1.21095 1.21095 1.55516 0.995235 1.97852C0.75 2.45982 0.75 3.08988 0.75 4.35V12.15C0.75 13.4101 0.75 14.0402 0.995235 14.5215C1.21095 14.9448 1.55516 15.289 1.97852 15.5048C2.45982 15.75 3.08988 15.75 4.35 15.75H9.15C10.4101 15.75 11.0402 15.75 11.5215 15.5048C11.9448 15.289 12.289 14.9448 12.5048 14.5215C12.75 14.0402 12.75 13.4101 12.75 12.15V5.25L8.25 0.75Z",stroke:"#0019FF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime");exports.DefaultCloseIcon=function(){return n.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}))},exports.DefaultDownloadIcon=function(){return n.jsxs("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:[n.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),n.jsx("polyline",{points:"7 10 12 15 17 10"}),n.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}))},exports.DefaultFullScreenCloseIcon=function(){return n.jsx("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})}))},exports.DefaultFullScreenIcon=function(){return n.jsx("svg",e.__assign({width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#475467",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},{children:n.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})}))},exports.DefaultPdfIcon=function(){return n.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",style:{width:"12px",height:"15px"},viewBox:"0 0 14 17",fill:"none"},{children:n.jsx("path",{d:"M8.25 0.952148V4.05005C8.25 4.47009 8.25 4.68011 8.33175 4.84055C8.40365 4.98167 8.51839 5.0964 8.65951 5.16831C8.81994 5.25005 9.02996 5.25005 9.45 5.25005H12.5479M9.75 9H3.75M9.75 12H3.75M5.25 6H3.75M8.25 0.75H4.35C3.08988 0.75 2.45982 0.75 1.97852 0.995235C1.55516 1.21095 1.21095 1.55516 0.995235 1.97852C0.75 2.45982 0.75 3.08988 0.75 4.35V12.15C0.75 13.4101 0.75 14.0402 0.995235 14.5215C1.21095 14.9448 1.55516 15.289 1.97852 15.5048C2.45982 15.75 3.08988 15.75 4.35 15.75H9.15C10.4101 15.75 11.0402 15.75 11.5215 15.5048C11.9448 15.289 12.289 14.9448 12.5048 14.5215C12.75 14.0402 12.75 13.4101 12.75 12.15V5.25L8.25 0.75Z",stroke:"#0019FF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))};
|
|
2
2
|
//# sourceMappingURL=PdfViewerIcons.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),i=require("lucide-react");exports.default=function(o){var r,s,a=o.children,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),i=require("lucide-react");exports.default=function(o){var r,s,a=o.children,l=o.uploadListTopContent,d=o.defaultHeight,u=void 0===d?300:d,c=o.minHeight,p=void 0===c?150:c,g=o.maxHeight,f=o.isExpanded,x=void 0!==f&&f,h=o.onToggle,v=o.onHeightChange,m=o.styles,_=void 0===m?{}:m,y=n.useState(!1),b=y[0],w=y[1],j=n.useState(u),C=j[0],H=j[1],R=n.useRef(0),S=n.useRef(u),E=n.useRef(null),k=n.useRef(0),D="string"==typeof g?parseFloat(g)/100*window.innerHeight:null!=g?g:.4*window.innerHeight;n.useEffect(function(){!x&&E.current&&(k.current=E.current.getBoundingClientRect().height)},[x]);return n.useEffect(function(){if(b){var e=function(e){e.preventDefault();var t=e.clientY-R.current,n=Math.max(p,Math.min(D,S.current+t));H(n),null==v||v(n)},t=function(){w(!1),document.body.style.userSelect=""};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}}},[b]),t.jsxs("div",e.__assign({ref:E,style:{position:"relative",width:"100%",minHeight:x?k.current:"auto"}},{children:[t.jsxs("div",e.__assign({style:e.__assign({position:x?"absolute":"relative",zIndex:x?10:"auto",left:0,right:0,top:0,display:"flex",flexDirection:"column",backgroundColor:"#fff",borderRadius:20,border:"1px solid #BDB4FE",boxShadow:"0 4px 8px -2px rgba(16, 24, 40, 0.05), 0 2px 4px -2px rgba(16, 24, 40, 0.06)",height:x?"".concat(C,"px"):"auto",minHeight:x?"".concat(p,"px"):"auto",maxHeight:x?"".concat(C,"px"):"auto",overflow:"hidden",width:"100%"},_.container)},{children:[t.jsx("div",e.__assign({style:e.__assign({display:"flex",alignItems:"center",width:"100%",marginBottom:12,flexShrink:0,padding:"12px 20px 0 20px"},_.header)},{children:t.jsx("span",e.__assign({style:e.__assign({display:"inline-block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,fontWeight:500,lineHeight:"24px",color:"#101828",fontFamily:"Inter, sans-serif"},_.title)},{children:(null==l?void 0:l.trim())?l:"Data uploaded for your context"}))})),x&&t.jsx("div",e.__assign({style:e.__assign({flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"0 20px"},_.body)},{children:a})),x&&t.jsx("div",e.__assign({onMouseDown:function(e){e.preventDefault(),w(!0),R.current=e.clientY,S.current=C,document.body.style.userSelect="none"},style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"8px 20px",cursor:"ns-resize",userSelect:"none",flexShrink:0}},{children:t.jsx("div",{style:e.__assign({width:48,height:4,borderRadius:4,background:b?null!==(r=_.dragPillActiveColor)&&void 0!==r?r:"#a78bfa":"#d1d5db"},_.dragPill)})}))]})),t.jsx("div",e.__assign({style:{position:x?"absolute":"relative",top:x?"".concat(C,"px"):"auto",width:"100%",display:"flex",justifyContent:"center",height:18,zIndex:x?10:"auto"}},{children:t.jsx("button",e.__assign({onClick:h,"aria-label":x?"Collapse":"Expand",style:e.__assign({position:"absolute",width:"52px",height:"18px",borderBottomLeftRadius:"10px",borderBottomRightRadius:"10px",border:"1px solid rgb(189, 180, 254)",borderTop:"none",backgroundColor:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},_.notch)},{children:t.jsx(i.ChevronDown,{size:14,color:null!==(s=_.notchArrowColor)&&void 0!==s?s:"#6d28d9",style:{transform:x?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}})}))}))]}))};
|
|
2
2
|
//# sourceMappingURL=ChatDrawer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material"),o=require("lucide-react"),r=require("../../assests/svg/ButtonCognitiveIcon.js"),l=require("./OverlayComponent.js"),s=require("./CognitiveComparehelpers.js"),u=require("./CognitiveCompareConfig.js"),a=require("./CognitiveCompareConstants.js"),c=require("./CognitivePopup.js"),d=require("./MoreFunctionsPopup.js"),v=require("./LoaderComponent.js"),f=require("./components/ThreeDotsLoader.js"),p=require("./hooks/useCompareData.js"),g=require("./hooks/useComparePopups.js"),h=require("./hooks/useSectionRefs.js"),m=require("./hooks/useAccordionState.js"),S=require("./hooks/useDeviationNavigation.js"),R=require("./components/CompareHeader.js"),x=require("./components/SubSectionAccordion.js"),_=require("./components/LHSSectionRow.js"),y=require("./components/RHSSectionRow.js"),b=require("./components/CognitiveSummaryPopup.js"),C=require("./CompareContext.js"),E=require("./hooks/useStyles.js"),A=require("./hooks/useResizeHandler.js"),B=require("./hooks/useLinesCalculator.js"),T=require("./hooks/useSideBySide.js"),w=require("./components/SvgConnectors.js");exports.SHARED_MARKDOWN_STYLES=u.SHARED_MARKDOWN_STYLES,exports.default=function(I){var D,F,O,j,P,N,k,L,q,M,H,V,z,G,W,K,U,Y,X,$,J,Q,Z,ee,ne,ie,te=I.componentHeaderText,oe=void 0===te?a.DEFAULT_COMPONENT_HEADER_TEXT:te,re=I.treeData,le=I.comparisonConfig,se=I.leftColumnTitleText,ue=I.rightColumnTitleText,ae=I.markdownStyles,ce=I.resetTrigger,de=I.displayConfig,ve=void 0===de?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!1}:de,fe=I.popupConfig,pe=I.deviationData,ge=void 0===pe?{}:pe,he=I.deviationNodeIdToView,me=I.resetDeviationNodeId,Se=I.isProposingFix,Re=void 0!==Se&&Se,xe=I.proposingFixNodeId,_e=I.isRedlineFlow,ye=i.useState(ve.maintainRelativeOrder),be=ye[0],Ce=ye[1],Ee=!!be||!!(null==ve?void 0:ve.showDeviationBadges),Ae=i.useState(!1),Be=Ae[0],Te=Ae[1],we=i.useState(null),Ie=we[0],De=we[1],Fe=i.useState(null===(F=null!==(D=null==re?void 0:re.newEvaluationResult)&&void 0!==D?D:null==ve?void 0:ve.enableDeviationSchemaBackwardCompatibility)||void 0===F||F)[0],Oe=i.useState(new Set),je=Oe[0],Pe=Oe[1],Ne=i.useState([]),ke=Ne[0],Le=Ne[1],qe=i.useRef(null),Me=i.useRef(null),He=i.useRef(null),Ve=i.useRef(null),ze=i.useRef(null),Ge=i.useRef(!1),We=i.useRef(null),Ke=i.useRef({}),Ue=i.useRef([]),Ye=i.useRef(function(){}),Xe=i.useRef(null),$e=i.useRef(function(){}),Je=i.useMemo(function(){return(null==re?void 0:re.cognitive_decisioning)||{}},[re]),Qe=i.useMemo(function(){return e.__assign(e.__assign({},u.SHARED_MARKDOWN_STYLES),ae)},[ae]),Ze=i.useRef(null),en=i.useRef(null),nn=i.useRef(null),tn=i.useRef(null),on=i.useRef(null),rn=i.useRef(null),ln=i.useRef(null),sn=i.useRef(null),un=i.useRef(null),an=i.useRef(null),cn=g.useComparePopups(Ze),dn=cn.cognitivePopup,vn=cn.setCognitivePopup,fn=cn.moreFunctions,pn=cn.setMoreFunctions,gn=cn.position,hn=cn.setPosition,mn=cn.activeBadgeId,Sn=cn.summaryPopup,Rn=cn.setSummaryPopup,xn=cn.closeSummaryPopup,_n=cn.setActiveBadgeId,yn=cn.popupRef,bn=cn.handleOpenCognitiveCompare,Cn=cn.openCognitivePopupFromState,En=cn.closeCognitivePopup,An=cn.closeMoreFunctionsPopup,Bn=i.useMemo(function(){var e,n,i,t,o,r,l;return{fields:null!==(e=null==le?void 0:le.fields)&&void 0!==e?e:u.DEFAULT_FIELD_CONFIG,thresholds:{high:null!==(i=null===(n=null==le?void 0:le.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:u.DEFAULT_COMPARISON_CONFIG.thresholds.high,medium:null!==(o=null===(t=null==le?void 0:le.thresholds)||void 0===t?void 0:t.medium)&&void 0!==o?o:u.DEFAULT_COMPARISON_CONFIG.thresholds.medium,exact:null!==(l=null===(r=null==le?void 0:le.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:u.DEFAULT_COMPARISON_CONFIG.thresholds.exact}}},[le]),Tn=i.useState(null),wn=Tn[0];Tn[1];var In=null===(P=null===(O=null==re?void 0:re.documents)||void 0===O?void 0:O[null===(j=null==re?void 0:re.input_index_map)||void 0===j?void 0:j[0]])||void 0===P?void 0:P.title,Dn=null===(L=null===(N=null==re?void 0:re.documents)||void 0===N?void 0:N[null===(k=null==re?void 0:re.input_index_map)||void 0===k?void 0:k[1]])||void 0===L?void 0:L.title,Fn=s.safeStringify(se||In||"Uploaded Contract"),On=s.safeStringify(ue||Dn||"Reference Template"),jn=p.useCognitiveTreeData(re,be,ge,Bn,Fe),Pn=jn.activeProposed,Nn=jn.existingRule,kn=jn.proposedSections,Ln=jn.existingSections,qn=jn.visibleFields,Mn=jn.parentDeviationRecord,Hn=jn.deviationNumberRegistry,Vn=jn.parseError;i.useEffect(function(){Vn&&De("Failed to load comparison: ".concat(Vn))},[Vn]);var zn=kn.length>0||Ln.length>0,Gn=i.useMemo(function(){if(!_e)return"off";var e=0,n=0,i=function(t){Array.isArray(t)&&t.forEach(function(t){var o,r=(null==t?void 0:t.content)||"";s.hasMeaningfulRedlineTags(r)&&(e+=1,n+=String(r).length),(null===(o=null==t?void 0:t.subsections)||void 0===o?void 0:o.length)&&i(t.subsections)})};return i(kn),i(Ln),"".concat(e,":").concat(n)},[_e,kn,Ln]),Wn=h.useSectionRefs(qn.map(function(e){return e.key}),Math.max(kn.length,Ln.length)),Kn=Wn.leftRefs,Un=Wn.rightRefs,Yn=Wn.sectionLeftRefs,Xn=Wn.sectionRightRefs,$n=Wn.lhsBadgeRefs,Jn=Wn.rhsBadgeRefs,Qn=Wn.sectionRightRowRefs,Zn=Wn.subSectionLeftRefs,ei=Wn.subSectionRightRefs,ni=Wn.sectionRowRefs,ii=Wn.getSectionRowRef,ti=Wn.getSubSectionRef,oi=Wn.getBadgeRef,ri=T.useSideBySide({maintainRelativeOrder:be,proposedSections:kn,existingSections:Ln,leftContainerRef:sn,rightContainerRef:nn,scrollContainerRef:Ze,sectionLeftRefs:Yn,sectionRightRefs:Xn,subSectionLeftRefs:Zn,subSectionRightRefs:ei,lhsBadgeRefs:$n,rhsBadgeRefs:Jn,sectionRowRefs:ni,sectionRightRowRefs:Qn,rhsTopSpacerRef:tn,rhsBottomSpacerRef:on,lhsTopSpacerRef:rn,lhsBottomSpacerRef:ln,calculateLinesRef:Ye,setConnectedSections:Pe,setConnectedLines:Le,cachedConnectedPositions:Ue,closeMoreFunctionsPopup:An,setErrorToast:De,moreFunctions:fn,closeSummaryPopup:xn}),li=ri.isSideBySide,si=ri.isArrowVisible,ui=ri.setIsArrowVisible,ai=ri.isResizing,ci=ri.setIsResizing,di=ri.isSideBySideLoading,vi=ri.activeSideBySideSection,fi=ri.scrollLock,pi=ri.sideBySideCacheRef,gi=ri.isSideBySideRef,hi=ri.activeSideBySideRightSectionRef,mi=ri.activeSideBySideSectionRef,Si=ri.sideBySideLineRef,Ri=ri.highlightedClauseRefs,xi=ri.clearClauseHighlight,_i=ri.applyAlignmentPadding,yi=ri.resetSideBySide,bi=ri.activateSideBySide,Ci=m.useAccordionState({maintainRelativeOrder:!!be,proposedSections:kn,existingSections:Ln,activeSideBySideSection:vi,connectedSections:je,resetSideBySide:yi,setConnectedSections:Pe,setConnectedLines:Le,cachedConnectedPositions:Ue,svgContainerRef:qe,isAnimatingRef:Ge,animationTimerRef:We,calculateLinesRef:Ye,sectionLeftRefs:Yn,sectionRightRefs:Xn,subSectionLeftRefs:Zn,subSectionRightRefs:ei}),Ei=Ci.expandedSections,Ai=Ci.setExpandedSections,Bi=Ci.expandedSubSections,Ti=Ci.setExpandedSubSections,wi=Ci.handleSubSectionToggle,Ii=Ci.toggleSection;i.useEffect(function(){_e&&"off"!==Gn&&"0:0"!==Gn&&(pi.current=null,Ue.current=[],requestAnimationFrame(function(){var e;null===(e=Ye.current)||void 0===e||e.call(Ye)}))},[_e,Gn]);var Di=i.useMemo(function(){var e=new Map,n=new Map,i=1;if(be)kn.forEach(function(n){!n.title&&!n.content||n.id&&e.set(n.id,i++)}),Ln.forEach(function(t){if(t.id){var o=kn.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(t.selfIndex)});if(o.length>0){var r=o.map(function(n){return e.get(n.id)}).filter(Boolean);n.set(t.id,r.join(", "))}else n.set(t.id,String(i++))}});else for(var t=Math.max(kn.length,Ln.length),o=0;o<t;o++){var r=kn[o],l=Ln[o];r?(e.set(r.id,i),l&&n.set(l.id,String(i)),i++):l&&n.set(l.id,String(i++))}return{leftNums:e,rightNums:n}},[kn,Ln,be]),Fi=Nn.analysis,Oi=s.safeStringify(null===(M=null===(q=null==Fi?void 0:Fi.rule_difference_comparison)||void 0===q?void 0:q.summary)||void 0===M?void 0:M.overall_summary),ji=!!Oi.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),Pi=null!==(H=null==re?void 0:re.base_root_id)&&void 0!==H?H:"-1";null==re||re[Pi];var Ni=Fe?null!==(Z=null!==($=ge&&(null===(X=null==ge?void 0:ge[Pi])||void 0===X?void 0:X.evaluation_result))&&void 0!==$?$:null===(Q=null===(J=null==re?void 0:re.nodes)||void 0===J?void 0:J[Pi])||void 0===Q?void 0:Q.evaluation_result)&&void 0!==Z?Z:null:null!==(Y=null!==(G=ge&&(null===(z=null===(V=null==ge?void 0:ge[Pi])||void 0===V?void 0:V.evaluation_result)||void 0===z?void 0:z[0]))&&void 0!==G?G:null===(U=null===(K=null===(W=null==re?void 0:re.nodes)||void 0===W?void 0:W[Pi])||void 0===K?void 0:K.evaluation_result)||void 0===U?void 0:U[0])&&void 0!==Y?Y:null,ki=s.extractDeviationScore(Ni),Li=s.generateColorPalette(null!==(ie=null===(ne=null===(ee=null==Ni?void 0:Ni.evaluation_outputs)||void 0===ee?void 0:ee.metadata)||void 0===ne?void 0:ne.label_color)&&void 0!==ie?ie:a.DEFAULT_DEVIAION_COLOR),qi=i.useCallback(function(){xi(),yi(),Pe(new Set),Le([]),Ue.current=[],et([]),it(null),Rn(a.EMPTY_SUMMARY_POPUP_STATE),En(),requestAnimationFrame(function(){var e;null===(e=Ye.current)||void 0===e||e.call(Ye)})},[]),Mi=i.useRef(qi);i.useEffect(function(){Mi.current=qi},[qi]),i.useEffect(function(){ce&&Mi.current()},[ce]);var Hi=i.useCallback(function(n,i,t,o,r,l,u){var a,c,d,v=s.safeStringify(null==i?void 0:i.id)||s.safeStringify(null==t?void 0:t.id)||"",f=(v?Je[v]:null)||(null==i?void 0:i.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:v,decisioning:[],gap:[],relevance_score:0},p=null!==(c=null===(a=ni.current[o])||void 0===a?void 0:a.current)&&void 0!==c?c:null;return{isLoading:null!==(d=null==ve?void 0:ve.isLoading)&&void 0!==d&&d,open:!0,sectionTitle:(null==i?void 0:i.title)?null==i?void 0:i.title:"No Counterpart",refSectionTitle:(null==t?void 0:t.title)?null==t?void 0:t.title:"No Counterpart",cognitiveData:f,anchorEl:n,sectionAnchorEl:p,badgeStyle:l||null,sectionIdx:o,docData:{documents:null==re?void 0:re.documents,input_index_map:null==re?void 0:re.input_index_map},deviationData:function(){var n,r,l=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,u=function(n){var i=function(e){if(!e||"object"!=typeof e)return null;var n=null==e?void 0:e.deviation_entries;if(n&&"object"==typeof n){var i=Object.keys(n).sort(function(e,n){return Number(e)-Number(n)})[0];if(i&&n[i])return n[i]}var t=Object.keys(e).filter(function(e){return/^\d+$/.test(e)}).sort(function(e,n){return Number(e)-Number(n)});if(t.length&&e[t[0]])return e[t[0]];var o=null==e?void 0:e.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(e,n){return Number(e)-Number(n)})[0];if(r&&o[r])return o[r]}return null}(n);return i?e.__assign(e.__assign({},n),{deviation_summary:(null==n?void 0:n.deviation_summary)||(null==i?void 0:i.deviation_summary),deviation_title:(null==n?void 0:n.deviation_title)||(null==i?void 0:i.deviation_title),deviation_impact:(null==n?void 0:n.deviation_impact)||(null==i?void 0:i.deviation_impact),deviation_explanation:(null==n?void 0:n.deviation_explanation)||(null==i?void 0:i.deviation_explanation),evaluation_outputs:(null==n?void 0:n.evaluation_outputs)||(null==i?void 0:i.evaluation_outputs),cognitive_decisioning:(null==n?void 0:n.cognitive_decisioning)||(null==i?void 0:i.cognitive_decisioning)}):n};if(!("string"==typeof o&&o.includes(s.DEVIATION_BADGE_SEPARATOR)))return u(l);var a=o.split(s.DEVIATION_BADGE_SEPARATOR)[1];if(!a)return l;var c=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||{},d=(null===(n=null==c?void 0:c.deviation_entries)||void 0===n?void 0:n[a])||(null===(r=null==c?void 0:c.deviations)||void 0===r?void 0:r[a])||null;return d?e.__assign(e.__assign(e.__assign({},c),d),{deviation_summary:(null==d?void 0:d.deviation_summary)||(null==c?void 0:c.deviation_summary),deviation_title:(null==d?void 0:d.deviation_title)||(null==c?void 0:c.deviation_title),deviation_impact:(null==d?void 0:d.deviation_impact)||(null==c?void 0:c.deviation_impact),deviation_explanation:(null==d?void 0:d.deviation_explanation)||(null==c?void 0:c.deviation_explanation),evaluation_outputs:(null==d?void 0:d.evaluation_outputs)||(null==c?void 0:c.evaluation_outputs),cognitive_decisioning:(null==d?void 0:d.cognitive_decisioning)||(null==c?void 0:c.cognitive_decisioning)}):u(l)}(),isOrphan:!!r}},[Je,re]),Vi=i.useCallback(function(){var e=fn.sectionIdx,n=fn.isOrphan;An(),xn(),null!==e&&(n?De("No counterpart exists to connect to."):(xi(),gi.current&&yi(),Le([]),Ue.current=[],Pe(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){Ye.current&&Ye.current()},50)))},[fn.sectionIdx,fn.isOrphan,An,xn,yi]),zi=i.useCallback(function(){var e=ze.current;if(e){ze.current=null;var n=kn.findIndex(function(n){return n.id===e}),i=Ln.findIndex(function(n){return n.id===e}),t=-1===n?s.findKeyPathByNodeId(kn,e):null,o=-1===i?s.findKeyPathByNodeId(Ln,e):null,r=-1!==n?n:t?Number(t.split("-")[0]):-1,l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=function(e,n,i,t){var o,r,l,s;return-1!==e?null!==(r=null===(o=i.current[e])||void 0===o?void 0:o.current)&&void 0!==r?r:null:n&&null!==(s=null===(l=t.current[n])||void 0===l?void 0:l.current)&&void 0!==s?s:null},a=function(e,n,i){void 0===i&&(i=30);var t=0,o=function(){var r=e();r&&0!==r.getBoundingClientRect().height?(Ri.current.add(r),s.scrollAndHighlightClause(r,n)):t++<i&&requestAnimationFrame(o)};requestAnimationFrame(o)};if(be)-1!==r&&sn.current&&a(function(){return u(n,t,Yn,Zn)},sn.current),-1!==l&&nn.current&&a(function(){return u(i,o,Xn,ei)},nn.current);else{var c=Ze.current;if(!c)return;a(function(){return-1!==r?u(n,t,Yn,Zn):u(i,o,Xn,ei)},c)}}},[kn,Ln,be,Yn,Xn,Zn,ei,sn,nn,Ze]),Gi=i.useCallback(function(n){if(n){xi(),yi(),Pe(new Set),Le([]),Ue.current=[],xn(),En();var i=kn.findIndex(function(e){return e.id===n}),t=Ln.findIndex(function(e){return e.id===n}),o=-1===i?s.findKeyPathByNodeId(kn,n):null,r=-1===t?s.findKeyPathByNodeId(Ln,n):null;if(-1!==i||o||-1!==t||r){var l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=-1!==t?t:r?Number(r.split("-")[0]):-1;ze.current=n,Ai(function(n){var i,t=e.__assign({},n),o=!1;-1!==l&&(t[i=be?"left-".concat(l):String(l)]||(t[i]=!0,o=!0));-1!==u&&(t[i=be?"right-".concat(u):String(u)]||(t[i]=!0,o=!0));return o?t:n}),Ti(function(n){var i=e.__assign({},n),t=!1,l=function(e){for(var n=e.split("-"),o=n[0],r=1;r<n.length;r++)o+="-".concat(n[r]),i[o]||(i[o]=!0,t=!0)};return o&&l(o),r&&l(r),t?i:n}),setTimeout(function(){requestAnimationFrame(function(){ze.current===n&&Wi.current()})},50)}else console.warn('scrollToAndHighlightClause: nodeId "'.concat(n,'" not found'))}},[kn,Ln,be,Ai,Ti,yi,xn,En]),Wi=i.useRef(zi);i.useEffect(function(){Wi.current=zi},[zi]);var Ki=i.useRef(null);i.useEffect(function(){if(wn){var e=Bn.fields.find(function(e){return e.analysisKey===wn||e.key===wn});if(e){var n=Kn.current[e.key]||Un.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[wn,Bn.fields]);var Ui=i.useCallback(function(e){var n,i,t,o,r,l,s,u,a,c=null===(n=null==Fi?void 0:Fi.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!c||!c[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=c[e],v=(null==d?void 0:d.relation)||(null===(t=null===(i=null==d?void 0:d.highlights)||void 0===i?void 0:i.ruleA_spans)||void 0===t?void 0:t.length)||(null===(r=null===(o=null==d?void 0:d.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==d?void 0:d.mappings)&&d.mappings.length>0;if(d.mappings){var f=d.mappings[0]||{};return{score:d.score,relation:f.relation||"",highlightsA:(null===(l=f.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(s=f.highlights)||void 0===s?void 0:s.ruleB_spans)||[],hasContent:!!v}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(u=d.highlights)||void 0===u?void 0:u.ruleA_spans)||[],highlightsB:(null===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[Fi]),Yi=E.useStyleHelpers({proposedSections:kn,existingSections:Ln,maintainRelativeOrder:be,cognitiveMap:Je,deviationData:ge,treeData:re,resolvedComparisonConfig:Bn}),Xi=Yi.getSectionCompareStyle,$i=Yi.getSubSectionCompareStyle,Ji=Yi.getDeviationStyleByKey,Qi=B.useLinesCalculator({containerRef:Me,leftContainerRef:sn,rightContainerRef:nn,svgContainerRef:qe,pathRefs:Ke,leftHeaderRef:He,rightHeaderRef:Ve,proposedSections:kn,existingSections:Ln,visibleFields:qn,leftRefs:Kn,rightRefs:Un,sectionLeftRefs:Yn,sectionRightRefs:Xn,subSectionLeftRefs:Zn,subSectionRightRefs:ei,lhsBadgeRefs:$n,rhsBadgeRefs:Jn,sectionRowRefs:ni,expandedSections:Ei,expandedSubSections:Bi,connectedSections:je,isSideBySide:li,activeSideBySideSection:vi,maintainRelativeOrder:be,cognitiveMap:Je,getSectionCompareStyle:Xi,getSubSectionCompareStyle:$i,getDeviationStyleByKey:Ji,isArrowVisible:si,isAnimatingRef:Ge,isSideBySideRef:gi,sideBySideCacheRef:pi,sideBySideLineRef:Si,activeSideBySideSectionRef:mi,activeSideBySideRightSectionRef:hi,connectedLines:ke,setConnectedLines:Le,cachedConnectedPositions:Ue,calculateLinesRef:Ye,resizeTimerRef:Xe,scrollLock:fi,handleResizeRef:$e,activeProposed:Pn,existingRule:Nn,analysisData:Fi,pendingScrollTargetRef:un,pendingScrollCallbackRef:an,resolvedComparisonConfig:Bn,getFieldData:Ui}),Zi=Qi.lines,et=Qi.setLines,nt=Qi.overallConnector,it=Qi.setOverallConnector,tt=Qi.svgDimensions,ot=Qi.handleColumnScroll,rt=i.useCallback(function(){xi(),Ai({}),Ti({}),yi(),Pe(new Set),Le([]),Ue.current=[],xn(),En(),An(),requestAnimationFrame(function(){Ye.current&&Ye.current()})},[Ai,Ti,yi,xn,En,An]),lt=i.useMemo(function(){return Object.values(Ei).some(Boolean)||Object.values(Bi).some(Boolean)},[Ei,Bi]),st=i.useRef(null),ut=i.useRef(0),at=i.useRef(0),ct=i.useRef(0),dt=A.useResizeHandler({timerRef:st,ruleComponentRef:en,scrollContainerRef:Ze,containerRef:Me,maintainRelativeOrder:be,proposedSections:kn,existingSections:Ln,isSideBySideRef:gi,activeSideBySideSectionRef:mi,activeSideBySideRightSectionRef:hi,sectionRowRefs:ni,sectionRightRowRefs:Qn,sectionLeftRefs:Yn,sectionRightRefs:Xn,subSectionLeftRefs:Zn,subSectionRightRefs:ei,lhsBadgeRefs:$n,rhsBadgeRefs:Jn,leftContainerRef:sn,rightContainerRef:nn,calculateLinesRef:Ye,handleResizeRef:$e,setIsResizing:ci,setIsArrowVisible:ui,sideBySideCacheRef:pi,cachedConnectedPositions:Ue}).handleResize;i.useEffect(function(){$e.current=dt},[dt,$e]),i.useEffect(function(){var e=function(e,n,i,t,o){n.current=e.getBoundingClientRect().width;var r=new ResizeObserver(function(e){null!==i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame(function(){var r,l,s;i.current=null;var u=e[e.length-1];if(u){var a=null!==(s=null===(l=null===(r=u.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==s?s:u.contentRect.width;Math.abs(a-n.current)<1?o():(n.current=a,t())}})});return r.observe(e),r},n={current:null},i={current:null},t={current:null},o=[],r=[n,i,t];return en.current&&o.push(e(en.current,ut,n,function(){return $e.current()},function(){})),Ze.current&&o.push(e(Ze.current,at,i,function(){return $e.current()},function(){return Ye.current()})),Me.current&&o.push(e(Me.current,ct,t,function(){return $e.current()},function(){return Ye.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),i.useEffect(function(){gi.current=li},[li]),i.useEffect(function(){mi.current=vi},[vi]);var vt=i.useCallback(function(){var e,n=fn.sectionIdx,i=fn.isOrphan;if(xn(),null!=n){var t="left";fn.anchorEl&&(null===(e=nn.current)||void 0===e?void 0:e.contains(fn.anchorEl))&&(t="right"),bi(n,i,{sourceSide:t})}},[bi,fn.isOrphan,fn.sectionIdx,fn.anchorEl,xn]),ft=i.useCallback(function(){xn(),yi(),Pe(new Set),Le([]),Ue.current=[]},[xn,yi]),pt=null!==fn.sectionIdx&&je.has(fn.sectionIdx),gt=S.useDeviationNavigation({proposedSections:kn,existingSections:Ln,parentDeviationRecord:Mn,expandedSections:Ei,maintainRelativeOrder:!!be,scrollContainerRef:Ze,leftContainerRef:sn,rightContainerRef:nn,lhsBadgeRefs:$n,rhsBadgeRefs:Jn}),ht=gt.showDeviationNavigation,mt=gt.showOpenNodeRef,St=gt.adjustScrollForPopup,Rt=i.useCallback(function(e,n,i,t,o){var r,l="string"==typeof t?s.safeStringify(t).trim():s.safeStringify(null==t?void 0:t.deviation_summary).trim(),u=e.currentTarget;En();var a="left";(null===(r=nn.current)||void 0===r?void 0:r.contains(u))&&(a="right");var c=function(){var e,i,t,o;if("string"==typeof n&&n.includes(s.DEVIATION_BADGE_SEPARATOR)){var r=n.split(s.DEVIATION_BADGE_SEPARATOR),l="".concat(r[0]).concat(s.DEVIATION_BADGE_SEPARATOR).concat(r[1]);return"right"===a?null===(e=Jn.current[l])||void 0===e?void 0:e.current:null===(i=$n.current[l])||void 0===i?void 0:i.current}return"right"===a?null===(t=Jn.current[n])||void 0===t?void 0:t.current:null===(o=$n.current[n])||void 0===o?void 0:o.current},d=function(e,t){var o=!!be,r=o?"right"===a?nn.current:sn.current:Ze.current,l=o?"right"===a?sn.current:nn.current:null;if(r&&e){var u=function(){var e="string"==typeof n&&n.includes(s.DEVIATION_BADGE_SEPARATOR);i||!e?t():requestAnimationFrame(function(){var e,i,o;pi.current=null,Ue.current=[],_i(!0,n,null),null===(e=Ye.current)||void 0===e||e.call(Ye),null===(i=sn.current)||void 0===i||i.dispatchEvent(new Event("scroll")),null===(o=nn.current)||void 0===o||o.dispatchEvent(new Event("scroll")),t()})},c=e.getBoundingClientRect(),d=r.getBoundingClientRect(),v=d.bottom-.35*d.height,f=d.top+.35*d.height;if(c.top>v||c.top<f){var p=d.top+d.height/2,g=c.top+c.height/2-p;o&&l&&s.smoothScrollTo(l,l.scrollTop+g,250,function(){}),s.smoothScrollTo(r,r.scrollTop+g,250,u)}else u()}else t()};if(i)return yi(),Pe(new Set),Le([]),Ue.current=[],void(l&&requestAnimationFrame(function(){var e=c()||u;d(e,function(){Rn({open:!0,anchorEl:e,summary:t,displayImpact:o})})}));bi(n,i,l?{toggleIfSame:!1,sourceSide:a,onReady:function(){var e=c()||u;d(e,function(){Rn({open:!0,anchorEl:e,summary:t,displayImpact:o})})}}:{toggleIfSame:!1,sourceSide:a})},[bi,En,Rn,yi,be]),xt=i.useMemo(function(){var e;if(!he)return null;var n=null===(e=null==he?void 0:he.id)||void 0===e?void 0:e.split(":")[0];for(var i in Mn){if((Mn[i]||[]).some(function(e){return e.id===n}))return i}return null},[he,Mn]),_t=i.useRef({id:null,triggerMs:null}),yt=i.useRef(null);i.useEffect(function(){var n;if(null==he?void 0:he.id){var i=Number(he.trigger),t=_t.current;if((null==t?void 0:t.triggerMs)!==i){if(!(he.id.includes(":")&&/:\d+$/.test(he.id)))return _t.current={id:he.id,triggerMs:i},void Gi(he.id);var o=null===(n=null==he?void 0:he.id)||void 0===n?void 0:n.split(":"),r=o[0],l=o[1],u=null!=l?l:"0";yt.current!==he.id&&(xn(),En(),yi(),Pe(new Set),Le([]),Ue.current=[],yt.current=he.id);var a=!1,c=0,d=null,v=150,f=function(e,n){for(var i=function(e,t){if(!e)return null;if(e.id===n)return t;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=i(e.subsections[o],"".concat(t,"-").concat(o));if(r)return r}return null},t=0;t<e.length;t++){var o=i(e[t],String(t));if(o)return o}return null},p=function(){var n,t,o,l;if(!a){var g=function(){_t.current={id:he.id,triggerMs:i}},h=null,m=null;for(var S in Mn){var R=Mn[S].find(function(e){return e.id===r});if(R){h=S,m=R;break}}if(m&&h){var x=kn.findIndex(function(e){return e.id===h}),_=Ln.findIndex(function(e){return e.id===h}),y=-1===x&&-1!==_,b=f(kn,m.id),C=f(Ln,m.id);if(b&&!C&&!y){var E=b.split("-"),A=Number(E[0]);if(be){var B=null===(t=null===(n=kn[A])||void 0===n?void 0:n.refIndexes)||void 0===t?void 0:t[0],T=Ln.findIndex(function(e){return e.selfIndex===B});-1!==T&&(A=T)}C=e.__spreadArray([A],E.slice(1),!0).join("-")}if(b||C){var w=y||!b&&!!C,I=b?Number(b.split("-")[0]):x,D=C?Number(C.split("-")[0]):_;if(w){if(!(be?!!Ei["right-".concat(D)]:!!Ei[String(D)])&&D>=0)return Ii(D,"right"),c+=1,void(d=setTimeout(p,450))}else if(!(be?!!Ei["left-".concat(I)]:!!Ei[String(I)])&&I>=0)return Ii(I,"left"),c+=1,void(d=setTimeout(p,450));var F,O=b||"",j=C||"",P="".concat(m.id).concat(s.DEVIATION_BADGE_SEPARATOR).concat(u).concat(s.DEVIATION_BADGE_SEPARATOR).concat(O).concat(s.DEVIATION_BADGE_SEPARATOR).concat(j),N="".concat(m.id).concat(s.DEVIATION_BADGE_SEPARATOR).concat(u),k=null===(o=$n.current[N])||void 0===o?void 0:o.current,L=null===(l=Jn.current[N])||void 0===l?void 0:l.current,q=w||!k&&!!L,M=q?L:k;if(F=be?q?nn.current:sn.current:Ze.current,M&&F){var H=M.getBoundingClientRect();if(0===H.height)return void((c+=1)<2?d=setTimeout(p,v):g());var V=F.getBoundingClientRect(),z=H.top-V.top+F.scrollTop-V.height/2+H.height/2+150,G=function(){var n,i,t,o,r;if(!a){g();var l=M instanceof Element?window.getComputedStyle(M).color:"";k&&(k.style.transition="box-shadow 300ms ease-in-out",k.style.boxShadow="0 0 10px ".concat(l)),L&&(L.style.transition="box-shadow 300ms ease-in-out",L.style.boxShadow="0 0 10px ".concat(l)),setTimeout(function(){k&&(k.style.boxShadow=""),L&&(L.style.boxShadow="")},2e3);var s=(null===(i=null===(n=m.evaluationResult)||void 0===n?void 0:n.deviations)||void 0===i?void 0:i[u])||m,c=(null===(t=m.evaluationResult)||void 0===t?void 0:t.evaluation_outputs)||m.evaluation_outputs;if(!(!!k&&!!L)){var d=q?(null===(o=Jn.current[N])||void 0===o?void 0:o.current)||L:(null===(r=$n.current[N])||void 0===r?void 0:r.current)||k;return St(d,function(){Rn({open:!0,anchorEl:d,displayImpact:he.displayImpact,summary:e.__assign(e.__assign({},s),{evaluation_outputs:c})})}),void(null==me||me())}bi(P,!1,{toggleIfSame:!1,sourceSide:"left",onReady:function(){var n,i,t=q?(null===(n=Jn.current[N])||void 0===n?void 0:n.current)||L:(null===(i=$n.current[N])||void 0===i?void 0:i.current)||k;St(t,function(){requestAnimationFrame(function(){var n,i,o;pi.current=null,Ue.current=[],_i(!0,P,null),null===(n=Ye.current)||void 0===n||n.call(Ye),null===(i=sn.current)||void 0===i||i.dispatchEvent(new Event("scroll")),null===(o=nn.current)||void 0===o||o.dispatchEvent(new Event("scroll")),Rn({open:!0,anchorEl:t,displayImpact:null==he?void 0:he.displayImpact,summary:e.__assign({},s)})})})}})}};Math.abs(F.scrollTop-z)<=2?G():(un.current=z,an.current=G,F.scrollTo({top:z,behavior:"smooth"}),d&&clearTimeout(d),d=setTimeout(function(){if(an.current){un.current=null;var e=an.current;an.current=null,e()}},800))}else(c+=1)<2?d=setTimeout(p,v):g()}else(c+=1)<2?d=setTimeout(p,v):g()}else(c+=1)<2?d=setTimeout(p,v):g()}};return d=setTimeout(p,v),function(){a=!0,d&&clearTimeout(d)}}}},[he,Mn,kn,Ln,be,Ei,Ii,bi,Rn,Gi]);var bt={maintainRelativeOrder:!!be,showDeviationBadges:Ee,isProposingFix:Re,proposingFixNodeId:xe,isRedlineFlow:_e,isSideBySide:li,activeSideBySideSection:vi,connectedSections:je,proposedSections:kn,existingSections:Ln,deviationNumberRegistry:Hn,treeData:re,displayConfig:ve,resolvedMarkdownStyles:Qe,unifiedNumbering:Di,expandedSections:Ei,expandedSubSections:Bi,setExpandedSubSections:Ti,getSectionCompareStyle:Xi,getSubSectionCompareStyle:$i,getBadgeRef:oi,getSectionRowRef:ii,getSubSectionRef:ti,sectionLeftRefs:Yn,sectionRightRefs:Xn,sectionRowRefs:ni,sectionRightRowRefs:Qn,subSectionLeftRefs:Zn,subSectionRightRefs:ei,lhsBadgeRefs:$n,rhsBadgeRefs:Jn,openMoreFunctionsPopup:function(e,n,i,t,o,r){var l;if(e.stopPropagation(),fn.open&&fn.sectionIdx===o)An();else{var u=e.currentTarget,a="left";(null===(l=nn.current)||void 0===l?void 0:l.contains(u))&&(a="right");xi(),gi.current&&yi(),Pe(new Set),Le([]),Ue.current=[],En(),Sn.open?ft():xn(),requestAnimationFrame(function(){var e=function(){var e,n,i,t;if("string"==typeof o&&o.includes(s.DEVIATION_BADGE_SEPARATOR)){var r=o.split(s.DEVIATION_BADGE_SEPARATOR),l="".concat(r[0]).concat(s.DEVIATION_BADGE_SEPARATOR).concat(r[1]);return"right"===a?null===(e=Jn.current[l])||void 0===e?void 0:e.current:null===(n=$n.current[l])||void 0===n?void 0:n.current}return"right"===a?null===(i=Jn.current[o])||void 0===i?void 0:i.current:null===(t=$n.current[o])||void 0===t?void 0:t.current}()||u;pn(Hi(e,n,t,o,i,r))})}},handleOpenSummaryPopup:Rt,openSummaryPopup:Rt,handleCloseSummaryPopup:ft,toggleSection:Ii,handleSubSectionToggle:wi,renderSubSectionAccordion:function(e){var i=e.section,t=e.keyPath,o=e.depth,r=void 0===o?0:o,l=e.columnKey,s=void 0===l?"left":l,u=e.parentNodeId,a=void 0===u?"":u,c=e.sectionOffset;return n.jsx(x.default,{section:i,keyPath:t,depth:r,columnKey:s,parentNodeId:a,sectionOffset:c})},resetSideBySide:yi,setConnectedSections:Pe,setConnectedLines:Le,cachedConnectedPositions:Ue,showDeviationNavigation:ht,showOpenNodeRef:mt,deviationNodeIdToView:null==he?void 0:he.id,deviationTargetParentId:xt};return n.jsx(C.CompareContextProvider,e.__assign({value:bt},{children:n.jsxs(t.Box,e.__assign({ref:en,sx:e.__assign(e.__assign({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},be?{}:{overflow:"visible"}),{position:"relative"})},{children:[Be&&n.jsx(t.Box,e.__assign({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:n.jsx(v.default,{})})),Sn.open&&n.jsx(b.default,{open:Sn.open,anchorEl:Sn.anchorEl,containerEl:Ki.current,clipTopEl:He.current,scrollContainerEl:Ze.current,onClose:ft,summary:Sn.summary,displayImpact:Sn.displayImpact}),n.jsx(d.default,{open:fn.open,anchorEl:fn.anchorEl,sectionTitle:fn.sectionTitle,referenceSectionTitle:fn.refSectionTitle,onClose:An,onOpenCognitiveCompare:bn,onOpenSideBySide:vt,onConnect:Vi,isConnected:pt,isOrphan:fn.isOrphan}),dn.open&&n.jsx(c.default,{open:dn.open,popupRef:yn,position:gn,popupConfig:fe,onClose:function(){hn(null),vn(function(n){return e.__assign(e.__assign({},n),{open:!1})}),_n(null)},markdownStyles:ae,sectionTitle:dn.sectionTitle,referenceSectionTitle:dn.refSectionTitle,cognitiveData:dn.cognitiveData,anchorEl:dn.anchorEl,sectionAnchorEl:dn.sectionAnchorEl,scrollContainerEl:Ze.current,badgeStyle:dn.badgeStyle,docData:dn.docData,deviationData:dn.deviationData,isLoading:dn.isLoading}),n.jsx(t.Snackbar,e.__assign({open:!!Ie,autoHideDuration:8e3,onClose:function(){return De(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:n.jsx(t.Alert,e.__assign({onClose:function(){return De(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Ie}))})),n.jsx(R.default,{componentHeaderText:oe,displayConfig:ve,maintainRelativeOrder:be,onCollapseAll:rt,showCollapseAll:lt,onToggleView:function(e){Te(!0),setTimeout(function(){Ce(!e),yi(),xn(),Pe(new Set),Le([]),Ue.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){Te(!1)},600)})})},50)}}),n.jsx(t.Box,e.__assign({ref:Ze,onScroll:ot,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:be?"hidden":"auto",borderTop:Oi&&ji?"none":"1.5px solid #EEF0F4"}},{children:n.jsx(t.Box,e.__assign({sx:e.__assign({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},be?{flex:1,minHeight:0}:{})},{children:n.jsxs(t.Box,e.__assign({ref:Me,sx:e.__assign({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},be?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(w.default,{svgContainerRef:qe,svgDimensions:tt,isResizing:ai,overallConnector:nt,rootDeviationStyle:Li,lines:Zi,isSideBySide:li,activeSideBySideSection:vi,isArrowVisible:si,maintainRelativeOrder:be,proposedSections:kn,existingSections:Ln,cognitivePopup:dn,activeBadgeId:mn,closeCognitivePopup:En,setActiveBadgeId:_n,openCognitivePopupFromState:Cn,buildSectionPopupState:Hi,connectedLines:ke,pathRefs:Ke}),n.jsxs(t.Box,e.__assign({sx:e.__assign({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},be?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(t.Box,e.__assign({ref:He,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",minHeight:"40px",overflow:"hidden",minWidth:0}},{children:n.jsx(t.Tooltip,e.__assign({title:Fn,placement:"top"},{children:n.jsx(t.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Fn}))}))})),n.jsxs(t.Box,e.__assign({ref:sn,onScroll:ot,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},be?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-160px",pr:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:rn,style:{width:"100%",height:"0px",flexShrink:0}}),zn&&kn.map(function(e,i){return n.jsx(_.default,{section:e,idx:i},"left-row-".concat(i))}),n.jsx("div",{ref:ln,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),n.jsx(t.Box,e.__assign({ref:Ki,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:n.jsx(t.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:n.jsxs(t.Box,e.__assign({onClick:function(n){n.stopPropagation(),dn.open&&mn===Pi?En():(_n(Pi),Cn(Hi(n.currentTarget,{title:"",content:"",evaluationResult:Ni,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,Pi,!0,e.__assign(e.__assign({},Li),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:Li.badgeBg,color:Li.badgeText,border:"1px solid ".concat(Li.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=ki?ki:n.jsx(f.default,{}),n.jsx(t.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n.jsx(r.ButtonCognitiveIcon,{})})),n.jsx(o.ChevronDown,{size:11,style:{transform:dn.open&&mn===Pi?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),n.jsxs(t.Box,e.__assign({sx:e.__assign({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},be?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[di&&n.jsx(l.default,{sections:11}),n.jsx(t.Box,e.__assign({ref:Ve,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:n.jsx(t.Tooltip,e.__assign({title:On,placement:"top"},{children:n.jsx(t.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:On}))}))})),n.jsxs(t.Box,e.__assign({ref:nn,onScroll:ot,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},be?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-150px",pl:"165px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:tn,style:{width:"100%",height:"0px",flexShrink:0}}),zn&&Ln.map(function(e,i){return n.jsx(y.default,{section:e,idx:i},"right-row-".concat(i))}),n.jsx("div",{ref:on,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("@mui/material"),o=require("lucide-react"),r=require("../../assests/svg/ButtonCognitiveIcon.js"),l=require("./OverlayComponent.js"),s=require("./CognitiveComparehelpers.js"),u=require("./CognitiveCompareConfig.js"),a=require("./CognitiveCompareConstants.js"),c=require("./CognitivePopup.js"),d=require("./MoreFunctionsPopup.js"),v=require("./LoaderComponent.js"),f=require("./components/ThreeDotsLoader.js"),p=require("./hooks/useCompareData.js"),g=require("./hooks/useComparePopups.js"),h=require("./hooks/useSectionRefs.js"),m=require("./hooks/useAccordionState.js"),S=require("./hooks/useDeviationNavigation.js"),R=require("./components/CompareHeader.js"),x=require("./components/SubSectionAccordion.js"),_=require("./components/LHSSectionRow.js"),y=require("./components/RHSSectionRow.js"),b=require("./components/CognitiveSummaryPopup.js"),C=require("./CompareContext.js"),E=require("./hooks/useStyles.js"),A=require("./hooks/useResizeHandler.js"),B=require("./hooks/useLinesCalculator.js"),w=require("./hooks/useSideBySide.js"),T=require("./components/SvgConnectors.js");exports.SHARED_MARKDOWN_STYLES=u.SHARED_MARKDOWN_STYLES,exports.default=function(I){var D,F,O,j,P,N,k,L,q,M,H,V,z,G,W,K,U,Y,X,$,J,Q,Z,ee,ne,ie,te=I.componentHeaderText,oe=void 0===te?a.DEFAULT_COMPONENT_HEADER_TEXT:te,re=I.treeData,le=I.comparisonConfig,se=I.leftColumnTitleText,ue=I.rightColumnTitleText,ae=I.markdownStyles,ce=I.resetTrigger,de=I.displayConfig,ve=void 0===de?{isHeaderVisible:!0,isToggleVisible:!0,maintainRelativeOrder:!1,isLoading:!0,showDeviationBadges:!1,enableDeviationSchemaBackwardCompatibility:!1,displayEmailNotifier:!0}:de,fe=I.popupConfig,pe=I.deviationData,ge=void 0===pe?{}:pe,he=I.deviationNodeIdToView,me=I.resetDeviationNodeId,Se=I.isProposingFix,Re=void 0!==Se&&Se,xe=I.proposingFixNodeId,_e=I.isRedlineFlow,ye=i.useState(ve.maintainRelativeOrder),be=ye[0],Ce=ye[1],Ee=!!be||!!(null==ve?void 0:ve.showDeviationBadges),Ae=i.useState(!1),Be=Ae[0],we=Ae[1],Te=i.useState(null),Ie=Te[0],De=Te[1],Fe=i.useState(null===(F=null!==(D=null==re?void 0:re.newEvaluationResult)&&void 0!==D?D:null==ve?void 0:ve.enableDeviationSchemaBackwardCompatibility)||void 0===F||F)[0],Oe=i.useState(new Set),je=Oe[0],Pe=Oe[1],Ne=i.useState([]),ke=Ne[0],Le=Ne[1],qe=i.useRef(null),Me=i.useRef(null),He=i.useRef(null),Ve=i.useRef(null),ze=i.useRef(null),Ge=i.useRef(!1),We=i.useRef(null),Ke=i.useRef({}),Ue=i.useRef([]),Ye=i.useRef(function(){}),Xe=i.useRef(null),$e=i.useRef(function(){}),Je=i.useMemo(function(){return(null==re?void 0:re.cognitive_decisioning)||{}},[re]),Qe=i.useMemo(function(){return e.__assign(e.__assign({},u.SHARED_MARKDOWN_STYLES),ae)},[ae]),Ze=i.useRef(null),en=i.useRef(null),nn=i.useRef(null),tn=i.useRef(null),on=i.useRef(null),rn=i.useRef(null),ln=i.useRef(null),sn=i.useRef(null),un=i.useRef(null),an=i.useRef(null),cn=g.useComparePopups(Ze),dn=cn.cognitivePopup,vn=cn.setCognitivePopup,fn=cn.moreFunctions,pn=cn.setMoreFunctions,gn=cn.position,hn=cn.setPosition,mn=cn.activeBadgeId,Sn=cn.summaryPopup,Rn=cn.setSummaryPopup,xn=cn.closeSummaryPopup,_n=cn.setActiveBadgeId,yn=cn.popupRef,bn=cn.handleOpenCognitiveCompare,Cn=cn.openCognitivePopupFromState,En=cn.closeCognitivePopup,An=cn.closeMoreFunctionsPopup,Bn=i.useMemo(function(){var e,n,i,t,o,r,l;return{fields:null!==(e=null==le?void 0:le.fields)&&void 0!==e?e:u.DEFAULT_FIELD_CONFIG,thresholds:{high:null!==(i=null===(n=null==le?void 0:le.thresholds)||void 0===n?void 0:n.high)&&void 0!==i?i:u.DEFAULT_COMPARISON_CONFIG.thresholds.high,medium:null!==(o=null===(t=null==le?void 0:le.thresholds)||void 0===t?void 0:t.medium)&&void 0!==o?o:u.DEFAULT_COMPARISON_CONFIG.thresholds.medium,exact:null!==(l=null===(r=null==le?void 0:le.thresholds)||void 0===r?void 0:r.exact)&&void 0!==l?l:u.DEFAULT_COMPARISON_CONFIG.thresholds.exact}}},[le]),wn=i.useState(null),Tn=wn[0];wn[1];var In=null===(P=null===(O=null==re?void 0:re.documents)||void 0===O?void 0:O[null===(j=null==re?void 0:re.input_index_map)||void 0===j?void 0:j[0]])||void 0===P?void 0:P.title,Dn=null===(L=null===(N=null==re?void 0:re.documents)||void 0===N?void 0:N[null===(k=null==re?void 0:re.input_index_map)||void 0===k?void 0:k[1]])||void 0===L?void 0:L.title,Fn=s.safeStringify(se||In||"Uploaded Contract"),On=s.safeStringify(ue||Dn||"Reference Template"),jn=p.useCognitiveTreeData(re,be,ge,Bn,Fe),Pn=jn.activeProposed,Nn=jn.existingRule,kn=jn.proposedSections,Ln=jn.existingSections,qn=jn.visibleFields,Mn=jn.parentDeviationRecord,Hn=jn.deviationNumberRegistry,Vn=jn.parseError;i.useEffect(function(){Vn&&De("Failed to load comparison: ".concat(Vn))},[Vn]);var zn=kn.length>0||Ln.length>0,Gn=i.useMemo(function(){if(!_e)return"off";var e=0,n=0,i=function(t){Array.isArray(t)&&t.forEach(function(t){var o,r=(null==t?void 0:t.content)||"";s.hasMeaningfulRedlineTags(r)&&(e+=1,n+=String(r).length),(null===(o=null==t?void 0:t.subsections)||void 0===o?void 0:o.length)&&i(t.subsections)})};return i(kn),i(Ln),"".concat(e,":").concat(n)},[_e,kn,Ln]),Wn=h.useSectionRefs(qn.map(function(e){return e.key}),Math.max(kn.length,Ln.length)),Kn=Wn.leftRefs,Un=Wn.rightRefs,Yn=Wn.sectionLeftRefs,Xn=Wn.sectionRightRefs,$n=Wn.lhsBadgeRefs,Jn=Wn.rhsBadgeRefs,Qn=Wn.sectionRightRowRefs,Zn=Wn.subSectionLeftRefs,ei=Wn.subSectionRightRefs,ni=Wn.sectionRowRefs,ii=Wn.getSectionRowRef,ti=Wn.getSubSectionRef,oi=Wn.getBadgeRef,ri=w.useSideBySide({maintainRelativeOrder:be,proposedSections:kn,existingSections:Ln,leftContainerRef:sn,rightContainerRef:nn,scrollContainerRef:Ze,sectionLeftRefs:Yn,sectionRightRefs:Xn,subSectionLeftRefs:Zn,subSectionRightRefs:ei,lhsBadgeRefs:$n,rhsBadgeRefs:Jn,sectionRowRefs:ni,sectionRightRowRefs:Qn,rhsTopSpacerRef:tn,rhsBottomSpacerRef:on,lhsTopSpacerRef:rn,lhsBottomSpacerRef:ln,calculateLinesRef:Ye,setConnectedSections:Pe,setConnectedLines:Le,cachedConnectedPositions:Ue,closeMoreFunctionsPopup:An,setErrorToast:De,moreFunctions:fn,closeSummaryPopup:xn}),li=ri.isSideBySide,si=ri.isArrowVisible,ui=ri.setIsArrowVisible,ai=ri.isResizing,ci=ri.setIsResizing,di=ri.isSideBySideLoading,vi=ri.activeSideBySideSection,fi=ri.scrollLock,pi=ri.sideBySideCacheRef,gi=ri.isSideBySideRef,hi=ri.activeSideBySideRightSectionRef,mi=ri.activeSideBySideSectionRef,Si=ri.sideBySideLineRef,Ri=ri.highlightedClauseRefs,xi=ri.clearClauseHighlight,_i=ri.applyAlignmentPadding,yi=ri.resetSideBySide,bi=ri.activateSideBySide,Ci=m.useAccordionState({maintainRelativeOrder:!!be,proposedSections:kn,existingSections:Ln,activeSideBySideSection:vi,connectedSections:je,resetSideBySide:yi,setConnectedSections:Pe,setConnectedLines:Le,cachedConnectedPositions:Ue,svgContainerRef:qe,isAnimatingRef:Ge,animationTimerRef:We,calculateLinesRef:Ye,sectionLeftRefs:Yn,sectionRightRefs:Xn,subSectionLeftRefs:Zn,subSectionRightRefs:ei}),Ei=Ci.expandedSections,Ai=Ci.setExpandedSections,Bi=Ci.expandedSubSections,wi=Ci.setExpandedSubSections,Ti=Ci.handleSubSectionToggle,Ii=Ci.toggleSection;i.useEffect(function(){_e&&"off"!==Gn&&"0:0"!==Gn&&(pi.current=null,Ue.current=[],requestAnimationFrame(function(){var e;null===(e=Ye.current)||void 0===e||e.call(Ye)}))},[_e,Gn]);var Di=i.useMemo(function(){var e=new Map,n=new Map,i=1;if(be)kn.forEach(function(n){!n.title&&!n.content||n.id&&e.set(n.id,i++)}),Ln.forEach(function(t){if(t.id){var o=kn.filter(function(e){var n;return null===(n=e.refIndexes)||void 0===n?void 0:n.includes(t.selfIndex)});if(o.length>0){var r=o.map(function(n){return e.get(n.id)}).filter(Boolean);n.set(t.id,r.join(", "))}else n.set(t.id,String(i++))}});else for(var t=Math.max(kn.length,Ln.length),o=0;o<t;o++){var r=kn[o],l=Ln[o];r?(e.set(r.id,i),l&&n.set(l.id,String(i)),i++):l&&n.set(l.id,String(i++))}return{leftNums:e,rightNums:n}},[kn,Ln,be]),Fi=Nn.analysis,Oi=s.safeStringify(null===(M=null===(q=null==Fi?void 0:Fi.rule_difference_comparison)||void 0===q?void 0:q.summary)||void 0===M?void 0:M.overall_summary),ji=!!Oi.match(/<ai_reasoning>([\s\S]*?)<\/ai_reasoning>/i),Pi=null!==(H=null==re?void 0:re.base_root_id)&&void 0!==H?H:"-1";null==re||re[Pi];var Ni=Fe?null!==(Z=null!==($=ge&&(null===(X=null==ge?void 0:ge[Pi])||void 0===X?void 0:X.evaluation_result))&&void 0!==$?$:null===(Q=null===(J=null==re?void 0:re.nodes)||void 0===J?void 0:J[Pi])||void 0===Q?void 0:Q.evaluation_result)&&void 0!==Z?Z:null:null!==(Y=null!==(G=ge&&(null===(z=null===(V=null==ge?void 0:ge[Pi])||void 0===V?void 0:V.evaluation_result)||void 0===z?void 0:z[0]))&&void 0!==G?G:null===(U=null===(K=null===(W=null==re?void 0:re.nodes)||void 0===W?void 0:W[Pi])||void 0===K?void 0:K.evaluation_result)||void 0===U?void 0:U[0])&&void 0!==Y?Y:null,ki=s.extractDeviationScore(Ni),Li=s.generateColorPalette(null!==(ie=null===(ne=null===(ee=null==Ni?void 0:Ni.evaluation_outputs)||void 0===ee?void 0:ee.metadata)||void 0===ne?void 0:ne.label_color)&&void 0!==ie?ie:a.DEFAULT_DEVIAION_COLOR),qi=i.useCallback(function(){xi(),yi(),Pe(new Set),Le([]),Ue.current=[],et([]),it(null),Rn(a.EMPTY_SUMMARY_POPUP_STATE),En(),requestAnimationFrame(function(){var e;null===(e=Ye.current)||void 0===e||e.call(Ye)})},[]),Mi=i.useRef(qi);i.useEffect(function(){Mi.current=qi},[qi]),i.useEffect(function(){ce&&Mi.current()},[ce]);var Hi=i.useCallback(function(n,i,t,o,r,l,u){var a,c,d,v=s.safeStringify(null==i?void 0:i.id)||s.safeStringify(null==t?void 0:t.id)||"",f=(v?Je[v]:null)||(null==i?void 0:i.cognitiveData)||(null==t?void 0:t.cognitiveData)||{section_id:v,decisioning:[],gap:[],relevance_score:0},p=null!==(c=null===(a=ni.current[o])||void 0===a?void 0:a.current)&&void 0!==c?c:null;return{isLoading:null!==(d=null==ve?void 0:ve.isLoading)&&void 0!==d&&d,open:!0,sectionTitle:(null==i?void 0:i.title)?null==i?void 0:i.title:"No Counterpart",refSectionTitle:(null==t?void 0:t.title)?null==t?void 0:t.title:"No Counterpart",cognitiveData:f,anchorEl:n,sectionAnchorEl:p,badgeStyle:l||null,sectionIdx:o,docData:{documents:null==re?void 0:re.documents,input_index_map:null==re?void 0:re.input_index_map},deviationData:function(){var n,r,l=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||null,u=function(n){var i=function(e){if(!e||"object"!=typeof e)return null;var n=null==e?void 0:e.deviation_entries;if(n&&"object"==typeof n){var i=Object.keys(n).sort(function(e,n){return Number(e)-Number(n)})[0];if(i&&n[i])return n[i]}var t=Object.keys(e).filter(function(e){return/^\d+$/.test(e)}).sort(function(e,n){return Number(e)-Number(n)});if(t.length&&e[t[0]])return e[t[0]];var o=null==e?void 0:e.deviations;if(o&&"object"==typeof o){var r=Object.keys(o).sort(function(e,n){return Number(e)-Number(n)})[0];if(r&&o[r])return o[r]}return null}(n);return i?e.__assign(e.__assign({},n),{deviation_summary:(null==n?void 0:n.deviation_summary)||(null==i?void 0:i.deviation_summary),deviation_title:(null==n?void 0:n.deviation_title)||(null==i?void 0:i.deviation_title),deviation_impact:(null==n?void 0:n.deviation_impact)||(null==i?void 0:i.deviation_impact),deviation_explanation:(null==n?void 0:n.deviation_explanation)||(null==i?void 0:i.deviation_explanation),evaluation_outputs:(null==n?void 0:n.evaluation_outputs)||(null==i?void 0:i.evaluation_outputs),cognitive_decisioning:(null==n?void 0:n.cognitive_decisioning)||(null==i?void 0:i.cognitive_decisioning)}):n};if(!("string"==typeof o&&o.includes(s.DEVIATION_BADGE_SEPARATOR)))return u(l);var a=o.split(s.DEVIATION_BADGE_SEPARATOR)[1];if(!a)return l;var c=(null==i?void 0:i.evaluationResult)||(null==t?void 0:t.evaluationResult)||{},d=(null===(n=null==c?void 0:c.deviation_entries)||void 0===n?void 0:n[a])||(null===(r=null==c?void 0:c.deviations)||void 0===r?void 0:r[a])||null;return d?e.__assign(e.__assign(e.__assign({},c),d),{deviation_summary:(null==d?void 0:d.deviation_summary)||(null==c?void 0:c.deviation_summary),deviation_title:(null==d?void 0:d.deviation_title)||(null==c?void 0:c.deviation_title),deviation_impact:(null==d?void 0:d.deviation_impact)||(null==c?void 0:c.deviation_impact),deviation_explanation:(null==d?void 0:d.deviation_explanation)||(null==c?void 0:c.deviation_explanation),evaluation_outputs:(null==d?void 0:d.evaluation_outputs)||(null==c?void 0:c.evaluation_outputs),cognitive_decisioning:(null==d?void 0:d.cognitive_decisioning)||(null==c?void 0:c.cognitive_decisioning)}):u(l)}(),isOrphan:!!r}},[Je,re]),Vi=i.useCallback(function(){var e=fn.sectionIdx,n=fn.isOrphan;An(),xn(),null!==e&&(n?De("No counterpart exists to connect to."):(xi(),gi.current&&yi(),Le([]),Ue.current=[],Pe(function(n){return n.has(e)?new Set:new Set([e])}),setTimeout(function(){Ye.current&&Ye.current()},50)))},[fn.sectionIdx,fn.isOrphan,An,xn,yi]),zi=i.useCallback(function(){var e=ze.current;if(e){ze.current=null;var n=kn.findIndex(function(n){return n.id===e}),i=Ln.findIndex(function(n){return n.id===e}),t=-1===n?s.findKeyPathByNodeId(kn,e):null,o=-1===i?s.findKeyPathByNodeId(Ln,e):null,r=-1!==n?n:t?Number(t.split("-")[0]):-1,l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=function(e,n,i,t){var o,r,l,s;return-1!==e?null!==(r=null===(o=i.current[e])||void 0===o?void 0:o.current)&&void 0!==r?r:null:n&&null!==(s=null===(l=t.current[n])||void 0===l?void 0:l.current)&&void 0!==s?s:null},a=function(e,n,i){void 0===i&&(i=30);var t=0,o=function(){var r=e();r&&0!==r.getBoundingClientRect().height?(Ri.current.add(r),s.scrollAndHighlightClause(r,n)):t++<i&&requestAnimationFrame(o)};requestAnimationFrame(o)};if(be)-1!==r&&sn.current&&a(function(){return u(n,t,Yn,Zn)},sn.current),-1!==l&&nn.current&&a(function(){return u(i,o,Xn,ei)},nn.current);else{var c=Ze.current;if(!c)return;a(function(){return-1!==r?u(n,t,Yn,Zn):u(i,o,Xn,ei)},c)}}},[kn,Ln,be,Yn,Xn,Zn,ei,sn,nn,Ze]),Gi=i.useCallback(function(n){if(n){xi(),yi(),Pe(new Set),Le([]),Ue.current=[],xn(),En();var i=kn.findIndex(function(e){return e.id===n}),t=Ln.findIndex(function(e){return e.id===n}),o=-1===i?s.findKeyPathByNodeId(kn,n):null,r=-1===t?s.findKeyPathByNodeId(Ln,n):null;if(-1!==i||o||-1!==t||r){var l=-1!==i?i:o?Number(o.split("-")[0]):-1,u=-1!==t?t:r?Number(r.split("-")[0]):-1;ze.current=n,Ai(function(n){var i,t=e.__assign({},n),o=!1;-1!==l&&(t[i=be?"left-".concat(l):String(l)]||(t[i]=!0,o=!0));-1!==u&&(t[i=be?"right-".concat(u):String(u)]||(t[i]=!0,o=!0));return o?t:n}),wi(function(n){var i=e.__assign({},n),t=!1,l=function(e){for(var n=e.split("-"),o=n[0],r=1;r<n.length;r++)o+="-".concat(n[r]),i[o]||(i[o]=!0,t=!0)};return o&&l(o),r&&l(r),t?i:n}),setTimeout(function(){requestAnimationFrame(function(){ze.current===n&&Wi.current()})},50)}else console.warn('scrollToAndHighlightClause: nodeId "'.concat(n,'" not found'))}},[kn,Ln,be,Ai,wi,yi,xn,En]),Wi=i.useRef(zi);i.useEffect(function(){Wi.current=zi},[zi]);var Ki=i.useRef(null);i.useEffect(function(){if(Tn){var e=Bn.fields.find(function(e){return e.analysisKey===Tn||e.key===Tn});if(e){var n=Kn.current[e.key]||Un.current[e.key];(null==n?void 0:n.current)&&setTimeout(function(){return n.current.scrollIntoView({behavior:"smooth",block:"center"})},150)}}},[Tn,Bn.fields]);var Ui=i.useCallback(function(e){var n,i,t,o,r,l,s,u,a,c=null===(n=null==Fi?void 0:Fi.rule_difference_comparison)||void 0===n?void 0:n.fields;if(!c||!c[e])return{score:0,relation:"",highlightsA:[],highlightsB:[],hasContent:!1};var d=c[e],v=(null==d?void 0:d.relation)||(null===(t=null===(i=null==d?void 0:d.highlights)||void 0===i?void 0:i.ruleA_spans)||void 0===t?void 0:t.length)||(null===(r=null===(o=null==d?void 0:d.highlights)||void 0===o?void 0:o.ruleB_spans)||void 0===r?void 0:r.length)||(null==d?void 0:d.mappings)&&d.mappings.length>0;if(d.mappings){var f=d.mappings[0]||{};return{score:d.score,relation:f.relation||"",highlightsA:(null===(l=f.highlights)||void 0===l?void 0:l.ruleA_spans)||[],highlightsB:(null===(s=f.highlights)||void 0===s?void 0:s.ruleB_spans)||[],hasContent:!!v}}return{score:d.score,relation:d.relation||"",highlightsA:(null===(u=d.highlights)||void 0===u?void 0:u.ruleA_spans)||[],highlightsB:(null===(a=d.highlights)||void 0===a?void 0:a.ruleB_spans)||[],hasContent:!!v}},[Fi]),Yi=E.useStyleHelpers({proposedSections:kn,existingSections:Ln,maintainRelativeOrder:be,cognitiveMap:Je,deviationData:ge,treeData:re,resolvedComparisonConfig:Bn}),Xi=Yi.getSectionCompareStyle,$i=Yi.getSubSectionCompareStyle,Ji=Yi.getDeviationStyleByKey,Qi=B.useLinesCalculator({containerRef:Me,leftContainerRef:sn,rightContainerRef:nn,svgContainerRef:qe,pathRefs:Ke,leftHeaderRef:He,rightHeaderRef:Ve,proposedSections:kn,existingSections:Ln,visibleFields:qn,leftRefs:Kn,rightRefs:Un,sectionLeftRefs:Yn,sectionRightRefs:Xn,subSectionLeftRefs:Zn,subSectionRightRefs:ei,lhsBadgeRefs:$n,rhsBadgeRefs:Jn,sectionRowRefs:ni,expandedSections:Ei,expandedSubSections:Bi,connectedSections:je,isSideBySide:li,activeSideBySideSection:vi,maintainRelativeOrder:be,cognitiveMap:Je,getSectionCompareStyle:Xi,getSubSectionCompareStyle:$i,getDeviationStyleByKey:Ji,isArrowVisible:si,isAnimatingRef:Ge,isSideBySideRef:gi,sideBySideCacheRef:pi,sideBySideLineRef:Si,activeSideBySideSectionRef:mi,activeSideBySideRightSectionRef:hi,connectedLines:ke,setConnectedLines:Le,cachedConnectedPositions:Ue,calculateLinesRef:Ye,resizeTimerRef:Xe,scrollLock:fi,handleResizeRef:$e,activeProposed:Pn,existingRule:Nn,analysisData:Fi,pendingScrollTargetRef:un,pendingScrollCallbackRef:an,resolvedComparisonConfig:Bn,getFieldData:Ui}),Zi=Qi.lines,et=Qi.setLines,nt=Qi.overallConnector,it=Qi.setOverallConnector,tt=Qi.svgDimensions,ot=Qi.handleColumnScroll,rt=i.useCallback(function(){xi(),Ai({}),wi({}),yi(),Pe(new Set),Le([]),Ue.current=[],xn(),En(),An(),requestAnimationFrame(function(){Ye.current&&Ye.current()})},[Ai,wi,yi,xn,En,An]),lt=i.useMemo(function(){return Object.values(Ei).some(Boolean)||Object.values(Bi).some(Boolean)},[Ei,Bi]),st=i.useRef(null),ut=i.useRef(0),at=i.useRef(0),ct=i.useRef(0),dt=A.useResizeHandler({timerRef:st,ruleComponentRef:en,scrollContainerRef:Ze,containerRef:Me,maintainRelativeOrder:be,proposedSections:kn,existingSections:Ln,isSideBySideRef:gi,activeSideBySideSectionRef:mi,activeSideBySideRightSectionRef:hi,sectionRowRefs:ni,sectionRightRowRefs:Qn,sectionLeftRefs:Yn,sectionRightRefs:Xn,subSectionLeftRefs:Zn,subSectionRightRefs:ei,lhsBadgeRefs:$n,rhsBadgeRefs:Jn,leftContainerRef:sn,rightContainerRef:nn,calculateLinesRef:Ye,handleResizeRef:$e,setIsResizing:ci,setIsArrowVisible:ui,sideBySideCacheRef:pi,cachedConnectedPositions:Ue}).handleResize;i.useEffect(function(){$e.current=dt},[dt,$e]),i.useEffect(function(){var e=function(e,n,i,t,o){n.current=e.getBoundingClientRect().width;var r=new ResizeObserver(function(e){null!==i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame(function(){var r,l,s;i.current=null;var u=e[e.length-1];if(u){var a=null!==(s=null===(l=null===(r=u.borderBoxSize)||void 0===r?void 0:r[0])||void 0===l?void 0:l.inlineSize)&&void 0!==s?s:u.contentRect.width;Math.abs(a-n.current)<1?o():(n.current=a,t())}})});return r.observe(e),r},n={current:null},i={current:null},t={current:null},o=[],r=[n,i,t];return en.current&&o.push(e(en.current,ut,n,function(){return $e.current()},function(){})),Ze.current&&o.push(e(Ze.current,at,i,function(){return $e.current()},function(){return Ye.current()})),Me.current&&o.push(e(Me.current,ct,t,function(){return $e.current()},function(){return Ye.current()})),function(){o.forEach(function(e){return e.disconnect()}),r.forEach(function(e){null!==e.current&&(cancelAnimationFrame(e.current),e.current=null)})}},[]),i.useEffect(function(){gi.current=li},[li]),i.useEffect(function(){mi.current=vi},[vi]);var vt=i.useCallback(function(){var e,n=fn.sectionIdx,i=fn.isOrphan;if(xn(),null!=n){var t="left";fn.anchorEl&&(null===(e=nn.current)||void 0===e?void 0:e.contains(fn.anchorEl))&&(t="right"),bi(n,i,{sourceSide:t})}},[bi,fn.isOrphan,fn.sectionIdx,fn.anchorEl,xn]),ft=i.useCallback(function(){xn(),yi(),Pe(new Set),Le([]),Ue.current=[]},[xn,yi]),pt=null!==fn.sectionIdx&&je.has(fn.sectionIdx),gt=S.useDeviationNavigation({proposedSections:kn,existingSections:Ln,parentDeviationRecord:Mn,expandedSections:Ei,maintainRelativeOrder:!!be,scrollContainerRef:Ze,leftContainerRef:sn,rightContainerRef:nn,lhsBadgeRefs:$n,rhsBadgeRefs:Jn}),ht=gt.showDeviationNavigation,mt=gt.showOpenNodeRef,St=gt.adjustScrollForPopup,Rt=i.useCallback(function(e,n,i,t,o){var r,l="string"==typeof t?s.safeStringify(t).trim():s.safeStringify(null==t?void 0:t.deviation_summary).trim(),u=e.currentTarget;En();var a="left";(null===(r=nn.current)||void 0===r?void 0:r.contains(u))&&(a="right");var c=function(){var e,i,t,o;if("string"==typeof n&&n.includes(s.DEVIATION_BADGE_SEPARATOR)){var r=n.split(s.DEVIATION_BADGE_SEPARATOR),l="".concat(r[0]).concat(s.DEVIATION_BADGE_SEPARATOR).concat(r[1]);return"right"===a?null===(e=Jn.current[l])||void 0===e?void 0:e.current:null===(i=$n.current[l])||void 0===i?void 0:i.current}return"right"===a?null===(t=Jn.current[n])||void 0===t?void 0:t.current:null===(o=$n.current[n])||void 0===o?void 0:o.current},d=function(e,t){var o=!!be,r=o?"right"===a?nn.current:sn.current:Ze.current,l=o?"right"===a?sn.current:nn.current:null;if(r&&e){var u=function(){var e="string"==typeof n&&n.includes(s.DEVIATION_BADGE_SEPARATOR);i||!e?t():requestAnimationFrame(function(){var e,i,o;pi.current=null,Ue.current=[],_i(!0,n,null),null===(e=Ye.current)||void 0===e||e.call(Ye),null===(i=sn.current)||void 0===i||i.dispatchEvent(new Event("scroll")),null===(o=nn.current)||void 0===o||o.dispatchEvent(new Event("scroll")),t()})},c=e.getBoundingClientRect(),d=r.getBoundingClientRect(),v=d.bottom-.35*d.height,f=d.top+.35*d.height;if(c.top>v||c.top<f){var p=d.top+d.height/2,g=c.top+c.height/2-p;o&&l&&s.smoothScrollTo(l,l.scrollTop+g,250,function(){}),s.smoothScrollTo(r,r.scrollTop+g,250,u)}else u()}else t()};if(i)return yi(),Pe(new Set),Le([]),Ue.current=[],void(l&&requestAnimationFrame(function(){var e=c()||u;d(e,function(){Rn({open:!0,anchorEl:e,summary:t,displayImpact:o})})}));bi(n,i,l?{toggleIfSame:!1,sourceSide:a,onReady:function(){var e=c()||u;d(e,function(){Rn({open:!0,anchorEl:e,summary:t,displayImpact:o})})}}:{toggleIfSame:!1,sourceSide:a})},[bi,En,Rn,yi,be]),xt=i.useMemo(function(){var e;if(!he)return null;var n=null===(e=null==he?void 0:he.id)||void 0===e?void 0:e.split(":")[0];for(var i in Mn){if((Mn[i]||[]).some(function(e){return e.id===n}))return i}return null},[he,Mn]),_t=i.useRef({id:null,triggerMs:null}),yt=i.useRef(null);i.useEffect(function(){var n;if(null==he?void 0:he.id){var i=Number(he.trigger),t=_t.current;if((null==t?void 0:t.triggerMs)!==i){if(!(he.id.includes(":")&&/:\d+$/.test(he.id)))return _t.current={id:he.id,triggerMs:i},void Gi(he.id);var o=null===(n=null==he?void 0:he.id)||void 0===n?void 0:n.split(":"),r=o[0],l=o[1],u=null!=l?l:"0";yt.current!==he.id&&(xn(),En(),yi(),Pe(new Set),Le([]),Ue.current=[],yt.current=he.id);var a=!1,c=0,d=null,v=150,f=function(e,n){for(var i=function(e,t){if(!e)return null;if(e.id===n)return t;if(!Array.isArray(e.subsections))return null;for(var o=0;o<e.subsections.length;o++){var r=i(e.subsections[o],"".concat(t,"-").concat(o));if(r)return r}return null},t=0;t<e.length;t++){var o=i(e[t],String(t));if(o)return o}return null},p=function(){var n,t,o,l;if(!a){var g=function(){_t.current={id:he.id,triggerMs:i}},h=null,m=null;for(var S in Mn){var R=Mn[S].find(function(e){return e.id===r});if(R){h=S,m=R;break}}if(m&&h){var x=kn.findIndex(function(e){return e.id===h}),_=Ln.findIndex(function(e){return e.id===h}),y=-1===x&&-1!==_,b=f(kn,m.id),C=f(Ln,m.id);if(b&&!C&&!y){var E=b.split("-"),A=Number(E[0]);if(be){var B=null===(t=null===(n=kn[A])||void 0===n?void 0:n.refIndexes)||void 0===t?void 0:t[0],w=Ln.findIndex(function(e){return e.selfIndex===B});-1!==w&&(A=w)}C=e.__spreadArray([A],E.slice(1),!0).join("-")}if(b||C){var T=y||!b&&!!C,I=b?Number(b.split("-")[0]):x,D=C?Number(C.split("-")[0]):_;if(T){if(!(be?!!Ei["right-".concat(D)]:!!Ei[String(D)])&&D>=0)return Ii(D,"right"),c+=1,void(d=setTimeout(p,450))}else if(!(be?!!Ei["left-".concat(I)]:!!Ei[String(I)])&&I>=0)return Ii(I,"left"),c+=1,void(d=setTimeout(p,450));var F,O=b||"",j=C||"",P="".concat(m.id).concat(s.DEVIATION_BADGE_SEPARATOR).concat(u).concat(s.DEVIATION_BADGE_SEPARATOR).concat(O).concat(s.DEVIATION_BADGE_SEPARATOR).concat(j),N="".concat(m.id).concat(s.DEVIATION_BADGE_SEPARATOR).concat(u),k=null===(o=$n.current[N])||void 0===o?void 0:o.current,L=null===(l=Jn.current[N])||void 0===l?void 0:l.current,q=T||!k&&!!L,M=q?L:k;if(F=be?q?nn.current:sn.current:Ze.current,M&&F){var H=M.getBoundingClientRect();if(0===H.height)return void((c+=1)<2?d=setTimeout(p,v):g());var V=F.getBoundingClientRect(),z=H.top-V.top+F.scrollTop-V.height/2+H.height/2+150,G=function(){var n,i,t,o,r;if(!a){g();var l=M instanceof Element?window.getComputedStyle(M).color:"";k&&(k.style.transition="box-shadow 300ms ease-in-out",k.style.boxShadow="0 0 10px ".concat(l)),L&&(L.style.transition="box-shadow 300ms ease-in-out",L.style.boxShadow="0 0 10px ".concat(l)),setTimeout(function(){k&&(k.style.boxShadow=""),L&&(L.style.boxShadow="")},2e3);var s=(null===(i=null===(n=m.evaluationResult)||void 0===n?void 0:n.deviations)||void 0===i?void 0:i[u])||m,c=(null===(t=m.evaluationResult)||void 0===t?void 0:t.evaluation_outputs)||m.evaluation_outputs;if(!(!!k&&!!L)){var d=q?(null===(o=Jn.current[N])||void 0===o?void 0:o.current)||L:(null===(r=$n.current[N])||void 0===r?void 0:r.current)||k;return St(d,function(){Rn({open:!0,anchorEl:d,displayImpact:he.displayImpact,summary:e.__assign(e.__assign({},s),{evaluation_outputs:c})})}),void(null==me||me())}bi(P,!1,{toggleIfSame:!1,sourceSide:"left",onReady:function(){var n,i,t=q?(null===(n=Jn.current[N])||void 0===n?void 0:n.current)||L:(null===(i=$n.current[N])||void 0===i?void 0:i.current)||k;St(t,function(){requestAnimationFrame(function(){var n,i,o;pi.current=null,Ue.current=[],_i(!0,P,null),null===(n=Ye.current)||void 0===n||n.call(Ye),null===(i=sn.current)||void 0===i||i.dispatchEvent(new Event("scroll")),null===(o=nn.current)||void 0===o||o.dispatchEvent(new Event("scroll")),Rn({open:!0,anchorEl:t,displayImpact:null==he?void 0:he.displayImpact,summary:e.__assign({},s)})})})}})}};Math.abs(F.scrollTop-z)<=2?G():(un.current=z,an.current=G,F.scrollTo({top:z,behavior:"smooth"}),d&&clearTimeout(d),d=setTimeout(function(){if(an.current){un.current=null;var e=an.current;an.current=null,e()}},800))}else(c+=1)<2?d=setTimeout(p,v):g()}else(c+=1)<2?d=setTimeout(p,v):g()}else(c+=1)<2?d=setTimeout(p,v):g()}};return d=setTimeout(p,v),function(){a=!0,d&&clearTimeout(d)}}}},[he,Mn,kn,Ln,be,Ei,Ii,bi,Rn,Gi]);var bt={maintainRelativeOrder:!!be,showDeviationBadges:Ee,isProposingFix:Re,proposingFixNodeId:xe,isRedlineFlow:_e,isSideBySide:li,activeSideBySideSection:vi,connectedSections:je,proposedSections:kn,existingSections:Ln,deviationNumberRegistry:Hn,treeData:re,displayConfig:ve,resolvedMarkdownStyles:Qe,unifiedNumbering:Di,expandedSections:Ei,expandedSubSections:Bi,setExpandedSubSections:wi,getSectionCompareStyle:Xi,getSubSectionCompareStyle:$i,getBadgeRef:oi,getSectionRowRef:ii,getSubSectionRef:ti,sectionLeftRefs:Yn,sectionRightRefs:Xn,sectionRowRefs:ni,sectionRightRowRefs:Qn,subSectionLeftRefs:Zn,subSectionRightRefs:ei,lhsBadgeRefs:$n,rhsBadgeRefs:Jn,openMoreFunctionsPopup:function(e,n,i,t,o,r){var l;if(e.stopPropagation(),fn.open&&fn.sectionIdx===o)An();else{var u=e.currentTarget,a="left";(null===(l=nn.current)||void 0===l?void 0:l.contains(u))&&(a="right");xi(),gi.current&&yi(),Pe(new Set),Le([]),Ue.current=[],En(),Sn.open?ft():xn(),requestAnimationFrame(function(){var e=function(){var e,n,i,t;if("string"==typeof o&&o.includes(s.DEVIATION_BADGE_SEPARATOR)){var r=o.split(s.DEVIATION_BADGE_SEPARATOR),l="".concat(r[0]).concat(s.DEVIATION_BADGE_SEPARATOR).concat(r[1]);return"right"===a?null===(e=Jn.current[l])||void 0===e?void 0:e.current:null===(n=$n.current[l])||void 0===n?void 0:n.current}return"right"===a?null===(i=Jn.current[o])||void 0===i?void 0:i.current:null===(t=$n.current[o])||void 0===t?void 0:t.current}()||u;pn(Hi(e,n,t,o,i,r))})}},handleOpenSummaryPopup:Rt,openSummaryPopup:Rt,handleCloseSummaryPopup:ft,toggleSection:Ii,handleSubSectionToggle:Ti,renderSubSectionAccordion:function(e){var i=e.section,t=e.keyPath,o=e.depth,r=void 0===o?0:o,l=e.columnKey,s=void 0===l?"left":l,u=e.parentNodeId,a=void 0===u?"":u,c=e.sectionOffset;return n.jsx(x.default,{section:i,keyPath:t,depth:r,columnKey:s,parentNodeId:a,sectionOffset:c})},resetSideBySide:yi,setConnectedSections:Pe,setConnectedLines:Le,cachedConnectedPositions:Ue,showDeviationNavigation:ht,showOpenNodeRef:mt,deviationNodeIdToView:null==he?void 0:he.id,deviationTargetParentId:xt};return n.jsx(C.CompareContextProvider,e.__assign({value:bt},{children:n.jsxs(t.Box,e.__assign({ref:en,sx:e.__assign(e.__assign({display:"flex",flexDirection:"column",height:"100%",bgcolor:"#F6F7F9B2",fontFamily:'"Plus Jakarta Sans", sans-serif'},be?{}:{overflow:"visible"}),{position:"relative"})},{children:[Be&&n.jsx(t.Box,e.__assign({sx:{position:"absolute",inset:0,bgcolor:"rgba(255, 255, 255, 0.6)",backdropFilter:"blur(10px)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},{children:n.jsx(v.default,{})})),Sn.open&&n.jsx(b.default,{open:Sn.open,anchorEl:Sn.anchorEl,containerEl:Ki.current,clipTopEl:He.current,scrollContainerEl:Ze.current,onClose:ft,summary:Sn.summary,displayImpact:Sn.displayImpact}),n.jsx(d.default,{open:fn.open,anchorEl:fn.anchorEl,sectionTitle:fn.sectionTitle,referenceSectionTitle:fn.refSectionTitle,onClose:An,onOpenCognitiveCompare:bn,onOpenSideBySide:vt,onConnect:Vi,isConnected:pt,isOrphan:fn.isOrphan}),dn.open&&n.jsx(c.default,{open:dn.open,popupRef:yn,position:gn,popupConfig:fe,onClose:function(){hn(null),vn(function(n){return e.__assign(e.__assign({},n),{open:!1})}),_n(null)},markdownStyles:ae,sectionTitle:Fn,referenceSectionTitle:On,cognitiveData:dn.cognitiveData,anchorEl:dn.anchorEl,sectionAnchorEl:dn.sectionAnchorEl,scrollContainerEl:Ze.current,badgeStyle:dn.badgeStyle,docData:dn.docData,deviationData:dn.deviationData,isLoading:dn.isLoading}),n.jsx(t.Snackbar,e.__assign({open:!!Ie,autoHideDuration:8e3,onClose:function(){return De(null)},anchorOrigin:{vertical:"top",horizontal:"center"}},{children:n.jsx(t.Alert,e.__assign({onClose:function(){return De(null)},severity:"error",sx:{width:"100%",whiteSpace:"pre-line"}},{children:Ie}))})),n.jsx(R.default,{componentHeaderText:oe,displayConfig:ve,maintainRelativeOrder:be,onCollapseAll:rt,showCollapseAll:lt,onToggleView:function(e){we(!0),setTimeout(function(){Ce(!e),yi(),xn(),Pe(new Set),Le([]),Ue.current=[],requestAnimationFrame(function(){requestAnimationFrame(function(){setTimeout(function(){we(!1)},600)})})},50)}}),n.jsx(t.Box,e.__assign({ref:Ze,onScroll:ot,sx:{flex:1,minHeight:0,pt:1.5,pb:1,px:3,display:"flex",justifyContent:"center",alignItems:"flex-start",bgcolor:"#FFFFFF",overflowY:be?"hidden":"auto",borderTop:Oi&&ji?"none":"1.5px solid #EEF0F4"}},{children:n.jsx(t.Box,e.__assign({sx:e.__assign({display:"flex",flexDirection:"column",width:"100%",maxWidth:"1200px"},be?{flex:1,minHeight:0}:{})},{children:n.jsxs(t.Box,e.__assign({ref:Me,sx:e.__assign({display:"grid",gridTemplateColumns:"minmax(0, 1fr) 180px minmax(0, 1fr)",gap:"60px",maxWidth:"1200px",width:"100%",position:"relative",minHeight:0},be?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(T.default,{svgContainerRef:qe,svgDimensions:tt,isResizing:ai,overallConnector:nt,rootDeviationStyle:Li,lines:Zi,isSideBySide:li,activeSideBySideSection:vi,isArrowVisible:si,maintainRelativeOrder:be,proposedSections:kn,existingSections:Ln,cognitivePopup:dn,activeBadgeId:mn,closeCognitivePopup:En,setActiveBadgeId:_n,openCognitivePopupFromState:Cn,buildSectionPopupState:Hi,connectedLines:ke,pathRefs:Ke}),n.jsxs(t.Box,e.__assign({sx:e.__assign({border:"1px solid #E7E7E9",borderRadius:"8px",bgcolor:"#FFFFFF",display:"flex",flexDirection:"column",position:"relative",zIndex:2,filter:"drop-shadow(0px 2px 4px #F2F2F2)"},be?{flex:1,overflow:"visible"}:{})},{children:[n.jsx(t.Box,e.__assign({ref:He,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E7E7E9",borderRadius:"8px 8px 0 0",display:"flex",alignItems:"center",minHeight:"40px",overflow:"hidden",minWidth:0}},{children:n.jsx(t.Tooltip,e.__assign({title:Fn,placement:"top"},{children:n.jsx(t.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#19213D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:Fn}))}))})),n.jsxs(t.Box,e.__assign({ref:sn,onScroll:ot,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},be?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,mr:"-160px",pr:"172px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:rn,style:{width:"100%",height:"0px",flexShrink:0}}),zn&&kn.map(function(e,i){return n.jsx(_.default,{section:e,idx:i},"left-row-".concat(i))}),n.jsx("div",{ref:ln,style:{width:"100%",height:"0px",flexShrink:0}})]}))]})),n.jsx(t.Box,e.__assign({ref:Ki,sx:{width:"180px",display:"flex",flexDirection:"column",alignItems:"center",pt:"15px",gap:0,zIndex:20,pointerEvents:"none"}},{children:n.jsx(t.Box,e.__assign({sx:{display:"flex",justifyContent:"center",alignItems:"center",mt:0}},{children:n.jsxs(t.Box,e.__assign({onClick:function(n){n.stopPropagation(),dn.open&&mn===Pi?En():(_n(Pi),Cn(Hi(n.currentTarget,{title:"",content:"",evaluationResult:Ni,cognitiveData:{section_id:"",decisioning:[],gap:[],relevance_score:0,isMissingRationale:!0}},null,Pi,!0,e.__assign(e.__assign({},Li),{label:""}))))},sx:{display:"inline-flex",alignItems:"center",gap:"5px",px:1.5,py:"5px",top:"-8px",borderRadius:"20px",bgcolor:Li.badgeBg,color:Li.badgeText,border:"1px solid ".concat(Li.badgeBorder),fontSize:"12px",fontWeight:600,whiteSpace:"nowrap",position:"relative",zIndex:1,pointerEvents:"auto",cursor:"pointer"}},{children:[null!=ki?ki:n.jsx(f.default,{}),n.jsx(t.Box,e.__assign({component:"span",sx:{width:14,height:14,display:"flex",alignItems:"center","& svg":{width:"14px",height:"14px"}}},{children:n.jsx(r.ButtonCognitiveIcon,{})})),n.jsx(o.ChevronDown,{size:11,style:{transform:dn.open&&mn===Pi?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.25s ease"}})]}))}))})),n.jsxs(t.Box,e.__assign({sx:e.__assign({border:"1px solid #E3E6EA",borderRadius:"8px",bgcolor:"#FFFFFF",boxShadow:"0px 1px 4px #F7F4FE",position:"relative",zIndex:2,display:"flex",flexDirection:"column",minWidth:0},be?{flex:1,overflow:"visible",minHeight:0}:{})},{children:[di&&n.jsx(l.default,{sections:11}),n.jsx(t.Box,e.__assign({ref:Ve,sx:{p:"8px",bgcolor:"#F7F8FA",borderBottom:"1px solid #E3E6EA",borderRadius:"8px 8px 0 0",minHeight:"40px",display:"flex",alignItems:"center",overflowX:"hidden"}},{children:n.jsx(t.Tooltip,e.__assign({title:On,placement:"top"},{children:n.jsx(t.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:500,color:"#5928ED",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",minWidth:0,textAlign:"center",display:"block"}},{children:On}))}))})),n.jsxs(t.Box,e.__assign({ref:nn,onScroll:ot,sx:e.__assign({p:"12px",display:"flex",flexDirection:"column"},be?{maxHeight:"calc(100vh - 150px)",flex:1,overflowY:"auto",overflowX:"hidden",minHeight:0,ml:"-150px",pl:"165px","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}:{})},{children:[n.jsx("div",{ref:tn,style:{width:"100%",height:"0px",flexShrink:0}}),zn&&Ln.map(function(e,i){return n.jsx(y.default,{section:e,idx:i},"right-row-".concat(i))}),n.jsx("div",{ref:on,style:{width:"100%",height:"0px",flexShrink:0}})]}))]}))]}))}))}))]}))}))};
|
|
2
2
|
//# sourceMappingURL=CognitiveCompare.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),o=require("@mui/material");exports.default=function(t){var r=t.componentHeaderText,n=t.displayConfig,s=t.maintainRelativeOrder,l=t.onToggleView,a=t.onCollapseAll,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),o=require("@mui/material");exports.default=function(t){var r=t.componentHeaderText,n=t.displayConfig,s=t.maintainRelativeOrder,l=t.onToggleView,a=t.onCollapseAll,d=t.showCollapseAll;return n.isHeaderVisible||n.isToggleVisible?i.jsxs(o.Box,e.__assign({sx:{px:2,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",bgcolor:"#FFFFFF",border:"1.5px solid #EEF0F4",borderTopLeftRadius:"8px",borderTopRightRadius:"8px"}},{children:[i.jsx(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:1}},{children:n.isHeaderVisible&&i.jsx(o.Typography,e.__assign({sx:{fontSize:"16px",fontWeight:600,color:"#0F172A"}},{children:r}))})),i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:2}},{children:[n.displayEmailNotifier&&i.jsxs(o.Box,e.__assign({sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:1,backgroundColor:"#f5f5f5",px:.5,py:.25,borderRadius:1,border:"1px solid #a0a0a0",paddingX:.8}},{children:[i.jsxs("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-bell-ring-icon lucide-bell-ring"},{children:[i.jsx("path",{d:"M10.268 21a2 2 0 0 0 3.464 0"}),i.jsx("path",{d:"M22 8c0-2.3-.8-4.3-2-6"}),i.jsx("path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"}),i.jsx("path",{d:"M4 2C2.8 3.7 2 5.7 2 8"})]})),i.jsx(o.Typography,e.__assign({variant:"caption",sx:{color:"black",textAlign:"center",fontSize:"13px",fontWeight:500}},{children:"You'll be notified on completion"}))]})),n.isToggleVisible&&i.jsxs(o.Box,e.__assign({sx:{display:"flex",alignItems:"center",gap:2}},{children:[d&&i.jsx(o.Button,e.__assign({variant:"outlined",size:"small",onClick:a,sx:{textTransform:"none",fontWeight:600,fontSize:"12px",color:"#5928ED",borderColor:"#5928ED",height:26,"&:hover":{borderColor:"#3E1BB3",backgroundColor:"rgba(89, 40, 237, 0.04)"}}},{children:"Collapse All"})),i.jsx(o.FormControlLabel,{control:i.jsx(o.Switch,{checked:!s,onChange:function(e){return l(e.target.checked)},color:"primary",size:"small",sx:{width:100,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:"3px",transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(75px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:"#5928ED",opacity:1,border:0,"&::before":{content:'"Side by Side"',position:"absolute",left:8,top:5,fontSize:10,color:"#fff",fontWeight:600}}},"& .MuiSwitch-thumb:before":{position:"absolute",width:"100%",height:"100%",left:0,top:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:700,color:"#5928ED"}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:20,height:20,boxShadow:"0px 1px 3px rgba(0,0,0,0.2)"},"& .MuiSwitch-track":{borderRadius:13,backgroundColor:"#CBD5E1",opacity:1,position:"relative","&::before":{content:'"Side By Side"',position:"absolute",right:8,top:5,left:30,fontSize:10,color:"#1E293B",fontWeight:600}}}}),label:"",sx:{m:0}})]}))]}))]})):null};
|
|
2
2
|
//# sourceMappingURL=CompareHeader.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),o=require("react"),n=require("@mui/material"),t=require("lucide-react"),r=require("./SectionAccordion.js"),a=require("./ThreeDotsLoader.js"),l=require("../CognitiveComparehelpers.js"),s=require("../CompareContext.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=d(o).default.memo(function(o){var d,c,u=o.section,p=o.idx,x=s.useCompareContext(),g=x.maintainRelativeOrder,v=x.existingSections;x.proposedSections;var f=x.connectedSections,m=x.expandedSections,b=x.displayConfig,h=x.treeData;x.deviationNumberRegistry;var S=x.getSectionCompareStyle;x.getBadgeRef;var B=x.getSectionRowRef,_=x.sectionLeftRefs,R=x.lhsBadgeRefs,j=x.openMoreFunctionsPopup,y=x.handleOpenSummaryPopup,w=x.handleCloseSummaryPopup,C=x.toggleSection;x.showDeviationBadges,x.renderSubSectionAccordion,x.isProposingFix,x.proposingFixNodeId,x.isRedlineFlow,x.isSideBySide,x.activeSideBySideSection,x.deviationNodeIdToView,x.deviationTargetParentId;var I=x.showDeviationNavigation;x.showOpenNodeRef,x.resolvedMarkdownStyles;var N=x.unifiedNumbering,q=!u.title&&!u.content;if(g&&q)return null;var D=u,P=S(p,"left"),T=g?!(null===(d=D.refIndexes)||void 0===d?void 0:d.length)||D.selfIndex<0:!v[p],k=f.has(p),z=l.extractDeviationScore(D.evaluationResult,null==P?void 0:P.deviationLabel),A=N.leftNums.get(D.id);return i.jsx(n.Box,e.__assign({ref:B(p),sx:{mb:1,width:"100%"}},{children:i.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),o=require("react"),n=require("@mui/material"),t=require("lucide-react"),r=require("./SectionAccordion.js"),a=require("./ThreeDotsLoader.js"),l=require("../CognitiveComparehelpers.js"),s=require("../CompareContext.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=d(o).default.memo(function(o){var d,c,u=o.section,p=o.idx,x=s.useCompareContext(),g=x.maintainRelativeOrder,v=x.existingSections;x.proposedSections;var f=x.connectedSections,m=x.expandedSections,b=x.displayConfig,h=x.treeData;x.deviationNumberRegistry;var S=x.getSectionCompareStyle;x.getBadgeRef;var B=x.getSectionRowRef,_=x.sectionLeftRefs,R=x.lhsBadgeRefs,j=x.openMoreFunctionsPopup,y=x.handleOpenSummaryPopup,w=x.handleCloseSummaryPopup,C=x.toggleSection;x.showDeviationBadges,x.renderSubSectionAccordion,x.isProposingFix,x.proposingFixNodeId,x.isRedlineFlow,x.isSideBySide,x.activeSideBySideSection,x.deviationNodeIdToView,x.deviationTargetParentId;var I=x.showDeviationNavigation;x.showOpenNodeRef,x.resolvedMarkdownStyles;var N=x.unifiedNumbering,q=!u.title&&!u.content;if(g&&q)return null;var D=u,P=S(p,"left"),T=g?!(null===(d=D.refIndexes)||void 0===d?void 0:d.length)||D.selfIndex<0:!v[p],k=f.has(p),z=l.extractDeviationScore(D.evaluationResult,null==P?void 0:P.deviationLabel),A=N.leftNums.get(D.id);return i.jsx(n.Box,e.__assign({ref:B(p),sx:{mb:1,width:"100%"}},{children:i.jsx(n.Box,e.__assign({ref:_.current[p],sx:e.__assign({width:"100%",display:"flex",flexDirection:"column",minWidth:0},k&&{borderRadius:"6px",outline:"2px solid ".concat((null==P?void 0:P.badgeBorder)||"#6366F1"),outlineOffset:"1px"})},{children:i.jsxs(n.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[i.jsx(r.default,{section:u,idx:p,columnKey:"left",colRef:B("left-accordion-".concat(p)),mb:0,parentNodeId:(null===(c=null==h?void 0:h.input_index_map)||void 0===c?void 0:c[0])||"",isExpanded:g?!!m["left-".concat(p)]:!!m[String(p)],onToggle:function(){w(),C(p,"left")},navigation:u.id?I[u.id]:null}),g&&P&&i.jsxs(n.Box,e.__assign({ref:R.current[p],onClick:function(e){var i,o,n,t=b.enableDeviationSchemaBackwardCompatibility?null!==(i=D.evaluationResult)&&void 0!==i?i:null:null!==(n=null===(o=D.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==n?n:null;y(e,String(p),T,t)},sx:{position:"absolute",top:"18px",right:0,transform:"translateY(-50%) translateX(calc(100% + 8px))",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",bgcolor:P.badgeBg,color:P.badgeText,border:"1px solid ".concat(P.badgeBorder),borderRadius:"12px",px:1.2,py:.3,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",zIndex:20,boxShadow:"0 1px 3px rgba(0,0,0,0.07)"}},{children:[i.jsxs(n.Box,e.__assign({component:"span",onClick:function(e){var i,o,n;e.stopPropagation();var t=b.enableDeviationSchemaBackwardCompatibility?null!==(i=D.evaluationResult)&&void 0!==i?i:null:null!==(n=null===(o=D.evaluationResult)||void 0===o?void 0:o[0])&&void 0!==n?n:null;y(e,String(p),T,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:T?"default":"pointer",borderRight:"1px solid ".concat(P.badgeBorder),"&:hover":T?{}:{bgColor:"".concat(P.badgeBorder,"22")}}},{children:[null!=A&&i.jsx(n.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(P.badgeBorder)}},{children:A})),i.jsx(n.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!b.isLoading||null!=D.evaluationResult&&void 0!==D.evaluationResult?"N/A"===z||"NA"===z?"N/A":0==z||null==z?"Same":"".concat(z):i.jsx(a.default,{color:P.badgeText})}))]})),i.jsx(n.Box,e.__assign({component:"span",onClick:function(e){e.stopPropagation();var i=g?v.find(function(e){var i;return null===(i=D.refIndexes)||void 0===i?void 0:i.includes(e.selfIndex)})||{title:"",content:""}:v[p]||{title:"",content:""};j(e,u,T,i,p,P)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(P.badgeBorder,"22")}}},{children:i.jsx(t.EllipsisVertical,{size:11,color:P.badgeText})}))]}))]}))}))}),"left-row-".concat(p))});exports.default=c;
|
|
2
2
|
//# sourceMappingURL=LHSSectionRow.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),o=require("@mui/material"),t=require("lucide-react"),r=require("./SectionAccordion.js"),a=require("./ThreeDotsLoader.js"),l=require("../CompareContext.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=d(n).default.memo(function(n){var d,s,c=n.section,u=n.idx,x=l.useCompareContext(),p=x.maintainRelativeOrder;x.existingSections;var g=x.proposedSections,v=x.connectedSections,f=x.expandedSections,h=x.displayConfig,b=x.treeData;x.deviationNumberRegistry;var m=x.getSectionCompareStyle;x.getBadgeRef;var S=x.getSectionRowRef,B=x.sectionRightRefs,_=x.rhsBadgeRefs,R=x.openMoreFunctionsPopup,j=x.handleOpenSummaryPopup,y=x.handleCloseSummaryPopup,I=x.toggleSection;x.showDeviationBadges,x.renderSubSectionAccordion,x.isProposingFix,x.proposingFixNodeId,x.isRedlineFlow,x.isSideBySide,x.activeSideBySideSection,x.deviationNodeIdToView,x.deviationTargetParentId;var w=x.showDeviationNavigation;x.showOpenNodeRef,x.resolvedMarkdownStyles;var C=x.unifiedNumbering,q=c,N=!1,P=null,D=-1;if(p){D=g.findIndex(function(e){var i;return(null===(i=e.refIndexes)||void 0===i?void 0:i.includes(q.selfIndex))&&e.selfIndex>=0});var T=g.findIndex(function(e,i){var n;return v.has(i)&&(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(q.selfIndex))});(N=-1!==T)&&(P=m(T,"left"))}else(N=v.has(u))&&(P=m(u,"right"));var k=p&&-1!==D?m(D,"left"):m(u,"right"),z=p?-1!==D||!(null===(d=q.refIndexes)||void 0===d?void 0:d.length)&&g.some(function(e){return e.id&&e.id===q.id}):Boolean(g[u]),F=p?q.selfIndex<0||!z:!g[u],O=C.rightNums.get(q.id);return i.jsx(o.Box,e.__assign({ref:S(u),sx:{mb:1,width:"100%"}},{children:i.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("react"),o=require("@mui/material"),t=require("lucide-react"),r=require("./SectionAccordion.js"),a=require("./ThreeDotsLoader.js"),l=require("../CompareContext.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=d(n).default.memo(function(n){var d,s,c=n.section,u=n.idx,x=l.useCompareContext(),p=x.maintainRelativeOrder;x.existingSections;var g=x.proposedSections,v=x.connectedSections,f=x.expandedSections,h=x.displayConfig,b=x.treeData;x.deviationNumberRegistry;var m=x.getSectionCompareStyle;x.getBadgeRef;var S=x.getSectionRowRef,B=x.sectionRightRefs,_=x.rhsBadgeRefs,R=x.openMoreFunctionsPopup,j=x.handleOpenSummaryPopup,y=x.handleCloseSummaryPopup,I=x.toggleSection;x.showDeviationBadges,x.renderSubSectionAccordion,x.isProposingFix,x.proposingFixNodeId,x.isRedlineFlow,x.isSideBySide,x.activeSideBySideSection,x.deviationNodeIdToView,x.deviationTargetParentId;var w=x.showDeviationNavigation;x.showOpenNodeRef,x.resolvedMarkdownStyles;var C=x.unifiedNumbering,q=c,N=!1,P=null,D=-1;if(p){D=g.findIndex(function(e){var i;return(null===(i=e.refIndexes)||void 0===i?void 0:i.includes(q.selfIndex))&&e.selfIndex>=0});var T=g.findIndex(function(e,i){var n;return v.has(i)&&(null===(n=e.refIndexes)||void 0===n?void 0:n.includes(q.selfIndex))});(N=-1!==T)&&(P=m(T,"left"))}else(N=v.has(u))&&(P=m(u,"right"));var k=p&&-1!==D?m(D,"left"):m(u,"right"),z=p?-1!==D||!(null===(d=q.refIndexes)||void 0===d?void 0:d.length)&&g.some(function(e){return e.id&&e.id===q.id}):Boolean(g[u]),F=p?q.selfIndex<0||!z:!g[u],O=C.rightNums.get(q.id);return i.jsx(o.Box,e.__assign({ref:S(u),sx:{mb:1,width:"100%"}},{children:i.jsx(o.Box,e.__assign({ref:B.current[u],sx:e.__assign({width:"100%",display:"flex"},N&&P&&{borderRadius:"6px",outline:"2px solid ".concat(P.badgeBorder),outlineOffset:"1px"})},{children:i.jsxs(o.Box,e.__assign({sx:{position:"relative",width:"100%"}},{children:[i.jsx(r.default,{section:c,idx:u,columnKey:"right",colRef:S("right-accordion-".concat(u)),mb:0,parentNodeId:(null===(s=null==b?void 0:b.input_index_map)||void 0===s?void 0:s[1])||"",isExpanded:p?!!f["right-".concat(u)]:!!f[String(u)],onToggle:function(){y(),I(u,"right")},navigation:c.id?w[c.id]:null}),p&&k&&i.jsx(o.Box,e.__assign({ref:_.current[u],"data-section-id":q.id,onClick:function(e){var i,n,o;if(F){var t=h.enableDeviationSchemaBackwardCompatibility?null!==(i=q.evaluationResult)&&void 0!==i?i:null:null!==(o=null===(n=q.evaluationResult)||void 0===n?void 0:n[0])&&void 0!==o?o:null;j(e,String(u),F,t)}},sx:{position:"absolute",top:"18px",left:0,transform:"translateY(-50%) translateX(calc(-100% - 8px))",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:F?"4px":"0px",fontSize:"11px",bgcolor:k.badgeBg,color:k.badgeText,border:"1px solid ".concat(k.badgeBorder),borderRadius:F?"12px":"10px",px:F?1.2:1,py:.3,fontWeight:F?600:700,cursor:F?"pointer":"default",whiteSpace:"nowrap",zIndex:20,boxShadow:F?"0 1px 3px rgba(0,0,0,0.07)":"none"}},{children:F?i.jsxs(i.Fragment,{children:[i.jsxs(o.Box,e.__assign({component:"span",onClick:function(e){var i,n,o;e.stopPropagation();var t=h.enableDeviationSchemaBackwardCompatibility?null!==(i=q.evaluationResult)&&void 0!==i?i:null:null!==(o=null===(n=q.evaluationResult)||void 0===n?void 0:n[0])&&void 0!==o?o:null;j(e,String(u),F,t)},sx:{display:"inline-flex",alignItems:"center",gap:"4px",px:.2,cursor:"pointer",borderRight:"1px solid ".concat(k.badgeBorder),"&:hover":{bgcolor:"".concat(k.badgeBorder,"22")}}},{children:[null!=O&&i.jsx(o.Box,e.__assign({component:"span",sx:{fontSize:"11px",fontWeight:700,pr:.5,borderRight:"1px solid ".concat(k.badgeBorder)}},{children:O})),i.jsx(o.Box,e.__assign({component:"span",sx:{fontSize:"11px",px:.25}},{children:!h.isLoading||null!=q.evaluationResult&&void 0!==q.evaluationResult?k.label?"".concat(k.label):"100% Deviation":i.jsx(a.default,{color:k.badgeText})}))]})),i.jsx(o.Box,e.__assign({component:"span",onClick:function(e){e.stopPropagation();var i=p?g.find(function(e){var i;return null===(i=e.refIndexes)||void 0===i?void 0:i.includes(q.selfIndex)})||{title:"",content:""}:g[u]||{title:"",content:""};R(e,i,F,q,u,k)},sx:{display:"inline-flex",alignItems:"center",px:.2,cursor:"pointer","&:hover":{bgcolor:"".concat(k.badgeBorder,"22")}}},{children:i.jsx(t.EllipsisVertical,{size:11,color:k.badgeText})}))]}):null!=O?O:""}))]}))}))}),"right-row-".concat(u))});exports.default=s;
|
|
2
2
|
//# sourceMappingURL=RHSSectionRow.js.map
|