@tantainnovative/ndpr-toolkit 2.4.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/README.md +226 -246
  2. package/dist/BreachReportForm-DpRrBoxU.d.ts +158 -0
  3. package/dist/BreachReportForm-yJ2Zl6gz.d.mts +158 -0
  4. package/dist/ConsentBanner-CDRT0o2k.d.mts +146 -0
  5. package/dist/ConsentBanner-Vxyt8SCX.d.ts +146 -0
  6. package/dist/{cross-border-entry-BrWVPly6.d.ts → CrossBorderTransferManager-D5Lc0e46.d.ts} +4 -5
  7. package/dist/{cross-border-entry-cCTvpwnT.d.mts → CrossBorderTransferManager-DkZhv9vD.d.mts} +4 -5
  8. package/dist/DPIAQuestionnaire-BkejviPj.d.mts +123 -0
  9. package/dist/DPIAQuestionnaire-DdSqXG3x.d.ts +123 -0
  10. package/dist/DSRRequestForm-BY8PogCU.d.mts +146 -0
  11. package/dist/DSRRequestForm-CHUg9cZh.d.ts +146 -0
  12. package/dist/DSRTracker-C6u_jAaK.d.mts +163 -0
  13. package/dist/DSRTracker-Dr_aT0pg.d.ts +163 -0
  14. package/dist/{lawful-basis-entry-CxZrofwG.d.mts → LawfulBasisTracker-CBqOxX1D.d.mts} +3 -5
  15. package/dist/{lawful-basis-entry-15qjKcNO.d.ts → LawfulBasisTracker-Cg30NbDA.d.ts} +3 -5
  16. package/dist/NDPRDashboard-CLJpEg0X.d.mts +44 -0
  17. package/dist/NDPRDashboard-DDWNd2Ah.d.ts +44 -0
  18. package/dist/{policy-E0fXZkda.d.mts → PolicyExporter-BIqSVjfC.d.mts} +4 -98
  19. package/dist/{policy-D2_jh5-T.d.ts → PolicyExporter-BNWaPBGU.d.ts} +4 -98
  20. package/dist/PolicyGenerator-BvcWPbxp.d.mts +96 -0
  21. package/dist/PolicyGenerator-BzRwtlgn.d.ts +96 -0
  22. package/dist/{ropa-entry-B0D7X1GV.d.ts → ROPAManager-BS4eB8Hw.d.mts} +4 -5
  23. package/dist/{ropa-entry-DiOThOc2.d.mts → ROPAManager-qxTrXLkD.d.ts} +4 -5
  24. package/dist/RegulatoryReportGenerator-BUYgzTTT.d.ts +282 -0
  25. package/dist/RegulatoryReportGenerator-DwcHcEFp.d.mts +282 -0
  26. package/dist/StepIndicator-D-nwRTyo.d.mts +171 -0
  27. package/dist/StepIndicator-D9ZATz_O.d.ts +171 -0
  28. package/dist/adapters.d.mts +25 -0
  29. package/dist/adapters.d.ts +25 -0
  30. package/dist/adapters.js +2 -0
  31. package/dist/adapters.mjs +2 -0
  32. package/dist/breach.d.mts +36 -431
  33. package/dist/breach.d.ts +36 -431
  34. package/dist/breach.js +1 -1
  35. package/dist/breach.mjs +1 -1
  36. package/dist/chunk-27NYSWUG.mjs +2 -0
  37. package/dist/chunk-2ORDHJRD.js +2 -0
  38. package/dist/chunk-2W7ARAW2.js +2 -0
  39. package/dist/chunk-3F34NACG.js +2 -0
  40. package/dist/chunk-3RGJV3VF.js +7 -0
  41. package/dist/chunk-3UWT64FI.mjs +2 -0
  42. package/dist/chunk-3V23O4ZJ.js +2 -0
  43. package/dist/chunk-3XAUN5IM.mjs +3 -0
  44. package/dist/chunk-5VMHKNJY.js +2 -0
  45. package/dist/chunk-6D3ZUGBB.mjs +2 -0
  46. package/dist/chunk-6E54NSAO.mjs +2 -0
  47. package/dist/chunk-7F5F5YWI.mjs +2 -0
  48. package/dist/chunk-7FIUX3ZM.js +89 -0
  49. package/dist/chunk-FR7ZYZXB.js +2 -0
  50. package/dist/chunk-FY5G6DGZ.js +7 -0
  51. package/dist/chunk-G26I6MP5.mjs +2 -0
  52. package/dist/chunk-GPJVTGHR.mjs +2 -0
  53. package/dist/chunk-GVANK6PL.js +3 -0
  54. package/dist/chunk-HNZK7LY3.mjs +2 -0
  55. package/dist/chunk-IKEPXHCZ.js +2 -0
  56. package/dist/chunk-IQQW52EF.js +2 -0
  57. package/dist/chunk-ISSGO2YT.mjs +72 -0
  58. package/dist/chunk-J6IKAGUP.mjs +89 -0
  59. package/dist/chunk-KHRBU5K7.js +2 -0
  60. package/dist/chunk-KNE4NXCY.mjs +7 -0
  61. package/dist/chunk-LFNA6WYQ.mjs +2 -0
  62. package/dist/chunk-NPI5T6NH.mjs +7 -0
  63. package/dist/chunk-NPLXE43Q.mjs +2 -0
  64. package/dist/chunk-P7BSBCB3.js +2 -0
  65. package/dist/chunk-PEH5GIMN.js +2 -0
  66. package/dist/chunk-RSUDIFZV.mjs +2 -0
  67. package/dist/chunk-SBNAMPAP.mjs +2 -0
  68. package/dist/chunk-SVCRYM4I.mjs +2 -0
  69. package/dist/chunk-U6VWHC46.js +72 -0
  70. package/dist/chunk-UK656RCG.js +2 -0
  71. package/dist/chunk-UNKXYVXY.js +2 -0
  72. package/dist/chunk-UOSEH6DC.js +2 -0
  73. package/dist/chunk-V37BM2LF.js +2 -0
  74. package/dist/chunk-V3MXWGXU.mjs +2 -0
  75. package/dist/chunk-VDZKGCAF.js +2 -0
  76. package/dist/chunk-WLSW4Z4W.mjs +2 -0
  77. package/dist/chunk-XSK4BSZJ.mjs +2 -0
  78. package/dist/chunk-YJCGEOLO.mjs +2 -0
  79. package/dist/chunk-ZCZ5RRZO.js +2 -0
  80. package/dist/compliance-score-racQe_E_.d.mts +115 -0
  81. package/dist/compliance-score-racQe_E_.d.ts +115 -0
  82. package/dist/consent.d.mts +67 -295
  83. package/dist/consent.d.ts +67 -295
  84. package/dist/consent.js +1 -1
  85. package/dist/consent.mjs +1 -1
  86. package/dist/core.d.mts +8 -5
  87. package/dist/core.d.ts +8 -5
  88. package/dist/core.js +1 -1
  89. package/dist/core.mjs +1 -1
  90. package/dist/cross-border-BBi9rZyO.d.mts +54 -0
  91. package/dist/cross-border-Dy-U9Hu6.d.ts +54 -0
  92. package/dist/{cross-border-BMcqLvjC.d.mts → cross-border-UyT00llA.d.mts} +1 -52
  93. package/dist/{cross-border-BMcqLvjC.d.ts → cross-border-UyT00llA.d.ts} +1 -52
  94. package/dist/cross-border.d.mts +32 -4
  95. package/dist/cross-border.d.ts +32 -4
  96. package/dist/cross-border.js +1 -1
  97. package/dist/cross-border.mjs +1 -1
  98. package/dist/dpia.d.mts +28 -284
  99. package/dist/dpia.d.ts +28 -284
  100. package/dist/dpia.js +1 -1
  101. package/dist/dpia.mjs +1 -1
  102. package/dist/dsr.d.mts +29 -300
  103. package/dist/dsr.d.ts +29 -300
  104. package/dist/dsr.js +1 -1
  105. package/dist/dsr.mjs +1 -1
  106. package/dist/hooks.d.mts +21 -10
  107. package/dist/hooks.d.ts +21 -10
  108. package/dist/hooks.js +1 -1
  109. package/dist/hooks.mjs +1 -1
  110. package/dist/index.d.mts +28 -18
  111. package/dist/index.d.ts +28 -18
  112. package/dist/index.js +1 -1
  113. package/dist/index.mjs +1 -1
  114. package/dist/lawful-basis.d.mts +31 -4
  115. package/dist/lawful-basis.d.ts +31 -4
  116. package/dist/lawful-basis.js +1 -1
  117. package/dist/lawful-basis.mjs +1 -1
  118. package/dist/policy.d.mts +36 -4
  119. package/dist/policy.d.ts +36 -4
  120. package/dist/policy.js +1 -1
  121. package/dist/policy.mjs +1 -1
  122. package/dist/presets.d.mts +124 -0
  123. package/dist/presets.d.ts +124 -0
  124. package/dist/presets.js +2 -0
  125. package/dist/presets.mjs +2 -0
  126. package/dist/{ropa-Li6UlL5H.d.ts → ropa-BDTM06tr.d.ts} +1 -49
  127. package/dist/{ropa-DP7pPPql.d.mts → ropa-CFHuT7jE.d.mts} +1 -49
  128. package/dist/ropa-CyynscU6.d.ts +51 -0
  129. package/dist/ropa-NIgxd8uP.d.mts +51 -0
  130. package/dist/ropa.d.mts +30 -4
  131. package/dist/ropa.d.ts +30 -4
  132. package/dist/ropa.js +1 -1
  133. package/dist/ropa.mjs +1 -1
  134. package/dist/styling-B7CBzYG7.d.ts +165 -0
  135. package/dist/styling-uJLsBbER.d.mts +165 -0
  136. package/dist/types-DK2CoKOC.d.mts +10 -0
  137. package/dist/types-DK2CoKOC.d.ts +10 -0
  138. package/dist/unstyled.d.mts +4 -4
  139. package/dist/unstyled.d.ts +4 -4
  140. package/dist/{useBreach-BBSoIcZO.d.mts → useBreach-CPr86Yan.d.mts} +18 -2
  141. package/dist/{useBreach-lFLbSyAN.d.ts → useBreach-DkVXvtJK.d.ts} +18 -2
  142. package/dist/{useConsent-D0pAfTlb.d.ts → useConsent-DCNkIJHR.d.mts} +12 -2
  143. package/dist/{useConsent-DOt2Njst.d.mts → useConsent-dOcELSfX.d.ts} +12 -2
  144. package/dist/{useCrossBorderTransfer-DmtACeqW.d.ts → useCrossBorderTransfer-BGNZt2lk.d.mts} +15 -3
  145. package/dist/{useCrossBorderTransfer-BZVFCXfr.d.mts → useCrossBorderTransfer-COqjgjsu.d.ts} +15 -3
  146. package/dist/{useDPIA-DBsg2yZx.d.ts → useDPIA-Dl16Te3r.d.ts} +13 -2
  147. package/dist/{useDPIA-Da7-Q_yW.d.mts → useDPIA-DzWye8JB.d.mts} +13 -2
  148. package/dist/{useDSR-YYZ6FYFs.d.mts → useDSR-C1LksCfP.d.mts} +13 -2
  149. package/dist/{useDSR-CYI7WCXr.d.ts → useDSR-DZel52O1.d.ts} +13 -2
  150. package/dist/{useDefaultPrivacyPolicy-CUluF_ic.d.mts → useDefaultPrivacyPolicy-BsYttRey.d.mts} +13 -2
  151. package/dist/{useDefaultPrivacyPolicy-B7kTHbZh.d.ts → useDefaultPrivacyPolicy-C-mG-A5S.d.ts} +13 -2
  152. package/dist/{useLawfulBasis-CpWuHtyh.d.mts → useLawfulBasis-CKJ-kw84.d.mts} +13 -2
  153. package/dist/{useLawfulBasis-CCWF9waR.d.ts → useLawfulBasis-DFTmu1ca.d.ts} +13 -2
  154. package/dist/{useROPA-BhJ3kvHp.d.ts → useROPA-BSSU1rfx.d.ts} +14 -2
  155. package/dist/{useROPA-DLFdjkxP.d.mts → useROPA-C2hjaBTz.d.mts} +14 -2
  156. package/package.json +18 -2
  157. package/dist/chunk-2XFAV267.mjs +0 -2
  158. package/dist/chunk-32UIWTGD.js +0 -72
  159. package/dist/chunk-3YCV2BA6.js +0 -2
  160. package/dist/chunk-4A354HL3.js +0 -2
  161. package/dist/chunk-5ZBO2UPH.js +0 -2
  162. package/dist/chunk-6GGGTRDZ.mjs +0 -2
  163. package/dist/chunk-BGHQTZAC.js +0 -94
  164. package/dist/chunk-BZTTQS4A.mjs +0 -7
  165. package/dist/chunk-EKVTLHBQ.js +0 -2
  166. package/dist/chunk-GMLNWS2N.mjs +0 -2
  167. package/dist/chunk-IBEKLDBY.mjs +0 -2
  168. package/dist/chunk-K3GMTMQ6.js +0 -2
  169. package/dist/chunk-L52PDW6O.mjs +0 -2
  170. package/dist/chunk-LI6WJ3LZ.js +0 -2
  171. package/dist/chunk-LXRXDTPI.js +0 -2
  172. package/dist/chunk-NW4A3JW6.mjs +0 -2
  173. package/dist/chunk-OITITR6K.mjs +0 -2
  174. package/dist/chunk-PDJGTQMY.mjs +0 -2
  175. package/dist/chunk-SKJCQKFL.mjs +0 -94
  176. package/dist/chunk-T44JQT2O.mjs +0 -2
  177. package/dist/chunk-TCJCE6WN.js +0 -2
  178. package/dist/chunk-VMJBW3EF.mjs +0 -2
  179. package/dist/chunk-WW3X3ELF.js +0 -2
  180. package/dist/chunk-XMYUYQH7.mjs +0 -72
  181. package/dist/chunk-ZNTMZ6NM.js +0 -7
  182. package/dist/chunk-ZU73VG3X.js +0 -2
package/dist/breach.d.ts CHANGED
@@ -1,439 +1,44 @@
1
- import React from 'react';
1
+ import { c as BreachReportFormProps } from './BreachReportForm-DpRrBoxU.js';
2
+ export { B as BreachFormSubmission, a as BreachReportForm, b as BreachReportFormClassNames } from './BreachReportForm-DpRrBoxU.js';
3
+ import { e as BreachRiskAssessmentProps, f as BreachNotificationManagerProps, g as RegulatoryReportGeneratorProps } from './RegulatoryReportGenerator-BUYgzTTT.js';
4
+ export { B as BreachNotificationManager, a as BreachNotificationManagerClassNames, b as BreachRiskAssessment, c as BreachRiskAssessmentClassNames, R as RegulatoryReportGenerator, d as RegulatoryReportGeneratorClassNames } from './RegulatoryReportGenerator-BUYgzTTT.js';
5
+ import { U as UseBreachReturn } from './useBreach-DkVXvtJK.js';
6
+ export { u as useBreach } from './useBreach-DkVXvtJK.js';
7
+ export { c as calculateBreachSeverity } from './breach-CzXqSsaY.js';
2
8
  import { B as BreachCategory, a as BreachReport, b as RiskAssessment, R as RegulatoryNotification } from './breach-Eu9byel8.js';
3
9
  export { N as NotificationRequirement } from './breach-Eu9byel8.js';
4
- export { u as useBreach } from './useBreach-lFLbSyAN.js';
5
- export { c as calculateBreachSeverity } from './breach-CzXqSsaY.js';
10
+ import * as React from 'react';
11
+ import React__default from 'react';
12
+ import { S as StorageAdapter } from './types-DK2CoKOC.js';
6
13
 
7
- /**
8
- * Represents the data submitted by the breach report form.
9
- */
10
- interface BreachFormSubmission {
11
- /** Title/summary of the breach */
12
- title: string;
13
- /** Detailed description of the breach */
14
- description: string;
15
- /** Breach category identifier */
16
- category: string;
17
- /** Timestamp (ms) when the breach was discovered */
18
- discoveredAt: number;
19
- /** Timestamp (ms) when the breach occurred (if known) */
20
- occurredAt?: number;
21
- /** Timestamp (ms) when the form was submitted */
22
- reportedAt: number;
23
- /** Person reporting the breach */
24
- reporter: {
25
- name: string;
26
- email: string;
27
- department: string;
28
- phone?: string;
29
- };
30
- /** Systems or applications affected by the breach */
31
- affectedSystems: string[];
32
- /** Types of data involved in the breach */
33
- dataTypes: string[];
34
- /** Estimated number of affected data subjects */
35
- estimatedAffectedSubjects?: number;
36
- /** Current status of the breach */
37
- status: 'ongoing' | 'contained' | 'resolved';
38
- /** Initial actions taken to address the breach */
39
- initialActions?: string;
40
- /** File attachments included with the report */
41
- attachments: Array<{
42
- name: string;
43
- type: string;
44
- size: number;
45
- file: File;
46
- }>;
47
- }
48
- interface BreachReportFormClassNames {
49
- root?: string;
50
- title?: string;
51
- form?: string;
52
- fieldGroup?: string;
53
- label?: string;
54
- input?: string;
55
- select?: string;
56
- textarea?: string;
57
- submitButton?: string;
58
- /** Alias for submitButton */
59
- primaryButton?: string;
60
- notice?: string;
61
- /** Custom class applied when isSubmitting is true (e.g. a loading overlay) */
62
- loadingOverlay?: string;
63
- }
64
- interface BreachReportFormProps {
65
- /**
66
- * Available breach categories
67
- */
14
+ interface BreachProviderProps {
68
15
  categories: BreachCategory[];
69
- /**
70
- * Callback function called when form is submitted
71
- */
72
- onSubmit: (data: BreachFormSubmission) => void;
73
- /**
74
- * Callback function called when form validation fails
75
- */
76
- onValidationError?: (errors: Record<string, string>) => void;
77
- /**
78
- * Title displayed on the form
79
- * @default "Report a Data Breach"
80
- */
81
- title?: string;
82
- /**
83
- * Description text displayed on the form
84
- * @default "Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40. All fields marked with * are required."
85
- */
86
- formDescription?: string;
87
- /**
88
- * Text for the submit button
89
- * @default "Submit Report"
90
- */
91
- submitButtonText?: string;
92
- /**
93
- * Custom CSS class for the form
94
- */
95
- className?: string;
96
- /**
97
- * Custom CSS class for the submit button
98
- */
99
- buttonClassName?: string;
100
- /**
101
- * Override class names for individual elements
102
- */
103
- classNames?: BreachReportFormClassNames;
104
- /**
105
- * Remove all default styles, only applying classNames overrides
106
- */
107
- unstyled?: boolean;
108
- /**
109
- * Whether the form is currently submitting.
110
- * When true, the submit button is disabled and shows "Submitting..." text.
111
- */
112
- isSubmitting?: boolean;
113
- /**
114
- * Whether to show a confirmation message after submission
115
- * @default true
116
- */
117
- showConfirmation?: boolean;
118
- /**
119
- * Confirmation message to display after submission
120
- * @default "Your breach report has been submitted successfully. The data protection team has been notified."
121
- */
122
- confirmationMessage?: string;
123
- /**
124
- * Whether to allow file attachments
125
- * @default true
126
- */
127
- allowAttachments?: boolean;
128
- /**
129
- * Maximum number of attachments allowed
130
- * @default 5
131
- */
132
- maxAttachments?: number;
133
- /**
134
- * Maximum file size for attachments (in bytes)
135
- * @default 5242880 (5MB)
136
- */
137
- maxFileSize?: number;
138
- /**
139
- * Allowed file types for attachments
140
- * @default ['.pdf', '.jpg', '.jpeg', '.png', '.doc', '.docx', '.xls', '.xlsx', '.txt']
141
- */
142
- allowedFileTypes?: string[];
143
- /**
144
- * Default values to pre-fill form fields.
145
- * Useful for editing existing breach reports or pre-populating known data.
146
- */
147
- defaultValues?: Partial<BreachFormSubmission>;
148
- /**
149
- * Callback fired when the form is reset via the Reset button.
150
- * To fully remount the component (clearing all internal state),
151
- * change the `key` prop from the parent.
152
- */
153
- onReset?: () => void;
154
- }
155
- /**
156
- * Breach report form component. Implements NDPA Section 40 breach notification requirements,
157
- * enabling organizations to document and report data breaches within the mandated 72-hour window.
158
- */
159
- declare const BreachReportForm: React.FC<BreachReportFormProps>;
160
-
161
- interface BreachRiskAssessmentClassNames {
162
- root?: string;
163
- header?: string;
164
- title?: string;
165
- slider?: string;
166
- riskBadge?: string;
167
- riskScore?: string;
168
- notificationStatus?: string;
169
- submitButton?: string;
170
- /** Alias for submitButton */
171
- primaryButton?: string;
172
- }
173
- interface BreachRiskAssessmentProps {
174
- /**
175
- * The breach data to assess
176
- */
177
- breachData: BreachReport;
178
- /**
179
- * Initial assessment data (if editing an existing assessment)
180
- */
181
- initialAssessment?: Partial<RiskAssessment>;
182
- /**
183
- * Callback function called when assessment is completed
184
- */
185
- onComplete: (assessment: RiskAssessment) => void;
186
- /**
187
- * Title displayed on the assessment form
188
- * @default "Breach Risk Assessment"
189
- */
190
- title?: string;
191
- /**
192
- * Description text displayed on the assessment form
193
- * @default "Assess the risk level of this data breach to determine notification requirements under NDPA Section 40."
194
- */
195
- description?: string;
196
- /**
197
- * Text for the submit button
198
- * @default "Complete Assessment"
199
- */
200
- submitButtonText?: string;
201
- /**
202
- * Custom CSS class for the form
203
- */
204
- className?: string;
205
- /**
206
- * Custom CSS class for the submit button
207
- */
208
- buttonClassName?: string;
209
- /**
210
- * Override class names for individual elements
211
- */
212
- classNames?: BreachRiskAssessmentClassNames;
213
- /**
214
- * Remove all default styles, only applying classNames overrides
215
- */
216
- unstyled?: boolean;
217
- /**
218
- * Whether to show the breach summary
219
- * @default true
220
- */
221
- showBreachSummary?: boolean;
222
- /**
223
- * Whether to show notification requirements after assessment
224
- * @default true
225
- */
226
- showNotificationRequirements?: boolean;
227
- }
228
- /**
229
- * Breach risk assessment component. Implements NDPA Section 40 requirements for assessing
230
- * breach severity and determining whether NDPC notification is required within 72 hours.
231
- */
232
- declare const BreachRiskAssessment: React.FC<BreachRiskAssessmentProps>;
16
+ adapter?: StorageAdapter<{
17
+ reports: BreachReport[];
18
+ assessments: RiskAssessment[];
19
+ notifications: RegulatoryNotification[];
20
+ }>;
21
+ storageKey?: string;
22
+ useLocalStorage?: boolean;
23
+ initialReports?: BreachReport[];
24
+ onReport?: (report: BreachReport) => void;
25
+ onAssessment?: (assessment: RiskAssessment) => void;
26
+ onNotification?: (notification: RegulatoryNotification) => void;
27
+ children: React__default.ReactNode;
28
+ }
29
+ declare const BreachProvider: React__default.FC<BreachProviderProps>;
233
30
 
234
- interface BreachNotificationManagerClassNames {
235
- root?: string;
236
- header?: string;
237
- title?: string;
238
- breachList?: string;
239
- breachItem?: string;
240
- statusBadge?: string;
241
- timeline?: string;
242
- timelineStep?: string;
243
- detailPanel?: string;
244
- }
245
- interface BreachNotificationManagerProps {
246
- /**
247
- * List of breach reports to manage
248
- */
249
- breachReports: BreachReport[];
250
- /**
251
- * List of risk assessments
252
- */
253
- riskAssessments: RiskAssessment[];
254
- /**
255
- * List of regulatory notifications
256
- */
257
- regulatoryNotifications: RegulatoryNotification[];
258
- /**
259
- * Callback function called when a breach is selected
260
- */
261
- onSelectBreach?: (breachId: string) => void;
262
- /**
263
- * Callback function called when a risk assessment is requested
264
- */
265
- onRequestAssessment?: (breachId: string) => void;
266
- /**
267
- * Callback function called when a notification is requested
268
- */
269
- onRequestNotification?: (breachId: string) => void;
270
- /**
271
- * Title displayed on the manager
272
- * @default "Breach Notification Manager"
273
- */
274
- title?: string;
275
- /**
276
- * Description text displayed on the manager
277
- * @default "Manage data breach notifications and track compliance with NDPA Section 40 requirements."
278
- */
279
- description?: string;
280
- /**
281
- * Custom CSS class for the manager
282
- */
283
- className?: string;
284
- /**
285
- * Custom CSS class for the buttons
286
- */
287
- buttonClassName?: string;
288
- /**
289
- * Override class names for individual elements
290
- */
291
- classNames?: BreachNotificationManagerClassNames;
292
- /**
293
- * Remove all default styles, only applying classNames overrides
294
- */
295
- unstyled?: boolean;
296
- /**
297
- * Whether to show the breach details
298
- * @default true
299
- */
300
- showBreachDetails?: boolean;
301
- /**
302
- * Whether to show the notification timeline
303
- * @default true
304
- */
305
- showNotificationTimeline?: boolean;
306
- /**
307
- * Whether to show the deadline alerts
308
- * @default true
309
- */
310
- showDeadlineAlerts?: boolean;
311
- }
312
- /**
313
- * Breach notification management component. Implements NDPA Section 40 requirements for
314
- * managing breach notifications, tracking 72-hour NDPC reporting deadlines, and coordinating
315
- * data subject notifications.
316
- */
317
- declare const BreachNotificationManager: React.FC<BreachNotificationManagerProps>;
31
+ declare const Breach: {
32
+ Provider: React.FC<BreachProviderProps>;
33
+ ReportForm: React.FC<BreachReportFormProps>;
34
+ RiskAssessment: React.FC<BreachRiskAssessmentProps>;
35
+ NotificationManager: React.FC<BreachNotificationManagerProps>;
36
+ ReportGenerator: React.FC<RegulatoryReportGeneratorProps>;
37
+ };
318
38
 
319
- interface RegulatoryReportGeneratorClassNames {
320
- root?: string;
321
- header?: string;
322
- title?: string;
323
- reportPreview?: string;
324
- field?: string;
325
- fieldLabel?: string;
326
- fieldValue?: string;
327
- generateButton?: string;
328
- /** Alias for generateButton */
329
- primaryButton?: string;
330
- downloadButton?: string;
331
- /** Alias for downloadButton */
332
- secondaryButton?: string;
333
- }
334
- interface OrganizationInfo {
335
- /**
336
- * Name of the organization
337
- */
338
- name: string;
339
- /**
340
- * Registration number or business ID
341
- */
342
- registrationNumber?: string;
343
- /**
344
- * Physical address of the organization
345
- */
346
- address: string;
347
- /**
348
- * Website URL
349
- */
350
- website?: string;
351
- /**
352
- * Name of the Data Protection Officer
353
- */
354
- dpoName: string;
355
- /**
356
- * Email of the Data Protection Officer
357
- */
358
- dpoEmail: string;
359
- /**
360
- * Phone number of the Data Protection Officer
361
- */
362
- dpoPhone?: string;
363
- }
364
- interface RegulatoryReportGeneratorProps {
365
- /**
366
- * The breach data to include in the report
367
- */
368
- breachData: BreachReport;
369
- /**
370
- * The risk assessment data
371
- */
372
- assessmentData?: RiskAssessment;
373
- /**
374
- * Organization information to include in the report
375
- */
376
- organizationInfo: OrganizationInfo;
377
- /**
378
- * Callback function called when the report is generated
379
- */
380
- onGenerate: (report: RegulatoryNotification) => void;
381
- /**
382
- * Title displayed on the generator form
383
- * @default "Generate NDPC Notification Report"
384
- */
385
- title?: string;
386
- /**
387
- * Description text displayed on the generator form
388
- * @default "Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements."
389
- */
390
- description?: string;
391
- /**
392
- * Text for the generate button
393
- * @default "Generate Report"
394
- */
395
- generateButtonText?: string;
396
- /**
397
- * Custom CSS class for the form
398
- */
399
- className?: string;
400
- /**
401
- * Custom CSS class for the buttons
402
- */
403
- buttonClassName?: string;
404
- /**
405
- * Override class names for individual elements
406
- */
407
- classNames?: RegulatoryReportGeneratorClassNames;
408
- /**
409
- * Remove all default styles, only applying classNames overrides
410
- */
411
- unstyled?: boolean;
412
- /**
413
- * Whether to show a preview of the generated report
414
- * @default true
415
- */
416
- showPreview?: boolean;
417
- /**
418
- * Whether to allow editing the report content
419
- * @default true
420
- */
421
- allowEditing?: boolean;
422
- /**
423
- * Whether to allow downloading the report
424
- * @default true
425
- */
426
- allowDownload?: boolean;
427
- /**
428
- * Format for downloading the report
429
- * @default "pdf"
430
- */
431
- downloadFormat?: 'pdf' | 'docx' | 'html';
39
+ interface BreachContextValue extends UseBreachReturn {
40
+ categories: BreachCategory[];
432
41
  }
433
- /**
434
- * Regulatory report generator component. Implements NDPA Section 40 requirements for
435
- * generating formal breach notification reports for submission to the NDPC.
436
- */
437
- declare const RegulatoryReportGenerator: React.FC<RegulatoryReportGeneratorProps>;
42
+ declare function useBreachCompound(): BreachContextValue;
438
43
 
439
- export { BreachCategory, type BreachFormSubmission, BreachNotificationManager, type BreachNotificationManagerClassNames, BreachReport, BreachReportForm, type BreachReportFormClassNames, BreachRiskAssessment, type BreachRiskAssessmentClassNames, RegulatoryNotification, RegulatoryReportGenerator, type RegulatoryReportGeneratorClassNames, RiskAssessment };
44
+ export { Breach, BreachCategory, BreachProvider, type BreachProviderProps, BreachReport, RegulatoryNotification, RiskAssessment, StorageAdapter, useBreachCompound };
package/dist/breach.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk32UIWTGD_js=require('./chunk-32UIWTGD.js'),chunkLI6WJ3LZ_js=require('./chunk-LI6WJ3LZ.js'),chunkRYZEIDNR_js=require('./chunk-RYZEIDNR.js');require('./chunk-EPF7J2FK.js'),require('./chunk-E64TU6IU.js'),require('./chunk-MQFZHA2D.js');Object.defineProperty(exports,"BreachNotificationManager",{enumerable:true,get:function(){return chunk32UIWTGD_js.c}});Object.defineProperty(exports,"BreachReportForm",{enumerable:true,get:function(){return chunk32UIWTGD_js.a}});Object.defineProperty(exports,"BreachRiskAssessment",{enumerable:true,get:function(){return chunk32UIWTGD_js.b}});Object.defineProperty(exports,"RegulatoryReportGenerator",{enumerable:true,get:function(){return chunk32UIWTGD_js.d}});Object.defineProperty(exports,"useBreach",{enumerable:true,get:function(){return chunkLI6WJ3LZ_js.a}});Object.defineProperty(exports,"calculateBreachSeverity",{enumerable:true,get:function(){return chunkRYZEIDNR_js.a}});//# sourceMappingURL=breach.js.map
1
+ 'use strict';var chunkU6VWHC46_js=require('./chunk-U6VWHC46.js'),chunkGVANK6PL_js=require('./chunk-GVANK6PL.js'),chunk2W7ARAW2_js=require('./chunk-2W7ARAW2.js'),chunkRYZEIDNR_js=require('./chunk-RYZEIDNR.js');require('./chunk-EPF7J2FK.js'),require('./chunk-E64TU6IU.js'),require('./chunk-UK656RCG.js');var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var p=react.createContext(null);function P(){let e=react.useContext(p);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 s=({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u,children:d})=>{let y=chunk2W7ARAW2_js.a({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u}),l=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},y),{categories:e});return jsxRuntime.jsx(p.Provider,{value:l,children:d})};var A={Provider:s,ReportForm:chunkGVANK6PL_js.a,RiskAssessment:chunkU6VWHC46_js.a,NotificationManager:chunkU6VWHC46_js.b,ReportGenerator:chunkU6VWHC46_js.c};Object.defineProperty(exports,"BreachNotificationManager",{enumerable:true,get:function(){return chunkU6VWHC46_js.b}});Object.defineProperty(exports,"BreachRiskAssessment",{enumerable:true,get:function(){return chunkU6VWHC46_js.a}});Object.defineProperty(exports,"RegulatoryReportGenerator",{enumerable:true,get:function(){return chunkU6VWHC46_js.c}});Object.defineProperty(exports,"BreachReportForm",{enumerable:true,get:function(){return chunkGVANK6PL_js.a}});Object.defineProperty(exports,"useBreach",{enumerable:true,get:function(){return chunk2W7ARAW2_js.a}});Object.defineProperty(exports,"calculateBreachSeverity",{enumerable:true,get:function(){return chunkRYZEIDNR_js.a}});exports.Breach=A;exports.BreachProvider=s;exports.useBreachCompound=P;//# sourceMappingURL=breach.js.map
2
2
  //# sourceMappingURL=breach.js.map
package/dist/breach.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export{c as BreachNotificationManager,a as BreachReportForm,b as BreachRiskAssessment,d as RegulatoryReportGenerator}from'./chunk-XMYUYQH7.mjs';export{a as useBreach}from'./chunk-OITITR6K.mjs';export{a as calculateBreachSeverity}from'./chunk-RGYK4VAY.mjs';import'./chunk-FXTZDKDC.mjs';import'./chunk-AYKLAEOU.mjs';import'./chunk-WWT2ZSNU.mjs';//# sourceMappingURL=breach.mjs.map
1
+ import {c,b,a}from'./chunk-ISSGO2YT.mjs';export{b as BreachNotificationManager,a as BreachRiskAssessment,c as RegulatoryReportGenerator}from'./chunk-ISSGO2YT.mjs';import {a as a$1}from'./chunk-3XAUN5IM.mjs';export{a as BreachReportForm}from'./chunk-3XAUN5IM.mjs';import {a as a$2}from'./chunk-LFNA6WYQ.mjs';export{a as useBreach}from'./chunk-LFNA6WYQ.mjs';export{a as calculateBreachSeverity}from'./chunk-RGYK4VAY.mjs';import'./chunk-FXTZDKDC.mjs';import'./chunk-AYKLAEOU.mjs';import'./chunk-SBNAMPAP.mjs';import {b as b$1,a as a$3}from'./chunk-WWT2ZSNU.mjs';import {createContext,useContext}from'react';import {jsx}from'react/jsx-runtime';var p=createContext(null);function P(){let e=useContext(p);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 s=({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(p.Provider,{value:l,children:d})};var A={Provider:s,ReportForm:a$1,RiskAssessment:a,NotificationManager:b,ReportGenerator:c};export{A as Breach,s as BreachProvider,P as useBreachCompound};//# sourceMappingURL=breach.mjs.map
2
2
  //# sourceMappingURL=breach.mjs.map
@@ -0,0 +1,2 @@
1
+ import {a}from'./chunk-AYKLAEOU.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var G=({options:l,settings:u,onSave:v,title:h="Manage Your Privacy Settings",description:x="Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function. Consent management is provided in accordance with NDPA Sections 25-26.",saveButtonText:m="Save Preferences",resetButtonText:y="Reset to Defaults",version:k="1.0",className:S="",buttonClassName:i="",primaryButtonClassName:a$2="",secondaryButtonClassName:w="",classNames:e,unstyled:s,showSuccessMessage:R=true,successMessage:B="Your preferences have been saved.",successMessageDuration:D=3e3})=>{let[p,n]=useState({}),[o,d]=useState(false);useEffect(()=>{if(u&&u.consents)n(u.consents);else {let t={};l.forEach(c=>{t[c.id]=c.defaultValue||false;}),n(t);}},[l,u]);let b$1=(t,c)=>{n(L=>b(a$1({},L),{[t]:c}));},I=()=>{let t={consents:p,timestamp:Date.now(),version:k,method:"manager",hasInteracted:true};v(t),R&&(d(true),setTimeout(()=>{d(false);},D));},M=()=>{let t={};l.forEach(c=>{t[c.id]=c.defaultValue||false;}),n(t);},O=(e==null?void 0:e.primaryButton)||(e==null?void 0:e.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${i} ${a$2}`,C=(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.resetButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${i} ${w}`;return jsxs("div",{className:a(`bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 ${S}`,e==null?void 0:e.root,s),children:[jsx("h2",{className:a("text-xl font-bold mb-2",e==null?void 0:e.title,s),children:h}),jsx("p",{className:a("mb-6 text-gray-600 dark:text-gray-300",e==null?void 0:e.description,s),children:x}),jsx("div",{className:a("space-y-6",e==null?void 0:e.optionsList,s),children:l.map(t=>jsx("div",{className:a("border-b border-gray-200 dark:border-gray-700 pb-4 last:border-0",e==null?void 0:e.optionItem,s),children:jsxs("div",{className:"flex items-start justify-between",children:[jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:t.label}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:t.description})]}),jsx("div",{className:"ml-4 flex-shrink-0",children:jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[jsx("input",{type:"checkbox",className:"sr-only peer",checked:p[t.id]||false,onChange:c=>b$1(t.id,c.target.checked),disabled:t.required}),jsx("div",{className:a(`w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-[rgb(var(--ndpr-ring)/0.3)] rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-[rgb(var(--ndpr-primary))] ${t.required?"opacity-60":""}`,e==null?void 0:e.toggle,s)}),jsxs("span",{className:"ml-3 text-sm font-medium text-gray-900 dark:text-gray-300",children:[p[t.id]?"Enabled":"Disabled",t.required&&jsx("span",{className:"text-xs text-red-500 ml-1",children:"(Required)"})]})]})})]})},t.id))}),o&&jsx("div",{className:"mt-4 p-3 bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200 rounded-md",children:B}),jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[jsx("button",{onClick:I,className:a(O,e==null?void 0:e.saveButton,s),children:m}),jsx("button",{onClick:M,className:a(C,e==null?void 0:e.resetButton,s),children:y})]}),jsxs("div",{className:"mt-4 text-xs text-gray-600 dark:text-gray-400",children:[jsxs("p",{children:["Last updated: ",u?new Date(u.timestamp).toLocaleString():"Never"]}),jsxs("p",{children:["Version: ",k]})]})]})};var X=({settings:l,storageOptions:u={},onLoad:v,onSave:h,autoSave:x=true,autoLoad:m=true,classNames:y,unstyled:k,children:S})=>{let{storageKey:i="ndpr_consent",storageType:a$1="localStorage",cookieOptions:w={}}=u,[e,s]=useState(false);useEffect(()=>{m&&!e&&R();},[m,e]),useEffect(()=>{x&&e&&B(l);},[l,x,e]);let R=()=>{let n=null;try{if(a$1==="localStorage"&&typeof window!="undefined"){let o=localStorage.getItem(i);o&&(n=JSON.parse(o));}else if(a$1==="sessionStorage"&&typeof window!="undefined"){let o=sessionStorage.getItem(i);o&&(n=JSON.parse(o));}else if(a$1==="cookie"&&typeof document!="undefined"){let d=document.cookie.split(";").find(b=>b.trim().startsWith(`${i}=`));if(d){let b=d.split("=")[1];n=JSON.parse(decodeURIComponent(b));}}s(!0),v&&v(n);}catch(o){console.error("Error loading consent settings:",o),s(true),v&&v(null);}return n},B=n=>{try{let o=JSON.stringify(n);if(a$1==="localStorage"&&typeof window!="undefined")localStorage.setItem(i,o);else if(a$1==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(i,o);else if(a$1==="cookie"&&typeof document!="undefined"){let{domain:d,path:b="/",expires:I=365,secure:M=!0,sameSite:O="Lax"}=w,C=new Date;C.setDate(C.getDate()+I);let t=`${i}=${encodeURIComponent(o)}; path=${b}; expires=${C.toUTCString()}`;d&&(t+=`; domain=${d}`),M&&(t+="; secure"),t+=`; samesite=${O}`,document.cookie=t;}return h&&h(n),!0}catch(o){return console.error("Error saving consent settings:",o),false}},D=()=>{try{if(a$1==="localStorage"&&typeof window!="undefined")localStorage.removeItem(i);else if(a$1==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(i);else if(a$1==="cookie"&&typeof document!="undefined"){let{domain:n,path:o="/"}=w,d=`${i}=; path=${o}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;n&&(d+=`; domain=${n}`),document.cookie=d;}return !0}catch(n){return console.error("Error clearing consent settings:",n),false}},p=a("",y==null?void 0:y.root,k);if(typeof S=="function"){let n=S({loadSettings:R,saveSettings:B,clearSettings:D,loaded:e});return p?jsx("div",{className:p,children:n}):jsx(Fragment,{children:n})}return p?jsx("div",{className:p,children:S}):jsx(Fragment,{children:S})};export{G as a,X as b};//# sourceMappingURL=chunk-27NYSWUG.mjs.map
2
+ //# sourceMappingURL=chunk-27NYSWUG.mjs.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkTDDAYVKK_js=require('./chunk-TDDAYVKK.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function F(v,c){return c?chunkUK656RCG_js.a(v):{load:()=>null,save:()=>{},remove:()=>{}}}function z({initialActivities:v=[],adapter:c,storageKey:b="ndpr_lawful_basis_activities",useLocalStorage:R=true,onAdd:g,onUpdate:A,onRemove:y}={}){let p=c!=null?c:F(b,R),f=react.useRef(p);f.current=p;let[o,u]=react.useState(v),[x,l]=react.useState(true);react.useEffect(()=>{let t=false;try{let i=f.current.load();i instanceof Promise?i.then(e=>{t||(e&&u(e),l(!1));},()=>{t||l(!1);}):(i&&u(i),l(!1));}catch(i){t||l(false);}return ()=>{t=true;}},[]);let a=react.useCallback(t=>{Promise.resolve(f.current.save(t)).catch(i=>{console.warn("[ndpr-toolkit] Failed to save lawful basis activities:",i);});},[]),_=()=>"lb_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),h=react.useCallback(t=>{let i=Date.now(),e=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{id:_(),createdAt:i,updatedAt:i});return u(s=>{let r=[...s,e];return a(r),r}),g&&g(e),e},[g,a]),O=react.useCallback((t,i)=>{let e=null;return u(s=>{let r=s.findIndex(k=>k.id===t);if(r===-1)return s;e=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},s[r]),i),{id:s[r].id,updatedAt:Date.now()});let P=[...s];return P[r]=e,a(P),P}),e&&A&&A(e),e},[A,a]),D=react.useCallback(t=>{u(i=>{let e=i.filter(s=>s.id!==t);return a(e),e}),y&&y(t);},[y,a]),I=react.useCallback(t=>o.find(i=>i.id===t)||null,[o]),U=react.useCallback(()=>chunkTDDAYVKK_js.d(o),[o]),V=react.useCallback(t=>chunkTDDAYVKK_js.a(t),[]);return {activities:o,addActivity:h,updateActivity:O,removeActivity:D,getActivity:I,getSummary:U,validateActivity:V,isLoading:x}}exports.a=z;//# sourceMappingURL=chunk-2ORDHJRD.js.map
2
+ //# sourceMappingURL=chunk-2ORDHJRD.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkRYZEIDNR_js=require('./chunk-RYZEIDNR.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function K(q,h){return h?chunkUK656RCG_js.a(q):{load:()=>null,save:()=>{},remove:()=>{}}}function W({categories:q,initialReports:h=[],adapter:g,storageKey:L="ndpr_breach_data",useLocalStorage:P=true,onReport:v,onAssessment:S,onNotification:I}){let D=g!=null?g:K(L,P),d=react.useRef(D);d.current=D;let[a,m]=react.useState(h),[u,A]=react.useState([]),[c,B]=react.useState([]),[U,N]=react.useState(true);react.useEffect(()=>{let e=false;try{let s=d.current.load(),r=t=>{var i,n,l;t&&(m((i=t.reports)!=null?i:[]),A((n=t.assessments)!=null?n:[]),B((l=t.notifications)!=null?l:[])),N(!1);};s instanceof Promise?s.then(t=>{e||r(t);},()=>{e||N(!1);}):r(s);}catch(s){e||N(false);}return ()=>{e=true;}},[]);let f=(e,s,r)=>{Promise.resolve(d.current.save({reports:e,assessments:s,notifications:r})).catch(t=>{console.warn("[ndpr-toolkit] Failed to save breach data:",t);});},y=e=>`${e}_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,_=e=>{let s=chunkMQFZHA2D_js.a({id:y("breach"),reportedAt:Date.now()},e),r=[...a,s];return m(r),f(r,u,c),v&&v(s),s},$=(e,s)=>{let r=a.findIndex(n=>n.id===e);if(r===-1)return null;let t=chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},a[r]),s),i=[...a];return i[r]=t,m(i),f(i,u,c),t},w=e=>a.find(s=>s.id===e)||null,j=(e,s)=>{let r=u.find(n=>n.breachId===e),t,i;return r?(i=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},r),s),{assessedAt:Date.now()}),t=u.map(n=>n.id===r.id?i:n)):(i=chunkMQFZHA2D_js.a({id:y("assessment"),breachId:e,assessedAt:Date.now()},s),t=[...u,i]),A(t),f(a,t,c),S&&S(i),i},b=e=>u.find(s=>s.breachId===e)||null,x=e=>{let s=w(e),r=b(e);if(!s)return null;let{severityLevel:t,notificationRequired:i,timeframeHours:n,justification:l}=chunkRYZEIDNR_js.a(s,r||void 0),R=s.discoveredAt+n*60*60*1e3;return {ndpcNotificationRequired:i,ndpcNotificationDeadline:R,dataSubjectNotificationRequired:t==="high"||t==="critical",justification:l}};return {reports:a,assessments:u,notifications:c,reportBreach:_,updateReport:$,getReport:w,assessRisk:j,getAssessment:b,calculateNotificationRequirements:x,sendNotification:(e,s)=>{let r=c.find(n=>n.breachId===e),t,i;return r?(i=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},r),s),{sentAt:Date.now()}),t=c.map(n=>n.id===r.id?i:n)):(i=chunkMQFZHA2D_js.a({id:y("notification"),breachId:e,sentAt:Date.now()},s),t=[...c,i]),B(t),f(a,u,t),I&&I(i),i},getNotification:e=>c.find(s=>s.breachId===e)||null,getBreachesRequiringNotification:(e=24)=>{let s=Date.now(),r=[];return a.forEach(t=>{if(c.some(E=>E.breachId===t.id))return;let i=b(t.id);if(!i)return;let n=x(t.id);if(!n||!n.ndpcNotificationRequired)return;let R=(n.ndpcNotificationDeadline-s)/(3600*1e3);R<=e&&r.push({report:t,assessment:i,requirements:n,hoursRemaining:R});}),r.sort((t,i)=>t.hoursRemaining-i.hoursRemaining)},clearBreachData:()=>{m([]),A([]),B([]),Promise.resolve(d.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove breach data:",e);});},isLoading:U}}exports.a=W;//# sourceMappingURL=chunk-2W7ARAW2.js.map
2
+ //# sourceMappingURL=chunk-2W7ARAW2.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';function p(t){return {load(){if(typeof window=="undefined")return null;try{let n=sessionStorage.getItem(t);return n?JSON.parse(n):null}catch(n){return null}},save(n){typeof window!="undefined"&&sessionStorage.setItem(t,JSON.stringify(n));},remove(){typeof window!="undefined"&&sessionStorage.removeItem(t);}}}function f(t,n={}){let{domain:r,path:a="/",expires:s=365,secure:d=true,sameSite:u="Lax"}=n;return {load(){if(typeof document=="undefined")return null;try{let e=document.cookie.split(";").map(o=>o.trim()).find(o=>o.startsWith(`${t}=`));return e?JSON.parse(decodeURIComponent(e.split("=")[1])):null}catch(e){return null}},save(e){if(typeof document=="undefined")return;let o=new Date;o.setDate(o.getDate()+s);let i=`${t}=${encodeURIComponent(JSON.stringify(e))}; path=${a}; expires=${o.toUTCString()}; samesite=${u}`;r&&(i+=`; domain=${r}`),d&&(i+="; secure"),document.cookie=i;},remove(){if(typeof document=="undefined")return;let e=`${t}=; path=${a}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;r&&(e+=`; domain=${r}`),document.cookie=e;}}}exports.a=p;exports.b=f;//# sourceMappingURL=chunk-3F34NACG.js.map
2
+ //# sourceMappingURL=chunk-3F34NACG.js.map
@@ -0,0 +1,7 @@
1
+ 'use strict';var chunk5RSOLEEP_js=require('./chunk-5RSOLEEP.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var tr=({sections:x=chunk5RSOLEEP_js.b,variables:h=chunk5RSOLEEP_js.c,onGenerate:F,title:L="NDPA Privacy Policy Generator",description:I="Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24.",className:R="",buttonClassName:y="",generateButtonText:O="Generate Policy",showPreview:K=true,allowEditing:P=true,classNames:r,unstyled:p=false})=>{let[f,$]=react.useState(x),[s,S]=react.useState(h),[l,m]=react.useState("sections"),[C,j]=react.useState(""),[E,G]=react.useState(""),[Q,_]=react.useState(false),[b,V]=react.useState({});react.useEffect(()=>{$(x);},[x]),react.useEffect(()=>{S(h);},[h]);let W=t=>{$(d=>d.map(n=>n.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{included:!n.included}):n));},k=(t,d)=>{S(n=>n.map(a=>a.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{value:d}):a)),b[t]&&V(n=>{let a=chunkMQFZHA2D_js.a({},n);return delete a[t],a});},U=()=>{let t={},d=true;return s.forEach(n=>{n.required&&!n.value&&(t[n.id]=`${n.name} is required`,d=false);}),V(t),d},Y=()=>{if(!U()){m("variables");return}let t=f.filter(a=>a.included),d=Object.fromEntries(s.map(a=>[a.name,a.value])),n="";t.forEach(a=>{n+=`## ${a.title}
2
+
3
+ `,n+=chunk5RSOLEEP_js.a(a.template,d),n+=`
4
+
5
+ `;}),j(n),G(n),_(true),m("preview");},z=()=>{F({sections:f,variables:s,content:P?E:C});},q=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",r==null?void 0:r.sectionList,p),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),f.map(t=>jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("border border-gray-200 dark:border-gray-700 rounded-md p-4",r==null?void 0:r.sectionItem,p),children:jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`section-${t.id}`,type:"checkbox",checked:t.included,onChange:()=>W(t.id),disabled:t.required,className:chunkE64TU6IU_js.a("w-4 h-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))] dark:focus:ring-[rgb(var(--ndpr-ring))] dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600",r==null?void 0:r.input,p)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:`section-${t.id}`,className:"font-medium text-gray-900 dark:text-white",children:[t.title," ",t.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),t.description&&jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:t.description})]})]})},t.id)),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{onClick:()=>m("variables"),className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),p),children:"Next: Fill Variables"})})]}),M=()=>{let t={};return s.forEach(d=>{let n=d.id.split(".")[0];t[n]||(t[n]=[]),t[n].push(d);}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",r==null?void 0:r.form,p),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Fill Policy Variables"}),jsxRuntime.jsx("div",{className:"space-y-6",children:Object.entries(t).map(([d,n])=>{let a=f.find(i=>i.id===d);return a&&!a.included?null:jsxRuntime.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxRuntime.jsx("h4",{className:"font-medium text-lg mb-3",children:a?a.title:"General Information"}),jsxRuntime.jsx("div",{className:"space-y-4",children:n.map(i=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`var-${i.id}`,className:"block text-sm font-medium mb-1",children:[i.name," ",i.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),i.description&&jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:i.description}),i.inputType==="textarea"?jsxRuntime.jsx("textarea",{id:`var-${i.id}`,value:i.value,onChange:c=>k(i.id,c.target.value),rows:4,className:chunkE64TU6IU_js.a(`w-full px-3 py-2 border ${b[i.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,p),required:i.required}):i.inputType==="select"&&i.options?jsxRuntime.jsxs("select",{id:`var-${i.id}`,value:i.value,onChange:c=>k(i.id,c.target.value),className:chunkE64TU6IU_js.a(`w-full px-3 py-2 border ${b[i.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,p),required:i.required,children:[jsxRuntime.jsx("option",{value:"",children:"Select an option"}),i.options.map(c=>jsxRuntime.jsx("option",{value:c,children:c},c))]}):jsxRuntime.jsx("input",{id:`var-${i.id}`,type:i.inputType,value:i.value,onChange:c=>k(i.id,c.target.value),className:chunkE64TU6IU_js.a(`w-full px-3 py-2 border ${b[i.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,p),required:i.required}),b[i.id]&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-500",children:b[i.id]})]},i.id))})]},d)})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>m("sections"),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${y}`,children:"Back to Sections"}),jsxRuntime.jsx("button",{onClick:Y,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),p),children:O})]})]})},H=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),P?jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{htmlFor:"policy-content",className:"block text-sm font-medium mb-1",children:"Edit Policy Content"}),jsxRuntime.jsx("textarea",{id:"policy-content",value:E,onChange:t=>G(t.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] font-mono text-sm"})]}):jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:jsxRuntime.jsx("div",{className:"prose dark:prose-invert max-w-none",children:C.split(`
6
+ `).map((t,d)=>t.startsWith("## ")?jsxRuntime.jsx("h2",{className:"text-xl font-bold mt-6 mb-3",children:t.substring(3)},d):t.startsWith("### ")?jsxRuntime.jsx("h3",{className:"text-lg font-bold mt-4 mb-2",children:t.substring(4)},d):t===""?jsxRuntime.jsx("br",{},d):jsxRuntime.jsx("p",{className:"mb-2",children:t},d))})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>m("variables"),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${y}`,children:"Back to Variables"}),jsxRuntime.jsx("button",{onClick:z,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${y}`,children:"Save Policy"})]})]}),J=()=>{switch(l){case "sections":return q();case "variables":return M();case "preview":return H();default:return q()}};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${R}`,r==null?void 0:r.root,p),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",r==null?void 0:r.header,p),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",r==null?void 0:r.title,p),children:L}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",r==null?void 0:r.description,p),children:I})]}),jsxRuntime.jsx("div",{className:"mb-8",children:jsxRuntime.jsxs("ol",{className:"flex items-center w-full",children:[jsxRuntime.jsxs("li",{className:`flex w-full items-center ${l==="sections"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${l==="sections"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"1"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Sections"})]}),jsxRuntime.jsxs("li",{className:`flex w-full items-center ${l==="variables"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${l==="variables"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"2"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Variables"})]}),jsxRuntime.jsxs("li",{className:`flex items-center ${l==="preview"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"}`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${l==="preview"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"3"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Preview"})]})]})}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",r==null?void 0:r.complianceNotice,p),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"This tool helps you generate a privacy policy that aligns with the Nigeria Data Protection Act (NDPA) 2023. While we strive to ensure compliance, we recommend having the final policy reviewed by a legal professional familiar with NDPA requirements."})]}),J()]})};exports.a=tr;//# sourceMappingURL=chunk-3RGJV3VF.js.map
7
+ //# sourceMappingURL=chunk-3RGJV3VF.js.map
@@ -0,0 +1,2 @@
1
+ import {a}from'./chunk-AYKLAEOU.mjs';import {jsxs,jsx}from'react/jsx-runtime';var m={consent:"Consent",dsr:"Data Subject Rights",dpia:"DPIA",breach:"Breach Notification",policy:"Privacy Policy",lawfulBasis:"Lawful Basis",crossBorder:"Cross-Border",ropa:"ROPA"},p={critical:"rgb(var(--ndpr-destructive))","needs-work":"rgb(var(--ndpr-warning))",good:"rgb(var(--ndpr-primary))",excellent:"rgb(var(--ndpr-success))"},x={critical:"Critical","needs-work":"Needs Work",good:"Good",excellent:"Excellent"},f={critical:"Critical",high:"High",medium:"Medium",low:"Low"},y=({score:t,rating:e,classNames:o,unstyled:a$1})=>{let r=p[e],i=2*Math.PI*40,l=i*(1-t/100);return jsxs("div",{className:a("relative inline-flex items-center justify-center",o==null?void 0:o.scoreCircle,a$1),children:[jsxs("svg",{width:"120",height:"120",viewBox:"0 0 100 100","aria-hidden":"true",children:[jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:"rgba(0,0,0,0.08)",strokeWidth:"8"}),jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:r,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:l,transform:"rotate(-90 50 50)",style:{transition:"stroke-dashoffset 0.4s ease"}})]}),jsx("span",{className:a("absolute text-2xl font-bold tabular-nums",o==null?void 0:o.scoreValue,a$1),style:{color:r},children:t})]})},C=({rating:t,className:e,unstyled:o})=>{let a$1=p[t];return jsx("span",{className:a("inline-block px-3 py-1 rounded-full text-sm font-semibold",e,o),style:{backgroundColor:`${a$1.replace("rgb(","rgba(").replace(")",", 0.12)")}`,color:a$1,border:`1px solid ${a$1.replace("rgb(","rgba(").replace(")",", 0.3)")}`},children:x[t]})},h=({moduleKey:t,module:e,classNames:o,unstyled:a$1})=>{var b;let r=e.score>=90?"excellent":e.score>=70?"good":e.score>=40?"needs-work":"critical",i=p[r];Math.round(e.score/100*(e.gaps.length+Math.round(e.score/100*5)));let u=e.gaps.length,c=(b=m[t])!=null?b:t;return jsxs("div",{className:a("rounded-lg border p-4 flex flex-col gap-2",o==null?void 0:o.moduleCard,a$1),style:{borderColor:`${i.replace("rgb(","rgba(").replace(")",", 0.25)")}`,backgroundColor:`${i.replace("rgb(","rgba(").replace(")",", 0.04)")}`},children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:a("text-sm font-semibold truncate",o==null?void 0:o.moduleTitle,a$1),children:c}),jsx("span",{className:a("text-lg font-bold tabular-nums",o==null?void 0:o.moduleScore,a$1),style:{color:i},children:e.score})]}),jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{backgroundColor:"rgba(0,0,0,0.08)"},role:"progressbar","aria-valuenow":e.score,"aria-valuemin":0,"aria-valuemax":100,children:jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${e.score}%`,backgroundColor:i}})}),u>0&&jsxs("p",{className:a("text-xs text-gray-500 dark:text-gray-400",o==null?void 0:o.moduleGaps,a$1),children:[u," gap",u!==1?"s":""," to address"]})]})},R=({rec:t,classNames:e,unstyled:o})=>{var i,l;let r=(i={critical:p.critical,high:p["needs-work"],medium:p.good,low:p.excellent}[t.priority])!=null?i:p.good;return jsxs("div",{"data-testid":"recommendation-item",className:a("flex gap-3 p-3 rounded-lg border border-gray-100 dark:border-gray-700 bg-white dark:bg-gray-800",e==null?void 0:e.recommendationItem,o),children:[jsx("span",{className:a("mt-0.5 shrink-0 inline-block px-2 py-0.5 rounded text-xs font-bold uppercase tracking-wide",e==null?void 0:e.recommendationPriority,o),style:{backgroundColor:`${r.replace("rgb(","rgba(").replace(")",", 0.12)")}`,color:r},children:(l=f[t.priority])!=null?l:t.priority}),jsxs("div",{className:"min-w-0 flex-1",children:[jsx("p",{className:a("text-sm font-medium text-gray-900 dark:text-gray-100",e==null?void 0:e.recommendationTitle,o),children:t.label}),jsx("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400 leading-relaxed",children:t.recommendation}),jsxs("p",{className:"mt-1 text-xs text-gray-400 dark:text-gray-500",children:[t.ndpaSection," \u2022 Effort: ",t.effort]})]})]})},k=({report:t,title:e="NDPA Compliance Dashboard",showRecommendations:o=true,maxRecommendations:a$1=5,classNames:r,unstyled:i=false})=>{let l=t.recommendations.slice(0,a$1),u=Object.entries(t.modules);return jsxs("div",{"data-ndpr-component":"compliance-dashboard",className:a("w-full rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-sm p-6 flex flex-col gap-8",r==null?void 0:r.root,i),children:[jsxs("div",{className:a("flex flex-col sm:flex-row items-start sm:items-center gap-6",r==null?void 0:r.header,i),children:[jsx(y,{score:t.score,rating:t.rating,classNames:{scoreCircle:r==null?void 0:r.scoreCircle,scoreValue:r==null?void 0:r.scoreValue},unstyled:i}),jsxs("div",{className:"flex flex-col gap-2",children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-gray-100 leading-tight",children:e}),jsx(C,{rating:t.rating,className:r==null?void 0:r.ratingBadge,unstyled:i}),jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Generated on"," ",new Date(t.generatedAt).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})]})]})]}),jsx("div",{className:a("grid grid-cols-2 sm:grid-cols-2 md:grid-cols-4 gap-3",r==null?void 0:r.modulesGrid,i),children:u.map(([c,b])=>jsx(h,{moduleKey:c,module:b,classNames:{moduleCard:r==null?void 0:r.moduleCard,moduleTitle:r==null?void 0:r.moduleTitle,moduleScore:r==null?void 0:r.moduleScore,moduleGaps:r==null?void 0:r.moduleGaps},unstyled:i},c))}),o&&l.length>0&&jsxs("div",{className:a("flex flex-col gap-3",r==null?void 0:r.recommendationsSection,i),children:[jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:"Recommendations"}),l.map(c=>jsx(R,{rec:c,classNames:{recommendationItem:r==null?void 0:r.recommendationItem,recommendationPriority:r==null?void 0:r.recommendationPriority,recommendationTitle:r==null?void 0:r.recommendationTitle},unstyled:i},`${c.module}-${c.key}`))]})]})};export{k as a};//# sourceMappingURL=chunk-3UWT64FI.mjs.map
2
+ //# sourceMappingURL=chunk-3UWT64FI.mjs.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkCMZTI7SG_js=require('./chunk-CMZTI7SG.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function _(c,a){return a?chunkUK656RCG_js.a(c):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialRequests:c=[],requestTypes:a,adapter:S,storageKey:h="ndpr_dsr_requests",useLocalStorage:P=true,onSubmit:D,onUpdate:f}){let m=S!=null?S:_(h,P),i=react.useRef(m);i.current=m;let[q,r]=react.useState(c),[x,d]=react.useState(true);react.useEffect(()=>{let e=false;try{let t=i.current.load();t instanceof Promise?t.then(s=>{e||(s&&r(s),d(!1));},()=>{e||d(!1);}):(t&&r(t),d(!1));}catch(t){e||d(false);}return ()=>{e=true;}},[]);let g=react.useCallback(e=>{Promise.resolve(i.current.save(e)).catch(t=>{console.warn("[ndpr-toolkit] Failed to save DSR requests:",t);});},[]),I=()=>"dsr_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);return {requests:q,submitRequest:e=>{let t=a.find(p=>p.id===e.type),s=(t==null?void 0:t.estimatedCompletionTime)||30,u=Date.now(),n=u+s*24*60*60*1e3,A=e,{createdAt:y}=A,o=chunkMQFZHA2D_js.c(A,["createdAt"]),R=chunkMQFZHA2D_js.a({id:I(),status:"pending",createdAt:u,updatedAt:u,dueDate:n},o);return r(p=>{let b=[...p,R];return g(b),b}),D&&D(R),R},updateRequest:(e,t)=>{let s=null;return r(u=>{let n=u.findIndex(R=>R.id===e);if(n===-1)return u;let y=u[n];s=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},y),t),{updatedAt:Date.now()});let o=[...u];return o[n]=s,g(o),o}),s&&f&&f(s),s},getRequest:e=>q.find(t=>t.id===e)||null,getRequestsByStatus:e=>q.filter(t=>t.status===e),getRequestsByType:e=>q.filter(t=>t.type===e),getRequestType:e=>a.find(t=>t.id===e),formatRequest:e=>{let{formattedRequest:t}=chunkCMZTI7SG_js.a(e);return t},clearRequests:()=>{r([]),Promise.resolve(i.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove DSR requests:",e);});},isLoading:x}}exports.a=Q;//# sourceMappingURL=chunk-3V23O4ZJ.js.map
2
+ //# sourceMappingURL=chunk-3V23O4ZJ.js.map