@tantainnovative/ndpr-toolkit 5.7.2 → 5.7.4
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/CHANGELOG.md +41 -1
- package/README.md +62 -16
- package/bin/ndpr.mjs +4 -3
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-426DIR5C.js +1 -0
- package/dist/{chunk-2OSZT7KI.js → chunk-55EAP4U7.js} +4 -4
- package/dist/chunk-5JS3L4XF.js +1 -0
- package/dist/chunk-7E5A7YVH.mjs +6 -0
- package/dist/{chunk-FVZUR7QN.mjs → chunk-7FCI5BPU.mjs} +1 -1
- package/dist/{chunk-JTM463ES.mjs → chunk-7LGOY2A3.mjs} +1 -1
- package/dist/chunk-C6F5JJV6.mjs +1 -0
- package/dist/chunk-CHUOSZST.js +2 -0
- package/dist/{chunk-OVXDSUQU.js → chunk-CLTIKUTQ.js} +1 -1
- package/dist/chunk-CUUM5U6W.js +2 -0
- package/dist/{chunk-IVSNHT24.mjs → chunk-DHRFX6AY.mjs} +0 -0
- package/dist/{chunk-IT5VIC2P.mjs → chunk-EH73TDZL.mjs} +1 -1
- package/dist/chunk-H5WABWMB.mjs +1 -0
- package/dist/chunk-HLPZALYL.mjs +1 -0
- package/dist/chunk-ISCFIAKJ.js +2 -0
- package/dist/chunk-J5JG3K7E.js +1 -0
- package/dist/chunk-JNEQIRM5.mjs +1 -0
- package/dist/{chunk-7BJXI2HI.mjs → chunk-K5WLRGDN.mjs} +1 -1
- package/dist/chunk-L5Z77INN.mjs +2 -0
- package/dist/chunk-LP3R2BBL.js +1 -0
- package/dist/chunk-OMACLDXI.mjs +2 -0
- package/dist/chunk-QX6RIR6I.mjs +1 -0
- package/dist/{chunk-T63MYPKE.js → chunk-RKG2FHSP.js} +1 -1
- package/dist/{chunk-OLTLB5MP.mjs → chunk-RNV6D6MV.mjs} +1 -1
- package/dist/{chunk-WJ4DAOKE.js → chunk-RP4JSZ6V.js} +2 -2
- package/dist/chunk-TSA2C2YC.js +1 -0
- package/dist/chunk-UFQLC3KP.mjs +1 -0
- package/dist/{chunk-YFBDJ4FH.js → chunk-USD363RW.js} +1 -1
- package/dist/{chunk-PQ5IPUJN.mjs → chunk-VSUV2ZAY.mjs} +1 -1
- package/dist/{chunk-VEWLYTRA.js → chunk-VT5KQCMY.js} +1 -1
- package/dist/chunk-WCC4EHKU.js +1 -0
- package/dist/{chunk-JS7SYL5P.js → chunk-XNCCIRT6.js} +0 -0
- package/dist/{chunk-QKXGVT2Q.js → chunk-XWOO2LT5.js} +1 -1
- package/dist/chunk-YSCHSH6V.mjs +2 -0
- package/dist/consent.d.mts +1 -1
- package/dist/consent.d.ts +1 -1
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +15 -5
- package/dist/core.d.ts +15 -5
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +30 -4
- package/dist/cross-border.d.ts +30 -4
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/dsr.d.mts +2 -0
- package/dist/dsr.d.ts +2 -0
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/headless.d.mts +1 -1
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/hooks.d.mts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +17 -5
- package/dist/index.d.ts +17 -5
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets-dsr.d.mts +2 -0
- package/dist/presets-dsr.d.ts +2 -0
- package/dist/presets-dsr.js +1 -1
- package/dist/presets-dsr.mjs +1 -1
- package/dist/presets-policy.js +1 -1
- package/dist/presets-policy.mjs +1 -1
- package/dist/presets.d.mts +2 -0
- package/dist/presets.d.ts +2 -0
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/server.d.mts +15 -5
- package/dist/server.d.ts +15 -5
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/unstyled.d.mts +2 -0
- package/dist/unstyled.d.ts +2 -0
- package/dist/unstyled.js +1 -1
- package/dist/unstyled.mjs +1 -1
- package/package.json +25 -12
- package/dist/chunk-5ZMYNOMR.mjs +0 -2
- package/dist/chunk-6UGLAVRM.mjs +0 -6
- package/dist/chunk-B6BRD5SL.mjs +0 -1
- package/dist/chunk-C5UYAOYX.mjs +0 -1
- package/dist/chunk-DKLJ5DYN.js +0 -1
- package/dist/chunk-EAV4BZKO.mjs +0 -2
- package/dist/chunk-FRHFIEWZ.js +0 -2
- package/dist/chunk-HCZDQWHY.js +0 -2
- package/dist/chunk-HHK5LHEG.js +0 -1
- package/dist/chunk-IRRUYR6M.js +0 -1
- package/dist/chunk-KDAZQO3N.mjs +0 -1
- package/dist/chunk-LHQG25Y2.js +0 -2
- package/dist/chunk-ME77GU4Q.mjs +0 -2
- package/dist/chunk-R3ZKV2J7.mjs +0 -1
- package/dist/chunk-SJDDNB6M.js +0 -1
- package/dist/chunk-T32YQT4Y.js +0 -1
- package/dist/chunk-TVA6D6S4.js +0 -1
- package/dist/chunk-XOH4WXOZ.mjs +0 -1
- package/dist/chunk-ZSRO4L3C.mjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## Changelog taxonomy
|
|
6
|
+
|
|
7
|
+
- **Features**: additive public APIs, components, hooks, routes, adapters, CLI behavior, or documented capabilities.
|
|
8
|
+
- **Bug Fixes**: corrections to shipped behavior, validation, packaging, security hardening, or regressions.
|
|
9
|
+
- **Documentation**: docs, examples, release guidance, legal citation wording, or site content that does not change package behavior.
|
|
10
|
+
- **Compliance Rule Changes**: changes to NDPA/NDPC/GAID assumptions, default thresholds, filing deadlines, citation mappings, scoring semantics, or compliance-sensitive validator behavior. These entries should name the affected source and module, and should say whether users need to re-run audits, update config, refresh evidence, or seek legal review.
|
|
11
|
+
|
|
12
|
+
Compliance-impacting examples:
|
|
13
|
+
|
|
14
|
+
- `Documentation`: clarify a citation block or add a stronger "not legal advice" notice.
|
|
15
|
+
- `Bug Fixes`: correct a false positive in `assessBreachNotification`.
|
|
16
|
+
- `Features`: add a new optional GAID check behind explicit config.
|
|
17
|
+
- `Compliance Rule Changes`: update DCPMI thresholds, CAR deadlines, breach notification content assumptions, or compliance score weights because NDPC guidance changed.
|
|
18
|
+
|
|
19
|
+
## [5.7.4](https://github.com/mr-tanta/ndpr-toolkit/compare/v5.7.3...v5.7.4) (2026-06-27)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Documentation
|
|
23
|
+
|
|
24
|
+
* clarify NDPA Toolkit / NDPA 2023 positioning while preserving NDPR package compatibility
|
|
25
|
+
* add the NDPR vs NDPA naming guide and link it from README and docs navigation
|
|
26
|
+
* update site, docs, recipes, and component metadata to lead with NDPA Toolkit while retaining NDPR search/package context
|
|
27
|
+
|
|
28
|
+
## [5.7.3](https://github.com/mr-tanta/ndpr-toolkit/compare/v5.7.2...v5.7.3) (2026-06-26)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
* **site:** add approved Used By section to the landing page
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* **ci:** add explicit serial, coverage, and local verification scripts
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Documentation
|
|
42
|
+
|
|
43
|
+
* refresh architecture and contributor guidance for v5 source roots
|
|
44
|
+
|
|
5
45
|
## [5.7.2](https://github.com/mr-tanta/ndpr-toolkit/compare/v5.7.1...v5.7.2) (2026-06-06)
|
|
6
46
|
|
|
7
47
|
## [5.7.1](https://github.com/mr-tanta/ndpr-toolkit/compare/v5.7.0...v5.7.1) (2026-06-05)
|
|
@@ -1683,4 +1723,4 @@ All v2 APIs continue to work unchanged. The deprecated `storageOptions`/`storage
|
|
|
1683
1723
|
- Data subject rights portal
|
|
1684
1724
|
- Privacy policy generator
|
|
1685
1725
|
- DPIA assessment tool
|
|
1686
|
-
- Breach notification module
|
|
1726
|
+
- Breach notification module
|
package/README.md
CHANGED
|
@@ -9,21 +9,29 @@
|
|
|
9
9
|
[](https://github.com/mr-tanta/ndpr-toolkit/actions/workflows/ci.yml)
|
|
10
10
|
[](https://bundlephobia.com/package/@tantainnovative/ndpr-toolkit)
|
|
11
11
|
|
|
12
|
-
v5 ships **zero-config presets**, **pluggable storage adapters**, **compound components**, **structured-error validators**, a **compliance score engine**, and **seven shipped locales** (en, yo, ig, ha, pcm, ar, fr) — eight production-ready modules covering consent, data subject rights, DPIA, breach notification, privacy policies, lawful basis, cross-border transfers, and ROPA. **5.2–5.5 add an NDPC GAID 2025 layer**: a DCPMI
|
|
12
|
+
v5 ships **zero-config presets**, **pluggable storage adapters**, **compound components**, **structured-error validators**, a **compliance score engine**, and **seven shipped locales** (en, yo, ig, ha, pcm, ar, fr) — eight production-ready modules covering consent, data subject rights, DPIA, breach notification, privacy policies, lawful basis, cross-border transfers, and ROPA. **5.2–5.5 add an NDPC GAID 2025 layer**: a DCPMI designation classifier, a Compliance Audit Returns scheduler, a Section 40 / Article 33 breach-notification checker (wired live into `BreachReportForm`), and an **`ndpr audit` CLI** that gates compliance in CI.
|
|
13
13
|
|
|
14
14
|
**[Documentation](https://ndprtoolkit.com.ng)** | **[Live Demos](https://ndprtoolkit.com.ng/ndpr-demos)** | **[npm](https://www.npmjs.com/package/@tantainnovative/ndpr-toolkit)** | **[Blog](https://ndprtoolkit.com.ng/blog)** | **[Latest Release](https://github.com/mr-tanta/ndpr-toolkit/releases/latest)**
|
|
15
15
|
|
|
16
16
|
[](https://stackblitz.com/github/mr-tanta/ndpr-toolkit/tree/main/examples/nextjs-app)
|
|
17
17
|
[](https://codesandbox.io/p/github/mr-tanta/ndpr-toolkit/main/examples/nextjs-app)
|
|
18
18
|
|
|
19
|
+
> **What's new in 5.7.4:** The docs now lead with **NDPA Toolkit** / **NDPA 2023 compliance** while preserving the `@tantainnovative/ndpr-toolkit` package name for compatibility, legacy imports, and search continuity.
|
|
20
|
+
>
|
|
19
21
|
> **What's new in 5.5:** The **`ndpr audit` CLI** scores a compliance config against the toolkit engine (compliance score + GAID 2025 DCPMI / CAR / breach checks) and exits non-zero on failure — a drop-in CI gate. The same logic is exported as `runNdprAudit` / `formatNdprAuditReport` from `/server`. See the [audit CLI guide](https://ndprtoolkit.com.ng/docs/guides/audit-cli).
|
|
20
22
|
>
|
|
21
|
-
> **NDPC GAID 2025 utilities (5.2–5.4):** `classifyDCPMI` (DCPMI
|
|
23
|
+
> **NDPC GAID 2025 utilities (5.2–5.4):** `classifyDCPMI` (DCPMI designation tier + fee estimate), `generateComplianceAuditReturn` (CAR initial-audit + annual filing schedule), and `assessBreachNotification` (Section 40 / Article 33 notification completeness) — each pure, React-free, and exposed as a hook. `BreachReportForm` now renders a live NDPC-notification readiness panel as it's filled in.
|
|
22
24
|
>
|
|
23
25
|
> **Earlier highlights:** Structured-result validators are the only shape — `{ field, code, message }[]` with stable codes; uniform `onAdd` / `onUpdate` / `onArchive` callbacks; `NDPRDPIA.onResult(result)` (5.0). Arabic + French locales with RTL-correct CSS (4.1.0). React 17 dropped; `^18 || ^19` (4.0.0). Full history in the [CHANGELOG](https://github.com/mr-tanta/ndpr-toolkit/blob/main/CHANGELOG.md).
|
|
24
26
|
|
|
27
|
+
> **Legal source transparency:** See [Legal Basis & Citations](https://ndprtoolkit.com.ng/docs/guides/legal-basis-and-citations) for NDPA 2023 module references, NDPC GAID 2025 DCPMI/CAR utility references, and audit CLI boundaries, plus the linked governance policy for regulatory changes.
|
|
28
|
+
>
|
|
29
|
+
> **Naming note:** The npm package remains `@tantainnovative/ndpr-toolkit` for compatibility and search continuity, but current legal positioning is **NDPA Toolkit** / **NDPA 2023 compliance**. See [NDPR vs NDPA Naming](https://ndprtoolkit.com.ng/docs/guides/ndpr-vs-ndpa-naming).
|
|
30
|
+
>
|
|
31
|
+
> **Compliance updates:** Watch [GitHub Releases](https://github.com/mr-tanta/ndpr-toolkit/releases) or npm version updates for compliance-impacting changes. Release notes call out NDPA/NDPC/GAID rule changes separately from features, bug fixes, and docs. The toolkit is implementation support, not legal advice; verify current NDPC guidance before relying on outputs for regulated filings or audit evidence.
|
|
32
|
+
|
|
25
33
|
<p align="center">
|
|
26
|
-
<img src="https://raw.githubusercontent.com/mr-tanta/ndpr-toolkit/
|
|
34
|
+
<img src="https://raw.githubusercontent.com/mr-tanta/ndpr-toolkit/main/public/screenshots/hero.png" alt="NDPA Toolkit — NDPA Compliance Made Beautiful" width="800" />
|
|
27
35
|
</p>
|
|
28
36
|
|
|
29
37
|
---
|
|
@@ -73,13 +81,31 @@ import { cookieAdapter, apiAdapter, composeAdapters, localStorageAdapter } from
|
|
|
73
81
|
The full SSR pattern (cookie read server-side → banner hydrates already-resolved, no flash) is in the [Server-Side Storage guide](https://ndprtoolkit.com.ng/docs/guides/server-side-storage).
|
|
74
82
|
|
|
75
83
|
<p align="center">
|
|
76
|
-
<img src="https://raw.githubusercontent.com/mr-tanta/ndpr-toolkit/
|
|
84
|
+
<img src="https://raw.githubusercontent.com/mr-tanta/ndpr-toolkit/main/public/screenshots/consent-demo.png" alt="Consent Management Demo — interactive consent banner with state inspector" width="800" />
|
|
77
85
|
<br />
|
|
78
86
|
<em>Interactive consent demo with configurable position, theme, storage, and real-time state inspector</em>
|
|
79
87
|
</p>
|
|
80
88
|
|
|
81
89
|
---
|
|
82
90
|
|
|
91
|
+
## Used by
|
|
92
|
+
|
|
93
|
+
The toolkit is used by Nigerian software, operations, education, laboratory, and compliance teams, including:
|
|
94
|
+
|
|
95
|
+
- [Perkflow Inc](https://perkflow.io)
|
|
96
|
+
- [Finlab Nigeria](https://ndprtoolkit.com.ng/case-studies#finlab-nigeria-privacy-readiness)
|
|
97
|
+
- [Burtech Products](https://burtechproducts.com)
|
|
98
|
+
- [Chibek Instruments](https://chibek.com)
|
|
99
|
+
- NGtaxkit
|
|
100
|
+
- [Tanta Innovative](https://ndprtoolkit.com.ng/case-studies#tanta-innovative-internal-compliance)
|
|
101
|
+
|
|
102
|
+
Only teams approved for public listing are included here and on the docs site. See the
|
|
103
|
+
[case studies and implementation stories](https://ndprtoolkit.com.ng/case-studies) for
|
|
104
|
+
approved proof assets; they describe implementation paths and modules used without claiming
|
|
105
|
+
legal certification, regulator approval, or unapproved business metrics.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
83
109
|
## Install
|
|
84
110
|
|
|
85
111
|
Pick your package manager:
|
|
@@ -451,11 +477,11 @@ import { NDPRComplianceDashboard } from '@tantainnovative/ndpr-toolkit/presets';
|
|
|
451
477
|
|
|
452
478
|
---
|
|
453
479
|
|
|
454
|
-
## DCPMI & Compliance Audit Returns
|
|
480
|
+
## DCPMI Designation & Compliance Audit Returns
|
|
455
481
|
|
|
456
|
-
Two pure utilities for the NDPC **General Application and Implementation Directive (GAID) 2025** registration regime — no React, safe to run server-side or in CI.
|
|
482
|
+
Two pure utilities for the NDPC **General Application and Implementation Directive (GAID) 2025** registration regime — no React, safe to run server-side or in CI. DCPMI here is a designation/classification utility, not a ninth NDPA module or a substitute for DPCO-led registration.
|
|
457
483
|
|
|
458
|
-
`classifyDCPMI()` derives an organisation's **Data Controller/Processor of Major Importance** tier from the number of data subjects processed in a six-month window, with its annual registration fee and filing obligations:
|
|
484
|
+
`classifyDCPMI()` derives an organisation's **Data Controller/Processor of Major Importance** designation tier from the number of data subjects processed in a six-month window, with its annual registration fee estimate and filing obligations:
|
|
459
485
|
|
|
460
486
|
```ts
|
|
461
487
|
import { classifyDCPMI } from '@tantainnovative/ndpr-toolkit/core';
|
|
@@ -597,7 +623,7 @@ Compliance score: 82/100 (good) — minimum 70
|
|
|
597
623
|
82/100 (good); minimum 70.
|
|
598
624
|
! Minor (child) data protection controls (Section 31)
|
|
599
625
|
Implement age-verification and parental-consent controls for processing data of minors.
|
|
600
|
-
✓ DCPMI
|
|
626
|
+
✓ DCPMI designation (GAID 2025)
|
|
601
627
|
Not a Data Controller/Processor of Major Importance by volume.
|
|
602
628
|
|
|
603
629
|
2 passed, 3 warning(s), 0 failed
|
|
@@ -628,18 +654,38 @@ Detects Next.js (App Router or Pages Router) or Express, prompts for your ORM (P
|
|
|
628
654
|
|
|
629
655
|
### Backend recipes
|
|
630
656
|
|
|
631
|
-
`@tantainnovative/ndpr-recipes` is a
|
|
657
|
+
`@tantainnovative/ndpr-recipes` is the companion npm package for production backend templates. Install it as a pinned source package, copy the files you need into your app, and adapt them to your auth, tenancy, database, and audit-log conventions:
|
|
658
|
+
|
|
659
|
+
```bash
|
|
660
|
+
pnpm add @tantainnovative/ndpr-toolkit
|
|
661
|
+
pnpm add -D @tantainnovative/ndpr-recipes
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
See the [Production Recipes guide](https://ndprtoolkit.com.ng/docs/guides/production-recipes) for the recommended handoff path.
|
|
632
665
|
|
|
633
666
|
| Recipe | What you get |
|
|
634
667
|
|--------|-------------|
|
|
635
|
-
| `prisma/schema.prisma` |
|
|
668
|
+
| `prisma/schema.prisma` | NDPA compliance tables for consent, DSR, breach, ROPA, DPIA, and audit logs |
|
|
636
669
|
| `src/adapters/prisma-consent.ts` | Prisma `StorageAdapter<ConsentSettings>` |
|
|
637
670
|
| `src/adapters/drizzle-consent.ts` | Drizzle `StorageAdapter<ConsentSettings>` |
|
|
638
|
-
| `src/nextjs/app-router/` | Consent, DSR, Breach, ROPA, compliance route handlers |
|
|
639
|
-
| `src/express/` | Full
|
|
671
|
+
| `src/nextjs/app-router/` | Consent, DSR, Breach, DPIA, ROPA, compliance route handlers; consent, breach, DPIA, and ROPA validate before writes |
|
|
672
|
+
| `src/express/` | Full NDPA compliance router with consent, DSR, DPIA, breach, ROPA routes; breach, DPIA, and ROPA validate before writes |
|
|
640
673
|
| `src/nextjs/app-router/middleware.ts` | Next.js consent gate middleware |
|
|
641
674
|
|
|
642
|
-
Copy
|
|
675
|
+
Copy from `node_modules/@tantainnovative/ndpr-recipes` for a pinned version, or [browse the recipes on GitHub](https://github.com/mr-tanta/ndpr-toolkit/tree/main/packages/ndpr-recipes).
|
|
676
|
+
|
|
677
|
+
The runnable examples cover the first production handoff paths:
|
|
678
|
+
|
|
679
|
+
| Example | What it demonstrates |
|
|
680
|
+
|---------|----------------------|
|
|
681
|
+
| [`examples/nextjs-app`](./examples/nextjs-app) | App Router consent endpoint that validates with `validateConsentStructured`, stores the current consent snapshot, and appends consent audit events. |
|
|
682
|
+
| [`examples/dsr-backend-reference`](./examples/dsr-backend-reference) | DSR intake endpoint with server validation, Prisma persistence, reference IDs, 30-day target dates, and best-effort confirmation email. |
|
|
683
|
+
|
|
684
|
+
The ROPA recipes now enforce the toolkit's production completeness checks before persistence. Include controller details, lawful-basis justification, data-subject categories, recipients, retention, security measures, and `dpiaReference` when `dpiaRequired` is true.
|
|
685
|
+
|
|
686
|
+
The breach recipes validate incident intake dates, reporter email, affected systems, data types, and lifecycle update values before persistence. Create/detail responses include `ndpcReadiness` from `assessBreachNotification` so DPO workflows can see missing GAID 2025 Article 33 notification content and 72-hour deadline status.
|
|
687
|
+
|
|
688
|
+
The DPIA recipes now provide maintained Next.js and Express persistence routes for `DPIARecord`, with validation for project metadata, `dpiaData`, risk level, score, status, and audit-log writes before records are created, updated, or deleted.
|
|
643
689
|
|
|
644
690
|
---
|
|
645
691
|
|
|
@@ -649,13 +695,13 @@ Every module has an interactive demo. No signup, no setup — try them instantly
|
|
|
649
695
|
|
|
650
696
|
<p align="center">
|
|
651
697
|
<a href="https://ndprtoolkit.com.ng/ndpr-demos">
|
|
652
|
-
<img src="https://raw.githubusercontent.com/mr-tanta/ndpr-toolkit/
|
|
698
|
+
<img src="https://raw.githubusercontent.com/mr-tanta/ndpr-toolkit/main/public/screenshots/demos-overview.png" alt="8 interactive live demos — zero setup required" width="800" />
|
|
653
699
|
</a>
|
|
654
700
|
</p>
|
|
655
701
|
|
|
656
702
|
<p align="center">
|
|
657
|
-
<img src="https://raw.githubusercontent.com/mr-tanta/ndpr-toolkit/
|
|
658
|
-
<img src="https://raw.githubusercontent.com/mr-tanta/ndpr-toolkit/
|
|
703
|
+
<img src="https://raw.githubusercontent.com/mr-tanta/ndpr-toolkit/main/public/screenshots/dsr-demo.png" alt="Data Subject Rights — 8 rights with request tracking" width="400" />
|
|
704
|
+
<img src="https://raw.githubusercontent.com/mr-tanta/ndpr-toolkit/main/public/screenshots/breach-demo.png" alt="Breach Notification — 72-hour countdown with step-by-step workflow" width="400" />
|
|
659
705
|
</p>
|
|
660
706
|
|
|
661
707
|
<p align="center">
|
package/bin/ndpr.mjs
CHANGED
|
@@ -118,9 +118,10 @@ async function main() {
|
|
|
118
118
|
|
|
119
119
|
const options = { ...(config.options ?? {}) };
|
|
120
120
|
if (args.flags['min-score'] !== undefined) {
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
const raw = args.flags['min-score'];
|
|
122
|
+
const minScore = typeof raw === 'string' && raw.trim() !== '' ? Number(raw) : NaN;
|
|
123
|
+
if (!Number.isFinite(minScore) || minScore < 0 || minScore > 100) {
|
|
124
|
+
process.stderr.write('--min-score requires a numeric value between 0 and 100.\n');
|
|
124
125
|
return 2;
|
|
125
126
|
}
|
|
126
127
|
options.minScore = minScore;
|
package/dist/breach.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var chunkC7OOUURS_js=require('./chunk-C7OOUURS.js'),
|
|
2
|
+
'use strict';var chunkC7OOUURS_js=require('./chunk-C7OOUURS.js'),chunkCUUM5U6W_js=require('./chunk-CUUM5U6W.js'),chunkEHQVTFYO_js=require('./chunk-EHQVTFYO.js'),chunk3YTAOT5O_js=require('./chunk-3YTAOT5O.js');require('./chunk-Y346CURW.js'),require('./chunk-UXUMYP4L.js'),require('./chunk-ZVOIR4QH.js'),require('./chunk-AME4HJR4.js'),require('./chunk-I5ZDNSX5.js'),require('./chunk-7563FVMY.js'),require('./chunk-VWED6UTN.js');var chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var c=react.createContext(null);function P(){let e=react.useContext(c);if(!e)throw new Error("Breach compound components must be wrapped in <Breach.Provider>. Example: <Breach.Provider categories={...}><Breach.ReportForm /></Breach.Provider>");return e}var p=({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u,children:d})=>{let y=chunkEHQVTFYO_js.a({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u}),l=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},y),{categories:e});return jsxRuntime.jsx(c.Provider,{value:l,children:d})};var A={Provider:p,ReportForm:chunkCUUM5U6W_js.a,RiskAssessment:chunkC7OOUURS_js.a,NotificationManager:chunkC7OOUURS_js.b,ReportGenerator:chunkC7OOUURS_js.c};Object.defineProperty(exports,"BreachNotificationManager",{enumerable:true,get:function(){return chunkC7OOUURS_js.b}});Object.defineProperty(exports,"BreachRiskAssessment",{enumerable:true,get:function(){return chunkC7OOUURS_js.a}});Object.defineProperty(exports,"RegulatoryReportGenerator",{enumerable:true,get:function(){return chunkC7OOUURS_js.c}});Object.defineProperty(exports,"BreachReportForm",{enumerable:true,get:function(){return chunkCUUM5U6W_js.a}});Object.defineProperty(exports,"useBreach",{enumerable:true,get:function(){return chunkEHQVTFYO_js.a}});Object.defineProperty(exports,"calculateBreachSeverity",{enumerable:true,get:function(){return chunk3YTAOT5O_js.a}});exports.Breach=A;exports.BreachProvider=p;exports.useBreachCompound=P;
|
package/dist/breach.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {c as c$1,b,a}from'./chunk-EF5CLD4V.mjs';export{b as BreachNotificationManager,a as BreachRiskAssessment,c as RegulatoryReportGenerator}from'./chunk-EF5CLD4V.mjs';import {a as a$1}from'./chunk-
|
|
2
|
+
import {c as c$1,b,a}from'./chunk-EF5CLD4V.mjs';export{b as BreachNotificationManager,a as BreachRiskAssessment,c as RegulatoryReportGenerator}from'./chunk-EF5CLD4V.mjs';import {a as a$1}from'./chunk-YSCHSH6V.mjs';export{a as BreachReportForm}from'./chunk-YSCHSH6V.mjs';import {a as a$2}from'./chunk-RFXGD5NE.mjs';export{a as useBreach}from'./chunk-RFXGD5NE.mjs';export{a as calculateBreachSeverity}from'./chunk-WTGKZX7J.mjs';import'./chunk-WJSUVPYX.mjs';import'./chunk-EWVK45Z3.mjs';import'./chunk-ITCY2Z66.mjs';import'./chunk-SFGW37LE.mjs';import'./chunk-PHA3YMFO.mjs';import'./chunk-5LJ652AH.mjs';import'./chunk-DBZSN4WP.mjs';import {b as b$1,a as a$3}from'./chunk-ZJYULEER.mjs';import {createContext,useContext}from'react';import {jsx}from'react/jsx-runtime';var c=createContext(null);function P(){let e=useContext(c);if(!e)throw new Error("Breach compound components must be wrapped in <Breach.Provider>. Example: <Breach.Provider categories={...}><Breach.ReportForm /></Breach.Provider>");return e}var p=({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u,children:d})=>{let y=a$2({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u}),l=b$1(a$3({},y),{categories:e});return jsx(c.Provider,{value:l,children:d})};var A={Provider:p,ReportForm:a$1,RiskAssessment:a,NotificationManager:b,ReportGenerator:c$1};export{A as Breach,p as BreachProvider,P as useBreachCompound};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var P=({settings:w,storageOptions:x={},onLoad:i,onSave:u,autoSave:R=true,autoLoad:l=true,classNames:m,unstyled:h,children:d})=>{let{storageKey:o="ndpr_consent",storageType:n="localStorage",cookieOptions:g={}}=x,[r,I]=react.useState(false),C=react.useCallback(()=>{let t=null;try{if(n==="localStorage"&&typeof window!="undefined"){let e=localStorage.getItem(o);e&&(t=JSON.parse(e));}else if(n==="sessionStorage"&&typeof window!="undefined"){let e=sessionStorage.getItem(o);e&&(t=JSON.parse(e));}else if(n==="cookie"&&typeof document!="undefined"){let e=encodeURIComponent(o),a=document.cookie.split(";").find(c=>c.trim().startsWith(`${e}=`));if(a){let c=a.slice(a.indexOf("=")+1);t=JSON.parse(decodeURIComponent(c));}}I(!0),i&&i(t);}catch(e){console.error("[ndpr-toolkit] Error loading consent settings:",e),I(true),i&&i(null);}return t},[n,o,i]),y=react.useCallback(t=>{try{let e=JSON.stringify(t);if(n==="localStorage"&&typeof window!="undefined")localStorage.setItem(o,e);else if(n==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(o,e);else if(n==="cookie"&&typeof document!="undefined"){let{domain:s,path:a="/",expires:c=365,secure:D=!0,sameSite:U="Lax"}=g,k=new Date;k.setDate(k.getDate()+c);let p=`${encodeURIComponent(o)}=${encodeURIComponent(e)}; path=${a}; expires=${k.toUTCString()}`;s&&(p+=`; domain=${s}`),D&&(p+="; secure"),p+=`; samesite=${U}`,document.cookie=p;}return u&&u(t),!0}catch(e){return console.error("[ndpr-toolkit] Error saving consent settings:",e),false}},[n,o,g,u]),N=react.useCallback(()=>{try{if(n==="localStorage"&&typeof window!="undefined")localStorage.removeItem(o);else if(n==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(o);else if(n==="cookie"&&typeof document!="undefined"){let{domain:t,path:e="/"}=g,s=`${encodeURIComponent(o)}=; path=${e}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;t&&(s+=`; domain=${t}`),document.cookie=s;}return !0}catch(t){return console.error("[ndpr-toolkit] Error clearing consent settings:",t),false}},[n,o,g]);react.useEffect(()=>{l&&!r&&C();},[l,r,C]),react.useEffect(()=>{R&&(r||!l)&&y(w);},[w,R,l,r,y]);let f=chunkAME4HJR4_js.a("",m==null?void 0:m.root,h);if(typeof d=="function"){let t=d({loadSettings:C,saveSettings:y,clearSettings:N,loaded:r});return f?jsxRuntime.jsx("div",{className:f,children:t}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:t})}return f?jsxRuntime.jsx("div",{className:f,children:d}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:d})};exports.a=P;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
`),riskAssessment:t.riskAssessment,riskLevel:t.riskLevel,frequency:t.frequency,status:t.status,tiaCompleted:t.tiaCompleted,tiaReference:t.tiaReference||"",ndpcApprovalApplied:((o=t.ndpcApproval)==null?void 0:o.applied)||false,ndpcApprovalApproved:((u=t.ndpcApproval)==null?void 0:u.approved)||false,ndpcApprovalReference:((v=t.ndpcApproval)==null?void 0:v.referenceNumber)||""}),D(true);},[]),l=react.useCallback((t,a)=>{N(o=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},o),{[t]:a}));},[]),K=react.useCallback(()=>{let t=
|
|
3
|
-
`).map(o=>o.trim()).filter(Boolean),riskAssessment:i.riskAssessment.trim(),riskLevel:i.riskLevel,frequency:i.frequency,status:t&&!i.ndpcApprovalApproved?"pending_approval":i.status,tiaCompleted:i.tiaCompleted,tiaReference:i.tiaReference.trim()||void 0,ndpcApproval:t?{required:true,applied:i.ndpcApprovalApplied,approved:i.ndpcApprovalApproved||void 0,referenceNumber:i.ndpcApprovalReference.trim()||void 0,appliedAt:i.ndpcApprovalApplied?a:void 0,approvedAt:i.ndpcApprovalApproved?a:void 0}:void 0,startDate:a,reviewDate:a+365*24*60*60*1e3}},[i]),be=react.useCallback(()=>{let t=K(),a=chunkRFPLZDIO_js.a({id:h||"temp",createdAt:Date.now(),updatedAt:Date.now()},t),o=chunkYFBDJ4FH_js.g(a);G(o),o.isValid&&(h?S==null||S(h,t):y==null||y(t),_(),D(false));},[K,h,S,y,_]),Y=react.useCallback(()=>{_(),D(false);},[_]),ge=react.useCallback(t=>{k==null||k(t),f===t&&T(null);},[k,f]),Q=react.useCallback(t=>jsxRuntime.jsxs("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${ye[t]}`,r==null?void 0:r.riskBadge,d),children:[t.charAt(0).toUpperCase()+t.slice(1)," Risk"]}),[r==null?void 0:r.riskBadge,d]),W=react.useCallback(t=>jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${Se[t]}`,r==null?void 0:r.statusBadge,d),children:ke[t]}),[r==null?void 0:r.statusBadge,d]),he=react.useCallback(t=>{var u;chunkYFBDJ4FH_js.e(t);let o=((u=z.find(v=>v.value===t))==null?void 0:u.label)||t;return jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium ndpr-badge ndpr-badge--info",children:o})},[]),w=react.useMemo(()=>{var v,c;if(B)return B;let t=0,a=[],o=[],u=[];for(let s of g){let O=s.status==="active";O&&t++,(s.status==="pending_approval"||(v=s.ndpcApproval)!=null&&v.required&&!((c=s.ndpcApproval)!=null&&c.approved))&&a.push(s),s.riskLevel==="high"&&O&&o.push(s),!s.tiaCompleted&&O&&u.push(s);}return {totalActiveTransfers:t,pendingApproval:a,highRiskTransfers:o,missingTIA:u,byMechanism:{},byAdequacy:{},dueForReview:[],lastUpdated:Date.now()}},[B,g]),Ce=()=>jsxRuntime.jsxs("div",{"data-ndpr-component":"cross-border-transfer-manager",role:"status","aria-label":"Transfer compliance summary",className:chunkAME4HJR4_js.a("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",r==null?void 0:r.summary,d),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--info",r==null?void 0:r.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:w.totalActiveTransfers}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-info",children:"Active Transfers"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--info",r==null?void 0:r.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:w.pendingApproval.length}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-info",children:"Pending Approval"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--destructive",r==null?void 0:r.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-destructive",children:w.highRiskTransfers.length}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-destructive",children:"High Risk"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--warning",r==null?void 0:r.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:w.missingTIA.length}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-warning",children:"Missing TIA"})]})]}),_e=()=>{let t=chunkYFBDJ4FH_js.e(i.transferMechanism);return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",r==null?void 0:r.form,d),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex justify-between items-center mb-4",r==null?void 0:r.header,d),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:h?"Edit Transfer":"Add New Transfer"}),jsxRuntime.jsx("button",{onClick:Y,"aria-label":"Cancel form",className:"text-gray-600 hover:ndpr-text-muted dark:hover:text-gray-200",children:"Cancel"})]}),C&&!C.isValid&&jsxRuntime.jsxs("div",{id:"cb-form-errors",role:"alert",className:"ndpr-alert ndpr-alert--destructive",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-destructive",children:C.errors.map((a,o)=>jsxRuntime.jsx("li",{children:a},o))})]}),C&&C.warnings.length>0&&jsxRuntime.jsxs("div",{id:"cb-form-warnings",role:"alert",className:"ndpr-alert ndpr-alert--warning",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Warnings:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:C.warnings.map((a,o)=>jsxRuntime.jsx("li",{children:a},o))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-destinationCountry",className:"ndpr-form-field__label",children:["Destination Country ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-destinationCountry",type:"text",value:i.destinationCountry,onChange:a=>l("destinationCountry",a.target.value),placeholder:"e.g. United Kingdom","aria-required":"true","aria-describedby":"cb-form-errors","aria-label":"Destination country",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-destinationCountryCode",className:"ndpr-form-field__label",children:"Country Code (ISO)"}),jsxRuntime.jsx("input",{id:"cb-destinationCountryCode",type:"text",value:i.destinationCountryCode,onChange:a=>l("destinationCountryCode",a.target.value),placeholder:"e.g. GB",maxLength:3,"aria-label":"Country code in ISO format",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-recipientOrganization",className:"ndpr-form-field__label",children:["Recipient Organization ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-recipientOrganization",type:"text",value:i.recipientOrganization,onChange:a=>l("recipientOrganization",a.target.value),placeholder:"Organization name","aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-transferMechanism",className:"ndpr-form-field__label",children:["Transfer Mechanism ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("select",{id:"cb-transferMechanism",value:i.transferMechanism,onChange:a=>l("transferMechanism",a.target.value),"aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:z.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-adequacyStatus",className:"ndpr-form-field__label",children:"Adequacy Status"}),jsxRuntime.jsx("select",{id:"cb-adequacyStatus",value:i.adequacyStatus,onChange:a=>l("adequacyStatus",a.target.value),"aria-label":"Select adequacy status of destination country",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:ae.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-riskLevel",className:"ndpr-form-field__label",children:"Risk Level"}),jsxRuntime.jsxs("select",{id:"cb-transfer-riskLevel",value:i.riskLevel,onChange:a=>l("riskLevel",a.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsxRuntime.jsx("option",{value:"low",children:"Low"}),jsxRuntime.jsx("option",{value:"medium",children:"Medium"}),jsxRuntime.jsx("option",{value:"high",children:"High"})]})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-dataCategories",className:"ndpr-form-field__label",children:["Data Categories ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-dataCategories",type:"text",value:i.dataCategories,onChange:a=>l("dataCategories",a.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers","aria-required":"true","aria-describedby":"cb-dataCategories-help",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)}),jsxRuntime.jsx("p",{id:"cb-dataCategories-help",className:"text-xs text-gray-500 mt-1",children:"Separate categories with commas"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:i.includesSensitiveData,onChange:a=>l("includesSensitiveData",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"includesSensitiveData",className:"ndpr-text-sm ndpr-font-medium",children:"Includes sensitive personal data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-estimatedDataSubjects",className:"ndpr-form-field__label",children:"Estimated Data Subjects"}),jsxRuntime.jsx("input",{id:"cb-transfer-estimatedDataSubjects",type:"number",value:i.estimatedDataSubjects,onChange:a=>l("estimatedDataSubjects",a.target.value),placeholder:"Number of data subjects",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-recipientContactName",className:"ndpr-form-field__label",children:["Recipient Contact Name ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-recipientContactName",type:"text",value:i.recipientContactName,onChange:a=>l("recipientContactName",a.target.value),placeholder:"Contact person name","aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-recipientContactEmail",className:"ndpr-form-field__label",children:["Recipient Contact Email ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-recipientContactEmail",type:"email",value:i.recipientContactEmail,onChange:a=>l("recipientContactEmail",a.target.value),placeholder:"contact@example.com","aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-recipientContactPhone",className:"ndpr-form-field__label",children:"Recipient Contact Phone"}),jsxRuntime.jsx("input",{id:"cb-transfer-recipientContactPhone",type:"text",value:i.recipientContactPhone,onChange:a=>l("recipientContactPhone",a.target.value),placeholder:"Phone number",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-recipientContactAddress",className:"ndpr-form-field__label",children:"Recipient Contact Address"}),jsxRuntime.jsx("input",{id:"cb-transfer-recipientContactAddress",type:"text",value:i.recipientContactAddress,onChange:a=>l("recipientContactAddress",a.target.value),placeholder:"Address",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-purpose",className:"ndpr-form-field__label",children:["Purpose of Transfer ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"cb-purpose",value:i.purpose,onChange:a=>l("purpose",a.target.value),placeholder:"Describe the purpose of this data transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-safeguards",className:"ndpr-form-field__label",children:["Safeguards ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"cb-safeguards",value:i.safeguards,onChange:a=>l("safeguards",a.target.value),placeholder:`One safeguard per line, e.g.
|
|
1
|
+
'use strict';var chunkUSD363RW_js=require('./chunk-USD363RW.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkI5ZDNSX5_js=require('./chunk-I5ZDNSX5.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var z=[{value:"adequacy_decision",label:"Adequacy Decision (Section 42)"},{value:"standard_clauses",label:"Standard Contractual Clauses (Section 41(1)(a))"},{value:"binding_corporate_rules",label:"Binding Corporate Rules (Section 41(1)(a))"},{value:"ndpc_authorization",label:"NDPC Authorization (Section 42(5))"},{value:"explicit_consent",label:"Explicit Consent (Section 43(1)(a))"},{value:"contract_performance",label:"Contract Performance (Section 43(1)(b))"},{value:"public_interest",label:"Public Interest (Section 43(1)(d))"},{value:"legal_claims",label:"Legal Claims (Section 43(1)(e))"},{value:"vital_interests",label:"Vital Interests (Section 43(1)(f))"}],ae=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],ne=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],ie=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],ye={low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--destructive"},Se={active:"ndpr-badge ndpr-badge--success",suspended:"ndpr-badge ndpr-badge--warning",terminated:"ndpr-badge ndpr-badge--neutral",pending_approval:"ndpr-badge ndpr-badge--info"},ke={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"},de={destinationCountry:"",destinationCountryCode:"",adequacyStatus:"unknown",transferMechanism:"adequacy_decision",dataCategories:"",includesSensitiveData:false,estimatedDataSubjects:"",recipientOrganization:"",recipientContactName:"",recipientContactEmail:"",recipientContactPhone:"",recipientContactAddress:"",purpose:"",safeguards:"",riskAssessment:"",riskLevel:"medium",frequency:"one_time",status:"active",tiaCompleted:false,tiaReference:"",ndpcApprovalApplied:false,ndpcApprovalApproved:false,ndpcApprovalReference:""},Be=({transfers:g,onAdd:y,onUpdate:S,onArchive:k,summary:B,title:M,description:P,className:pe="",buttonClassName:I="",showSummary:oe=true,showTIA:le=true,classNames:r,unstyled:d})=>{var J,X;let $=chunkI5ZDNSX5_js.c(),se=(J=M!=null?M:$.crossBorder.title)!=null?J:"Cross-Border Data Transfer Manager",ce=(X=P!=null?P:$.crossBorder.description)!=null?X:"Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VIII (Sections 41-43).",[f,T]=react.useState(null),[V,D]=react.useState(false),[h,U]=react.useState(null),[i,N]=react.useState(de),[C,G]=react.useState(null),[R,ue]=react.useState("all"),[q,me]=react.useState("all"),x=react.useMemo(()=>{let t=[...g];return R!=="all"&&(t=t.filter(a=>a.status===R)),q!=="all"&&(t=t.filter(a=>a.transferMechanism===q)),t.sort((a,o)=>o.updatedAt-a.updatedAt),t},[g,R,q]);react.useEffect(()=>{x.length>0&&!f&&T(x[0].id);},[x,f]);let H=react.useMemo(()=>{var t;return f&&(t=g.find(a=>a.id===f))!=null?t:null},[g,f]),A=react.useCallback(t=>new Date(t).toLocaleDateString(),[]),_=react.useCallback(()=>{N(de),U(null),G(null);},[]),ve=react.useCallback(()=>{_(),D(true);},[_]),fe=react.useCallback(t=>{var a,o,u,v;U(t.id),N({destinationCountry:t.destinationCountry,destinationCountryCode:t.destinationCountryCode||"",adequacyStatus:t.adequacyStatus,transferMechanism:t.transferMechanism,dataCategories:t.dataCategories.join(", "),includesSensitiveData:t.includesSensitiveData,estimatedDataSubjects:((a=t.estimatedDataSubjects)==null?void 0:a.toString())||"",recipientOrganization:t.recipientOrganization,recipientContactName:t.recipientContact.name,recipientContactEmail:t.recipientContact.email,recipientContactPhone:t.recipientContact.phone||"",recipientContactAddress:t.recipientContact.address||"",purpose:t.purpose,safeguards:t.safeguards.join(`
|
|
2
|
+
`),riskAssessment:t.riskAssessment,riskLevel:t.riskLevel,frequency:t.frequency,status:t.status,tiaCompleted:t.tiaCompleted,tiaReference:t.tiaReference||"",ndpcApprovalApplied:((o=t.ndpcApproval)==null?void 0:o.applied)||false,ndpcApprovalApproved:((u=t.ndpcApproval)==null?void 0:u.approved)||false,ndpcApprovalReference:((v=t.ndpcApproval)==null?void 0:v.referenceNumber)||""}),D(true);},[]),l=react.useCallback((t,a)=>{N(o=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},o),{[t]:a}));},[]),K=react.useCallback(()=>{let t=chunkUSD363RW_js.f(i.transferMechanism),a=Date.now();return {destinationCountry:i.destinationCountry.trim(),destinationCountryCode:i.destinationCountryCode.trim()||void 0,adequacyStatus:i.adequacyStatus,transferMechanism:i.transferMechanism,dataCategories:i.dataCategories.split(",").map(o=>o.trim()).filter(Boolean),includesSensitiveData:i.includesSensitiveData,estimatedDataSubjects:i.estimatedDataSubjects?parseInt(i.estimatedDataSubjects,10):void 0,recipientOrganization:i.recipientOrganization.trim(),recipientContact:{name:i.recipientContactName.trim(),email:i.recipientContactEmail.trim(),phone:i.recipientContactPhone.trim()||void 0,address:i.recipientContactAddress.trim()||void 0},purpose:i.purpose.trim(),safeguards:i.safeguards.split(`
|
|
3
|
+
`).map(o=>o.trim()).filter(Boolean),riskAssessment:i.riskAssessment.trim(),riskLevel:i.riskLevel,frequency:i.frequency,status:t&&!i.ndpcApprovalApproved?"pending_approval":i.status,tiaCompleted:i.tiaCompleted,tiaReference:i.tiaReference.trim()||void 0,ndpcApproval:t?{required:true,applied:i.ndpcApprovalApplied,approved:i.ndpcApprovalApproved||void 0,referenceNumber:i.ndpcApprovalReference.trim()||void 0,appliedAt:i.ndpcApprovalApplied?a:void 0,approvedAt:i.ndpcApprovalApproved?a:void 0}:void 0,startDate:a,reviewDate:a+365*24*60*60*1e3}},[i]),be=react.useCallback(()=>{let t=K(),a=chunkRFPLZDIO_js.a({id:h||"temp",createdAt:Date.now(),updatedAt:Date.now()},t),o=chunkUSD363RW_js.h(a);G(o),o.isValid&&(h?S==null||S(h,t):y==null||y(t),_(),D(false));},[K,h,S,y,_]),Y=react.useCallback(()=>{_(),D(false);},[_]),ge=react.useCallback(t=>{k==null||k(t),f===t&&T(null);},[k,f]),Q=react.useCallback(t=>jsxRuntime.jsxs("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${ye[t]}`,r==null?void 0:r.riskBadge,d),children:[t.charAt(0).toUpperCase()+t.slice(1)," Risk"]}),[r==null?void 0:r.riskBadge,d]),W=react.useCallback(t=>jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${Se[t]}`,r==null?void 0:r.statusBadge,d),children:ke[t]}),[r==null?void 0:r.statusBadge,d]),he=react.useCallback(t=>{var u;chunkUSD363RW_js.f(t);let o=((u=z.find(v=>v.value===t))==null?void 0:u.label)||t;return jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium ndpr-badge ndpr-badge--info",children:o})},[]),w=react.useMemo(()=>{var v,c;if(B)return B;let t=0,a=[],o=[],u=[];for(let s of g){let O=s.status==="active";O&&t++,(s.status==="pending_approval"||(v=s.ndpcApproval)!=null&&v.required&&!((c=s.ndpcApproval)!=null&&c.approved))&&a.push(s),s.riskLevel==="high"&&O&&o.push(s),!s.tiaCompleted&&O&&u.push(s);}return {totalActiveTransfers:t,pendingApproval:a,highRiskTransfers:o,missingTIA:u,byMechanism:{},byAdequacy:{},dueForReview:[],lastUpdated:Date.now()}},[B,g]),Ce=()=>jsxRuntime.jsxs("div",{"data-ndpr-component":"cross-border-transfer-manager",role:"status","aria-label":"Transfer compliance summary",className:chunkAME4HJR4_js.a("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",r==null?void 0:r.summary,d),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--info",r==null?void 0:r.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:w.totalActiveTransfers}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-info",children:"Active Transfers"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--info",r==null?void 0:r.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:w.pendingApproval.length}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-info",children:"Pending Approval"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--destructive",r==null?void 0:r.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-destructive",children:w.highRiskTransfers.length}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-destructive",children:"High Risk"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--warning",r==null?void 0:r.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:w.missingTIA.length}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-warning",children:"Missing TIA"})]})]}),_e=()=>{let t=chunkUSD363RW_js.f(i.transferMechanism);return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",r==null?void 0:r.form,d),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex justify-between items-center mb-4",r==null?void 0:r.header,d),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:h?"Edit Transfer":"Add New Transfer"}),jsxRuntime.jsx("button",{onClick:Y,"aria-label":"Cancel form",className:"text-gray-600 hover:ndpr-text-muted dark:hover:text-gray-200",children:"Cancel"})]}),C&&!C.isValid&&jsxRuntime.jsxs("div",{id:"cb-form-errors",role:"alert",className:"ndpr-alert ndpr-alert--destructive",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-destructive",children:C.errors.map((a,o)=>jsxRuntime.jsx("li",{children:a},o))})]}),C&&C.warnings.length>0&&jsxRuntime.jsxs("div",{id:"cb-form-warnings",role:"alert",className:"ndpr-alert ndpr-alert--warning",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Warnings:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:C.warnings.map((a,o)=>jsxRuntime.jsx("li",{children:a},o))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-destinationCountry",className:"ndpr-form-field__label",children:["Destination Country ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-destinationCountry",type:"text",value:i.destinationCountry,onChange:a=>l("destinationCountry",a.target.value),placeholder:"e.g. United Kingdom","aria-required":"true","aria-describedby":"cb-form-errors","aria-label":"Destination country",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-destinationCountryCode",className:"ndpr-form-field__label",children:"Country Code (ISO)"}),jsxRuntime.jsx("input",{id:"cb-destinationCountryCode",type:"text",value:i.destinationCountryCode,onChange:a=>l("destinationCountryCode",a.target.value),placeholder:"e.g. GB",maxLength:3,"aria-label":"Country code in ISO format",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-recipientOrganization",className:"ndpr-form-field__label",children:["Recipient Organization ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-recipientOrganization",type:"text",value:i.recipientOrganization,onChange:a=>l("recipientOrganization",a.target.value),placeholder:"Organization name","aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-transferMechanism",className:"ndpr-form-field__label",children:["Transfer Mechanism ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("select",{id:"cb-transferMechanism",value:i.transferMechanism,onChange:a=>l("transferMechanism",a.target.value),"aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:z.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-adequacyStatus",className:"ndpr-form-field__label",children:"Adequacy Status"}),jsxRuntime.jsx("select",{id:"cb-adequacyStatus",value:i.adequacyStatus,onChange:a=>l("adequacyStatus",a.target.value),"aria-label":"Select adequacy status of destination country",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:ae.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-riskLevel",className:"ndpr-form-field__label",children:"Risk Level"}),jsxRuntime.jsxs("select",{id:"cb-transfer-riskLevel",value:i.riskLevel,onChange:a=>l("riskLevel",a.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsxRuntime.jsx("option",{value:"low",children:"Low"}),jsxRuntime.jsx("option",{value:"medium",children:"Medium"}),jsxRuntime.jsx("option",{value:"high",children:"High"})]})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-dataCategories",className:"ndpr-form-field__label",children:["Data Categories ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-dataCategories",type:"text",value:i.dataCategories,onChange:a=>l("dataCategories",a.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers","aria-required":"true","aria-describedby":"cb-dataCategories-help",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)}),jsxRuntime.jsx("p",{id:"cb-dataCategories-help",className:"text-xs text-gray-500 mt-1",children:"Separate categories with commas"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:i.includesSensitiveData,onChange:a=>l("includesSensitiveData",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"includesSensitiveData",className:"ndpr-text-sm ndpr-font-medium",children:"Includes sensitive personal data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-estimatedDataSubjects",className:"ndpr-form-field__label",children:"Estimated Data Subjects"}),jsxRuntime.jsx("input",{id:"cb-transfer-estimatedDataSubjects",type:"number",value:i.estimatedDataSubjects,onChange:a=>l("estimatedDataSubjects",a.target.value),placeholder:"Number of data subjects",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-recipientContactName",className:"ndpr-form-field__label",children:["Recipient Contact Name ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-recipientContactName",type:"text",value:i.recipientContactName,onChange:a=>l("recipientContactName",a.target.value),placeholder:"Contact person name","aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-recipientContactEmail",className:"ndpr-form-field__label",children:["Recipient Contact Email ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-recipientContactEmail",type:"email",value:i.recipientContactEmail,onChange:a=>l("recipientContactEmail",a.target.value),placeholder:"contact@example.com","aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-recipientContactPhone",className:"ndpr-form-field__label",children:"Recipient Contact Phone"}),jsxRuntime.jsx("input",{id:"cb-transfer-recipientContactPhone",type:"text",value:i.recipientContactPhone,onChange:a=>l("recipientContactPhone",a.target.value),placeholder:"Phone number",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-recipientContactAddress",className:"ndpr-form-field__label",children:"Recipient Contact Address"}),jsxRuntime.jsx("input",{id:"cb-transfer-recipientContactAddress",type:"text",value:i.recipientContactAddress,onChange:a=>l("recipientContactAddress",a.target.value),placeholder:"Address",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-purpose",className:"ndpr-form-field__label",children:["Purpose of Transfer ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"cb-purpose",value:i.purpose,onChange:a=>l("purpose",a.target.value),placeholder:"Describe the purpose of this data transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-safeguards",className:"ndpr-form-field__label",children:["Safeguards ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"cb-safeguards",value:i.safeguards,onChange:a=>l("safeguards",a.target.value),placeholder:`One safeguard per line, e.g.
|
|
4
4
|
End-to-end encryption
|
|
5
5
|
Access control policies
|
|
6
|
-
Regular security audits`,rows:3,"aria-required":"true","aria-describedby":"cb-safeguards-help",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)}),jsxRuntime.jsx("p",{id:"cb-safeguards-help",className:"text-xs text-gray-500 mt-1",children:"Enter one safeguard per line"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-riskAssessment",className:"ndpr-form-field__label",children:["Risk Assessment Summary ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"cb-riskAssessment",value:i.riskAssessment,onChange:a=>l("riskAssessment",a.target.value),placeholder:"Summarize the risk assessment for this transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-frequency",className:"ndpr-form-field__label",children:"Transfer Frequency"}),jsxRuntime.jsx("select",{id:"cb-transfer-frequency",value:i.frequency,onChange:a=>l("frequency",a.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:ne.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-status",className:"ndpr-form-field__label",children:"Status"}),jsxRuntime.jsx("select",{id:"cb-transfer-status",value:i.status,onChange:a=>l("status",a.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:ie.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]})]}),t&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium ndpr-text-info mb-3",children:"NDPC Approval Required"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-info mb-3",children:"The selected transfer mechanism requires approval from the Nigeria Data Protection Commission."}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:i.ndpcApprovalApplied,onChange:a=>l("ndpcApprovalApplied",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApplied",className:"ndpr-text-sm",children:"Application submitted"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:i.ndpcApprovalApproved,onChange:a=>l("ndpcApprovalApproved",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApproved",className:"ndpr-text-sm",children:"Approval granted"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-ndpcApprovalReference",className:"ndpr-form-field__label",children:"NDPC Reference Number"}),jsxRuntime.jsx("input",{id:"cb-transfer-ndpcApprovalReference",type:"text",value:i.ndpcApprovalReference,onChange:a=>l("ndpcApprovalReference",a.target.value),placeholder:"Reference number (if available)",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]})]})]}),le&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-gray-100 dark:bg-gray-600 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium mb-3",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"tiaCompleted",checked:i.tiaCompleted,onChange:a=>l("tiaCompleted",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"tiaCompleted",className:"ndpr-text-sm",children:"TIA completed"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-tiaReference",className:"ndpr-form-field__label",children:"TIA Reference"}),jsxRuntime.jsx("input",{id:"cb-transfer-tiaReference",type:"text",value:i.tiaReference,onChange:a=>l("tiaReference",a.target.value),placeholder:"Document reference",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]})]})]}),jsxRuntime.jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[jsxRuntime.jsx("button",{onClick:Y,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:be,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${I}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),d),children:h?"Update Transfer":"Add Transfer"})]})]})},xe=t=>{var u,v;let a=chunkYFBDJ4FH_js.h(t),o=chunkYFBDJ4FH_js.g(t);return jsxRuntime.jsxs("div",{role:"status","aria-label":"Transfer details",className:chunkAME4HJR4_js.a("",r==null?void 0:r.detailPanel,d),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsxs("h3",{className:"ndpr-section-heading",children:[t.destinationCountry," \u2014 ",t.recipientOrganization]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[W(t.status),Q(t.riskLevel)]})]}),!o.isValid&&jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Compliance Issues"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-destructive",children:o.errors.map((c,s)=>jsxRuntime.jsx("li",{children:c},s))})]}),o.warnings.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Warnings"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:o.warnings.map((c,s)=>jsxRuntime.jsx("li",{children:c},s))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Destination:"})," ",t.destinationCountry,t.destinationCountryCode?` (${t.destinationCountryCode})`:""]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(u=ae.find(c=>c.value===t.adequacyStatus))==null?void 0:u.label]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Frequency:"})," ",(v=ne.find(c=>c.value===t.frequency))==null?void 0:v.label]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Start Date:"})," ",A(t.startDate)]}),t.endDate&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"End Date:"})," ",A(t.endDate)]}),t.reviewDate&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next Review:"})," ",A(t.reviewDate)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Recipient:"})," ",t.recipientOrganization]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Contact:"})," ",t.recipientContact.name," (",t.recipientContact.email,")"]}),t.estimatedDataSubjects&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",t.estimatedDataSubjects.toLocaleString()]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",t.includesSensitiveData?"Yes":"No"]})]})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Transfer Mechanism"}),jsxRuntime.jsx("div",{className:"ndpr-panel",children:jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:chunkYFBDJ4FH_js.f(t.transferMechanism)})})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Purpose"}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-muted bg-gray-50 dark:bg-gray-700 p-2 rounded-md",children:t.purpose})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Data Categories"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:t.dataCategories.map((c,s)=>jsxRuntime.jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs",children:c},s))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Safeguards"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-muted",children:t.safeguards.map((c,s)=>jsxRuntime.jsx("li",{children:c},s))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Risk Assessment"}),jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2",children:t.riskAssessment}),jsxRuntime.jsxs("div",{className:"mt-2",role:"status","aria-label":"Automated risk assessment result",children:[jsxRuntime.jsxs("p",{className:"text-xs font-medium ndpr-text-muted mb-1",children:["Automated Assessment (Score: ",a.riskScore,")"]}),a.factors.length>0&&jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs ndpr-text-muted",children:a.factors.map((c,s)=>jsxRuntime.jsx("li",{children:c},s))}),a.recommendations.length>0&&jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium ndpr-text-muted mb-1",children:"Recommendations:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs ndpr-text-muted",children:a.recommendations.map((c,s)=>jsxRuntime.jsx("li",{children:c},s))})]})]})]})]}),t.ndpcApproval&&jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"NDPC Approval"}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`p-3 rounded-md ${t.ndpcApproval.approved?"ndpr-alert ndpr-alert--success":t.ndpcApproval.applied?"ndpr-alert ndpr-alert--warning":"ndpr-alert ndpr-alert--destructive"}`,r==null?void 0:r.approvalStatus,d),children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",t.ndpcApproval.approved?"Approved":t.ndpcApproval.applied?"Application Submitted":"Not Applied"]}),t.ndpcApproval.referenceNumber&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",t.ndpcApproval.referenceNumber]}),t.ndpcApproval.appliedAt&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Applied:"})," ",A(t.ndpcApproval.appliedAt)]}),t.ndpcApproval.approvedAt&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Approved:"})," ",A(t.ndpcApproval.approvedAt)]})]})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:`p-3 rounded-md ${t.tiaCompleted?"ndpr-alert ndpr-alert--success":"ndpr-alert ndpr-alert--warning"}`,children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",t.tiaCompleted?"Completed":"Not Completed"]}),t.tiaReference&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",t.tiaReference]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-3 mt-6",children:[jsxRuntime.jsx("button",{onClick:()=>fe(t),"aria-label":`Edit transfer to ${t.destinationCountry}`,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${I}`,children:"Edit"}),jsxRuntime.jsx("button",{onClick:()=>ge(t.id),"aria-label":`Remove transfer to ${t.destinationCountry}`,className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Remove"})]})]})};return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${pe}`,r==null?void 0:r.root,d),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.title,d),children:se}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:ce}),oe&&Ce(),!V&&jsxRuntime.jsx("div",{className:"mb-6",children:jsxRuntime.jsx("button",{onClick:ve,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${I}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),d),children:"Add Transfer"})}),V&&_e(),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbStatusFilter",className:"ndpr-form-field__label",children:"Status Filter"}),jsxRuntime.jsxs("select",{id:"cbStatusFilter",value:R,onChange:t=>ue(t.target.value),"aria-label":"Filter transfers by status",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),ie.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbMechanismFilter",className:"ndpr-form-field__label",children:"Mechanism Filter"}),jsxRuntime.jsxs("select",{id:"cbMechanismFilter",value:q,onChange:t=>me(t.target.value),"aria-label":"Filter transfers by mechanism",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsxRuntime.jsx("option",{value:"all",children:"All Mechanisms"}),z.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"md:col-span-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Transfers"}),x.length===0?jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:"No cross-border transfers found."}):jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",r==null?void 0:r.transferList,d),children:x.map(t=>{var a,o;return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`p-3 rounded-md cursor-pointer ${f===t.id?"ndpr-alert ndpr-alert--info":"ndpr-panel"}`,r==null?void 0:r.transferItem,d),role:"button",tabIndex:0,"aria-label":`View transfer to ${t.destinationCountry}`,onClick:()=>T(t.id),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),T(t.id));},children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:t.destinationCountry}),Q(t.riskLevel)]}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mb-1",children:t.recipientOrganization}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mb-1",children:he(t.transferMechanism)}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[W(t.status),((a=t.ndpcApproval)==null?void 0:a.required)&&!((o=t.ndpcApproval)!=null&&o.approved)&&jsxRuntime.jsx("span",{className:"text-xs ndpr-text-info",children:"NDPC Pending"})]})]},t.id)})})]}),jsxRuntime.jsx("div",{className:"md:col-span-2",children:H?xe(H):jsxRuntime.jsx("div",{className:"ndpr-empty-state",children:jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:"Select a transfer to view details"})})})]})]})};exports.a=Be;
|
|
6
|
+
Regular security audits`,rows:3,"aria-required":"true","aria-describedby":"cb-safeguards-help",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)}),jsxRuntime.jsx("p",{id:"cb-safeguards-help",className:"text-xs text-gray-500 mt-1",children:"Enter one safeguard per line"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-riskAssessment",className:"ndpr-form-field__label",children:["Risk Assessment Summary ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"cb-riskAssessment",value:i.riskAssessment,onChange:a=>l("riskAssessment",a.target.value),placeholder:"Summarize the risk assessment for this transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-frequency",className:"ndpr-form-field__label",children:"Transfer Frequency"}),jsxRuntime.jsx("select",{id:"cb-transfer-frequency",value:i.frequency,onChange:a=>l("frequency",a.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:ne.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-status",className:"ndpr-form-field__label",children:"Status"}),jsxRuntime.jsx("select",{id:"cb-transfer-status",value:i.status,onChange:a=>l("status",a.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:ie.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]})]}),t&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium ndpr-text-info mb-3",children:"NDPC Approval Required"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-info mb-3",children:"The selected transfer mechanism requires approval from the Nigeria Data Protection Commission."}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:i.ndpcApprovalApplied,onChange:a=>l("ndpcApprovalApplied",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApplied",className:"ndpr-text-sm",children:"Application submitted"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:i.ndpcApprovalApproved,onChange:a=>l("ndpcApprovalApproved",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApproved",className:"ndpr-text-sm",children:"Approval granted"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-ndpcApprovalReference",className:"ndpr-form-field__label",children:"NDPC Reference Number"}),jsxRuntime.jsx("input",{id:"cb-transfer-ndpcApprovalReference",type:"text",value:i.ndpcApprovalReference,onChange:a=>l("ndpcApprovalReference",a.target.value),placeholder:"Reference number (if available)",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]})]})]}),le&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-gray-100 dark:bg-gray-600 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium mb-3",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"tiaCompleted",checked:i.tiaCompleted,onChange:a=>l("tiaCompleted",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"tiaCompleted",className:"ndpr-text-sm",children:"TIA completed"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-tiaReference",className:"ndpr-form-field__label",children:"TIA Reference"}),jsxRuntime.jsx("input",{id:"cb-transfer-tiaReference",type:"text",value:i.tiaReference,onChange:a=>l("tiaReference",a.target.value),placeholder:"Document reference",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]})]})]}),jsxRuntime.jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[jsxRuntime.jsx("button",{onClick:Y,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:be,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${I}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),d),children:h?"Update Transfer":"Add Transfer"})]})]})},xe=t=>{var u,v;let a=chunkUSD363RW_js.i(t),o=chunkUSD363RW_js.h(t);return jsxRuntime.jsxs("div",{role:"status","aria-label":"Transfer details",className:chunkAME4HJR4_js.a("",r==null?void 0:r.detailPanel,d),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsxs("h3",{className:"ndpr-section-heading",children:[t.destinationCountry," \u2014 ",t.recipientOrganization]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[W(t.status),Q(t.riskLevel)]})]}),!o.isValid&&jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Compliance Issues"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-destructive",children:o.errors.map((c,s)=>jsxRuntime.jsx("li",{children:c},s))})]}),o.warnings.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Warnings"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:o.warnings.map((c,s)=>jsxRuntime.jsx("li",{children:c},s))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Destination:"})," ",t.destinationCountry,t.destinationCountryCode?` (${t.destinationCountryCode})`:""]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(u=ae.find(c=>c.value===t.adequacyStatus))==null?void 0:u.label]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Frequency:"})," ",(v=ne.find(c=>c.value===t.frequency))==null?void 0:v.label]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Start Date:"})," ",A(t.startDate)]}),t.endDate&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"End Date:"})," ",A(t.endDate)]}),t.reviewDate&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next Review:"})," ",A(t.reviewDate)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Recipient:"})," ",t.recipientOrganization]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Contact:"})," ",t.recipientContact.name," (",t.recipientContact.email,")"]}),t.estimatedDataSubjects&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",t.estimatedDataSubjects.toLocaleString()]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",t.includesSensitiveData?"Yes":"No"]})]})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Transfer Mechanism"}),jsxRuntime.jsx("div",{className:"ndpr-panel",children:jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:chunkUSD363RW_js.g(t.transferMechanism)})})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Purpose"}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-muted bg-gray-50 dark:bg-gray-700 p-2 rounded-md",children:t.purpose})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Data Categories"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:t.dataCategories.map((c,s)=>jsxRuntime.jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs",children:c},s))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Safeguards"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-muted",children:t.safeguards.map((c,s)=>jsxRuntime.jsx("li",{children:c},s))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Risk Assessment"}),jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2",children:t.riskAssessment}),jsxRuntime.jsxs("div",{className:"mt-2",role:"status","aria-label":"Automated risk assessment result",children:[jsxRuntime.jsxs("p",{className:"text-xs font-medium ndpr-text-muted mb-1",children:["Automated Assessment (Score: ",a.riskScore,")"]}),a.factors.length>0&&jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs ndpr-text-muted",children:a.factors.map((c,s)=>jsxRuntime.jsx("li",{children:c},s))}),a.recommendations.length>0&&jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium ndpr-text-muted mb-1",children:"Recommendations:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs ndpr-text-muted",children:a.recommendations.map((c,s)=>jsxRuntime.jsx("li",{children:c},s))})]})]})]})]}),t.ndpcApproval&&jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"NDPC Approval"}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`p-3 rounded-md ${t.ndpcApproval.approved?"ndpr-alert ndpr-alert--success":t.ndpcApproval.applied?"ndpr-alert ndpr-alert--warning":"ndpr-alert ndpr-alert--destructive"}`,r==null?void 0:r.approvalStatus,d),children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",t.ndpcApproval.approved?"Approved":t.ndpcApproval.applied?"Application Submitted":"Not Applied"]}),t.ndpcApproval.referenceNumber&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",t.ndpcApproval.referenceNumber]}),t.ndpcApproval.appliedAt&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Applied:"})," ",A(t.ndpcApproval.appliedAt)]}),t.ndpcApproval.approvedAt&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Approved:"})," ",A(t.ndpcApproval.approvedAt)]})]})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:`p-3 rounded-md ${t.tiaCompleted?"ndpr-alert ndpr-alert--success":"ndpr-alert ndpr-alert--warning"}`,children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",t.tiaCompleted?"Completed":"Not Completed"]}),t.tiaReference&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",t.tiaReference]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-3 mt-6",children:[jsxRuntime.jsx("button",{onClick:()=>fe(t),"aria-label":`Edit transfer to ${t.destinationCountry}`,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${I}`,children:"Edit"}),jsxRuntime.jsx("button",{onClick:()=>ge(t.id),"aria-label":`Remove transfer to ${t.destinationCountry}`,className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Remove"})]})]})};return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${pe}`,r==null?void 0:r.root,d),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.title,d),children:se}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:ce}),oe&&Ce(),!V&&jsxRuntime.jsx("div",{className:"mb-6",children:jsxRuntime.jsx("button",{onClick:ve,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${I}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),d),children:"Add Transfer"})}),V&&_e(),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbStatusFilter",className:"ndpr-form-field__label",children:"Status Filter"}),jsxRuntime.jsxs("select",{id:"cbStatusFilter",value:R,onChange:t=>ue(t.target.value),"aria-label":"Filter transfers by status",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),ie.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbMechanismFilter",className:"ndpr-form-field__label",children:"Mechanism Filter"}),jsxRuntime.jsxs("select",{id:"cbMechanismFilter",value:q,onChange:t=>me(t.target.value),"aria-label":"Filter transfers by mechanism",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsxRuntime.jsx("option",{value:"all",children:"All Mechanisms"}),z.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"md:col-span-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Transfers"}),x.length===0?jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:"No cross-border transfers found."}):jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",r==null?void 0:r.transferList,d),children:x.map(t=>{var a,o;return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`p-3 rounded-md cursor-pointer ${f===t.id?"ndpr-alert ndpr-alert--info":"ndpr-panel"}`,r==null?void 0:r.transferItem,d),role:"button",tabIndex:0,"aria-label":`View transfer to ${t.destinationCountry}`,onClick:()=>T(t.id),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),T(t.id));},children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:t.destinationCountry}),Q(t.riskLevel)]}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mb-1",children:t.recipientOrganization}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mb-1",children:he(t.transferMechanism)}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[W(t.status),((a=t.ndpcApproval)==null?void 0:a.required)&&!((o=t.ndpcApproval)!=null&&o.approved)&&jsxRuntime.jsx("span",{className:"text-xs ndpr-text-info",children:"NDPC Pending"})]})]},t.id)})})]}),jsxRuntime.jsx("div",{className:"md:col-span-2",children:H?xe(H):jsxRuntime.jsx("div",{className:"ndpr-empty-state",children:jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:"Select a transfer to view details"})})})]})]})};exports.a=Be;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkUSD363RW_js=require('./chunk-USD363RW.js'),chunkVWED6UTN_js=require('./chunk-VWED6UTN.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react');function H(T,l){return l?chunkVWED6UTN_js.a(T):{load:()=>null,save:()=>{},remove:()=>{}}}function X({initialTransfers:T=[],adapter:l,storageKey:x="ndpr_cross_border_transfers",useLocalStorage:M=true,onAdd:v,onUpdate:C,onRemove:B}={}){let S=l!=null?l:H(x,M),A=react.useRef(S);A.current=S;let[a,D]=react.useState(T),[k,p]=react.useState(true),m=react.useRef(T),o=react.useCallback(r=>{m.current=r,D(r);},[]);react.useEffect(()=>{let r=false;try{let e=A.current.load();e instanceof Promise?e.then(t=>{r||(t&&o(t),p(!1));},()=>{r||p(!1);}):(e&&o(e),p(!1));}catch(e){r||p(false);}return ()=>{r=true;}},[o]);let f=react.useCallback(r=>{Promise.resolve(A.current.save(r)).catch(e=>{console.warn("[ndpr-toolkit] Failed to save cross-border transfers:",e);});},[]),I=()=>"cbt_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),L=react.useCallback(r=>{let e=Date.now(),t=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},r),{id:I(),createdAt:e,updatedAt:e}),n=[...m.current,t];return o(n),f(n),v&&v(t),t},[v,o,f]),U=react.useCallback((r,e)=>{let t=m.current,n=t.findIndex(h=>h.id===r);if(n===-1)return null;let i=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},t[n]),e),{updatedAt:Date.now()}),c=[...t];return c[n]=i,o(c),f(c),C&&C(i),i},[C,o,f]),O=react.useCallback(r=>{let e=m.current;if(e.findIndex(i=>i.id===r)===-1)return;let n=e.filter(i=>i.id!==r);o(n),f(n),B&&B(r);},[B,o,f]),P=react.useCallback(r=>a.find(e=>e.id===r)||null,[a]),V=react.useCallback(()=>{let r=Date.now(),e=a.filter(s=>s.status==="active"),t=["adequacy_decision","standard_clauses","binding_corporate_rules","ndpc_authorization","explicit_consent","contract_performance","public_interest","legal_claims","vital_interests"],n={};for(let s of t)n[s]=e.filter(u=>u.transferMechanism===s).length;let i=["adequate","inadequate","pending_review","unknown"],c={};for(let s of i)c[s]=e.filter(u=>u.adequacyStatus===s).length;let h=a.filter(s=>{var u,_;return s.status==="pending_approval"||((u=s.ndpcApproval)==null?void 0:u.required)&&!((_=s.ndpcApproval)!=null&&_.approved)}),z=720*60*60*1e3,E=a.filter(s=>s.reviewDate&&s.reviewDate<=r+z&&s.status==="active"),K=a.filter(s=>!s.tiaCompleted&&s.status==="active"),j=a.filter(s=>s.riskLevel==="high"&&s.status==="active");return {totalActiveTransfers:e.length,byMechanism:n,byAdequacy:c,pendingApproval:h,dueForReview:E,missingTIA:K,highRiskTransfers:j,lastUpdated:r}},[a]),F=react.useCallback(r=>chunkUSD363RW_js.h(r),[]);return {transfers:a,addTransfer:L,updateTransfer:U,removeTransfer:O,getTransfer:P,getSummary:V,validateTransfer:F,isLoading:k}}exports.a=X;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import {f,h,i,g}from'./chunk-K5WLRGDN.mjs';import {a as a$1}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-PHA3YMFO.mjs';import {b,a}from'./chunk-ZJYULEER.mjs';import {useState,useMemo,useEffect,useCallback}from'react';import {jsxs,jsx}from'react/jsx-runtime';var z=[{value:"adequacy_decision",label:"Adequacy Decision (Section 42)"},{value:"standard_clauses",label:"Standard Contractual Clauses (Section 41(1)(a))"},{value:"binding_corporate_rules",label:"Binding Corporate Rules (Section 41(1)(a))"},{value:"ndpc_authorization",label:"NDPC Authorization (Section 42(5))"},{value:"explicit_consent",label:"Explicit Consent (Section 43(1)(a))"},{value:"contract_performance",label:"Contract Performance (Section 43(1)(b))"},{value:"public_interest",label:"Public Interest (Section 43(1)(d))"},{value:"legal_claims",label:"Legal Claims (Section 43(1)(e))"},{value:"vital_interests",label:"Vital Interests (Section 43(1)(f))"}],ae=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],ne=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],ie=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],ye={low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--destructive"},Se={active:"ndpr-badge ndpr-badge--success",suspended:"ndpr-badge ndpr-badge--warning",terminated:"ndpr-badge ndpr-badge--neutral",pending_approval:"ndpr-badge ndpr-badge--info"},ke={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"},de={destinationCountry:"",destinationCountryCode:"",adequacyStatus:"unknown",transferMechanism:"adequacy_decision",dataCategories:"",includesSensitiveData:false,estimatedDataSubjects:"",recipientOrganization:"",recipientContactName:"",recipientContactEmail:"",recipientContactPhone:"",recipientContactAddress:"",purpose:"",safeguards:"",riskAssessment:"",riskLevel:"medium",frequency:"one_time",status:"active",tiaCompleted:false,tiaReference:"",ndpcApprovalApplied:false,ndpcApprovalApproved:false,ndpcApprovalReference:""},Be=({transfers:g$1,onAdd:y,onUpdate:S,onArchive:k,summary:B,title:M,description:P,className:pe="",buttonClassName:I="",showSummary:oe=true,showTIA:le=true,classNames:r,unstyled:d})=>{var J,X;let $=c(),se=(J=M!=null?M:$.crossBorder.title)!=null?J:"Cross-Border Data Transfer Manager",ce=(X=P!=null?P:$.crossBorder.description)!=null?X:"Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VIII (Sections 41-43).",[f$1,T]=useState(null),[V,D]=useState(false),[h$1,U]=useState(null),[i$1,N]=useState(de),[C,G]=useState(null),[R,ue]=useState("all"),[q,me]=useState("all"),x=useMemo(()=>{let t=[...g$1];return R!=="all"&&(t=t.filter(a=>a.status===R)),q!=="all"&&(t=t.filter(a=>a.transferMechanism===q)),t.sort((a,o)=>o.updatedAt-a.updatedAt),t},[g$1,R,q]);useEffect(()=>{x.length>0&&!f$1&&T(x[0].id);},[x,f$1]);let H=useMemo(()=>{var t;return f$1&&(t=g$1.find(a=>a.id===f$1))!=null?t:null},[g$1,f$1]),A=useCallback(t=>new Date(t).toLocaleDateString(),[]),_=useCallback(()=>{N(de),U(null),G(null);},[]),ve=useCallback(()=>{_(),D(true);},[_]),fe=useCallback(t=>{var a,o,u,v;U(t.id),N({destinationCountry:t.destinationCountry,destinationCountryCode:t.destinationCountryCode||"",adequacyStatus:t.adequacyStatus,transferMechanism:t.transferMechanism,dataCategories:t.dataCategories.join(", "),includesSensitiveData:t.includesSensitiveData,estimatedDataSubjects:((a=t.estimatedDataSubjects)==null?void 0:a.toString())||"",recipientOrganization:t.recipientOrganization,recipientContactName:t.recipientContact.name,recipientContactEmail:t.recipientContact.email,recipientContactPhone:t.recipientContact.phone||"",recipientContactAddress:t.recipientContact.address||"",purpose:t.purpose,safeguards:t.safeguards.join(`
|
|
2
|
+
`),riskAssessment:t.riskAssessment,riskLevel:t.riskLevel,frequency:t.frequency,status:t.status,tiaCompleted:t.tiaCompleted,tiaReference:t.tiaReference||"",ndpcApprovalApplied:((o=t.ndpcApproval)==null?void 0:o.applied)||false,ndpcApprovalApproved:((u=t.ndpcApproval)==null?void 0:u.approved)||false,ndpcApprovalReference:((v=t.ndpcApproval)==null?void 0:v.referenceNumber)||""}),D(true);},[]),l=useCallback((t,a$1)=>{N(o=>b(a({},o),{[t]:a$1}));},[]),K=useCallback(()=>{let t=f(i$1.transferMechanism),a=Date.now();return {destinationCountry:i$1.destinationCountry.trim(),destinationCountryCode:i$1.destinationCountryCode.trim()||void 0,adequacyStatus:i$1.adequacyStatus,transferMechanism:i$1.transferMechanism,dataCategories:i$1.dataCategories.split(",").map(o=>o.trim()).filter(Boolean),includesSensitiveData:i$1.includesSensitiveData,estimatedDataSubjects:i$1.estimatedDataSubjects?parseInt(i$1.estimatedDataSubjects,10):void 0,recipientOrganization:i$1.recipientOrganization.trim(),recipientContact:{name:i$1.recipientContactName.trim(),email:i$1.recipientContactEmail.trim(),phone:i$1.recipientContactPhone.trim()||void 0,address:i$1.recipientContactAddress.trim()||void 0},purpose:i$1.purpose.trim(),safeguards:i$1.safeguards.split(`
|
|
3
|
+
`).map(o=>o.trim()).filter(Boolean),riskAssessment:i$1.riskAssessment.trim(),riskLevel:i$1.riskLevel,frequency:i$1.frequency,status:t&&!i$1.ndpcApprovalApproved?"pending_approval":i$1.status,tiaCompleted:i$1.tiaCompleted,tiaReference:i$1.tiaReference.trim()||void 0,ndpcApproval:t?{required:true,applied:i$1.ndpcApprovalApplied,approved:i$1.ndpcApprovalApproved||void 0,referenceNumber:i$1.ndpcApprovalReference.trim()||void 0,appliedAt:i$1.ndpcApprovalApplied?a:void 0,approvedAt:i$1.ndpcApprovalApproved?a:void 0}:void 0,startDate:a,reviewDate:a+365*24*60*60*1e3}},[i$1]),be=useCallback(()=>{let t=K(),a$1=a({id:h$1||"temp",createdAt:Date.now(),updatedAt:Date.now()},t),o=h(a$1);G(o),o.isValid&&(h$1?S==null||S(h$1,t):y==null||y(t),_(),D(false));},[K,h$1,S,y,_]),Y=useCallback(()=>{_(),D(false);},[_]),ge=useCallback(t=>{k==null||k(t),f$1===t&&T(null);},[k,f$1]),Q=useCallback(t=>jsxs("span",{className:a$1(`px-2 py-1 rounded text-xs font-medium ${ye[t]}`,r==null?void 0:r.riskBadge,d),children:[t.charAt(0).toUpperCase()+t.slice(1)," Risk"]}),[r==null?void 0:r.riskBadge,d]),W=useCallback(t=>jsx("span",{className:a$1(`px-2 py-1 rounded text-xs font-medium ${Se[t]}`,r==null?void 0:r.statusBadge,d),children:ke[t]}),[r==null?void 0:r.statusBadge,d]),he=useCallback(t=>{var u;f(t);let o=((u=z.find(v=>v.value===t))==null?void 0:u.label)||t;return jsx("span",{className:"px-2 py-1 rounded text-xs font-medium ndpr-badge ndpr-badge--info",children:o})},[]),w=useMemo(()=>{var v,c;if(B)return B;let t=0,a=[],o=[],u=[];for(let s of g$1){let O=s.status==="active";O&&t++,(s.status==="pending_approval"||(v=s.ndpcApproval)!=null&&v.required&&!((c=s.ndpcApproval)!=null&&c.approved))&&a.push(s),s.riskLevel==="high"&&O&&o.push(s),!s.tiaCompleted&&O&&u.push(s);}return {totalActiveTransfers:t,pendingApproval:a,highRiskTransfers:o,missingTIA:u,byMechanism:{},byAdequacy:{},dueForReview:[],lastUpdated:Date.now()}},[B,g$1]),Ce=()=>jsxs("div",{"data-ndpr-component":"cross-border-transfer-manager",role:"status","aria-label":"Transfer compliance summary",className:a$1("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",r==null?void 0:r.summary,d),children:[jsxs("div",{className:a$1("ndpr-alert ndpr-alert--info",r==null?void 0:r.summaryCard,d),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:w.totalActiveTransfers}),jsx("p",{className:"text-sm ndpr-text-info",children:"Active Transfers"})]}),jsxs("div",{className:a$1("ndpr-alert ndpr-alert--info",r==null?void 0:r.summaryCard,d),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:w.pendingApproval.length}),jsx("p",{className:"text-sm ndpr-text-info",children:"Pending Approval"})]}),jsxs("div",{className:a$1("ndpr-alert ndpr-alert--destructive",r==null?void 0:r.summaryCard,d),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-destructive",children:w.highRiskTransfers.length}),jsx("p",{className:"text-sm ndpr-text-destructive",children:"High Risk"})]}),jsxs("div",{className:a$1("ndpr-alert ndpr-alert--warning",r==null?void 0:r.summaryCard,d),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:w.missingTIA.length}),jsx("p",{className:"text-sm ndpr-text-warning",children:"Missing TIA"})]})]}),_e=()=>{let t=f(i$1.transferMechanism);return jsxs("div",{className:a$1("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",r==null?void 0:r.form,d),children:[jsxs("div",{className:a$1("flex justify-between items-center mb-4",r==null?void 0:r.header,d),children:[jsx("h3",{className:"ndpr-section-heading",children:h$1?"Edit Transfer":"Add New Transfer"}),jsx("button",{onClick:Y,"aria-label":"Cancel form",className:"text-gray-600 hover:ndpr-text-muted dark:hover:text-gray-200",children:"Cancel"})]}),C&&!C.isValid&&jsxs("div",{id:"cb-form-errors",role:"alert",className:"ndpr-alert ndpr-alert--destructive",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-destructive",children:C.errors.map((a,o)=>jsx("li",{children:a},o))})]}),C&&C.warnings.length>0&&jsxs("div",{id:"cb-form-warnings",role:"alert",className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Warnings:"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:C.warnings.map((a,o)=>jsx("li",{children:a},o))})]}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"cb-destinationCountry",className:"ndpr-form-field__label",children:["Destination Country ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-destinationCountry",type:"text",value:i$1.destinationCountry,onChange:a=>l("destinationCountry",a.target.value),placeholder:"e.g. United Kingdom","aria-required":"true","aria-describedby":"cb-form-errors","aria-label":"Destination country",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-destinationCountryCode",className:"ndpr-form-field__label",children:"Country Code (ISO)"}),jsx("input",{id:"cb-destinationCountryCode",type:"text",value:i$1.destinationCountryCode,onChange:a=>l("destinationCountryCode",a.target.value),placeholder:"e.g. GB",maxLength:3,"aria-label":"Country code in ISO format",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-recipientOrganization",className:"ndpr-form-field__label",children:["Recipient Organization ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-recipientOrganization",type:"text",value:i$1.recipientOrganization,onChange:a=>l("recipientOrganization",a.target.value),placeholder:"Organization name","aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-transferMechanism",className:"ndpr-form-field__label",children:["Transfer Mechanism ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("select",{id:"cb-transferMechanism",value:i$1.transferMechanism,onChange:a=>l("transferMechanism",a.target.value),"aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:z.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-adequacyStatus",className:"ndpr-form-field__label",children:"Adequacy Status"}),jsx("select",{id:"cb-adequacyStatus",value:i$1.adequacyStatus,onChange:a=>l("adequacyStatus",a.target.value),"aria-label":"Select adequacy status of destination country",className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:ae.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-riskLevel",className:"ndpr-form-field__label",children:"Risk Level"}),jsxs("select",{id:"cb-transfer-riskLevel",value:i$1.riskLevel,onChange:a=>l("riskLevel",a.target.value),className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsx("option",{value:"low",children:"Low"}),jsx("option",{value:"medium",children:"Medium"}),jsx("option",{value:"high",children:"High"})]})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-dataCategories",className:"ndpr-form-field__label",children:["Data Categories ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-dataCategories",type:"text",value:i$1.dataCategories,onChange:a=>l("dataCategories",a.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers","aria-required":"true","aria-describedby":"cb-dataCategories-help",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)}),jsx("p",{id:"cb-dataCategories-help",className:"text-xs text-gray-500 mt-1",children:"Separate categories with commas"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:i$1.includesSensitiveData,onChange:a=>l("includesSensitiveData",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"includesSensitiveData",className:"ndpr-text-sm ndpr-font-medium",children:"Includes sensitive personal data"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-estimatedDataSubjects",className:"ndpr-form-field__label",children:"Estimated Data Subjects"}),jsx("input",{id:"cb-transfer-estimatedDataSubjects",type:"number",value:i$1.estimatedDataSubjects,onChange:a=>l("estimatedDataSubjects",a.target.value),placeholder:"Number of data subjects",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-recipientContactName",className:"ndpr-form-field__label",children:["Recipient Contact Name ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-recipientContactName",type:"text",value:i$1.recipientContactName,onChange:a=>l("recipientContactName",a.target.value),placeholder:"Contact person name","aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-recipientContactEmail",className:"ndpr-form-field__label",children:["Recipient Contact Email ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-recipientContactEmail",type:"email",value:i$1.recipientContactEmail,onChange:a=>l("recipientContactEmail",a.target.value),placeholder:"contact@example.com","aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-recipientContactPhone",className:"ndpr-form-field__label",children:"Recipient Contact Phone"}),jsx("input",{id:"cb-transfer-recipientContactPhone",type:"text",value:i$1.recipientContactPhone,onChange:a=>l("recipientContactPhone",a.target.value),placeholder:"Phone number",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-recipientContactAddress",className:"ndpr-form-field__label",children:"Recipient Contact Address"}),jsx("input",{id:"cb-transfer-recipientContactAddress",type:"text",value:i$1.recipientContactAddress,onChange:a=>l("recipientContactAddress",a.target.value),placeholder:"Address",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-purpose",className:"ndpr-form-field__label",children:["Purpose of Transfer ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"cb-purpose",value:i$1.purpose,onChange:a=>l("purpose",a.target.value),placeholder:"Describe the purpose of this data transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-safeguards",className:"ndpr-form-field__label",children:["Safeguards ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"cb-safeguards",value:i$1.safeguards,onChange:a=>l("safeguards",a.target.value),placeholder:`One safeguard per line, e.g.
|
|
4
|
+
End-to-end encryption
|
|
5
|
+
Access control policies
|
|
6
|
+
Regular security audits`,rows:3,"aria-required":"true","aria-describedby":"cb-safeguards-help",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)}),jsx("p",{id:"cb-safeguards-help",className:"text-xs text-gray-500 mt-1",children:"Enter one safeguard per line"})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-riskAssessment",className:"ndpr-form-field__label",children:["Risk Assessment Summary ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"cb-riskAssessment",value:i$1.riskAssessment,onChange:a=>l("riskAssessment",a.target.value),placeholder:"Summarize the risk assessment for this transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-frequency",className:"ndpr-form-field__label",children:"Transfer Frequency"}),jsx("select",{id:"cb-transfer-frequency",value:i$1.frequency,onChange:a=>l("frequency",a.target.value),className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:ne.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-status",className:"ndpr-form-field__label",children:"Status"}),jsx("select",{id:"cb-transfer-status",value:i$1.status,onChange:a=>l("status",a.target.value),className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:ie.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]})]}),t&&jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h4",{className:"text-sm font-medium ndpr-text-info mb-3",children:"NDPC Approval Required"}),jsx("p",{className:"text-xs ndpr-text-info mb-3",children:"The selected transfer mechanism requires approval from the Nigeria Data Protection Commission."}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:i$1.ndpcApprovalApplied,onChange:a=>l("ndpcApprovalApplied",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"ndpcApprovalApplied",className:"ndpr-text-sm",children:"Application submitted"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:i$1.ndpcApprovalApproved,onChange:a=>l("ndpcApprovalApproved",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"ndpcApprovalApproved",className:"ndpr-text-sm",children:"Approval granted"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"cb-transfer-ndpcApprovalReference",className:"ndpr-form-field__label",children:"NDPC Reference Number"}),jsx("input",{id:"cb-transfer-ndpcApprovalReference",type:"text",value:i$1.ndpcApprovalReference,onChange:a=>l("ndpcApprovalReference",a.target.value),placeholder:"Reference number (if available)",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]})]})]}),le&&jsxs("div",{className:"mt-4 p-4 bg-gray-100 dark:bg-gray-600 rounded-md",children:[jsx("h4",{className:"text-sm font-medium mb-3",children:"Transfer Impact Assessment"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"tiaCompleted",checked:i$1.tiaCompleted,onChange:a=>l("tiaCompleted",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"tiaCompleted",className:"ndpr-text-sm",children:"TIA completed"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-tiaReference",className:"ndpr-form-field__label",children:"TIA Reference"}),jsx("input",{id:"cb-transfer-tiaReference",type:"text",value:i$1.tiaReference,onChange:a=>l("tiaReference",a.target.value),placeholder:"Document reference",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]})]})]}),jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[jsx("button",{onClick:Y,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600",children:"Cancel"}),jsx("button",{onClick:be,className:a$1(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${I}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),d),children:h$1?"Update Transfer":"Add Transfer"})]})]})},xe=t=>{var u,v;let a=i(t),o=h(t);return jsxs("div",{role:"status","aria-label":"Transfer details",className:a$1("",r==null?void 0:r.detailPanel,d),children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxs("h3",{className:"ndpr-section-heading",children:[t.destinationCountry," \u2014 ",t.recipientOrganization]}),jsxs("div",{className:"flex gap-2",children:[W(t.status),Q(t.riskLevel)]})]}),!o.isValid&&jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Compliance Issues"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-destructive",children:o.errors.map((c,s)=>jsx("li",{children:c},s))})]}),o.warnings.length>0&&jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Warnings"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:o.warnings.map((c,s)=>jsx("li",{children:c},s))})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Destination:"})," ",t.destinationCountry,t.destinationCountryCode?` (${t.destinationCountryCode})`:""]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(u=ae.find(c=>c.value===t.adequacyStatus))==null?void 0:u.label]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Frequency:"})," ",(v=ne.find(c=>c.value===t.frequency))==null?void 0:v.label]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Start Date:"})," ",A(t.startDate)]}),t.endDate&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"End Date:"})," ",A(t.endDate)]}),t.reviewDate&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Next Review:"})," ",A(t.reviewDate)]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Recipient:"})," ",t.recipientOrganization]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",t.recipientContact.name," (",t.recipientContact.email,")"]}),t.estimatedDataSubjects&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",t.estimatedDataSubjects.toLocaleString()]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",t.includesSensitiveData?"Yes":"No"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Transfer Mechanism"}),jsx("div",{className:"ndpr-panel",children:jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:g(t.transferMechanism)})})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Purpose"}),jsx("p",{className:"text-sm ndpr-text-muted bg-gray-50 dark:bg-gray-700 p-2 rounded-md",children:t.purpose})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Data Categories"}),jsx("div",{className:"flex flex-wrap gap-1",children:t.dataCategories.map((c,s)=>jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs",children:c},s))})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Safeguards"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-muted",children:t.safeguards.map((c,s)=>jsx("li",{children:c},s))})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Risk Assessment"}),jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2",children:t.riskAssessment}),jsxs("div",{className:"mt-2",role:"status","aria-label":"Automated risk assessment result",children:[jsxs("p",{className:"text-xs font-medium ndpr-text-muted mb-1",children:["Automated Assessment (Score: ",a.riskScore,")"]}),a.factors.length>0&&jsx("ul",{className:"list-disc list-inside text-xs ndpr-text-muted",children:a.factors.map((c,s)=>jsx("li",{children:c},s))}),a.recommendations.length>0&&jsxs("div",{className:"mt-2",children:[jsx("p",{className:"text-xs font-medium ndpr-text-muted mb-1",children:"Recommendations:"}),jsx("ul",{className:"list-disc list-inside text-xs ndpr-text-muted",children:a.recommendations.map((c,s)=>jsx("li",{children:c},s))})]})]})]})]}),t.ndpcApproval&&jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"NDPC Approval"}),jsxs("div",{className:a$1(`p-3 rounded-md ${t.ndpcApproval.approved?"ndpr-alert ndpr-alert--success":t.ndpcApproval.applied?"ndpr-alert ndpr-alert--warning":"ndpr-alert ndpr-alert--destructive"}`,r==null?void 0:r.approvalStatus,d),children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",t.ndpcApproval.approved?"Approved":t.ndpcApproval.applied?"Application Submitted":"Not Applied"]}),t.ndpcApproval.referenceNumber&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Reference:"})," ",t.ndpcApproval.referenceNumber]}),t.ndpcApproval.appliedAt&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Applied:"})," ",A(t.ndpcApproval.appliedAt)]}),t.ndpcApproval.approvedAt&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Approved:"})," ",A(t.ndpcApproval.approvedAt)]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Transfer Impact Assessment"}),jsxs("div",{className:`p-3 rounded-md ${t.tiaCompleted?"ndpr-alert ndpr-alert--success":"ndpr-alert ndpr-alert--warning"}`,children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",t.tiaCompleted?"Completed":"Not Completed"]}),t.tiaReference&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Reference:"})," ",t.tiaReference]})]})]}),jsxs("div",{className:"flex gap-3 mt-6",children:[jsx("button",{onClick:()=>fe(t),"aria-label":`Edit transfer to ${t.destinationCountry}`,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${I}`,children:"Edit"}),jsx("button",{onClick:()=>ge(t.id),"aria-label":`Remove transfer to ${t.destinationCountry}`,className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Remove"})]})]})};return jsxs("div",{className:a$1(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${pe}`,r==null?void 0:r.root,d),children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.title,d),children:se}),jsx("p",{className:"ndpr-card__subtitle",children:ce}),oe&&Ce(),!V&&jsx("div",{className:"mb-6",children:jsx("button",{onClick:ve,className:a$1(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${I}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),d),children:"Add Transfer"})}),V&&_e(),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"cbStatusFilter",className:"ndpr-form-field__label",children:"Status Filter"}),jsxs("select",{id:"cbStatusFilter",value:R,onChange:t=>ue(t.target.value),"aria-label":"Filter transfers by status",className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsx("option",{value:"all",children:"All Statuses"}),ie.map(t=>jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cbMechanismFilter",className:"ndpr-form-field__label",children:"Mechanism Filter"}),jsxs("select",{id:"cbMechanismFilter",value:q,onChange:t=>me(t.target.value),"aria-label":"Filter transfers by mechanism",className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsx("option",{value:"all",children:"All Mechanisms"}),z.map(t=>jsx("option",{value:t.value,children:t.label},t.value))]})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxs("div",{className:"md:col-span-1",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Transfers"}),x.length===0?jsx("p",{className:"ndpr-card__subtitle",children:"No cross-border transfers found."}):jsx("div",{className:a$1("space-y-2 max-h-96 overflow-y-auto pr-2",r==null?void 0:r.transferList,d),children:x.map(t=>{var a,o;return jsxs("div",{className:a$1(`p-3 rounded-md cursor-pointer ${f$1===t.id?"ndpr-alert ndpr-alert--info":"ndpr-panel"}`,r==null?void 0:r.transferItem,d),role:"button",tabIndex:0,"aria-label":`View transfer to ${t.destinationCountry}`,onClick:()=>T(t.id),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),T(t.id));},children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:t.destinationCountry}),Q(t.riskLevel)]}),jsx("p",{className:"text-xs ndpr-text-muted mb-1",children:t.recipientOrganization}),jsx("p",{className:"text-xs ndpr-text-muted mb-1",children:he(t.transferMechanism)}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[W(t.status),((a=t.ndpcApproval)==null?void 0:a.required)&&!((o=t.ndpcApproval)!=null&&o.approved)&&jsx("span",{className:"text-xs ndpr-text-info",children:"NDPC Pending"})]})]},t.id)})})]}),jsx("div",{className:"md:col-span-2",children:H?xe(H):jsx("div",{className:"ndpr-empty-state",children:jsx("p",{className:"ndpr-card__subtitle",children:"Select a transfer to view details"})})})]})]})};export{Be as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-EH73TDZL.mjs';import {b}from'./chunk-4QQJEO3F.mjs';import {c,b as b$1,a as a$1}from'./chunk-ZJYULEER.mjs';import {useMemo}from'react';import {jsx}from'react/jsx-runtime';var C=d=>{var o=d,{template:e,templateOverrides:r,initialContext:t,copy:s}=o,l=c(o,["template","templateOverrides","initialContext","copy"]);let n=useMemo(()=>{if(t)return t;if(e)return b(e,r)},[t,e,r]);return jsx(a,b$1(a$1({},l),{initialContext:n}))};export{C as a};
|