@tantainnovative/ndpr-toolkit 3.3.0 → 3.4.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 (176) hide show
  1. package/CHANGELOG.md +529 -0
  2. package/README.md +4 -4
  3. package/dist/{ConsentBanner-CDRT0o2k.d.mts → ConsentBanner-F5ayys5K.d.mts} +10 -0
  4. package/dist/{ConsentBanner-Vxyt8SCX.d.ts → ConsentBanner-VqIPophc.d.ts} +10 -0
  5. package/dist/{styling-B7CBzYG7.d.ts → ConsentManager-C7I3PDe8.d.mts} +2 -62
  6. package/dist/{styling-uJLsBbER.d.mts → ConsentManager-CQ2IZtUU.d.ts} +2 -62
  7. package/dist/{sanitize-B0AzEm1D.d.mts → NDPRProvider-DYFb8xEl.d.ts} +2 -94
  8. package/dist/{sanitize-B0AzEm1D.d.ts → NDPRProvider-U3QNu6MA.d.mts} +2 -94
  9. package/dist/adapters.js +1 -1
  10. package/dist/adapters.mjs +1 -1
  11. package/dist/breach.js +1 -1
  12. package/dist/breach.mjs +1 -1
  13. package/dist/chunk-2AW7KAZO.mjs +2 -0
  14. package/dist/chunk-2WH4DLV5.js +3 -0
  15. package/dist/chunk-3NQQSU4P.js +2 -0
  16. package/dist/chunk-3VQAYQR7.js +7 -0
  17. package/dist/chunk-4R42ZNO7.mjs +318 -0
  18. package/dist/chunk-5HL4UBFV.js +2 -0
  19. package/dist/chunk-6FGCGLH5.mjs +2 -0
  20. package/dist/chunk-6HZL2WDU.mjs +2 -0
  21. package/dist/chunk-6QPRDQZF.js +2 -0
  22. package/dist/chunk-74Z23WUA.mjs +2 -0
  23. package/dist/chunk-AHSMDPG5.js +132 -0
  24. package/dist/chunk-BN77GP4W.mjs +2 -0
  25. package/dist/chunk-C5QO3SX4.js +2 -0
  26. package/dist/chunk-CISJAQ6W.mjs +2 -0
  27. package/dist/chunk-DCJK5OZT.mjs +2 -0
  28. package/dist/chunk-DUY6F3GT.mjs +94 -0
  29. package/dist/chunk-EHAZIKDX.js +81 -0
  30. package/dist/chunk-EPT2K355.mjs +2 -0
  31. package/dist/chunk-HGGLW5TE.js +2 -0
  32. package/dist/chunk-HQSU7LGM.js +94 -0
  33. package/dist/chunk-IZCWCE7W.mjs +2 -0
  34. package/dist/chunk-JBSCER34.js +2 -0
  35. package/dist/chunk-KF3EFJEF.mjs +3 -0
  36. package/dist/chunk-KSERBMXW.mjs +4 -0
  37. package/dist/chunk-LJNNPAFU.mjs +2 -0
  38. package/dist/{chunk-UXMGBIX6.js → chunk-LSCMXAPY.mjs} +4 -4
  39. package/dist/chunk-LSNL4XR5.js +2 -0
  40. package/dist/chunk-M2TPT5GB.js +2 -0
  41. package/dist/chunk-MCWV7S2G.js +2 -0
  42. package/dist/chunk-MG73MOZC.mjs +15 -0
  43. package/dist/chunk-NCOZB2WU.mjs +2 -0
  44. package/dist/chunk-NQNFS3QI.js +7 -0
  45. package/dist/chunk-OPYQIJKY.js +2 -0
  46. package/dist/{chunk-ZEOQYWOE.mjs → chunk-P2YV6DR3.js} +4 -4
  47. package/dist/chunk-P6QAFBCV.js +2 -0
  48. package/dist/chunk-QVULSG6J.mjs +3 -0
  49. package/dist/chunk-R5FW5XUQ.mjs +2 -0
  50. package/dist/chunk-RGNP45VR.js +2 -0
  51. package/dist/chunk-RLYTX3MM.js +2 -0
  52. package/dist/chunk-RNTNHVKZ.js +15 -0
  53. package/dist/chunk-RRVKUCFR.mjs +2 -0
  54. package/dist/chunk-RXL6CZAI.js +2 -0
  55. package/dist/chunk-RY3PGVLZ.mjs +2 -0
  56. package/dist/chunk-SUEGUY35.js +2 -0
  57. package/dist/chunk-SYMQJO2W.mjs +7 -0
  58. package/dist/chunk-TCN22KYP.mjs +7 -0
  59. package/dist/chunk-UFPSUO52.js +318 -0
  60. package/dist/chunk-VTITKWGX.mjs +2 -0
  61. package/dist/chunk-WH6ZMUOS.mjs +81 -0
  62. package/dist/chunk-WTJGLNTB.js +3 -0
  63. package/dist/chunk-XHROISIF.mjs +2 -0
  64. package/dist/chunk-XMBSJJ5U.js +4 -0
  65. package/dist/chunk-XSEZDQLB.js +2 -0
  66. package/dist/chunk-Z6IIMLZU.mjs +2 -0
  67. package/dist/chunk-ZLSWOFAY.mjs +132 -0
  68. package/dist/chunk-ZPKVLTSX.js +2 -0
  69. package/dist/consent.d.mts +6 -4
  70. package/dist/consent.d.ts +6 -4
  71. package/dist/consent.js +1 -1
  72. package/dist/consent.mjs +1 -1
  73. package/dist/core.d.mts +6 -25
  74. package/dist/core.d.ts +6 -25
  75. package/dist/core.js +1 -1
  76. package/dist/core.mjs +1 -1
  77. package/dist/cross-border.d.mts +2 -2
  78. package/dist/cross-border.d.ts +2 -2
  79. package/dist/cross-border.js +1 -1
  80. package/dist/cross-border.mjs +1 -1
  81. package/dist/docx-BxKascXN.d.ts +64 -0
  82. package/dist/docx-CV7Vsry_.d.mts +64 -0
  83. package/dist/dpia.js +1 -1
  84. package/dist/dpia.mjs +1 -1
  85. package/dist/dsr.js +1 -1
  86. package/dist/dsr.mjs +1 -1
  87. package/dist/hooks.d.mts +4 -4
  88. package/dist/hooks.d.ts +4 -4
  89. package/dist/hooks.js +1 -1
  90. package/dist/hooks.mjs +1 -1
  91. package/dist/index.d.mts +8 -6
  92. package/dist/index.d.ts +8 -6
  93. package/dist/index.js +1 -1
  94. package/dist/index.mjs +1 -1
  95. package/dist/lawful-basis.js +1 -1
  96. package/dist/lawful-basis.mjs +1 -1
  97. package/dist/locale-CxJx2tzn.d.mts +25 -0
  98. package/dist/locale-DSkrtf-c.d.ts +25 -0
  99. package/dist/{policy-engine-C6nC2t3a.d.ts → policy-engine-CCUCud2T.d.ts} +1 -1
  100. package/dist/{policy-engine-DefZcX3R.d.mts → policy-engine-fYSqEqSW.d.mts} +1 -1
  101. package/dist/{policy-sections-DFDPVCCg.d.ts → policy-sections-BYx6fEFk.d.ts} +4 -2
  102. package/dist/{policy-sections-Bylm31kZ.d.mts → policy-sections-Dm97Nq8m.d.mts} +4 -2
  103. package/dist/{policy-templates-CIKcV0i1.d.ts → policy-templates-DhLwq4R-.d.ts} +8 -1
  104. package/dist/{policy-templates-DMsPwOSZ.d.mts → policy-templates-DwYl2329.d.mts} +8 -1
  105. package/dist/policy.d.mts +36 -71
  106. package/dist/policy.d.ts +36 -71
  107. package/dist/policy.js +1 -1
  108. package/dist/policy.mjs +1 -1
  109. package/dist/presets.d.mts +2 -2
  110. package/dist/presets.d.ts +2 -2
  111. package/dist/presets.js +1 -1
  112. package/dist/presets.mjs +1 -1
  113. package/dist/ropa.js +1 -1
  114. package/dist/ropa.mjs +1 -1
  115. package/dist/sanitize-CxxwKxAx.d.mts +94 -0
  116. package/dist/sanitize-CxxwKxAx.d.ts +94 -0
  117. package/dist/server.d.mts +24 -0
  118. package/dist/server.d.ts +24 -0
  119. package/dist/server.js +2 -0
  120. package/dist/server.mjs +2 -0
  121. package/dist/styles.css +1423 -31
  122. package/dist/styling-BMDGQDgS.d.mts +64 -0
  123. package/dist/styling-BaoQtV06.d.ts +64 -0
  124. package/dist/unstyled.d.mts +52 -19
  125. package/dist/unstyled.d.ts +52 -19
  126. package/dist/unstyled.js +1 -1
  127. package/dist/unstyled.mjs +1 -1
  128. package/dist/{useAdaptivePolicyWizard-A1PyOy6P.d.mts → useAdaptivePolicyWizard-BnjW4OR4.d.mts} +1 -1
  129. package/dist/{useAdaptivePolicyWizard-LVIKhAxw.d.ts → useAdaptivePolicyWizard-sb3m4-Zk.d.ts} +1 -1
  130. package/dist/{useCrossBorderTransfer-BGNZt2lk.d.mts → useCrossBorderTransfer-DixjLjN1.d.mts} +1 -1
  131. package/dist/{useCrossBorderTransfer-COqjgjsu.d.ts → useCrossBorderTransfer-DvSq06lv.d.ts} +1 -1
  132. package/dist/{useDefaultPrivacyPolicy-BsYttRey.d.mts → useDefaultPrivacyPolicy-Cs2WQSYQ.d.mts} +34 -9
  133. package/dist/{useDefaultPrivacyPolicy-C-mG-A5S.d.ts → useDefaultPrivacyPolicy-DkOqMg2e.d.ts} +34 -9
  134. package/package.json +20 -6
  135. package/dist/chunk-256APOQM.js +0 -2
  136. package/dist/chunk-25OOUES4.js +0 -2
  137. package/dist/chunk-4JKTIR33.mjs +0 -2
  138. package/dist/chunk-5BUS6AI7.js +0 -2
  139. package/dist/chunk-6BXUVS6E.js +0 -81
  140. package/dist/chunk-6JCRDJQI.mjs +0 -2
  141. package/dist/chunk-6RQGQZT2.js +0 -2
  142. package/dist/chunk-6YN73KR7.mjs +0 -2
  143. package/dist/chunk-CDZDT2OS.mjs +0 -320
  144. package/dist/chunk-CSIJCLGZ.mjs +0 -2
  145. package/dist/chunk-CWUPGY3M.mjs +0 -3
  146. package/dist/chunk-E63VPR7U.js +0 -2
  147. package/dist/chunk-FDDI426Y.mjs +0 -2
  148. package/dist/chunk-GCQRHMTQ.mjs +0 -144
  149. package/dist/chunk-GMLCWGNJ.js +0 -7
  150. package/dist/chunk-GQVNLUP2.js +0 -94
  151. package/dist/chunk-GXLSOZCH.mjs +0 -2
  152. package/dist/chunk-IQJO7WIH.js +0 -7
  153. package/dist/chunk-LETEUS5X.mjs +0 -2
  154. package/dist/chunk-LU4PFST7.js +0 -144
  155. package/dist/chunk-M6XETYNL.js +0 -2
  156. package/dist/chunk-NBSVFQ5G.js +0 -2
  157. package/dist/chunk-NUDVUAD4.mjs +0 -81
  158. package/dist/chunk-NUULHXVL.mjs +0 -7
  159. package/dist/chunk-PM7O5IGE.mjs +0 -2
  160. package/dist/chunk-Q7VHB64E.mjs +0 -2
  161. package/dist/chunk-QDHHD2KR.mjs +0 -94
  162. package/dist/chunk-SAA7UVI2.js +0 -3
  163. package/dist/chunk-TI2M7H6R.mjs +0 -7
  164. package/dist/chunk-TKVJ3OOV.mjs +0 -2
  165. package/dist/chunk-TXXWCB5O.js +0 -320
  166. package/dist/chunk-UGY5ZYUG.js +0 -2
  167. package/dist/chunk-UO6QPJLH.js +0 -2
  168. package/dist/chunk-UX6ZZNEM.mjs +0 -3
  169. package/dist/chunk-VLSGE2YA.js +0 -2
  170. package/dist/chunk-XFUEZ3MP.mjs +0 -2
  171. package/dist/chunk-XHSHPB74.js +0 -2
  172. package/dist/chunk-YCX6BFOQ.js +0 -2
  173. package/dist/chunk-YURSF2YO.mjs +0 -2
  174. package/dist/chunk-YZXUAIYN.js +0 -3
  175. package/dist/chunk-ZGJA7OO4.js +0 -2
  176. package/dist/chunk-ZT7KNFAU.mjs +0 -2
@@ -1,144 +0,0 @@
1
- 'use strict';var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js');var f=[{id:"full-name",label:"Full Name",group:"identity",dataPoints:["first name","last name","middle name","title"],selected:false},{id:"contact-details",label:"Contact Details",group:"identity",dataPoints:["email address","phone number","postal address"],selected:false},{id:"government-ids",label:"Government-Issued Identifiers",group:"identity",dataPoints:["NIN","passport number","driver's licence number","voter's card number"],selected:false},{id:"account-credentials",label:"Account Credentials",group:"identity",dataPoints:["username","hashed password","security questions"],selected:false},{id:"payment-info",label:"Payment Information",group:"financial",dataPoints:["credit/debit card number","bank account number","billing address"],selected:false},{id:"financial-records",label:"Financial Records",group:"financial",dataPoints:["transaction history","account balance","income details"],selected:false},{id:"bvn",label:"Bank Verification Number (BVN)",group:"financial",dataPoints:["BVN"],selected:false},{id:"device-info",label:"Device & Browser Information",group:"behavioral",dataPoints:["IP address","browser type","operating system","device identifiers"],selected:false},{id:"usage-data",label:"Usage & Analytics Data",group:"behavioral",dataPoints:["pages visited","click patterns","session duration","referral source"],selected:false},{id:"location-data",label:"Location Data",group:"behavioral",dataPoints:["GPS coordinates","city","country","timezone"],selected:false},{id:"cookies",label:"Cookies & Tracking Technologies",group:"behavioral",dataPoints:["cookie identifiers","pixel tags","local storage data"],selected:false},{id:"health-data",label:"Health & Medical Data",group:"sensitive",dataPoints:["medical history","prescriptions","health insurance details","disability status"],selected:false},{id:"biometric-data",label:"Biometric Data",group:"sensitive",dataPoints:["fingerprints","facial recognition data","voiceprints"],selected:false},{id:"ethnic-religious",label:"Ethnic Origin & Religious Beliefs",group:"sensitive",dataPoints:["ethnic origin","religious affiliation","political opinions"],selected:false},{id:"child-identity",label:"Child Identity Information",group:"children",dataPoints:["child's name","date of birth","school name","parent/guardian contact"],selected:false},{id:"child-activity",label:"Child Online Activity",group:"children",dataPoints:["content viewed","in-app activity","communications"],selected:false}];function R(){return {org:{name:"",website:"",privacyEmail:"",address:"",dpoName:"",dpoEmail:"",industry:"other",orgSize:"startup",country:"Nigeria"},dataCategories:f.map(e=>chunkMQFZHA2D_js.a({},e)),purposes:[],hasChildrenData:false,hasSensitiveData:false,hasFinancialData:false,hasCrossBorderTransfer:false,hasAutomatedDecisions:false,thirdPartyProcessors:[]}}function u(e,t){return e.sections.some(i=>i.id===t&&i.included)}function h(e,t){var n;let i=e.sections.find(a=>a.id===t&&a.included);return (n=i==null?void 0:i.template)!=null?n:""}function g(e){return e.sections.filter(t=>t.included).map(t=>t.template).join(`
2
- `)}var m=[{id:"controller-identity",name:"Controller Identity",ndpaSection:"NDPA Section 24(1)(a)",severity:"critical",points:10,check:e=>{var t,i;return ((t=e.organizationInfo.name)!=null?t:"").trim().length>0&&((i=e.organizationInfo.privacyEmail)!=null?i:"").trim().length>0},gap:()=>({message:"The policy does not identify the data controller. The organisation name and contact email must be provided so data subjects know who is responsible for their data.",fixType:"fill_field",fixLabel:"Add organisation details",suggestedContent:"Provide your organisation's registered name and a valid privacy contact email address in the Organisation Info section."})},{id:"purpose-of-processing",name:"Purpose of Processing",ndpaSection:"NDPA Section 24(1)(b)",severity:"critical",points:10,check:(e,t)=>t.purposes.length>0,gap:()=>({message:"No processing purposes have been selected. The NDPA requires you to clearly state the specific purposes for which personal data is collected and processed.",fixType:"fill_field",fixLabel:"Select processing purposes",suggestedContent:"Select at least one processing purpose (e.g. service delivery, analytics, marketing) in the wizard."})},{id:"lawful-basis",name:"Lawful Basis Identified",ndpaSection:"NDPA Section 25",severity:"critical",points:10,check:e=>u(e,"legal-basis"),gap:()=>({message:"The policy does not include a section identifying the lawful basis for processing. Under the NDPA, every processing activity must be grounded in a lawful basis such as consent, contract, or legitimate interest.",fixType:"add_section",fixLabel:"Add legal basis section",suggestedContent:`We process personal data under one or more of the following lawful bases as prescribed by the NDPA 2023:
3
-
4
- - Consent: where you have given clear, informed, and voluntary consent.
5
- - Contract: where processing is necessary for the performance of a contract.
6
- - Legal Obligation: where processing is required by Nigerian law.
7
- - Legitimate Interest: where processing is necessary for our legitimate interests, provided they do not override your rights.`})},{id:"data-categories-disclosed",name:"Data Categories Disclosed",ndpaSection:"NDPA Section 24(1)(c)",severity:"critical",points:10,check:(e,t)=>t.dataCategories.some(i=>i.selected),gap:()=>({message:"No data categories have been selected. The NDPA requires you to disclose the categories of personal data you collect (e.g. identity, financial, behavioral data).",fixType:"fill_field",fixLabel:"Select data categories",suggestedContent:"Select the categories of personal data your organisation collects in the Data Collection step of the wizard."})},{id:"recipients-disclosed",name:"Recipients Disclosed",ndpaSection:"NDPA Section 24(1)(e)",severity:"critical",points:10,check:(e,t)=>{if(!u(e,"data-sharing"))return false;if(t.thirdPartyProcessors.length>0){let i=h(e,"data-sharing");return t.thirdPartyProcessors.every(n=>i.includes(n.name))}return true},gap:e=>({message:e.thirdPartyProcessors.length>0?"The data sharing section does not list all third-party processors. Each processor must be named with its purpose and location.":"The policy does not include a data sharing section. Even if you do not share data, you must state this clearly.",fixType:e.thirdPartyProcessors.length>0?"add_content":"add_section",fixLabel:e.thirdPartyProcessors.length>0?"Update sharing section":"Add data sharing section",suggestedContent:"We do not sell personal data. We may share your data with service providers under strict data processing agreements that comply with the NDPA 2023."})},{id:"retention-periods",name:"Retention Periods Specified",ndpaSection:"NDPA Section 24(1)(f)",severity:"critical",points:10,check:e=>u(e,"data-retention"),gap:()=>({message:"The policy does not include a data retention section. The NDPA requires you to specify the period for which personal data will be stored, or the criteria used to determine that period.",fixType:"add_section",fixLabel:"Add retention schedule",suggestedContent:"We retain personal data only for as long as necessary to fulfil the purposes for which it was collected, or as required by applicable Nigerian law. When personal data is no longer needed, it is securely deleted or anonymised."})},{id:"data-subject-rights",name:"Data Subject Rights Listed",ndpaSection:"NDPA Sections 34-39",severity:"important",points:7,check:e=>{if(!u(e,"data-subject-rights"))return false;let t=h(e,"data-subject-rights").toLowerCase();return ["access","rectification","erasure","portability","restrict","object"].every(n=>t.includes(n))},gap:()=>({message:"The data subject rights section is missing or does not cover all six NDPA rights: access, rectification, erasure, portability, restriction, and objection.",fixType:"add_content",fixLabel:"Add missing rights",suggestedContent:`Under the NDPA 2023, you have the following rights:
8
- 1. Right of Access (Section 34)
9
- 2. Right to Rectification (Section 35)
10
- 3. Right to Erasure (Section 36)
11
- 4. Right to Restrict Processing (Section 37)
12
- 5. Right to Data Portability (Section 38)
13
- 6. Right to Object (Section 37)`})},{id:"right-to-withdraw-consent",name:"Right to Withdraw Consent",ndpaSection:"NDPA Section 25(2)",severity:"important",points:7,check:e=>{let t=g(e).toLowerCase();return t.includes("withdraw")&&t.includes("consent")},gap:()=>({message:"The policy does not mention the right to withdraw consent. Data subjects must be informed that they can withdraw consent at any time without affecting the lawfulness of prior processing.",fixType:"add_content",fixLabel:"Add withdrawal clause",suggestedContent:"You have the right to withdraw your consent at any time, without affecting the lawfulness of processing carried out prior to withdrawal. To withdraw your consent, contact us at the email address provided in this policy."})},{id:"right-to-lodge-complaint",name:"Right to Lodge Complaint with NDPC",ndpaSection:"NDPA Section 40",severity:"important",points:7,check:e=>{let t=g(e).toLowerCase();return t.includes("ndpc")||t.includes("nigeria data protection commission")},gap:()=>({message:"The policy does not mention the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC). Data subjects must be informed of this right.",fixType:"add_content",fixLabel:"Add NDPC complaint reference",suggestedContent:"You have the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC) if you believe your data protection rights have been infringed. Website: https://ndpc.gov.ng"})},{id:"cross-border-safeguards",name:"Cross-Border Transfer Safeguards",ndpaSection:"NDPA Sections 43-44",severity:"important",points:7,check:(e,t)=>t.hasCrossBorderTransfer?u(e,"cross-border-transfers"):true,gap:()=>({message:"Cross-border data transfers are indicated but the policy lacks a section describing the safeguards in place. The NDPA requires disclosure of transfer mechanisms and adequacy assessments.",fixType:"add_section",fixLabel:"Add cross-border section",suggestedContent:"Where we transfer personal data outside Nigeria, we ensure compliance with Sections 43 and 44 of the NDPA 2023 by implementing appropriate safeguards, including adequacy assessments and Standard Contractual Clauses."})},{id:"automated-decision-disclosure",name:"Automated Decision-Making Disclosure",ndpaSection:"NDPA Section 39",severity:"important",points:7,check:(e,t)=>t.hasAutomatedDecisions?u(e,"automated-decision-making"):true,gap:()=>({message:"Automated decision-making is indicated but the policy does not include a section disclosing this. The NDPA requires you to inform data subjects about automated decisions, including the logic involved and the right to human intervention.",fixType:"add_section",fixLabel:"Add automated decisions section",suggestedContent:"We use automated decision-making in certain processes. You have the right to request human intervention, express your point of view, and contest automated decisions, in accordance with Section 39 of the NDPA 2023."})},{id:"children-data-protection",name:"Children's Data Protection",ndpaSection:"NDPA Section 31",severity:"recommended",points:5,check:(e,t)=>t.hasChildrenData?u(e,"children-data-protection"):true,gap:()=>({message:"Children's data processing is indicated but the policy does not include a dedicated children's data protection section. The NDPA requires enhanced protections including parental consent for children under 13.",fixType:"add_section",fixLabel:"Add children's data section",suggestedContent:"We do not knowingly collect personal data from children under the age of 13 without verifiable parental or guardian consent. Parents and guardians may request access to, correction of, or deletion of their child's data at any time."})},{id:"dpo-contact-info",name:"DPO Contact Information",ndpaSection:"NDPA Section 30",severity:"recommended",points:5,check:e=>{var t,i;return ((t=e.organizationInfo.dpoName)!=null?t:"").trim().length>0&&((i=e.organizationInfo.dpoEmail)!=null?i:"").trim().length>0},gap:()=>({message:"The Data Protection Officer (DPO) contact information is not provided. While not always mandatory, appointing a DPO and publishing their contact details is strongly recommended under the NDPA.",fixType:"fill_field",fixLabel:"Add DPO details",suggestedContent:"Provide the full name and email address of your Data Protection Officer in the Organisation Info section."})},{id:"security-measures",name:"Security Measures Described",ndpaSection:"NDPA Section 28",severity:"recommended",points:5,check:e=>u(e,"data-security"),gap:()=>({message:"The policy does not describe the technical and organisational security measures in place to protect personal data. Describing these measures builds trust and demonstrates NDPA compliance.",fixType:"add_section",fixLabel:"Add security section",suggestedContent:"We implement appropriate technical and organisational measures to protect personal data, including encryption in transit and at rest, access controls, regular security assessments, and incident response procedures aligned with NDPA breach notification requirements."})},{id:"policy-effective-date",name:"Policy Effective Date",ndpaSection:"NDPA Section 24",severity:"recommended",points:5,check:e=>e.effectiveDate>0,gap:()=>({message:"The policy does not have an effective date set. An effective date is important for version control and for data subjects to know when the policy was last updated.",fixType:"fill_field",fixLabel:"Set effective date",suggestedContent:"Set the policy's effective date to the date you intend to publish it."})}];function L(e,t){let i=m.reduce((r,l)=>r+l.points,0),n=0,a=[],o=[];for(let r of m)if(r.check(e,t))n+=r.points,o.push(r.id);else {let l=r.gap(t);a.push(chunkMQFZHA2D_js.a({requirementId:r.id,requirement:r.name,ndpaSection:r.ndpaSection,severity:r.severity},l));}let c=Math.round(n/i*100),d;return n>=100?d="compliant":n>=80?d="nearly_compliant":d="not_compliant",{score:n,maxScore:i,percentage:c,rating:d,gaps:a,passed:o}}function s(e,t,i,n,a){return {id:e,title:t,template:i,order:n,required:a,included:true}}function y(e){return e.filter(t=>t.selected)}function b(e){return {service_delivery:"Service Delivery \u2014 to provide, maintain, and improve the services you have requested from us",marketing:"Marketing \u2014 to send promotional communications where you have opted in to receive them",analytics:"Analytics \u2014 to analyse usage patterns and improve user experience",research:"Research \u2014 to conduct research and development for service improvement",legal_compliance:"Legal Compliance \u2014 to meet our obligations under Nigerian law, including the NDPA 2023",fraud_prevention:"Fraud Prevention \u2014 to detect, prevent, and respond to fraud, security threats, and abuse"}[e]}function v(e,t){let i=e.org.name||"[Organisation Name]",n=e.org.website||"[website]",a=new Date().toISOString().slice(0,10);return s("introduction","Introduction & Scope",`This Privacy Policy explains how ${i} ("we", "us", or "our") collects, uses, stores, and protects personal data when you use our services and visit our website at ${n}. This policy is issued in compliance with the Nigeria Data Protection Act (NDPA) 2023 and the Nigeria Data Protection Regulation (NDPR). It applies to all personal data processed by ${i}, whether collected online or offline.
14
-
15
- Effective Date: ${a}.
16
-
17
- We are committed to protecting your privacy and ensuring that your personal data is handled responsibly and in accordance with applicable data protection legislation.`,t,true)}function P(e,t){let i=e.org.name||"[Organisation Name]",n=y(e.dataCategories),a={identity:"Identity & Contact Information",financial:"Financial Information",behavioral:"Technical & Behavioral Data",sensitive:"Sensitive / Special-Category Data",children:"Children's Data"},o="",c=["identity","financial","behavioral","sensitive","children"];for(let d of c){let r=n.filter(l=>l.group===d);if(r.length>0){o+=`
18
- ${a[d]}:
19
- `;for(let l of r)o+=`- ${l.label}: ${l.dataPoints.join(", ")}.
20
- `;}}return o===""&&(o=`
21
- - Personal data categories have not yet been specified.
22
- `),s("data-collection","Data We Collect",`${i} collects the following categories of personal data in the course of providing our services. Data may be collected directly from you (e.g. through forms, account registration, or correspondence) or automatically (e.g. through cookies, server logs, and similar technologies).
23
- `+o+`
24
- We only collect personal data that is adequate, relevant, and limited to what is necessary for the purposes described in this policy, in accordance with the NDPA 2023.`,t,true)}function w(e,t){let i=e.org.name||"[Organisation Name]",n=[];return (e.purposes.includes("service_delivery")||e.purposes.length===0)&&(n.push("- Consent: where you have given clear, informed, and voluntary consent for specific processing activities (NDPA Section 25)."),n.push("- Contract: where processing is necessary for the performance of a contract to which you are a party, or to take pre-contractual steps at your request (NDPA Section 25).")),e.purposes.includes("legal_compliance")&&n.push("- Legal Obligation: where processing is required for compliance with a legal obligation to which we are subject under Nigerian law."),e.purposes.includes("fraud_prevention")&&n.push("- Legitimate Interest: where processing is necessary for our legitimate interests (such as fraud prevention and network security), provided those interests are not overridden by your rights and freedoms (NDPA Section 25)."),e.purposes.includes("research")&&n.push("- Public Interest / Research: where processing is necessary for scientific or historical research purposes, or statistical purposes, subject to appropriate safeguards."),n.length===0&&(n.push("- Consent: where you have given clear, informed, and voluntary consent for specific processing activities (NDPA Section 25)."),n.push("- Contract: where processing is necessary for the performance of a contract to which you are a party (NDPA Section 25).")),s("legal-basis","Legal Basis for Processing",`${i} processes personal data under one or more of the following lawful bases as prescribed by the Nigeria Data Protection Act (NDPA) 2023:
25
-
26
- `+n.join(`
27
- `)+`
28
-
29
- We will always inform you of the specific legal basis applicable to each processing activity at the time of data collection.`,t,true)}function D(e,t){let n=(e.purposes.length>0?e.purposes:["service_delivery"]).map(a=>`- ${b(a)}`).join(`
30
- `);return s("data-usage","How We Use Your Data",`We process the personal data we collect for the following purposes:
31
-
32
- `+n+`
33
-
34
- We will not process your personal data for purposes incompatible with those stated above without providing you with prior notice and, where required by the NDPA, obtaining your consent.`,t,true)}function C(e,t){let i=e.org.name||"[Organisation Name]",n=e.thirdPartyProcessors,a;return n.length>0?a=`We share personal data with the following third-party processors under data processing agreements that comply with the NDPA 2023:
35
-
36
- | Processor | Purpose | Country |
37
- | --- | --- | --- |
38
- `+n.map(c=>`| ${c.name} | ${c.purpose} | ${c.country} |`).join(`
39
- `)+`
40
-
41
- All processors are contractually required to implement appropriate technical and organisational measures to protect personal data.`:a="We do not currently share your personal data with third-party processors. Should this change, we will update this policy and, where required, obtain your consent before any sharing takes place.",s("data-sharing","Data Sharing & Disclosure",`${i} does not sell personal data under any circumstances.
42
-
43
- `+a+`
44
-
45
- We may also disclose personal data where required by law, regulation, or valid legal process, including requests from Nigerian regulatory and law enforcement authorities.`,t,true)}function S(e,t){let i=e.org.privacyEmail||"[privacy email]";return s("data-subject-rights","Your Rights as a Data Subject",`Under the Nigeria Data Protection Act (NDPA) 2023, you are entitled to the following rights regarding your personal data:
46
-
47
- 1. Right of Access \u2014 You may request confirmation of whether we process your personal data and obtain a copy of that data (NDPA Section 34).
48
- 2. Right to Rectification \u2014 You may request correction of inaccurate or incomplete personal data we hold about you (NDPA Section 35).
49
- 3. Right to Erasure \u2014 You may request deletion of your personal data where there is no compelling legal reason for its continued processing (NDPA Section 36).
50
- 4. Right to Data Portability \u2014 You may request to receive your personal data in a structured, commonly used, and machine-readable format (NDPA Section 38).
51
- 5. Right to Restrict Processing \u2014 You may request that we limit the processing of your personal data in certain circumstances (NDPA Section 37).
52
- 6. Right to Object \u2014 You may object to the processing of your personal data where processing is based on legitimate interest or is carried out for direct marketing purposes (NDPA Section 37).
53
-
54
- You also have the right to withdraw your consent at any time, without affecting the lawfulness of processing carried out prior to withdrawal.
55
-
56
- To exercise any of these rights, please contact us at ${i}. We will respond to your request within 30 days, as required by the NDPA. If you are unsatisfied with our response, you have the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC).`,t,true)}function N(e,t){let i=e.org.privacyEmail||"[privacy email]",n=e.org.industry,a="";return n==="fintech"?a=`
57
- - Compliance with Payment Card Industry Data Security Standard (PCI-DSS) for cardholder data protection.
58
- - End-to-end encryption of financial transactions.
59
- - Multi-factor authentication for account access.`:n==="healthcare"?a=`
60
- - HIPAA-aligned safeguards for health information, including access controls and audit logging.
61
- - Segregation of medical data from other personal data.
62
- - Role-based access controls restricting health data to authorised personnel.`:n==="ecommerce"?a=`
63
- - PCI-DSS compliant payment processing.
64
- - Secure checkout and tokenisation of payment credentials.`:n==="government"&&(a=`
65
- - Compliance with Nigeria's Cybercrimes Act 2015 requirements.
66
- - Government-grade access controls and audit trails.`),s("data-security","Data Security Measures",`We implement appropriate technical and organisational measures to protect personal data against unauthorised access, alteration, disclosure, or destruction. These measures include:
67
-
68
- - Encryption of personal data in transit (TLS 1.2+) and at rest (AES-256).
69
- - Access controls and least-privilege principles for all systems handling personal data.
70
- - Regular security assessments, penetration testing, and vulnerability scanning.
71
- - Staff training on data protection obligations and information security best practices.
72
- - Incident response procedures aligned with NDPA breach notification requirements (72-hour notification to NDPC).`+a+`
73
-
74
- While we employ industry-standard safeguards, no method of electronic transmission or storage is entirely secure. If you become aware of any security incident affecting your data, please contact us immediately at ${i}.`,t,true)}function A(e,t){let i=e.org.name||"[Organisation Name]",n=e.org.address||"[Address]",a=e.org.privacyEmail||"[privacy email]",o=e.org.website||"[website]",c=e.org.dpoName||"[DPO Name]",d=e.org.dpoEmail||"[DPO Email]";return s("contact-info","Contact Information",`If you have questions, concerns, or requests regarding this privacy policy or our data protection practices, please contact us:
75
-
76
- Organisation: ${i}
77
- Address: ${n}
78
- Email: ${a}
79
- Website: ${o}
80
-
81
- Data Protection Officer: ${c}
82
- DPO Email: ${d}
83
-
84
- You also have the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC) if you believe your data protection rights have been infringed.
85
-
86
- Nigeria Data Protection Commission
87
- Website: https://ndpc.gov.ng
88
- Email: info@ndpc.gov.ng`,t,true)}function T(e){return s("children-data-protection","Children's Data Protection",`We recognise the importance of protecting the privacy of children. In accordance with Section 31 of the NDPA 2023, we implement the following safeguards when processing children's personal data:
89
-
90
- - We do not knowingly collect personal data from children under the age of 13 without verifiable parental or guardian consent.
91
- - Where we process data of children between the ages of 13 and 17, we obtain consent from a parent or guardian, taking into account the child's age and maturity.
92
- - Parents and guardians may request access to, correction of, or deletion of their child's personal data at any time by contacting us.
93
- - We limit the collection of children's data to what is strictly necessary for the service provided and do not use it for marketing or profiling.
94
- - A Data Protection Impact Assessment (DPIA) is conducted before any new processing activity involving children's data.
95
-
96
- If we discover that we have inadvertently collected personal data from a child without appropriate consent, we will delete that data promptly.`,e,true)}function x(e){return s("sensitive-data-processing","Sensitive / Special-Category Data",`Certain categories of personal data are considered sensitive under the NDPA 2023 and require additional safeguards. Sensitive data includes information relating to health, biometric identifiers, ethnic origin, religious or political beliefs, and genetic data.
97
-
98
- We process sensitive personal data only where:
99
-
100
- - You have given explicit consent for the specific processing purpose.
101
- - Processing is necessary to protect your vital interests or those of another person.
102
- - Processing is required for the establishment, exercise, or defence of legal claims.
103
- - Processing is necessary for reasons of substantial public interest under Nigerian law.
104
-
105
- Enhanced security measures are applied to all sensitive data, including additional encryption, strict access controls, and enhanced audit logging. Sensitive data is stored separately from other personal data where technically feasible.`,e,true)}function k(e,t){let i=e.thirdPartyProcessors.filter(a=>a.country.toLowerCase()!=="nigeria"),n="";return i.length>0&&(n=`
106
-
107
- We currently transfer personal data to the following jurisdictions: ${[...new Set(i.map(o=>o.country))].join(", ")}. Each transfer is subject to the safeguards described above.`),s("cross-border-transfers","Cross-Border Data Transfers",`Where we transfer personal data outside Nigeria, we do so in strict compliance with Sections 43 and 44 of the NDPA 2023. We ensure that any cross-border transfer of personal data is subject to one or more of the following safeguards:
108
-
109
- - The receiving country has been assessed by the NDPC as providing an adequate level of data protection.
110
- - We have put in place appropriate contractual safeguards, such as Standard Contractual Clauses approved by the NDPC.
111
- - You have provided explicit consent to the transfer after being informed of the associated risks.
112
- - The transfer is necessary for the performance of a contract between you and us, or for pre-contractual steps taken at your request.
113
- - The NDPC has granted an administrative authorisation for the transfer.`+n,t,true)}function q(e){return s("automated-decision-making","Automated Decision-Making & Profiling",`In accordance with Section 39 of the NDPA 2023, we inform you of any automated decision-making processes, including profiling, that produce legal effects or similarly significant effects on you.
114
-
115
- Where we use automated decision-making:
116
-
117
- - We will inform you that automated processing is being used and provide meaningful information about the logic involved.
118
- - You have the right to request human intervention in any automated decision.
119
- - You have the right to express your point of view and contest the decision.
120
- - We will carry out regular reviews of automated decision-making systems to ensure fairness, accuracy, and absence of bias.
121
- - We will not base automated decisions solely on sensitive personal data unless you have given explicit consent or the processing is authorised by Nigerian law.
122
-
123
- You may object to automated decision-making at any time by contacting us using the details provided in this policy.`,e,true)}function I(e,t){let i=e.org.name||"[Organisation Name]",n=e.org.industry,a="";return n==="fintech"?a=`
124
-
125
- Financial transaction records are retained for a minimum of six (6) years in compliance with the Central Bank of Nigeria (CBN) guidelines and the Money Laundering (Prevention and Prohibition) Act.`:n==="healthcare"?a=`
126
-
127
- Medical and health records are retained for a minimum of ten (10) years after the last date of treatment, or longer where required by applicable health regulations.`:n==="ecommerce"?a=`
128
-
129
- Order and transaction records are retained for six (6) years in accordance with Nigerian tax and commercial law requirements.`:n==="education"&&(a=`
130
-
131
- Student academic records may be retained indefinitely for verification purposes. Other personal data is retained only for the duration of enrolment plus five (5) years.`),s("data-retention","Data Retention Schedule",`${i} retains personal data only for as long as necessary to fulfil the purposes for which it was collected, or as required by applicable Nigerian law. Our retention periods are determined based on the following criteria:
132
-
133
- - The nature and sensitivity of the personal data.
134
- - The purposes for which the data is processed.
135
- - Legal, regulatory, and contractual obligations (including NDPA 2023 requirements).
136
- - Legitimate business needs such as maintaining records for audits, dispute resolution, and regulatory examinations.
137
-
138
- General retention periods:
139
- - Account data: retained for the duration of your relationship with us, plus three (3) years.
140
- - Communication records: retained for two (2) years from the date of correspondence.
141
- - Analytics and usage data: retained in identifiable form for twelve (12) months, then aggregated or anonymised.`+a+`
142
-
143
- When personal data is no longer required, it is securely deleted or irreversibly anonymised in accordance with our internal data retention and disposal policy.`,t,true)}function j(e){let t=1,i=[];return i.push(v(e,t++)),i.push(P(e,t++)),i.push(w(e,t++)),i.push(D(e,t++)),i.push(C(e,t++)),i.push(S(e,t++)),i.push(N(e,t++)),i.push(A(e,t++)),e.hasChildrenData&&i.push(T(t++)),e.hasSensitiveData&&i.push(x(t++)),e.hasCrossBorderTransfer&&i.push(k(e,t++)),e.hasAutomatedDecisions&&i.push(q(t++)),i.push(I(e,t++)),i}exports.a=f;exports.b=R;exports.c=L;exports.d=j;//# sourceMappingURL=chunk-LU4PFST7.js.map
144
- //# sourceMappingURL=chunk-LU4PFST7.js.map
@@ -1,2 +0,0 @@
1
- 'use strict';var chunkC4YM4UMI_js=require('./chunk-C4YM4UMI.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function j(m,l){return l?chunkELKB2AFZ_js.a(m):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialTransfers:m=[],adapter:l,storageKey:R="ndpr_cross_border_transfers",useLocalStorage:q=true,onAdd:g,onUpdate:C,onRemove:B}={}){let y=l!=null?l:j(R,q),v=react.useRef(y);v.current=y;let[i,u]=react.useState(m),[x,T]=react.useState(true);react.useEffect(()=>{let e=false;try{let r=v.current.load();r instanceof Promise?r.then(t=>{e||(t&&u(t),T(!1));},()=>{e||T(!1);}):(r&&u(r),T(!1));}catch(r){e||T(false);}return ()=>{e=true;}},[]);let f=react.useCallback(e=>{Promise.resolve(v.current.save(e)).catch(r=>{console.warn("[ndpr-toolkit] Failed to save cross-border transfers:",r);});},[]),M=()=>"cbt_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),D=react.useCallback(e=>{let r=Date.now(),t=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{id:M(),createdAt:r,updatedAt:r});return u(a=>{let n=[...a,t];return f(n),n}),g&&g(t),t},[g,f]),k=react.useCallback((e,r)=>{let t=null;return u(a=>{let n=a.findIndex(A=>A.id===e);if(n===-1)return a;t=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},a[n]),r),{updatedAt:Date.now()});let o=[...a];return o[n]=t,f(o),o}),t&&C&&C(t),t},[C,f]),I=react.useCallback(e=>{let r=false;return u(t=>{if(t.findIndex(o=>o.id===e)===-1)return t;r=true;let n=t.filter(o=>o.id!==e);return f(n),n}),r&&B&&B(e),r},[B,f]),L=react.useCallback(e=>i.find(r=>r.id===e)||null,[i]),U=react.useCallback(()=>{let e=Date.now(),r=i.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"],a={};for(let s of t)a[s]=r.filter(c=>c.transferMechanism===s).length;let n=["adequate","inadequate","pending_review","unknown"],o={};for(let s of n)o[s]=r.filter(c=>c.adequacyStatus===s).length;let A=i.filter(s=>{var c,b;return s.status==="pending_approval"||((c=s.ndpcApproval)==null?void 0:c.required)&&!((b=s.ndpcApproval)!=null&&b.approved)}),P=720*60*60*1e3,V=i.filter(s=>s.reviewDate&&s.reviewDate<=e+P&&s.status==="active"),F=i.filter(s=>!s.tiaCompleted&&s.status==="active"),z=i.filter(s=>s.riskLevel==="high"&&s.status==="active");return {totalActiveTransfers:r.length,byMechanism:a,byAdequacy:o,pendingApproval:A,dueForReview:V,missingTIA:F,highRiskTransfers:z,lastUpdated:e}},[i]),O=react.useCallback(e=>chunkC4YM4UMI_js.g(e),[]);return {transfers:i,addTransfer:D,updateTransfer:k,removeTransfer:I,getTransfer:L,getSummary:U,validateTransfer:O,isLoading:x}}exports.a=Q;//# sourceMappingURL=chunk-M6XETYNL.js.map
2
- //# sourceMappingURL=chunk-M6XETYNL.js.map
@@ -1,2 +0,0 @@
1
- 'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),reactDom=require('react-dom'),jsxRuntime=require('react/jsx-runtime');var yt=({options:d,onSave:U,title:Q="We Value Your Privacy",description:X="We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",acceptAllButtonText:Z="Accept All",rejectAllButtonText:s="Reject All",customizeButtonText:N="Customize",saveButtonText:tt="Save Preferences",position:L="bottom",zIndex:q=9999,version:a="1.0",show:x,manageStorage:z=true,storageKey:D="ndpr_consent",className:et="",buttonClassName:B="",primaryButtonClassName:H="",secondaryButtonClassName:nt="",classNames:t,unstyled:o,onAnalytics:k})=>{let[u,c]=react.useState(false),[g,m]=react.useState(false),[w,E]=react.useState({}),[F,rt]=react.useState(false),f=react.useRef(null),T=react.useRef(null),$=react.useRef(false);react.useEffect(()=>{rt(true);},[]);let b=react.useCallback((e,n)=>{k==null||k(chunkMQFZHA2D_js.a({action:e,timestamp:Date.now(),version:a},n!==void 0?{categories:n}:{}));},[k,a]);react.useEffect(()=>{let e={};if(d.forEach(n=>{e[n.id]=n.defaultValue||false;}),E(e),x===void 0)if(!z)c(true);else {let n=localStorage.getItem(D);if(n)try{JSON.parse(n).version!==a?c(!0):c(!1);}catch(C){c(true);}else c(true);}else c(x);},[d,D,a,z]),react.useEffect(()=>{x!==void 0&&c(x);},[x]);let ot=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),b("accepted_all",e),j(e);},M=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),b("rejected_all",e),j(e);},it=(e,n)=>{E(C=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},C),{[e]:n}));},dt=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),E(e);},ut=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),E(e);},_=d.length>0&&d.every(e=>w[e.id]),ct=()=>{b("customized",w),j(w);},j=e=>{let n={consents:e,timestamp:Date.now(),version:a,method:g?"customize":"banner",hasInteracted:true};z&&localStorage.setItem(D,JSON.stringify(n)),U(n),c(false),m(false);};if(react.useEffect(()=>{if(!u)return;let e=n=>{n.key==="Escape"&&(b("dismissed"),M());};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u,b,d,g]),react.useEffect(()=>{u&&!$.current&&($.current=true,b("shown")),u||($.current=false);},[u,b]),react.useEffect(()=>{if(!u||!f.current)return;let e='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',C=setTimeout(()=>{if(!f.current)return;let p=f.current.querySelectorAll(e);p.length>0?p[0].focus():f.current.focus();},0),G=p=>{if(p.key!=="Tab"||!f.current)return;let A=f.current.querySelectorAll(e);if(A.length===0)return;let V=A[0],J=A[A.length-1];p.shiftKey?document.activeElement===V&&(p.preventDefault(),J.focus()):document.activeElement===J&&(p.preventDefault(),V.focus());};return document.addEventListener("keydown",G),()=>{clearTimeout(C),document.removeEventListener("keydown",G);}},[u,g]),react.useEffect(()=>{if(g&&T.current){let e=T.current;e.style.maxHeight="0px",e.style.opacity="0",e.offsetHeight,e.style.maxHeight=`${e.scrollHeight}px`,e.style.opacity="1";}},[g]),!u)return null;let lt=(t==null?void 0:t.primaryButton)||(t==null?void 0:t.acceptButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${B} ${H}`,K=(t==null?void 0:t.secondaryButton)||(t==null?void 0:t.rejectButton)||`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 ${B} ${nt}`,gt=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${B}`,ft=(t==null?void 0:t.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${B} ${H}`,S=L==="inline",y=L==="center",h;S||y?h="":L==="top"?h="fixed inset-x-0 top-0":h="fixed inset-x-0 bottom-0";let P=jsxRuntime.jsx("div",{ref:f,tabIndex:-1,"data-ndpr-component":"consent-banner",className:chunkE64TU6IU_js.a(`${S?"":h} bg-white dark:bg-gray-800 shadow-lg p-3 sm:p-4 border border-gray-200 dark:border-gray-700 ${y?"max-w-lg w-full":""} ${et}`,t==null?void 0:t.root,o),style:!S&&!y?{zIndex:q}:void 0,role:"dialog","aria-modal":y||void 0,"aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("max-w-6xl mx-auto",t==null?void 0:t.container,o),children:[jsxRuntime.jsx("h2",{id:"consent-banner-title",className:chunkE64TU6IU_js.a("text-lg font-bold mb-2",t==null?void 0:t.title,o),children:Q}),jsxRuntime.jsx("p",{id:"consent-banner-description",className:chunkE64TU6IU_js.a("text-sm sm:text-base mb-4",t==null?void 0:t.description,o),children:X}),g&&jsxRuntime.jsxs("div",{ref:T,className:chunkE64TU6IU_js.a("mb-4 p-3 sm:p-4 rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50",t==null?void 0:t.customizePanel,o),style:{overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out"},children:[jsxRuntime.jsx("div",{className:"mb-3 flex items-center justify-end",children:jsxRuntime.jsx("button",{type:"button",onClick:_?ut:dt,className:chunkE64TU6IU_js.a("text-sm font-medium text-[rgb(var(--ndpr-primary))] hover:underline",t==null?void 0:t.selectAllButton,o),children:_?"Deselect All":"Select All"})}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",t==null?void 0:t.optionsList,o),children:d.map(e=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start",t==null?void 0:t.optionItem,o),children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`consent-${e.id}`,type:"checkbox",checked:w[e.id]||false,onChange:n=>it(e.id,n.target.checked),disabled:e.required,className:chunkE64TU6IU_js.a("h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",t==null?void 0:t.optionCheckbox,o)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${e.id}`,className:chunkE64TU6IU_js.a("font-medium",t==null?void 0:t.optionLabel,o),children:[e.label," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-400",t==null?void 0:t.optionDescription,o),children:e.description})]})]},e.id))}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-4 flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:ct,className:chunkE64TU6IU_js.a(ft,t==null?void 0:t.saveButton,o),children:tt}),jsxRuntime.jsx("button",{onClick:()=>m(false),className:chunkE64TU6IU_js.a(K,t==null?void 0:t.rejectButton,o),children:"Back"})]})]}),!g&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:ot,className:chunkE64TU6IU_js.a(lt,t==null?void 0:t.acceptButton,o),children:Z}),jsxRuntime.jsx("button",{onClick:M,className:chunkE64TU6IU_js.a(K,t==null?void 0:t.rejectButton,o),children:s}),jsxRuntime.jsx("button",{onClick:()=>m(true),className:chunkE64TU6IU_js.a(gt,t==null?void 0:t.customizeButton,o),children:N})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("mt-2 text-xs text-gray-600 dark:text-gray-400",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(S)return P;if(y){let e=jsxRuntime.jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:q},children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"relative",children:P})]});return F?reactDom.createPortal(e,document.body):null}return F?reactDom.createPortal(P,document.body):null};exports.a=yt;//# sourceMappingURL=chunk-NBSVFQ5G.js.map
2
- //# sourceMappingURL=chunk-NBSVFQ5G.js.map
@@ -1,81 +0,0 @@
1
- import {a as a$1}from'./chunk-DJGS7SSN.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var ve=({breachData:g,initialAssessment:u={},onComplete:w,title:J="Breach Risk Assessment",description:_="Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",submitButtonText:K="Complete Assessment",className:ae="",buttonClassName:Z="",classNames:v={},unstyled:d=false,showBreachSummary:l=true,showNotificationRequirements:A=true})=>{let[j,se]=useState(u.confidentialityImpact||3),[P,b]=useState(u.integrityImpact||3),[D,C]=useState(u.availabilityImpact||3),[q,B]=useState(u.harmLikelihood||3),[E,I]=useState(u.harmSeverity||3),[M,O]=useState(u.risksToRightsAndFreedoms!==void 0?u.risksToRightsAndFreedoms:false),[G,W]=useState(u.highRisksToRightsAndFreedoms!==void 0?u.highRisksToRightsAndFreedoms:false),[Q,ie]=useState(u.justification||""),[Y,re]=useState(0),[R,h]=useState("low"),[x,f]=useState(false),[y,X]=useState(0),[U,z]=useState(0),[p,k]=useState(false);useEffect(()=>{let ee=j*.2+P*.1+D*.1+q*.3+E*.3;re(Number(ee.toFixed(1)));let L;ee<2?L="low":ee<3?L="medium":ee<4?L="high":L="critical",h(L),f(M||L==="high"||L==="critical");let ne=g.discoveredAt+4320*60*1e3;X(ne);let ce=Date.now(),pe=(ne-ce)/(3600*1e3);z(Number(pe.toFixed(1)));},[j,P,D,q,E,M,g.discoveredAt]);let T=o=>new Date(o).toLocaleString(),H=o=>{o.preventDefault();let N={id:u.id||`assessment_${Date.now()}`,breachId:g.id,assessedAt:Date.now(),assessor:u.assessor||{name:"Assessment User",role:"Data Protection Officer",email:"dpo@example.com"},confidentialityImpact:j,integrityImpact:P,availabilityImpact:D,harmLikelihood:q,harmSeverity:E,overallRiskScore:Y,riskLevel:R,risksToRightsAndFreedoms:M,highRisksToRightsAndFreedoms:G,justification:Q};w(N),k(true);},s=o=>{switch(o){case 1:return "Minimal";case 2:return "Low";case 3:return "Moderate";case 4:return "High";case 5:return "Severe";default:return "Unknown"}},m=o=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[o]}`,v.riskBadge,d),children:o.charAt(0).toUpperCase()+o.slice(1)});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,v.root,d),children:[jsx("h2",{className:a("text-xl font-bold mb-2",v.title,d),children:J}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:_}),l&&jsxs("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("h3",{className:"text-lg font-medium mb-2",children:"Breach Summary"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Title:"})," ",g.title]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",T(g.discoveredAt)]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",g.status.charAt(0).toUpperCase()+g.status.slice(1)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",g.dataTypes.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",g.affectedSystems.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",g.estimatedAffectedSubjects||"Unknown"]})]})]})]}),p?jsxs("div",{children:[jsxs("div",{className:"mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Assessment Results"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Level:"})," ",m(R)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",Y," / 5"]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Assessed On:"})," ",T(Date.now())]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",M?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",G?"Yes":"No"]})]})]}),jsxs("div",{className:"mt-3",children:[jsx("p",{className:"text-sm mb-1",children:jsx("span",{className:"font-medium",children:"Justification:"})}),jsx("p",{className:"text-sm bg-white dark:bg-gray-800 p-2 rounded",children:Q})]})]}),A&&jsxs("div",{className:a(`mb-6 p-4 rounded-md ${x?U>24?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20":"bg-green-50 dark:bg-green-900/20"}`,v.notificationStatus,d),children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Requirements"}),x?jsxs("div",{children:[jsx("p",{className:`text-sm font-bold mb-2 ${U>24?"text-yellow-800 dark:text-yellow-200":"text-red-800 dark:text-red-200"}`,children:"NDPC Notification Required"}),jsx("p",{className:"text-sm mb-2",children:"Under the NDPA (Section 40), this breach must be reported to the NDPC within 72 hours of discovery."}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Deadline:"})," ",T(y)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsx("span",{className:U<24?"text-red-600 dark:text-red-400 font-bold":"",children:U>0?`${U} hours`:"Deadline passed"})]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",G?"Required (NDPA Section 40(4))":"Not required unless directed by NDPC"]})]}):jsxs("div",{children:[jsx("p",{className:"text-sm font-bold mb-2 text-green-800 dark:text-green-200",children:"NDPC Notification Not Required"}),jsx("p",{className:"text-sm mb-2",children:"Based on this assessment, this breach does not need to be reported to the NDPC."}),jsx("p",{className:"text-sm mb-2",children:"However, the breach should still be documented internally for compliance purposes."})]}),jsxs("div",{className:"mt-3 text-sm",children:[jsx("p",{className:"font-medium",children:"Next Steps:"}),jsx("ul",{className:"list-disc pl-5 mt-1",children:x?jsxs(Fragment,{children:[jsx("li",{children:"Prepare a notification report for the NDPC"}),jsx("li",{children:"Document all aspects of the breach and your response"}),G&&jsx("li",{children:"Prepare communications for affected data subjects"}),jsx("li",{children:"Implement measures to mitigate the impact of the breach"})]}):jsxs(Fragment,{children:[jsx("li",{children:"Document the breach and this assessment in your internal records"}),jsx("li",{children:"Implement measures to prevent similar breaches in the future"}),jsx("li",{children:"Review and update security measures as needed"})]})})]})]}),jsx("button",{onClick:()=>k(false),className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${Z}`,v.primaryButton||v.submitButton,d),children:"Edit Assessment"})]}):jsx("form",{onSubmit:H,children:jsxs("div",{className:"space-y-6",children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Assessment"}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"confidentialityImpact",className:"block text-sm font-medium mb-1",children:["Confidentiality Impact (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the confidentiality of data been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"confidentialityImpact",min:"1",max:"5",step:"1",value:j,onChange:o=>se(parseInt(o.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(j)," (",j,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"integrityImpact",className:"block text-sm font-medium mb-1",children:["Integrity Impact (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the integrity of data been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"integrityImpact",min:"1",max:"5",step:"1",value:P,onChange:o=>b(parseInt(o.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(P)," (",P,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"availabilityImpact",className:"block text-sm font-medium mb-1",children:["Availability Impact (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the availability of data or systems been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"availabilityImpact",min:"1",max:"5",step:"1",value:D,onChange:o=>C(parseInt(o.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(D)," (",D,")"]})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Risk to Data Subjects"}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"harmLikelihood",className:"block text-sm font-medium mb-1",children:["Likelihood of Harm (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How likely is it that data subjects will experience harm?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"harmLikelihood",min:"1",max:"5",step:"1",value:q,onChange:o=>B(parseInt(o.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(q)," (",q,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"harmSeverity",className:"block text-sm font-medium mb-1",children:["Severity of Harm (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How severe would the harm be to affected data subjects?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"harmSeverity",min:"1",max:"5",step:"1",value:E,onChange:o=>I(parseInt(o.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(E)," (",E,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:M,onChange:o=>O(o.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"risksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a risk to the rights and freedoms of data subjects"})]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40), breaches that pose a risk to rights and freedoms must be reported to the NDPC within 72 hours."})]}),jsxs("div",{className:"mb-4",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"highRisksToRightsAndFreedoms",checked:G,onChange:o=>W(o.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"highRisksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a high risk to the rights and freedoms of data subjects"})]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40(4)), breaches that pose a high risk to rights and freedoms also require notification to affected data subjects without undue delay."})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Overall Assessment"}),jsxs("div",{className:"mb-4 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Score:"}),jsxs("span",{className:a("",v.riskScore,d),children:[Y," / 5"]})]}),jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:"font-medium",children:"Risk Level:"}),m(R)]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:["Justification for Assessment ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"justification",value:Q,onChange:o=>ie(o.target.value),rows:4,placeholder:"Explain the reasoning behind your assessment, including any factors that influenced your decision.",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))]",required:true})]})]}),jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This assessment will determine if notification is required for this breach."})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${Z}`,v.primaryButton||v.submitButton,d),children:K})})]})})]})};var Ce=({breachReports:g,riskAssessments:u,regulatoryNotifications:w,onSelectBreach:J,onRequestAssessment:_,onRequestNotification:K,title:ae="Breach Notification Manager",description:Z="Manage data breach notifications and track compliance with NDPA Section 40 requirements.",className:v="",buttonClassName:d="",classNames:l={},unstyled:A=false,showBreachDetails:j=true,showNotificationTimeline:se=true,showDeadlineAlerts:P=true})=>{var H;let[b,D]=useState(null),[C,q]=useState(g),[B,E]=useState("all"),[I,M]=useState(""),[O,G]=useState("discoveredAt"),[W,Q]=useState("desc");useEffect(()=>{let s=[...g];if(B!=="all"&&(s=s.filter(m=>m.status===B)),I){let m=I.toLowerCase();s=s.filter(o=>o.title.toLowerCase().includes(m)||o.description.toLowerCase().includes(m)||o.affectedSystems.some(N=>N.toLowerCase().includes(m))||o.dataTypes.some(N=>N.toLowerCase().includes(m)));}s.sort((m,o)=>{let N=0;switch(O){case "title":N=m.title.localeCompare(o.title);break;case "discoveredAt":N=m.discoveredAt-o.discoveredAt;break;case "status":N=m.status.localeCompare(o.status);break;case "riskLevel":let F=u.find(L=>L.breachId===m.id),$=u.find(L=>L.breachId===o.id),oe=(F==null?void 0:F.riskLevel)||"unknown",ee=($==null?void 0:$.riskLevel)||"unknown";N=oe.localeCompare(ee);break;default:N=m.discoveredAt-o.discoveredAt;}return W==="asc"?N:-N}),q(s);},[g,B,I,O,W,u]),useEffect(()=>{C.length>0&&(b&&C.some(m=>m.id===b)||D(C[0].id));},[C,b]);let ie=s=>{D(s),J&&J(s);},Y=()=>{b&&_&&_(b);},re=()=>{b&&K&&K(b);},R=s=>new Date(s).toLocaleString(),h=b?g.find(s=>s.id===b):null,x=b?u.find(s=>s.breachId===b):null,f=b?w.find(s=>s.breachId===b):null,y=h?X(h,x):null;function X(s,m){let o=a$1(s,m||void 0),N=s.discoveredAt+o.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:o.notificationRequired,ndpcNotificationDeadline:N,dataSubjectNotificationRequired:(m==null?void 0:m.highRisksToRightsAndFreedoms)||false,justification:o.justification}}function U(s){let m=Date.now(),o=(s-m)/(3600*1e3);return Number(o.toFixed(1))}let z=s=>s?jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[s]}`,l.statusBadge,A),children:s.charAt(0).toUpperCase()+s.slice(1)}):null,p=s=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{ongoing:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",contained:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",resolved:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"}[s]||"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}`,l.statusBadge,A),children:s.charAt(0).toUpperCase()+s.slice(1)}),k=()=>{if(!h||!y)return null;if(!y.ndpcNotificationRequired)return jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Not Required"}),jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"Based on the risk assessment, NDPC notification is not required for this breach."})]});if(f)return jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Sent"}),jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:["Notification was sent to the NDPC on ",R(f.sentAt),"."]})]});let s=U(y.ndpcNotificationDeadline);return s<=0?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Notification Deadline Passed"}),jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The 72-hour deadline for NDPC notification has passed. Notification should be sent immediately."})]}):s<=24?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Notification Due Soon"}),jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",s," hours remaining until the NDPC notification deadline."]})]}):jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Notification Required"}),jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:["NDPC notification is required by ",R(y.ndpcNotificationDeadline)," (",s," hours remaining)."]})]})},T=()=>{if(!h)return null;let s=[{title:"Breach Discovered",date:h.discoveredAt,completed:true,description:`Breach was discovered on ${R(h.discoveredAt)}.`},{title:"Risk Assessment",date:x==null?void 0:x.assessedAt,completed:!!x,description:x?`Risk assessment completed on ${R(x.assessedAt)}.`:"Risk assessment has not been completed yet."}];return y!=null&&y.ndpcNotificationRequired&&s.push({title:"NDPC Notification",date:f==null?void 0:f.sentAt,completed:!!f,description:f?`Notification sent to the NDPC on ${R(f.sentAt)}.`:`Notification must be sent to the NDPC by ${R(y.ndpcNotificationDeadline)}.`}),y!=null&&y.dataSubjectNotificationRequired&&s.push({title:"Data Subject Notification",date:void 0,completed:false,description:"Notification to affected data subjects is required but has not been sent yet."}),jsxs("div",{className:a("mt-6",l.timeline,A),children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Notification Timeline"}),jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:s.map((m,o)=>jsxs("li",{className:a("mb-6 ml-4",l.timelineStep,A),children:[jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${m.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-600 dark:text-gray-500",children:m.date?R(m.date):"Pending"}),jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:m.title}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:m.description})]},o))})]})};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${v}`,l.root,A),children:[jsxs("div",{className:a("",l.header,A),children:[jsx("h2",{className:a("text-xl font-bold mb-2",l.title,A),children:ae}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:Z})]}),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxs("select",{id:"statusFilter",value:B,onChange:s=>E(s.target.value),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))]",children:[jsx("option",{value:"all",children:"All Statuses"}),jsx("option",{value:"ongoing",children:"Ongoing"}),jsx("option",{value:"contained",children:"Contained"}),jsx("option",{value:"resolved",children:"Resolved"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxs("select",{id:"sortBy",value:O,onChange:s=>G(s.target.value),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))]",children:[jsx("option",{value:"discoveredAt",children:"Discovery Date"}),jsx("option",{value:"title",children:"Title"}),jsx("option",{value:"status",children:"Status"}),jsx("option",{value:"riskLevel",children:"Risk Level"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"searchTerm",value:I,onChange:s=>M(s.target.value),placeholder:"Search breaches...",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))]"})]})]}),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:"Breach Reports"}),C.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No breach reports found."}):jsx("div",{className:a("space-y-2 max-h-96 overflow-y-auto pr-2",l.breachList,A),children:C.map(s=>{let m=u.find($=>$.breachId===s.id),o=w.find($=>$.breachId===s.id),N=X(s,m),F=null;if(N!=null&&N.ndpcNotificationRequired)if(o)F=jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Notified"});else {let $=U(N.ndpcNotificationDeadline);$<=0?F=jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):$<=24?F=jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):F=jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Required"});}else F=jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Not Required"});return jsxs("div",{className:a(`p-3 rounded-md cursor-pointer ${b===s.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,l.breachItem,A),onClick:()=>ie(s.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:s.title}),p(s.status)]}),jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Discovered: ",new Date(s.discoveredAt).toLocaleDateString()]}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsx("div",{children:m&&z(m.riskLevel)}),jsx("div",{children:F})]})]},s.id)})})]}),jsx("div",{className:a("md:col-span-2",l.detailPanel,A),children:h?jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsx("h3",{className:"text-lg font-medium",children:h.title}),p(h.status)]}),P&&jsx("div",{className:"mb-4",children:k()}),j&&jsxs("div",{className:"mb-6",children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",R(h.discoveredAt)]}),h.occurredAt&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Occurred:"})," ",R(h.occurredAt)]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Reporter:"})," ",h.reporter.name]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",h.affectedSystems.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",h.dataTypes.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",h.estimatedAffectedSubjects||"Unknown"]})]})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium",children:"Description:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:h.description})]}),h.initialActions&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium",children:"Initial Actions Taken:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:h.initialActions})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),x?jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsx("p",{className:"text-sm font-medium",children:"Risk Level:"}),z(x.riskLevel)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",x.overallRiskScore," / 5"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",x.risksToRightsAndFreedoms?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",x.highRisksToRightsAndFreedoms?"Yes":"No"]}),jsx("p",{className:"text-sm mb-1",children:jsx("span",{className:"font-medium",children:"Justification:"})}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 bg-white dark:bg-gray-800 p-2 rounded-md",children:x.justification})]}):jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"Risk assessment has not been conducted yet."}),jsx("button",{onClick:Y,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Conduct Risk Assessment"})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),f?jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Sent:"})," ",R(f.sentAt)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Method:"})," ",f.method.charAt(0).toUpperCase()+f.method.slice(1)]}),f.referenceNumber&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Reference Number:"})," ",f.referenceNumber]}),(f.ndpcContact||f.nitdaContact)&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(H=f.ndpcContact||f.nitdaContact)==null?void 0:H.name]})]}):jsx("div",{children:y!=null&&y.ndpcNotificationRequired?jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"NDPC notification is required but has not been sent yet."}),jsx("button",{onClick:re,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Generate Notification"})]}):jsx("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:"NDPC notification is not required for this breach."})})})]}),se&&T()]}):jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a breach to view details"})})})]})]})};var Te=({breachData:g,assessmentData:u,organizationInfo:w,onGenerate:J,title:_="Generate NDPC Notification Report",description:K="Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements.",generateButtonText:ae="Generate Report",className:Z="",buttonClassName:v="",classNames:d={},unstyled:l=false,showPreview:A=true,allowEditing:j=true,allowDownload:se=true,downloadFormat:P="pdf"})=>{let[b,D]=useState(""),[C,q]=useState(""),[B,E]=useState(""),[I,M]=useState(""),[O,G]=useState("email"),[W,Q]=useState(""),[ie,Y]=useState(""),[re,R]=useState(false),[h,x]=useState(false);useEffect(()=>{let p=y();D(p),R(true);},[g,u,w]);let f=p=>new Date(p).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),y=()=>`
2
- NDPC DATA BREACH NOTIFICATION
3
-
4
- Date: ${new Date().toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})}
5
-
6
- Reference: NDPA Section 40 - Breach Notification
7
-
8
- ORGANIZATION DETAILS
9
- -------------------
10
- Organization Name: ${w.name}
11
- ${w.registrationNumber?`Registration Number: ${w.registrationNumber}`:""}
12
- Address: ${w.address}
13
- ${w.website?`Website: ${w.website}`:""}
14
-
15
- DATA PROTECTION OFFICER
16
- ----------------------
17
- Name: ${w.dpoName}
18
- Email: ${w.dpoEmail}
19
- ${w.dpoPhone?`Phone: ${w.dpoPhone}`:""}
20
-
21
- BREACH DETAILS
22
- -------------
23
- Breach Title: ${g.title}
24
- Date Discovered: ${f(g.discoveredAt)}
25
- ${g.occurredAt?`Date Occurred: ${f(g.occurredAt)}`:"Date Occurred: Unknown"}
26
- Status: ${g.status.charAt(0).toUpperCase()+g.status.slice(1)}
27
-
28
- Description of the Breach:
29
- ${g.description}
30
-
31
- Affected Systems/Applications:
32
- ${g.affectedSystems.join(", ")}
33
-
34
- Types of Personal Data Involved:
35
- ${g.dataTypes.join(", ")}
36
-
37
- Estimated Number of Data Subjects Affected:
38
- ${g.estimatedAffectedSubjects||"Unknown"}
39
-
40
- RISK ASSESSMENT
41
- --------------
42
- ${u?`
43
- Overall Risk Level: ${u.riskLevel.charAt(0).toUpperCase()+u.riskLevel.slice(1)}
44
- Risk to Rights and Freedoms of Data Subjects: ${u.risksToRightsAndFreedoms?"Yes":"No"}
45
- High Risk to Rights and Freedoms of Data Subjects: ${u.highRisksToRightsAndFreedoms?"Yes":"No"}
46
-
47
- Justification for Risk Assessment:
48
- ${u.justification}
49
- `:"Risk assessment has not been conducted yet."}
50
-
51
- MEASURES TAKEN
52
- -------------
53
- Measures taken or proposed to address the breach:
54
- ${g.initialActions||"To be determined"}
55
-
56
- Measures taken or proposed to mitigate possible adverse effects:
57
- [Please specify measures taken to mitigate adverse effects]
58
-
59
- NOTIFICATION TO DATA SUBJECTS (NDPA Section 40(4))
60
- ----------------------------
61
- Have data subjects been notified: [Yes/No]
62
- If yes, date of notification: [Date]
63
- If no, planned date of notification: [Date]
64
- Reason for delay (if applicable): [Reason]
65
-
66
- ADDITIONAL INFORMATION
67
- ---------------------
68
- [Any additional information relevant to the breach]
69
-
70
- This notification is made in compliance with the Nigeria Data Protection Act (NDPA), Section 40.
71
- `,X=p=>{p.preventDefault();let k={id:`notification_${Date.now()}`,breachId:g.id,sentAt:Date.now(),method:O,referenceNumber:W||void 0,ndpcContact:C?{name:C,email:B,phone:I||void 0}:void 0,content:b,attachments:[]};J(k),x(true);},U=()=>{let p,k,T;switch(P){case "html":{p="text/html",k="html",T=`<!DOCTYPE html>
72
- <html lang="en">
73
- <head>
74
- <meta charset="UTF-8">
75
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
76
- <title>NDPC Breach Notification Report</title>
77
- <style>body{font-family:monospace;white-space:pre-wrap;max-width:800px;margin:2rem auto;padding:0 1rem;}</style>
78
- </head>
79
- <body>${b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}</body>
80
- </html>`;break}case "pdf":p="text/plain",k="pdf.txt",T=b;break;case "docx":p="text/plain",k="docx.txt",T=b;break;default:p="text/plain",k="txt",T=b;}let H=document.createElement("a"),s=new Blob([T],{type:p});H.href=URL.createObjectURL(s),H.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.${k}`,document.body.appendChild(H),H.click(),document.body.removeChild(H);},z=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(k=>jsx("option",{value:k.value,children:k.label},k.value));return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Z}`,d.root,l),children:[jsxs("div",{className:a("",d.header,l),children:[jsx("h2",{className:a("text-xl font-bold mb-2",d.title,l),children:_}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:K})]}),h?jsxs("div",{children:[jsxs("div",{className:"mb-6 p-4 bg-green-50 dark:bg-green-900/20 rounded-md",children:[jsx("h3",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Generated Successfully"}),jsx("p",{className:"text-green-700 dark:text-green-300",children:"Your NDPC notification report has been generated and is ready for submission. Please review the report carefully before submitting it to the NDPC."})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Submission Details"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Method:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:O.charAt(0).toUpperCase()+O.slice(1)})]}),C&&jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Contact Name:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:C})]}),B&&jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Contact Email:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:B})]}),I&&jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Contact Phone:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:I})]})]}),jsxs("div",{children:[jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Date Generated:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:f(Date.now())})]}),jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Breach ID:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:g.id})]}),W&&jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Reference Number:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:W})]})]})]})]}),A&&jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Preview"}),jsx("div",{className:a("bg-gray-50 dark:bg-gray-700 p-4 rounded-md",d.reportPreview,l),children:jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:b})})]}),jsxs("div",{className:"flex flex-wrap gap-3",children:[se&&jsxs("button",{onClick:U,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${v}`,d.secondaryButton||d.downloadButton,l),children:["Download Report (",P.toUpperCase(),")"]}),jsx("button",{onClick:()=>x(false),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 ${v}`,children:"Edit Report"})]})]}):jsx("form",{onSubmit:X,children:jsxs("div",{className:"space-y-6",children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Notification Method"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"method",className:"block text-sm font-medium mb-1",children:["Method of Submission ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("select",{id:"method",value:O,onChange:p=>G(p.target.value),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))]",required:true,children:z()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"referenceNumber",className:"block text-sm font-medium mb-1",children:"Reference Number (if available)"}),jsx("input",{type:"text",id:"referenceNumber",value:W,onChange:p=>Q(p.target.value),placeholder:"e.g. NDPC/BR/2024/001",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))]"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"NDPC Contact (if known)"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[jsxs("div",{children:[jsx("label",{htmlFor:"contactName",className:"block text-sm font-medium mb-1",children:"Contact Name"}),jsx("input",{type:"text",id:"contactName",value:C,onChange:p=>q(p.target.value),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))]"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactEmail",className:"block text-sm font-medium mb-1",children:"Contact Email"}),jsx("input",{type:"email",id:"contactEmail",value:B,onChange:p=>E(p.target.value),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))]"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactPhone",className:"block text-sm font-medium mb-1",children:"Contact Phone"}),jsx("input",{type:"tel",id:"contactPhone",value:I,onChange:p=>M(p.target.value),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))]"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxs("div",{children:[jsx("label",{htmlFor:"additionalInfo",className:"block text-sm font-medium mb-1",children:"Additional Information to Include"}),jsx("textarea",{id:"additionalInfo",value:ie,onChange:p=>Y(p.target.value),rows:3,placeholder:"Any additional information you want to include in the report",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))]"})]})]}),j&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Content"}),jsxs("div",{children:[jsxs("label",{htmlFor:"reportContent",className:"block text-sm font-medium mb-1",children:["Edit Report Content ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"reportContent",value:b,onChange:p=>D(p.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",required:true})]})]}),jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This report will help you comply with this requirement."})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${v}`,d.primaryButton||d.generateButton,l),children:ae})})]})})]})};export{ve as a,Ce as b,Te as c};//# sourceMappingURL=chunk-NUDVUAD4.mjs.map
81
- //# sourceMappingURL=chunk-NUDVUAD4.mjs.map
@@ -1,7 +0,0 @@
1
- import {a}from'./chunk-AYKLAEOU.mjs';import {jsxs,jsx}from'react/jsx-runtime';import D from'react';var S=({result:r,sections:m,showFullReport:p=true,allowPrint:x=true,allowExport:y=true,onExport:v,className:u="",buttonClassName:b="",classNames:k={},unstyled:N=false})=>{let i=(a$1,s)=>{let d=s?k[s]:void 0;return !d&&s==="printButton"&&(d=k.primaryButton),a(a$1,d,N)},g=a=>new Date(a).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),l=a=>{let s=r.answers[a];return s==null?"Not answered":typeof s=="boolean"?s?"Yes":"No":Array.isArray(s)?s.join(", "):String(s)},w=()=>{window.print();},C=a=>{v&&v(a);},h=a=>jsx("span",{className:i(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[a]}`,"riskBadge"),children:a.charAt(0).toUpperCase()+a.slice(1)});return jsxs("div",{className:`${i("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 print:shadow-none print:p-0","root")} ${u}`,children:[jsxs("div",{className:i("mb-8 border-b border-gray-200 dark:border-gray-700 pb-6 print:pb-4","header"),children:[jsxs("div",{className:"flex justify-between items-start",children:[jsxs("div",{children:[jsx("h1",{className:i("text-2xl font-bold text-gray-900 dark:text-white mb-2","title"),children:"Data Protection Impact Assessment Report"}),jsx("h2",{className:"text-xl text-gray-700 dark:text-gray-300 mb-4",children:r.title})]}),(x||y)&&jsxs("div",{className:"flex space-x-2 print:hidden",children:[x&&jsx("button",{onClick:w,className:`${i("px-3 py-1 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600","printButton")} ${b}`,children:jsxs("span",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})}),"Print"]})}),y&&jsx("div",{className:"relative inline-block",children:jsx("button",{onClick:()=>C("pdf"),className:`px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${b}`,children:jsxs("span",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Export PDF"]})})})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Assessor:"})," ",r.assessor.name,", ",r.assessor.role]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",r.assessor.email]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Started:"})," ",g(r.startedAt)]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Completed:"})," ",r.completedAt?g(r.completedAt):"In progress"]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Next review:"})," ",r.reviewDate?g(r.reviewDate):"Not scheduled"]})]})]})]}),jsxs("div",{className:i("mb-8","summary"),children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Executive Summary"}),jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:[jsxs("div",{className:"flex items-center mb-2",role:"status","aria-live":"polite",children:[jsx("span",{className:"font-medium mr-2",children:"Overall Risk Level:"}),h(r.overallRiskLevel)]}),jsxs("div",{className:i("mb-2","conclusion"),children:[jsx("span",{className:"font-medium",children:"Conclusion:"})," ",r.conclusion]}),jsxs("div",{role:"status","aria-live":"polite",children:[jsx("span",{className:"font-medium",children:"Can Proceed:"})," ",r.canProceed?"Yes":"No"]})]}),jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Processing Activity Description"}),jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-4",children:r.processingDescription}),r.recommendations&&r.recommendations.length>0&&jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Key Recommendations"}),jsx("ul",{className:"list-disc pl-5 text-gray-700 dark:text-gray-300",children:r.recommendations.map((a,s)=>jsx("li",{className:i("","recommendation"),children:a},s))})]})]})]}),jsxs("div",{className:"mb-8",children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Identified Risks"}),r.risks.length===0?jsx("p",{className:"text-gray-700 dark:text-gray-300",children:"No risks identified."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:i("min-w-full divide-y divide-gray-200 dark:divide-gray-700","riskTable"),children:[jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Risk"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Likelihood"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Impact"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Risk Level"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Mitigated"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:r.risks.map(a=>jsxs("tr",{className:i("","riskRow"),children:[jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:a.description}),jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[a.likelihood," / 5"]}),jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[a.impact," / 5"]}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:h(a.level)}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:a.mitigated?jsx("span",{className:"text-green-600 dark:text-green-400",children:"Yes"}):jsx("span",{className:"text-red-600 dark:text-red-400",children:"No"})})]},a.id))})]})})]}),p&&jsxs("div",{children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Full Assessment Details"}),m.map(a=>{let s=a.questions.filter(d=>r.answers[d.id]!==void 0);return s.length===0?null:jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:a.title}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Question"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Answer"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:s.map(d=>jsxs("tr",{children:[jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:d.text}),jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-600 dark:text-gray-400",children:l(d.id)})]},d.id))})]})})]},a.id)})]}),jsxs("div",{className:"mt-8 pt-4 border-t border-gray-200 dark:border-gray-700 text-sm text-gray-600 dark:text-gray-400",children:[jsx("p",{children:"This DPIA was conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023."}),jsxs("p",{children:["DPIA Report Version: ",r.version]}),jsxs("p",{children:["Generated on: ",new Date().toLocaleDateString()]})]})]})};var F=({steps:r,onStepClick:m,clickable:p=true,orientation:x="horizontal",className:y="",activeStepClassName:v="",completedStepClassName:u="",incompleteStepClassName:b="",classNames:k={},unstyled:N=false})=>{let i=(n,l)=>a(n,l?k[l]:void 0,N),g=n=>{p&&m&&m(n);},c=x==="vertical";return jsx("div",{role:"navigation","aria-label":"Step progress",className:`${i(c?"flex flex-col space-y-4":"flex items-center justify-between","root")} ${y}`,children:r.map((n,l)=>{let w=l===r.length-1,C=n.active?i(`font-medium ${v||"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]"}`,"label"):n.completed?i(u||"text-green-600 dark:text-green-400","label"):i(b||"text-gray-600 dark:text-gray-400","label"),h=n.active?i("flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] border-2 border-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]","stepActive"):n.completed?i("flex items-center justify-center w-8 h-8 rounded-full bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-400 border-2 border-green-600 dark:border-green-400","stepCompleted"):i("flex items-center justify-center w-8 h-8 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400 border-2 border-gray-300 dark:border-gray-600","stepPending");return jsxs(D.Fragment,{children:[jsxs("div",{className:i(`${c?"flex items-start":"flex flex-col items-center"} ${p?"cursor-pointer":""}`,"step"),onClick:()=>g(n.id),"aria-current":n.active?"step":void 0,children:[jsx("div",{className:`
2
- flex items-center justify-center
3
- ${c?"mr-4":""}
4
- `,children:jsx("div",{className:h,children:n.icon?n.icon:n.completed?jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):jsx("span",{children:l+1})})}),jsxs("div",{className:`
5
- ${c?"flex-1":"mt-2 text-center"}
6
- `,children:[jsx("div",{className:`text-sm font-medium ${C}`,children:n.label}),n.description&&jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:n.description})]})]}),!w&&jsx("div",{className:i(c?"ml-4 h-8 border-l-2 border-gray-300 dark:border-gray-600":"w-full border-t-2 border-gray-300 dark:border-gray-600 hidden sm:block","connector")})]},n.id)})})};export{S as a,F as b};//# sourceMappingURL=chunk-NUULHXVL.mjs.map
7
- //# sourceMappingURL=chunk-NUULHXVL.mjs.map
@@ -1,2 +0,0 @@
1
- import {b as b$1,c,d}from'./chunk-SHMJNRHO.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function E({initialData:S,adapter:l,onRecordAdd:p,onRecordUpdate:g,onRecordArchive:f}){let d$1=useRef(l);d$1.current=l;let[s,u]=useState(S),[v,P]=useState(l!==void 0);useEffect(()=>{if(!d$1.current)return;let t=false;try{let e=d$1.current.load();e instanceof Promise?e.then(r=>{t||(r&&u(r),P(!1));},()=>{t||P(!1);}):(e&&u(e),P(!1));}catch(e){t||P(false);}return ()=>{t=true;}},[]);let n=useCallback(t=>{d$1.current&&Promise.resolve(d$1.current.save(t)).catch(e=>{console.warn("[ndpr-toolkit] Failed to save ROPA:",e);});},[]),C=useCallback(t=>{u(e=>{let r=b(a({},e),{records:[...e.records,t],lastUpdated:Date.now()});return n(r),r}),p==null||p(t);},[p,n]),w=useCallback((t,e)=>{u(r=>{let a$1=b(a({},r),{records:r.records.map(R=>R.id===t?b(a(a({},R),e),{updatedAt:Date.now()}):R),lastUpdated:Date.now()});return n(a$1),a$1}),g==null||g(t,e);},[g,n]),x=useCallback(t=>{u(e=>{let r=b(a({},e),{records:e.records.map(a$1=>a$1.id===t?b(a({},a$1),{status:"archived",updatedAt:Date.now()}):a$1),lastUpdated:Date.now()});return n(r),r}),f==null||f(t);},[f,n]),D=useCallback(t=>s.records.find(e=>e.id===t),[s.records]),G=useCallback(()=>b$1(s),[s]),b$2=useCallback(()=>c(s),[s]),L=useCallback(()=>d(s),[s]);return {ropa:s,addRecord:C,updateRecord:w,archiveRecord:x,getRecord:D,getSummary:G,exportCSV:b$2,getComplianceGaps:L,isLoading:v}}export{E as a};//# sourceMappingURL=chunk-PM7O5IGE.mjs.map
2
- //# sourceMappingURL=chunk-PM7O5IGE.mjs.map
@@ -1,2 +0,0 @@
1
- import {a}from'./chunk-AYKLAEOU.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useRef,useEffect,useCallback}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var _=({options:b$1,settings:l,onSave:v,title:h="Manage Your Privacy Settings",description:R="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:B="Save Preferences",resetButtonText:x="Reset to Defaults",version:$="1.0",className:S="",buttonClassName:o="",primaryButtonClassName:i="",secondaryButtonClassName:y="",classNames:e,unstyled:s,showSuccessMessage:m=true,successMessage:k="Your preferences have been saved.",successMessageDuration:T=3e3})=>{let[p,t]=useState({}),[r,d]=useState(false),g=useRef(null);useEffect(()=>()=>{g.current&&clearTimeout(g.current);},[]),useEffect(()=>{if(l&&l.consents)t(l.consents);else {let n={};b$1.forEach(c=>{n[c.id]=c.defaultValue||false;}),t(n);}},[b$1,l]);let I=(n,c)=>{t(Y=>b(a$1({},Y),{[n]:c}));},M=()=>{let n={consents:p,timestamp:Date.now(),version:$,method:"manager",hasInteracted:true};v(n),m&&(d(true),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{d(false);},T));},O=()=>{let n={};b$1.forEach(c=>{n[c.id]=c.defaultValue||false;}),t(n);},w=(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))] ${o} ${i}`,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 ${o} ${y}`;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:R}),jsx("div",{className:a("space-y-6",e==null?void 0:e.optionsList,s),children:b$1.map(n=>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:n.label}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:n.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[n.id]||false,onChange:c=>I(n.id,c.target.checked),disabled:n.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))] ${n.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[n.id]?"Enabled":"Disabled",n.required&&jsx("span",{className:"text-xs text-red-500 ml-1",children:"(Required)"})]})]})})]})},n.id))}),r&&jsx("div",{className:"mt-4 p-3 bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200 rounded-md","aria-live":"polite",role:"status",children:k}),jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[jsx("button",{onClick:M,className:a(w,e==null?void 0:e.saveButton,s),children:B}),jsx("button",{onClick:O,className:a(C,e==null?void 0:e.resetButton,s),children:x})]}),jsxs("div",{className:"mt-4 text-xs text-gray-600 dark:text-gray-400",children:[jsxs("p",{children:["Last updated: ",l?new Date(l.timestamp).toLocaleString():"Never"]}),jsxs("p",{children:["Version: ",$]})]})]})};var N=({settings:b,storageOptions:l={},onLoad:v,onSave:h,autoSave:R=true,autoLoad:B=true,classNames:x,unstyled:$,children:S})=>{let{storageKey:o="ndpr_consent",storageType:i="localStorage",cookieOptions:y={}}=l,[e,s]=useState(false),m=useCallback(()=>{let t=null;try{if(i==="localStorage"&&typeof window!="undefined"){let r=localStorage.getItem(o);r&&(t=JSON.parse(r));}else if(i==="sessionStorage"&&typeof window!="undefined"){let r=sessionStorage.getItem(o);r&&(t=JSON.parse(r));}else if(i==="cookie"&&typeof document!="undefined"){let d=document.cookie.split(";").find(g=>g.trim().startsWith(`${o}=`));if(d){let g=d.split("=")[1];t=JSON.parse(decodeURIComponent(g));}}s(!0),v&&v(t);}catch(r){console.error("Error loading consent settings:",r),s(true),v&&v(null);}return t},[i,o,v]),k=useCallback(t=>{try{let r=JSON.stringify(t);if(i==="localStorage"&&typeof window!="undefined")localStorage.setItem(o,r);else if(i==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(o,r);else if(i==="cookie"&&typeof document!="undefined"){let{domain:d,path:g="/",expires:I=365,secure:M=!0,sameSite:O="Lax"}=y,w=new Date;w.setDate(w.getDate()+I);let C=`${o}=${encodeURIComponent(r)}; path=${g}; expires=${w.toUTCString()}`;d&&(C+=`; domain=${d}`),M&&(C+="; secure"),C+=`; samesite=${O}`,document.cookie=C;}return h&&h(t),!0}catch(r){return console.error("Error saving consent settings:",r),false}},[i,o,y,h]),T=useCallback(()=>{try{if(i==="localStorage"&&typeof window!="undefined")localStorage.removeItem(o);else if(i==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(o);else if(i==="cookie"&&typeof document!="undefined"){let{domain:t,path:r="/"}=y,d=`${o}=; path=${r}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;t&&(d+=`; domain=${t}`),document.cookie=d;}return !0}catch(t){return console.error("Error clearing consent settings:",t),false}},[i,o,y]);useEffect(()=>{B&&!e&&m();},[B,e,m]),useEffect(()=>{R&&e&&k(b);},[b,R,e,k]);let p=a("",x==null?void 0:x.root,$);if(typeof S=="function"){let t=S({loadSettings:m,saveSettings:k,clearSettings:T,loaded:e});return p?jsx("div",{className:p,children:t}):jsx(Fragment,{children:t})}return p?jsx("div",{className:p,children:S}):jsx(Fragment,{children:S})};export{_ as a,N as b};//# sourceMappingURL=chunk-Q7VHB64E.mjs.map
2
- //# sourceMappingURL=chunk-Q7VHB64E.mjs.map