@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
@@ -0,0 +1,81 @@
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 xe=({breachData:u,initialAssessment:f={},onComplete:y,title:J="Breach Risk Assessment",description:K="Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",submitButtonText:Z="Complete Assessment",className:se="",buttonClassName:Q="",classNames:b={},unstyled:o=false,showBreachSummary:l=true,showNotificationRequirements:C=true})=>{let[$,ae]=useState(f.confidentialityImpact||3),[B,h]=useState(f.integrityImpact||3),[_,S]=useState(f.availabilityImpact||3),[L,I]=useState(f.harmLikelihood||3),[j,T]=useState(f.harmSeverity||3),[O,q]=useState(f.risksToRightsAndFreedoms!==void 0?f.risksToRightsAndFreedoms:false),[U,H]=useState(f.highRisksToRightsAndFreedoms!==void 0?f.highRisksToRightsAndFreedoms:false),[X,ie]=useState(f.justification||""),[V,ne]=useState(0),[k,g]=useState("low"),[x,N]=useState(false),[R,z]=useState(0),[E,ee]=useState(0),[p,w]=useState(false),[M]=useState(()=>Date.now());useEffect(()=>{let W=$*.2+B*.1+_*.1+L*.3+j*.3;ne(Number(W.toFixed(1)));let Y;W<2?Y="low":W<3?Y="medium":W<4?Y="high":Y="critical",g(Y),N(O||Y==="high"||Y==="critical");let de=u.discoveredAt+4320*60*1e3;z(de);let pe=Date.now(),ue=(de-pe)/(3600*1e3);ee(Number(ue.toFixed(1)));},[$,B,_,L,j,O,u.discoveredAt]);let P=d=>new Date(d).toLocaleString(),a$1=d=>{d.preventDefault();let D={id:f.id||`assessment_${Date.now()}`,breachId:u.id,assessedAt:Date.now(),assessor:f.assessor||{name:"Assessment User",role:"Data Protection Officer",email:"dpo@example.com"},confidentialityImpact:$,integrityImpact:B,availabilityImpact:_,harmLikelihood:L,harmSeverity:j,overallRiskScore:V,riskLevel:k,risksToRightsAndFreedoms:O,highRisksToRightsAndFreedoms:U,justification:X};y(D),w(true);},m=d=>{switch(d){case 1:return "Minimal";case 2:return "Low";case 3:return "Moderate";case 4:return "High";case 5:return "Severe";default:return "Unknown"}},v=d=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--warning",critical:"ndpr-badge ndpr-badge--destructive"}[d]}`,b.riskBadge,o),children:d.charAt(0).toUpperCase()+d.slice(1)});return jsxs("div",{"data-ndpr-component":"breach-risk-assessment",className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${se}`,b.root,o),children:[jsx("h2",{className:a("ndpr-section-heading",b.title,o),children:J}),jsx("p",{className:"ndpr-card__subtitle",children:K}),l&&jsxs("div",{className:"ndpr-panel",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:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Title:"})," ",u.title]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",P(u.discoveredAt)]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",u.status.charAt(0).toUpperCase()+u.status.slice(1)]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",u.dataTypes.join(", ")]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",u.affectedSystems.join(", ")]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",u.estimatedAffectedSubjects||"Unknown"]})]})]})]}),p?jsxs("div",{children:[jsxs("div",{className:"ndpr-alert ndpr-alert--info",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Assessment Results"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Level:"})," ",v(k)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",V," / 5"]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Assessed On:"})," ",P(M)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",O?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",U?"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:X})]})]}),C&&jsxs("div",{className:a(`mb-6 p-4 rounded-md ${x?E>24?"ndpr-alert ndpr-alert--warning":"ndpr-alert ndpr-alert--destructive":"ndpr-alert ndpr-alert--success"}`,b.notificationStatus,o),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 ${E>24?"ndpr-text-warning":"ndpr-text-destructive"}`,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:"})," ",P(R)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsx("span",{className:E<24?"ndpr-text-destructive font-bold":"",children:E>0?`${E} hours`:"Deadline passed"})]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",U?"Required (NDPA Section 40(4))":"Not required unless directed by NDPC"]})]}):jsxs("div",{children:[jsx("p",{className:"text-sm font-bold mb-2 ndpr-text-success",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"}),U&&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:()=>w(false),className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${Q}`,b.primaryButton||b.submitButton,o),children:"Edit Assessment"})]}):jsx("form",{onSubmit:a$1,children:jsxs("div",{className:"ndpr-form-section",children:[jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Impact Assessment"}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"confidentialityImpact",className:"ndpr-form-field__label",children:["Confidentiality Impact (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",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:$,onChange:d=>ae(parseInt(d.target.value)),className:a("ndpr-form-field__range",b.slider,o)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[m($)," (",$,")"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"integrityImpact",className:"ndpr-form-field__label",children:["Integrity Impact (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",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:B,onChange:d=>h(parseInt(d.target.value)),className:a("ndpr-form-field__range",b.slider,o)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(B)," (",B,")"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"availabilityImpact",className:"ndpr-form-field__label",children:["Availability Impact (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",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:_,onChange:d=>S(parseInt(d.target.value)),className:a("ndpr-form-field__range",b.slider,o)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(_)," (",_,")"]})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Risk to Data Subjects"}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"harmLikelihood",className:"ndpr-form-field__label",children:["Likelihood of Harm (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",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:L,onChange:d=>I(parseInt(d.target.value)),className:a("ndpr-form-field__range",b.slider,o)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(L)," (",L,")"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"harmSeverity",className:"ndpr-form-field__label",children:["Severity of Harm (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",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:j,onChange:d=>T(parseInt(d.target.value)),className:a("ndpr-form-field__range",b.slider,o)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(j)," (",j,")"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:O,onChange:d=>q(d.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 ndpr-text-muted 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:"ndpr-form-field",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"highRisksToRightsAndFreedoms",checked:U,onChange:d=>H(d.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 ndpr-text-muted 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:"ndpr-section-heading",children:"Overall Assessment"}),jsxs("div",{className:"ndpr-panel",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("",b.riskScore,o),children:[V," / 5"]})]}),jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:"font-medium",children:"Risk Level:"}),v(k)]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"justification",className:"ndpr-form-field__label",children:["Justification for Assessment ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"justification",value:X,onChange:d=>ie(d.target.value),rows:4,placeholder:"Explain the reasoning behind your assessment, including any factors that influenced your decision.",className:"ndpr-form-field__input",required:true})]})]}),jsxs("div",{className:"ndpr-alert ndpr-alert--info",children:[jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"ndpr-text-info 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 ${Q}`,b.primaryButton||b.submitButton,o),children:Z})})]})})]})};var Se=({breachReports:u,riskAssessments:f,regulatoryNotifications:y,onSelectBreach:J,onRequestAssessment:K,onRequestNotification:Z,title:se="Breach Notification Manager",description:Q="Manage data breach notifications and track compliance with NDPA Section 40 requirements.",className:b="",buttonClassName:o="",classNames:l={},unstyled:C=false,showBreachDetails:$=true,showNotificationTimeline:ae=true,showDeadlineAlerts:B=true})=>{var P;let[h,_]=useState(null),[S,L]=useState(u),[I,j]=useState("all"),[T,O]=useState(""),[q,U]=useState("discoveredAt"),[H,X]=useState("desc");useEffect(()=>{let a=[...u];if(I!=="all"&&(a=a.filter(m=>m.status===I)),T){let m=T.toLowerCase();a=a.filter(v=>v.title.toLowerCase().includes(m)||v.description.toLowerCase().includes(m)||v.affectedSystems.some(d=>d.toLowerCase().includes(m))||v.dataTypes.some(d=>d.toLowerCase().includes(m)));}a.sort((m,v)=>{let d=0;switch(q){case "title":d=m.title.localeCompare(v.title);break;case "discoveredAt":d=m.discoveredAt-v.discoveredAt;break;case "status":d=m.status.localeCompare(v.status);break;case "riskLevel":let D=f.find(W=>W.breachId===m.id),F=f.find(W=>W.breachId===v.id),re=(D==null?void 0:D.riskLevel)||"unknown",oe=(F==null?void 0:F.riskLevel)||"unknown";d=re.localeCompare(oe);break;default:d=m.discoveredAt-v.discoveredAt;}return H==="asc"?d:-d}),L(a);},[u,I,T,q,H,f]),useEffect(()=>{S.length>0&&(h&&S.some(m=>m.id===h)||_(S[0].id));},[S,h]);let ie=a=>{_(a),J&&J(a);},V=()=>{h&&K&&K(h);},ne=()=>{h&&Z&&Z(h);},k=a=>new Date(a).toLocaleString(),g=h?u.find(a=>a.id===h):null,x=h?f.find(a=>a.breachId===h):null,N=h?y.find(a=>a.breachId===h):null,R=g?z(g,x):null;function z(a,m){let v=a$1(a,m||void 0),d=a.discoveredAt+v.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:v.notificationRequired,ndpcNotificationDeadline:d,dataSubjectNotificationRequired:(m==null?void 0:m.highRisksToRightsAndFreedoms)||false,justification:v.justification}}function E(a){let m=Date.now(),v=(a-m)/(3600*1e3);return Number(v.toFixed(1))}let ee=a$1=>a$1?jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--warning",critical:"ndpr-badge ndpr-badge--destructive"}[a$1]}`,l.statusBadge,C),children:a$1.charAt(0).toUpperCase()+a$1.slice(1)}):null,p=a$1=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{ongoing:"ndpr-badge ndpr-badge--destructive",contained:"ndpr-badge ndpr-badge--warning",resolved:"ndpr-badge ndpr-badge--success"}[a$1]||"ndpr-badge ndpr-badge--neutral"}`,l.statusBadge,C),children:a$1.charAt(0).toUpperCase()+a$1.slice(1)}),w=()=>{if(!g||!R)return null;if(!R.ndpcNotificationRequired)return jsxs("div",{"data-ndpr-component":"breach-notification-manager",className:"ndpr-alert ndpr-alert--success",children:[jsx("p",{className:"text-sm ndpr-text-success font-medium",children:"Notification Not Required"}),jsx("p",{className:"text-xs ndpr-text-success mt-1",children:"Based on the risk assessment, NDPC notification is not required for this breach."})]});if(N)return jsxs("div",{className:"ndpr-alert ndpr-alert--success",children:[jsx("p",{className:"text-sm ndpr-text-success font-medium",children:"Notification Sent"}),jsxs("p",{className:"text-xs ndpr-text-success mt-1",children:["Notification was sent to the NDPC on ",k(N.sentAt),"."]})]});let a=E(R.ndpcNotificationDeadline);return a<=0?jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsx("p",{className:"text-sm ndpr-text-destructive font-medium",children:"Notification Deadline Passed"}),jsx("p",{className:"text-xs ndpr-text-destructive mt-1",children:"The 72-hour deadline for NDPC notification has passed. Notification should be sent immediately."})]}):a<=24?jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsx("p",{className:"text-sm ndpr-text-destructive font-medium",children:"Urgent: Notification Due Soon"}),jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["Only ",a," hours remaining until the NDPC notification deadline."]})]}):jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm ndpr-text-warning font-medium",children:"Notification Required"}),jsxs("p",{className:"text-xs ndpr-text-warning mt-1",children:["NDPC notification is required by ",k(R.ndpcNotificationDeadline)," (",a," hours remaining)."]})]})},M=()=>{if(!g)return null;let a$1=[{title:"Breach Discovered",date:g.discoveredAt,completed:true,description:`Breach was discovered on ${k(g.discoveredAt)}.`},{title:"Risk Assessment",date:x==null?void 0:x.assessedAt,completed:!!x,description:x?`Risk assessment completed on ${k(x.assessedAt)}.`:"Risk assessment has not been completed yet."}];return R!=null&&R.ndpcNotificationRequired&&a$1.push({title:"NDPC Notification",date:N==null?void 0:N.sentAt,completed:!!N,description:N?`Notification sent to the NDPC on ${k(N.sentAt)}.`:`Notification must be sent to the NDPC by ${k(R.ndpcNotificationDeadline)}.`}),R!=null&&R.dataSubjectNotificationRequired&&a$1.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,C),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:a$1.map((m,v)=>jsxs("li",{className:a("mb-6 ml-4",l.timelineStep,C),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 ndpr-text-muted",children:m.date?k(m.date):"Pending"}),jsx("h4",{className:"ndpr-section-heading",children:m.title}),jsx("p",{className:"ndpr-form-field__hint",children:m.description})]},v))})]})};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${b}`,l.root,C),children:[jsxs("div",{className:a("",l.header,C),children:[jsx("h2",{className:a("ndpr-section-heading",l.title,C),children:se}),jsx("p",{className:"ndpr-card__subtitle",children:Q})]}),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"statusFilter",className:"ndpr-form-field__label",children:"Status Filter"}),jsxs("select",{id:"statusFilter",value:I,onChange:a=>j(a.target.value),className:"ndpr-form-field__input",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:"ndpr-form-field__label",children:"Sort By"}),jsxs("select",{id:"sortBy",value:q,onChange:a=>U(a.target.value),className:"ndpr-form-field__input",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:"ndpr-form-field__label",children:"Search"}),jsx("input",{type:"text",id:"searchTerm",value:T,onChange:a=>O(a.target.value),placeholder:"Search breaches...",className:"ndpr-form-field__input"})]})]}),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"}),S.length===0?jsx("p",{className:"ndpr-card__subtitle",children:"No breach reports found."}):jsx("div",{className:a("space-y-2 max-h-96 overflow-y-auto pr-2",l.breachList,C),children:S.map(a$1=>{let m=f.find(F=>F.breachId===a$1.id),v=y.find(F=>F.breachId===a$1.id),d=z(a$1,m),D=null;if(d!=null&&d.ndpcNotificationRequired)if(v)D=jsx("span",{className:"text-xs ndpr-text-success",children:"Notified"});else {let F=E(d.ndpcNotificationDeadline);F<=0?D=jsx("span",{className:"text-xs ndpr-text-destructive font-bold",children:"Overdue"}):F<=24?D=jsx("span",{className:"text-xs ndpr-text-destructive",children:"Urgent"}):D=jsx("span",{className:"text-xs ndpr-text-warning",children:"Required"});}else D=jsx("span",{className:"text-xs ndpr-text-success",children:"Not Required"});return jsxs("div",{className:a(`p-3 rounded-md cursor-pointer ${h===a$1.id?"ndpr-alert ndpr-alert--info":"ndpr-panel"}`,l.breachItem,C),onClick:()=>ie(a$1.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:a$1.title}),p(a$1.status)]}),jsxs("p",{className:"text-xs ndpr-text-muted mb-1",children:["Discovered: ",new Date(a$1.discoveredAt).toLocaleDateString()]}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsx("div",{children:m&&ee(m.riskLevel)}),jsx("div",{children:D})]})]},a$1.id)})})]}),jsx("div",{className:a("md:col-span-2",l.detailPanel,C),children:g?jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsx("h3",{className:"ndpr-section-heading",children:g.title}),p(g.status)]}),B&&jsx("div",{className:"ndpr-form-field",children:w()}),$&&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:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",k(g.discoveredAt)]}),g.occurredAt&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Occurred:"})," ",k(g.occurredAt)]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Reporter:"})," ",g.reporter.name]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",g.affectedSystems.join(", ")]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",g.dataTypes.join(", ")]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",g.estimatedAffectedSubjects||"Unknown"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-text-sm ndpr-font-medium",children:"Description:"}),jsx("p",{className:"ndpr-panel",children:g.description})]}),g.initialActions&&jsxs("div",{children:[jsx("p",{className:"ndpr-text-sm ndpr-font-medium",children:"Initial Actions Taken:"}),jsx("p",{className:"ndpr-panel",children:g.initialActions})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),x?jsxs("div",{className:"ndpr-panel",children:[jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsx("p",{className:"ndpr-text-sm ndpr-font-medium",children:"Risk Level:"}),ee(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 ndpr-text-muted bg-white dark:bg-gray-800 p-2 rounded-md",children:x.justification})]}):jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm ndpr-text-warning",children:"Risk assessment has not been conducted yet."}),jsx("button",{onClick:V,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${o}`,children:"Conduct Risk Assessment"})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),N?jsxs("div",{className:"ndpr-panel",children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Sent:"})," ",k(N.sentAt)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Method:"})," ",N.method.charAt(0).toUpperCase()+N.method.slice(1)]}),N.referenceNumber&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Reference Number:"})," ",N.referenceNumber]}),(N.ndpcContact||N.nitdaContact)&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(P=N.ndpcContact||N.nitdaContact)==null?void 0:P.name]})]}):jsx("div",{children:R!=null&&R.ndpcNotificationRequired?jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm ndpr-text-warning",children:"NDPC notification is required but has not been sent yet."}),jsx("button",{onClick:ne,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${o}`,children:"Generate Notification"})]}):jsx("div",{className:"ndpr-alert ndpr-alert--success",children:jsx("p",{className:"text-sm ndpr-text-success",children:"NDPC notification is not required for this breach."})})})]}),ae&&M()]}):jsx("div",{className:"ndpr-empty-state",children:jsx("p",{className:"ndpr-card__subtitle",children:"Select a breach to view details"})})})]})]})};var Te=({breachData:u,assessmentData:f,organizationInfo:y,onGenerate:J,title:K="Generate NDPC Notification Report",description:Z="Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements.",generateButtonText:se="Generate Report",className:Q="",buttonClassName:b="",classNames:o={},unstyled:l=false,showPreview:C=true,allowEditing:$=true,allowDownload:ae=true,downloadFormat:B="pdf"})=>{let[h,_]=useState(""),[S,L]=useState(""),[I,j]=useState(""),[T,O]=useState(""),[q,U]=useState("email"),[H,X]=useState(""),[ie,V]=useState(""),[ne,k]=useState(false),[g,x]=useState(false);useEffect(()=>{let p=R();_(p),k(true);},[u,f,y]);let N=p=>new Date(p).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),R=()=>`
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: ${y.name}
11
+ ${y.registrationNumber?`Registration Number: ${y.registrationNumber}`:""}
12
+ Address: ${y.address}
13
+ ${y.website?`Website: ${y.website}`:""}
14
+
15
+ DATA PROTECTION OFFICER
16
+ ----------------------
17
+ Name: ${y.dpoName}
18
+ Email: ${y.dpoEmail}
19
+ ${y.dpoPhone?`Phone: ${y.dpoPhone}`:""}
20
+
21
+ BREACH DETAILS
22
+ -------------
23
+ Breach Title: ${u.title}
24
+ Date Discovered: ${N(u.discoveredAt)}
25
+ ${u.occurredAt?`Date Occurred: ${N(u.occurredAt)}`:"Date Occurred: Unknown"}
26
+ Status: ${u.status.charAt(0).toUpperCase()+u.status.slice(1)}
27
+
28
+ Description of the Breach:
29
+ ${u.description}
30
+
31
+ Affected Systems/Applications:
32
+ ${u.affectedSystems.join(", ")}
33
+
34
+ Types of Personal Data Involved:
35
+ ${u.dataTypes.join(", ")}
36
+
37
+ Estimated Number of Data Subjects Affected:
38
+ ${u.estimatedAffectedSubjects||"Unknown"}
39
+
40
+ RISK ASSESSMENT
41
+ --------------
42
+ ${f?`
43
+ Overall Risk Level: ${f.riskLevel.charAt(0).toUpperCase()+f.riskLevel.slice(1)}
44
+ Risk to Rights and Freedoms of Data Subjects: ${f.risksToRightsAndFreedoms?"Yes":"No"}
45
+ High Risk to Rights and Freedoms of Data Subjects: ${f.highRisksToRightsAndFreedoms?"Yes":"No"}
46
+
47
+ Justification for Risk Assessment:
48
+ ${f.justification}
49
+ `:"Risk assessment has not been conducted yet."}
50
+
51
+ MEASURES TAKEN
52
+ -------------
53
+ Measures taken or proposed to address the breach:
54
+ ${u.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
+ `,z=p=>{p.preventDefault();let w={id:`notification_${Date.now()}`,breachId:u.id,sentAt:Date.now(),method:q,referenceNumber:H||void 0,ndpcContact:S?{name:S,email:I,phone:T||void 0}:void 0,content:h,attachments:[]};J(w),x(true);},E=()=>{let p,w,M;switch(B){case "html":{p="text/html",w="html",M=`<!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>${h.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}</body>
80
+ </html>`;break}case "pdf":p="text/plain",w="pdf.txt",M=h;break;case "docx":p="text/plain",w="docx.txt",M=h;break;default:p="text/plain",w="txt",M=h;}let P=document.createElement("a"),a=new Blob([M],{type:p});P.href=URL.createObjectURL(a),P.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.${w}`,document.body.appendChild(P),P.click(),document.body.removeChild(P);},ee=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(w=>jsx("option",{value:w.value,children:w.label},w.value));return jsxs("div",{"data-ndpr-component":"regulatory-report-generator",className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,o.root,l),children:[jsxs("div",{className:a("",o.header,l),children:[jsx("h2",{className:a("ndpr-section-heading",o.title,l),children:K}),jsx("p",{className:"ndpr-card__subtitle",children:Z})]}),g?jsxs("div",{children:[jsxs("div",{className:"ndpr-alert ndpr-alert--success",children:[jsx("h3",{className:"text-lg font-bold ndpr-text-success mb-2",children:"Report Generated Successfully"}),jsx("p",{className:"ndpr-text-success",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:"ndpr-section-heading",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("ndpr-text-sm",o.field,l),children:[jsx("span",{className:a("font-medium",o.fieldLabel,l),children:"Method:"})," ",jsx("span",{className:a("",o.fieldValue,l),children:q.charAt(0).toUpperCase()+q.slice(1)})]}),S&&jsxs("p",{className:a("ndpr-text-sm",o.field,l),children:[jsx("span",{className:a("font-medium",o.fieldLabel,l),children:"Contact Name:"})," ",jsx("span",{className:a("",o.fieldValue,l),children:S})]}),I&&jsxs("p",{className:a("ndpr-text-sm",o.field,l),children:[jsx("span",{className:a("font-medium",o.fieldLabel,l),children:"Contact Email:"})," ",jsx("span",{className:a("",o.fieldValue,l),children:I})]}),T&&jsxs("p",{className:a("ndpr-text-sm",o.field,l),children:[jsx("span",{className:a("font-medium",o.fieldLabel,l),children:"Contact Phone:"})," ",jsx("span",{className:a("",o.fieldValue,l),children:T})]})]}),jsxs("div",{children:[jsxs("p",{className:a("ndpr-text-sm",o.field,l),children:[jsx("span",{className:a("font-medium",o.fieldLabel,l),children:"Date Generated:"})," ",jsx("span",{className:a("",o.fieldValue,l),children:N(Date.now())})]}),jsxs("p",{className:a("ndpr-text-sm",o.field,l),children:[jsx("span",{className:a("font-medium",o.fieldLabel,l),children:"Breach ID:"})," ",jsx("span",{className:a("",o.fieldValue,l),children:u.id})]}),H&&jsxs("p",{className:a("ndpr-text-sm",o.field,l),children:[jsx("span",{className:a("font-medium",o.fieldLabel,l),children:"Reference Number:"})," ",jsx("span",{className:a("",o.fieldValue,l),children:H})]})]})]})]}),C&&jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"ndpr-section-heading",children:"Report Preview"}),jsx("div",{className:a("ndpr-panel",o.reportPreview,l),children:jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:h})})]}),jsxs("div",{className:"ndpr-card__footer",children:[ae&&jsxs("button",{onClick:E,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${b}`,o.secondaryButton||o.downloadButton,l),children:["Download Report (",B.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 ${b}`,children:"Edit Report"})]})]}):jsx("form",{onSubmit:z,children:jsxs("div",{className:"ndpr-form-section",children:[jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Notification Method"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"method",className:"ndpr-form-field__label",children:["Method of Submission ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("select",{id:"method",value:q,onChange:p=>U(p.target.value),className:"ndpr-form-field__input",required:true,children:ee()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"referenceNumber",className:"ndpr-form-field__label",children:"Reference Number (if available)"}),jsx("input",{type:"text",id:"referenceNumber",value:H,onChange:p=>X(p.target.value),placeholder:"e.g. NDPC/BR/2024/001",className:"ndpr-form-field__input"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",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:"ndpr-form-field__label",children:"Contact Name"}),jsx("input",{type:"text",id:"contactName",value:S,onChange:p=>L(p.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactEmail",className:"ndpr-form-field__label",children:"Contact Email"}),jsx("input",{type:"email",id:"contactEmail",value:I,onChange:p=>j(p.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactPhone",className:"ndpr-form-field__label",children:"Contact Phone"}),jsx("input",{type:"tel",id:"contactPhone",value:T,onChange:p=>O(p.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Additional Information"}),jsxs("div",{children:[jsx("label",{htmlFor:"additionalInfo",className:"ndpr-form-field__label",children:"Additional Information to Include"}),jsx("textarea",{id:"additionalInfo",value:ie,onChange:p=>V(p.target.value),rows:3,placeholder:"Any additional information you want to include in the report",className:"ndpr-form-field__input"})]})]}),$&&jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Report Content"}),jsxs("div",{children:[jsxs("label",{htmlFor:"reportContent",className:"ndpr-form-field__label",children:["Edit Report Content ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"reportContent",value:h,onChange:p=>_(p.target.value),rows:20,className:"ndpr-form-field__input ndpr-form-field__input--mono",required:true})]})]}),jsxs("div",{className:"ndpr-alert ndpr-alert--info",children:[jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"ndpr-text-info 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 ${b}`,o.primaryButton||o.generateButton,l),children:se})})]})})]})};export{xe as a,Se as b,Te as c};//# sourceMappingURL=chunk-WH6ZMUOS.mjs.map
81
+ //# sourceMappingURL=chunk-WH6ZMUOS.mjs.map
@@ -0,0 +1,3 @@
1
+ 'use strict';var chunkI54CDQGN_js=require('./chunk-I54CDQGN.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ke=({categories:pe,onSubmit:fe,onValidationError:y,title:ge="Report a Data Breach",formDescription:be="Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40. All fields marked with * are required.",submitButtonText:he="Submit Report",className:P="",buttonClassName:M="",classNames:d={},unstyled:c=false,isSubmitting:b=false,showConfirmation:ve=true,confirmationMessage:Ne="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:ue=true,maxAttachments:A=5,maxFileSize:x=5*1024*1024,allowedFileTypes:S=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"],defaultValues:t,onReset:D})=>{var ae,ne,oe,se,de;let z=r=>{if(!r)return "";let n=new Date(r),l=o=>String(o).padStart(2,"0");return `${n.getFullYear()}-${l(n.getMonth()+1)}-${l(n.getDate())}T${l(n.getHours())}:${l(n.getMinutes())}`},[C,L]=react.useState((t==null?void 0:t.title)||""),[w,O]=react.useState((t==null?void 0:t.description)||""),[F,Y]=react.useState((t==null?void 0:t.category)||""),[T,U]=react.useState(z(t==null?void 0:t.discoveredAt)),[R,H]=react.useState(z(t==null?void 0:t.occurredAt)),[q,Z]=react.useState(((ae=t==null?void 0:t.reporter)==null?void 0:ae.name)||""),[N,G]=react.useState(((ne=t==null?void 0:t.reporter)==null?void 0:ne.email)||""),[B,K]=react.useState(((oe=t==null?void 0:t.reporter)==null?void 0:oe.department)||""),[j,W]=react.useState(((se=t==null?void 0:t.reporter)==null?void 0:se.phone)||""),[J,Q]=react.useState((t==null?void 0:t.affectedSystems)||[]),[_e,X]=react.useState(((de=t==null?void 0:t.affectedSystems)==null?void 0:de.join(", "))||""),[k,V]=react.useState((t==null?void 0:t.dataTypes)||[]),[h,ee]=react.useState((t==null?void 0:t.estimatedAffectedSubjects)!=null?String(t.estimatedAffectedSubjects):""),[re,te]=react.useState((t==null?void 0:t.status)||"ongoing"),[E,ie]=react.useState((t==null?void 0:t.initialActions)||""),[u,I]=react.useState([]),[ye,$]=react.useState(false),[a,v]=react.useState({}),Ae=()=>{L(""),O(""),Y(""),U(""),H(""),Z(""),G(""),K(""),W(""),Q([]),X(""),V([]),ee(""),te("ongoing"),ie(""),I([]),$(false),v({}),D==null||D();},xe=r=>{let n=r.target.value;X(n);let l=n.split(",").map(o=>o.trim()).filter(Boolean);Q(l);},Se=r=>{V(n=>n.includes(r)?n.filter(l=>l!==r):[...n,r]);},De=r=>{var me;let n=r.target.files;if(!n)return;let l=[],o={};if(u.length+n.length>A){o.attachments=`Maximum of ${A} files allowed`,v(p=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},p),o));return}for(let p=0;p<n.length;p++){let _=n[p];if(_.size>x){o.attachments=`File ${_.name} exceeds the maximum size of ${x/(1024*1024)}MB`;continue}let ce="."+((me=_.name.split(".").pop())==null?void 0:me.toLowerCase());if(!S.includes(ce)){o.attachments=`File type ${ce} is not allowed`;continue}l.push(_);}l.length>0&&I(p=>[...p,...l]),Object.keys(o).length>0?v(p=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},p),o)):v(p=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},p),{attachments:""}));},Ce=r=>{I(n=>n.filter((l,o)=>o!==r));},we=()=>{let r={};return C.trim()||(r.breachTitle="Breach title is required"),w.trim()||(r.description="Description is required"),F||(r.category="Category is required"),T||(r.discoveredAt="Discovery date is required"),q.trim()||(r.reporterName="Reporter name is required"),N.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(N)||(r.reporterEmail="Reporter email is invalid"):r.reporterEmail="Reporter email is required",B.trim()||(r.reporterDepartment="Reporter department is required"),J.length===0&&(r.affectedSystems="At least one affected system is required"),k.length===0&&(r.dataTypes="At least one data type is required"),h&&isNaN(Number(h))&&(r.estimatedAffectedSubjects="Estimated affected subjects must be a number"),v(r),r},Fe=r=>{r.preventDefault();let n=we();if(Object.keys(n).length>0){y==null||y(n);return}let l={title:chunkI54CDQGN_js.a(C),description:chunkI54CDQGN_js.a(w),category:F,discoveredAt:new Date(T).getTime(),occurredAt:R?new Date(R).getTime():void 0,reportedAt:Date.now(),reporter:{name:chunkI54CDQGN_js.a(q),email:chunkI54CDQGN_js.a(N),department:chunkI54CDQGN_js.a(B),phone:j?chunkI54CDQGN_js.a(j):void 0},affectedSystems:J.map(o=>chunkI54CDQGN_js.a(o)),dataTypes:k,estimatedAffectedSubjects:h?Number(h):void 0,status:re,initialActions:E?chunkI54CDQGN_js.a(E):void 0,attachments:u.map(o=>({name:o.name,type:o.type,size:o.size,file:o}))};fe(l),ve&&$(true);};if(ye)return jsxRuntime.jsxs("div",{"data-ndpr-component":"breach-report-form",className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${P}`,children:[jsxRuntime.jsx("h2",{className:"text-lg font-bold ndpr-text-success mb-2",children:"Report Submitted"}),jsxRuntime.jsx("p",{className:"ndpr-text-success",children:Ne}),jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold ndpr-text-warning mb-2",children:"Important: Next Steps"}),jsxRuntime.jsx("p",{className:"ndpr-text-warning text-sm",children:"Under the 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. The data protection team will assess this breach and determine if notification is required."})]}),jsxRuntime.jsx("button",{onClick:()=>$(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${M}`,children:"Report Another Breach"})]});let Te=[{id:"personal",label:"Personal Information (names, addresses)"},{id:"contact",label:"Contact Information (email, phone)"},{id:"financial",label:"Financial Information (bank details, payment info)"},{id:"health",label:"Health Information"},{id:"identification",label:"Identification Documents (ID cards, passports)"},{id:"login",label:"Login Credentials"},{id:"biometric",label:"Biometric Data"},{id:"children",label:"Children's Data"},{id:"location",label:"Location Data"},{id:"communications",label:"Communications Content"}];return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${P}`,d.root,c),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("ndpr-section-heading",d.title,c),children:ge}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:be}),jsxRuntime.jsx("form",{onSubmit:Fe,className:chunkE64TU6IU_js.a("",d.form,c),children:jsxRuntime.jsxs("div",{className:"ndpr-form-section",children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",d.fieldGroup,c),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Breach Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"breachTitle",className:chunkE64TU6IU_js.a("ndpr-form-field__label",d.label,c),children:["Breach Title/Summary ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"breachTitle",value:C,onChange:r=>L(r.target.value),className:chunkE64TU6IU_js.a("ndpr-form-field__input",d.input,c),required:true,"aria-invalid":!!a.breachTitle,"aria-describedby":a.breachTitle?"breachTitle-error":void 0}),a.breachTitle&&jsxRuntime.jsx("p",{id:"breachTitle-error",role:"alert",className:"ndpr-form-field__error",children:a.breachTitle})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"category",className:chunkE64TU6IU_js.a("ndpr-form-field__label",d.label,c),children:["Breach Category ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsxs("select",{id:"category",value:F,onChange:r=>Y(r.target.value),className:chunkE64TU6IU_js.a("ndpr-form-field__input",d.select,c),required:true,"aria-invalid":!!a.category,"aria-describedby":a.category?"category-error":void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select a category"}),pe.map(r=>jsxRuntime.jsx("option",{value:r.id,children:r.name},r.id))]}),a.category&&jsxRuntime.jsx("p",{id:"category-error",role:"alert",className:"ndpr-form-field__error",children:a.category})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"description",className:chunkE64TU6IU_js.a("ndpr-form-field__label",d.label,c),children:["Detailed Description ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"description",value:w,onChange:r=>O(r.target.value),rows:4,className:chunkE64TU6IU_js.a("ndpr-form-field__input",d.textarea,c),required:true,"aria-invalid":!!a.description,"aria-describedby":a.description?"description-error":void 0}),a.description&&jsxRuntime.jsx("p",{id:"description-error",role:"alert",className:"ndpr-form-field__error",children:a.description})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"discoveredAt",className:"ndpr-form-field__label",children:["Date Discovered ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"datetime-local",id:"discoveredAt",value:T,onChange:r=>U(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.discoveredAt,"aria-describedby":a.discoveredAt?"discoveredAt-error":void 0}),a.discoveredAt&&jsxRuntime.jsx("p",{id:"discoveredAt-error",role:"alert",className:"ndpr-form-field__error",children:a.discoveredAt})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"occurredAt",className:"ndpr-form-field__label",children:"Date Occurred (if known)"}),jsxRuntime.jsx("input",{type:"datetime-local",id:"occurredAt",value:R,onChange:r=>H(r.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Reporter Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterName",className:"ndpr-form-field__label",children:["Your Name ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterName",value:q,onChange:r=>Z(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterName,"aria-describedby":a.reporterName?"reporterName-error":void 0}),a.reporterName&&jsxRuntime.jsx("p",{id:"reporterName-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterName})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterEmail",className:"ndpr-form-field__label",children:["Your Email ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",id:"reporterEmail",value:N,onChange:r=>G(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterEmail,"aria-describedby":a.reporterEmail?"reporterEmail-error":void 0}),a.reporterEmail&&jsxRuntime.jsx("p",{id:"reporterEmail-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterEmail})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterDepartment",className:"ndpr-form-field__label",children:["Your Department ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterDepartment",value:B,onChange:r=>K(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterDepartment,"aria-describedby":a.reporterDepartment?"reporterDepartment-error":void 0}),a.reporterDepartment&&jsxRuntime.jsx("p",{id:"reporterDepartment-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterDepartment})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"reporterPhone",className:"ndpr-form-field__label",children:"Your Phone Number (Optional)"}),jsxRuntime.jsx("input",{type:"tel",id:"reporterPhone",value:j,onChange:r=>W(r.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Impact Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"affectedSystems",className:"ndpr-form-field__label",children:["Affected Systems/Applications ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"affectedSystems",value:_e,onChange:xe,placeholder:"e.g. CRM, Email Server, Website (comma separated)",className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.affectedSystems,"aria-describedby":a.affectedSystems?"affectedSystems-error":void 0}),a.affectedSystems&&jsxRuntime.jsx("p",{id:"affectedSystems-error",role:"alert",className:"ndpr-form-field__error",children:a.affectedSystems})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"ndpr-form-field__label",children:"Estimated Number of Affected Data Subjects"}),jsxRuntime.jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:h,onChange:r=>ee(r.target.value),placeholder:"e.g. 100",className:"ndpr-form-field__input","aria-invalid":!!a.estimatedAffectedSubjects,"aria-describedby":a.estimatedAffectedSubjects?"estimatedAffectedSubjects-error":void 0}),a.estimatedAffectedSubjects&&jsxRuntime.jsx("p",{id:"estimatedAffectedSubjects-error",role:"alert",className:"ndpr-form-field__error",children:a.estimatedAffectedSubjects})]}),jsxRuntime.jsxs("fieldset",{className:"md:col-span-2",children:[jsxRuntime.jsxs("legend",{className:"ndpr-form-field__label",children:["Types of Data Involved ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:Te.map(r=>jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"checkbox",id:`dataType_${r.id}`,checked:k.includes(r.id),onChange:()=>Se(r.id),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:`dataType_${r.id}`,className:"ml-2 text-sm ndpr-text-muted",children:r.label})]},r.id))}),a.dataTypes&&jsxRuntime.jsx("p",{id:"dataTypes-error",role:"alert",className:"ndpr-form-field__error",children:a.dataTypes})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"status",className:"ndpr-form-field__label",children:["Current Status ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsxs("select",{id:"status",value:re,onChange:r=>te(r.target.value),className:chunkE64TU6IU_js.a("ndpr-form-field__input",d.select,c),required:true,children:[jsxRuntime.jsx("option",{value:"ongoing",children:"Ongoing (breach is still active)"}),jsxRuntime.jsx("option",{value:"contained",children:"Contained (breach is stopped but not resolved)"}),jsxRuntime.jsx("option",{value:"resolved",children:"Resolved (breach is fully addressed)"})]})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"initialActions",className:"ndpr-form-field__label",children:"Initial Actions Taken"}),jsxRuntime.jsx("textarea",{id:"initialActions",value:E,onChange:r=>ie(r.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",rows:3,className:chunkE64TU6IU_js.a("ndpr-form-field__input",d.textarea,c)})]})]})]}),ue&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Attachments"}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("label",{className:"ndpr-form-field__label",children:"Upload Supporting Files (Optional)"}),jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-muted mb-2",children:["Max ",A," files, ",x/(1024*1024),"MB each. Allowed types: ",S.join(", ")]}),jsxRuntime.jsx("input",{type:"file",onChange:De,multiple:true,className:"ndpr-form-field__input",accept:S.join(",")}),a.attachments&&jsxRuntime.jsx("p",{id:"attachments-error",role:"alert",className:"ndpr-form-field__error",children:a.attachments})]}),u.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("h4",{className:"ndpr-form-field__label",children:"Attached Files:"}),jsxRuntime.jsx("ul",{className:"ndpr-form-section",children:u.map((r,n)=>jsxRuntime.jsxs("li",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 ndpr-text-muted mr-2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M8 4a3 3 0 00-3 3v4a5 5 0 0010 0V7a1 1 0 112 0v4a7 7 0 11-14 0V7a5 5 0 0110 0v4a3 3 0 11-6 0V7a1 1 0 012 0v4a1 1 0 102 0V7a3 3 0 00-3-3z",clipRule:"evenodd"})}),jsxRuntime.jsx("span",{className:"text-sm ndpr-text-muted",children:r.name}),jsxRuntime.jsxs("span",{className:"ml-2 text-xs ndpr-text-muted",children:["(",(r.size/1024).toFixed(1)," KB)"]})]}),jsxRuntime.jsx("button",{type:"button",onClick:()=>Ce(n),className:"text-red-500 hover:ndpr-text-destructive",children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]},n))})]})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("ndpr-alert ndpr-alert--info",d.notice,c),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"ndpr-text-info 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. The data protection team will assess this breach and determine if notification is required."})]}),jsxRuntime.jsxs("div",{className:"mt-6 relative flex gap-3",children:[b&&d.loadingOverlay&&jsxRuntime.jsx("div",{className:d.loadingOverlay}),jsxRuntime.jsx("button",{type:"submit",disabled:b,className:chunkE64TU6IU_js.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 ${M} ${b?"opacity-50 cursor-not-allowed":""}`,d.primaryButton||d.submitButton,c),children:b?"Submitting...":he}),jsxRuntime.jsx("button",{type:"button",onClick:Ae,disabled:b,className:chunkE64TU6IU_js.a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,c),children:"Reset"})]})]})})]})};
2
+ exports.a=ke;//# sourceMappingURL=chunk-WTJGLNTB.js.map
3
+ //# sourceMappingURL=chunk-WTJGLNTB.js.map
@@ -0,0 +1,2 @@
1
+ import {a as a$1}from'./chunk-WWT2ZSNU.mjs';var i={consent:{title:"We Value Your Privacy",description:"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.",acceptAll:"Accept All",rejectAll:"Reject All",customize:"Customize",savePreferences:"Save Preferences",selectAll:"Select All",deselectAll:"Deselect All",required:"Required",cookieNotice:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'},dsr:{title:"Submit a Data Subject Request",description:"Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitRequest:"Submit Request",reset:"Reset",fullName:"Full Name",email:"Email Address",phone:"Phone Number (Optional)",requestType:"Request Type",additionalInfo:"Additional Information",identityVerification:"Identity Verification",identifierType:"Identifier Type",identifierValue:"Identifier Value",privacyNotice:"The information you provide in this form will be used solely for the purpose of processing your data subject request.",successMessage:"Your request has been submitted successfully."},breach:{title:"Report a Data Breach",description:"Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40.",submitReport:"Submit Report",breachTitle:"Breach Title/Summary",category:"Category",discoveredAt:"Date Discovered",detailedDescription:"Detailed Description"},dpia:{title:"Data Protection Impact Assessment",next:"Next",previous:"Previous",complete:"Complete Assessment",progress:"Progress"},policy:{title:"Privacy Policy Generator",generate:"Generate Policy",preview:"Preview",export:"Export",sections:"Sections",variables:"Variables"},compliance:{score:"Compliance Score",excellent:"Excellent",good:"Good",needsWork:"Needs Work",critical:"Critical",recommendations:"Recommendations",passed:"Passed",gaps:"Gaps"},common:{loading:"Loading...",error:"An error occurred",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",add:"Add",back:"Back",next:"Next",search:"Search",noResults:"No results found"}};function a(e){if(!e)return i;let r=a$1({},i);for(let t of Object.keys(e))e[t]&&(r[t]=a$1(a$1({},i[t]),e[t]));return r}export{i as a,a as b};//# sourceMappingURL=chunk-XHROISIF.mjs.map
2
+ //# sourceMappingURL=chunk-XHROISIF.mjs.map
@@ -0,0 +1,4 @@
1
+ 'use strict';var chunkUFPSUO52_js=require('./chunk-UFPSUO52.js'),chunkRNTNHVKZ_js=require('./chunk-RNTNHVKZ.js'),chunkAHSMDPG5_js=require('./chunk-AHSMDPG5.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');var nt=10,Rt="ndpr_policy_draft",_t=2e3;function st(){return `section_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function it(){return `draft_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function w(u,A,M){let S=Date.now();return {id:M,title:`Privacy Policy${u.org.name?` \u2014 ${u.org.name}`:""}`,templateId:"adaptive-policy-wizard",organizationInfo:{name:u.org.name,website:u.org.website,privacyEmail:u.org.privacyEmail,address:u.org.address,dpoName:u.org.dpoName,dpoEmail:u.org.dpoEmail,industry:u.org.industry},sections:A,variableValues:{},effectiveDate:S,lastUpdated:S,version:"1.0",applicableFrameworks:["ndpa","ndpr"]}}function Ut(u={}){var K;let{onComplete:A,onComplianceChange:M}=u,S=react.useRef((K=u.adapter)!=null?K:chunkELKB2AFZ_js.a(Rt));u.adapter&&(S.current=u.adapter);let f=react.useRef(it()),[P,y]=react.useState(1),[n,v]=react.useState(chunkRNTNHVKZ_js.b),[b,O]=react.useState([]),[x,I]=react.useState({}),[E,$]=react.useState([]),[at,q]=react.useState(false),[ct,z]=react.useState(null),[N,U]=react.useState(true),T=react.useRef(false),R=react.useRef(null);react.useEffect(()=>{let t=false,e=r=>{r&&(f.current=r.id,v(r.templateContext),O(r.customSections),I(r.sectionOverrides),$(r.sectionOrder),y(r.currentStep),z(r.lastSavedAt),q(true));};try{let r=S.current.load();r instanceof Promise?r.then(i=>{t||(e(i),U(!1));},()=>{t||U(!1);}):(e(r),U(!1));}catch(r){t||U(false);}return ()=>{t=true;}},[]);let l=react.useMemo(()=>{let e=chunkAHSMDPG5_js.c(n).map(o=>x[o.id]?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},o),{template:x[o.id]}):o),r=b.map(o=>{var d;return {id:o.id,title:o.title,template:(d=x[o.id])!=null?d:o.content,order:o.order,required:false,included:true}}),i=[...e,...r];if(E.length>0){let o=new Map(E.map((d,p)=>[d,p]));return [...i].sort((d,p)=>{let m=o.has(d.id)?o.get(d.id):i.length,C=o.has(p.id)?o.get(p.id):i.length;return m-C})}return [...i].sort((o,d)=>{var p,m;return ((p=o.order)!=null?p:0)-((m=d.order)!=null?m:0)})},[n,b,x,E]),s=react.useMemo(()=>!n.org.name&&!n.org.privacyEmail?null:w(n,l,f.current),[n,l]),Y=react.useMemo(()=>w(chunkRNTNHVKZ_js.b(),[],f.current),[]),V=react.useMemo(()=>chunkRNTNHVKZ_js.c(s!=null?s:Y,n),[s,n,Y]),_=V.percentage,D=V.gaps,j=react.useRef({score:-1,gaps:[]});react.useEffect(()=>{let t=j.current;M&&(_!==t.score||D!==t.gaps)&&M(_,D),j.current={score:_,gaps:D};},[_,D,M]);let dt=react.useMemo(()=>{switch(P){case 1:return n.org.name.trim().length>0&&n.org.privacyEmail.trim().length>0;case 2:return n.dataCategories.some(t=>t.selected);case 3:return n.purposes.length>0;case 4:return true;default:return false}},[P,n]),lt=react.useCallback(t=>{let e=Math.min(Math.max(1,t),4);e<4&&(T.current=false),y(e);},[]),pt=react.useCallback(()=>{y(t=>Math.min(t+1,4));},[]),ut=react.useCallback(()=>{T.current=false,y(t=>Math.max(t-1,1));},[]),mt=react.useCallback(t=>{v(e=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},e),t));},[]),gt=react.useCallback(t=>{v(e=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{org:chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},e.org),t)}));},[]),ft=react.useCallback(t=>{v(e=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{dataCategories:e.dataCategories.map(r=>r.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},r),{selected:!r.selected}):r)}));},[]),Pt=react.useCallback(t=>{v(e=>{let r=t,i=e.purposes.includes(r);return chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{purposes:i?e.purposes.filter(o=>o!==t):[...e.purposes,r]})});},[]),yt=react.useCallback(t=>{v(e=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{thirdPartyProcessors:[...e.thirdPartyProcessors,t]}));},[]),Ct=react.useCallback(t=>{v(e=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{thirdPartyProcessors:e.thirdPartyProcessors.filter((r,i)=>i!==t)}));},[]),St=react.useCallback(t=>{O(e=>e.length>=nt?e:[...e,chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{id:st(),required:false})]);},[]),vt=react.useCallback((t,e)=>{O(r=>r.map(i=>i.id===t?chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},i),e):i));},[]),xt=react.useCallback(t=>{O(e=>e.filter(r=>r.id!==t)),$(e=>e.filter(r=>r!==t)),I(e=>{let r=chunkMQFZHA2D_js.a({},e);return delete r[t],r});},[]),ht=react.useCallback((t,e)=>{$(r=>{let i=r.length>0?r:l.map(m=>m.id),o=i.indexOf(t);if(o===-1){let m=l.map(It=>It.id),C=m.indexOf(t);if(C===-1)return r;let G=e==="up"?C-1:C+1;if(G<0||G>=m.length)return m;let k=[...m];return [k[C],k[G]]=[k[G],k[C]],k}let d=e==="up"?o-1:o+1;if(d<0||d>=i.length)return i;let p=[...i];return [p[o],p[d]]=[p[d],p[o]],p});},[l]),Dt=react.useCallback((t,e)=>{I(r=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},r),{[t]:e}));},[]),bt=react.useCallback(t=>{let e=D.find(r=>r.requirementId===t);if(e)switch(e.fixType){case "fill_field":{T.current=false;let i=["data-categories-disclosed"],o=["purpose-of-processing"];i.includes(t)?y(2):o.includes(t)?y(3):(y(1));break}case "add_section":{if(!e.suggestedContent)break;O(r=>r.length>=nt?r:[...r,{id:st(),title:e.requirement,content:e.suggestedContent,order:999,required:false}]);break}case "add_content":{if(!e.suggestedContent)break;let r="data-subject-rights";I(i=>{var d,p,m;let o=(m=(p=i[r])!=null?p:(d=l.find(C=>C.id===r))==null?void 0:d.template)!=null?m:"";return chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{[r]:`${o}
2
+
3
+ ${e.suggestedContent}`.trim()})});break}}},[D,l]),X=react.useCallback(t=>({id:f.current,templateContext:n,customSections:b,sectionOverrides:x,sectionOrder:E,currentStep:t,lastSavedAt:Date.now(),status:"draft"}),[n,b,x,E]),Ot=react.useCallback(()=>chunkMQFZHA2D_js.d(null,null,function*(){let t=X(P);try{yield Promise.resolve(S.current.save(t)),z(t.lastSavedAt),q(!0);}catch(e){console.warn("[ndpr-toolkit] Failed to save draft:",e);}}),[X,P]),Et=react.useCallback(()=>{Promise.resolve(S.current.remove()).catch(t=>{console.warn("[ndpr-toolkit] Failed to remove draft:",t);}),f.current=it(),T.current=false,v(chunkRNTNHVKZ_js.b()),O([]),I({}),$([]),y(1),q(false),z(null);},[]);react.useEffect(()=>{if(!N)return R.current&&clearTimeout(R.current),R.current=setTimeout(()=>{let t=X(P);Promise.resolve(S.current.save(t)).then(()=>{z(t.lastSavedAt),q(true);}).catch(e=>{console.warn("[ndpr-toolkit] Auto-save failed:",e);});},_t),()=>{R.current&&clearTimeout(R.current);}},[n,b,x,E,P,N,X]),react.useEffect(()=>{P===4&&s&&A&&!T.current&&(T.current=true,A(s));},[P,s,A]);let Tt=react.useCallback(t=>chunkMQFZHA2D_js.d(null,null,function*(){let e=s!=null?s:w(n,l,f.current);return chunkUFPSUO52_js.c(e,t)}),[s,n,l]),wt=react.useCallback(t=>chunkMQFZHA2D_js.d(null,null,function*(){let e=s!=null?s:w(n,l,f.current);return chunkUFPSUO52_js.d(e,t)}),[s,n,l]),At=react.useCallback(t=>{let e=s!=null?s:w(n,l,f.current);return chunkUFPSUO52_js.a(e,t)},[s,n,l]),Mt=react.useCallback(()=>{let t=s!=null?s:w(n,l,f.current);return chunkUFPSUO52_js.b(t)},[s,n,l]);return {currentStep:P,goToStep:lt,nextStep:pt,prevStep:ut,canProceed:dt,context:n,updateContext:mt,updateOrg:gt,toggleDataCategory:ft,togglePurpose:Pt,addProcessor:yt,removeProcessor:Ct,policy:s,sections:l,customSections:b,addCustomSection:St,updateCustomSection:vt,removeCustomSection:xt,reorderSections:ht,editSectionContent:Dt,sectionOverrides:x,complianceScore:_,complianceResult:V,complianceGaps:D,applyFix:bt,handleExportPDF:Tt,handleExportDOCX:wt,handleExportHTML:At,handleExportMarkdown:Mt,isDraftSaved:at,lastSavedAt:ct,saveDraft:Ot,discardDraft:Et,isLoading:N}}exports.a=Ut;//# sourceMappingURL=chunk-XMBSJJ5U.js.map
4
+ //# sourceMappingURL=chunk-XMBSJJ5U.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkJKKRPS4P_js=require('./chunk-JKKRPS4P.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function G(D,o){return o?chunkELKB2AFZ_js.a(D):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialRequests:D=[],requestTypes:o,adapter:m,storageKey:O="ndpr_dsr_requests",useLocalStorage:P=true,onSubmit:p,onUpdate:f}){let y=m!=null?m:G(O,P),R=react.useRef(y);R.current=y;let[r,a]=react.useState(D),[x,l]=react.useState(true);react.useEffect(()=>{let e=false;try{let t=R.current.load();t instanceof Promise?t.then(s=>{e||(s&&a(s),l(!1));},()=>{e||l(!1);}):(t&&a(t),l(!1));}catch(t){e||l(false);}return ()=>{e=true;}},[]);let c=react.useCallback(e=>{Promise.resolve(R.current.save(e)).catch(t=>{console.warn("[ndpr-toolkit] Failed to save DSR requests:",t);});},[]),B=()=>"dsr_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),I=react.useCallback(e=>{let t=o.find(g=>g.id===e.type),s=(t==null?void 0:t.estimatedCompletionTime)||30,n=Date.now(),i=n+s*24*60*60*1e3,b=e,{createdAt:A}=b,d=chunkMQFZHA2D_js.c(b,["createdAt"]),q=chunkMQFZHA2D_js.a({id:B(),status:"pending",createdAt:n,updatedAt:n,dueDate:i},d);return a(g=>{let v=[...g,q];return c(v),v}),p&&p(q),q},[o,c,p]),L=react.useCallback((e,t)=>{let s=null;return a(n=>{let i=n.findIndex(q=>q.id===e);if(i===-1)return n;let A=n[i];s=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},A),t),{updatedAt:Date.now()});let d=[...n];return d[i]=s,c(d),d}),s&&f&&f(s),s},[c,f]),_=react.useCallback(e=>r.find(t=>t.id===e)||null,[r]),U=react.useCallback(e=>r.filter(t=>t.status===e),[r]),F=react.useCallback(e=>r.filter(t=>t.type===e),[r]),E=react.useCallback(e=>o.find(t=>t.id===e),[o]),K=react.useCallback(e=>{let{formattedRequest:t}=chunkJKKRPS4P_js.a(e);return t},[]),M=react.useCallback(()=>{a([]),Promise.resolve(R.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove DSR requests:",e);});},[R]);return {requests:r,submitRequest:I,updateRequest:L,getRequest:_,getRequestsByStatus:U,getRequestsByType:F,getRequestType:E,formatRequest:K,clearRequests:M,isLoading:x}}exports.a=Q;//# sourceMappingURL=chunk-XSEZDQLB.js.map
2
+ //# sourceMappingURL=chunk-XSEZDQLB.js.map
@@ -0,0 +1,2 @@
1
+ import {g}from'./chunk-75TJPK2N.mjs';import {a as a$1}from'./chunk-6WIP33TW.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function j(m,l){return l?a$1(m):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialTransfers:m=[],adapter:l,storageKey:R="ndpr_cross_border_transfers",useLocalStorage:q=true,onAdd:g$1,onUpdate:C,onRemove:B}={}){let y=l!=null?l:j(R,q),v=useRef(y);v.current=y;let[i,u]=useState(m),[x,T]=useState(true);useEffect(()=>{let r=false;try{let e=v.current.load();e instanceof Promise?e.then(t=>{r||(t&&u(t),T(!1));},()=>{r||T(!1);}):(e&&u(e),T(!1));}catch(e){r||T(false);}return ()=>{r=true;}},[]);let f=useCallback(r=>{Promise.resolve(v.current.save(r)).catch(e=>{console.warn("[ndpr-toolkit] Failed to save cross-border transfers:",e);});},[]),M=()=>"cbt_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),D=useCallback(r=>{let e=Date.now(),t=b(a({},r),{id:M(),createdAt:e,updatedAt:e});return u(a=>{let n=[...a,t];return f(n),n}),g$1&&g$1(t),t},[g$1,f]),k=useCallback((r,e)=>{let t=null;return u(a$1=>{let n=a$1.findIndex(A=>A.id===r);if(n===-1)return a$1;t=b(a(a({},a$1[n]),e),{updatedAt:Date.now()});let o=[...a$1];return o[n]=t,f(o),o}),t&&C&&C(t),t},[C,f]),I=useCallback(r=>{let e=false;u(t=>{if(t.findIndex(o=>o.id===r)===-1)return t;e=true;let n=t.filter(o=>o.id!==r);return f(n),n}),e&&B&&B(r);},[B,f]),L=useCallback(r=>i.find(e=>e.id===r)||null,[i]),U=useCallback(()=>{let r=Date.now(),e=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]=e.filter(c=>c.transferMechanism===s).length;let n=["adequate","inadequate","pending_review","unknown"],o={};for(let s of n)o[s]=e.filter(c=>c.adequacyStatus===s).length;let A=i.filter(s=>{var c,S;return s.status==="pending_approval"||((c=s.ndpcApproval)==null?void 0:c.required)&&!((S=s.ndpcApproval)!=null&&S.approved)}),P=720*60*60*1e3,V=i.filter(s=>s.reviewDate&&s.reviewDate<=r+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:e.length,byMechanism:a,byAdequacy:o,pendingApproval:A,dueForReview:V,missingTIA:F,highRiskTransfers:z,lastUpdated:r}},[i]),O=useCallback(r=>g(r),[]);return {transfers:i,addTransfer:D,updateTransfer:k,removeTransfer:I,getTransfer:L,getSummary:U,validateTransfer:O,isLoading:x}}export{Q as a};//# sourceMappingURL=chunk-Z6IIMLZU.mjs.map
2
+ //# sourceMappingURL=chunk-Z6IIMLZU.mjs.map
@@ -0,0 +1,132 @@
1
+ var p="\xABTODO: ",I="\xBB";function s(e){return `${p}${e}\xBB`}function i(e,t,n,o,a){return {id:e,title:t,template:n,order:o,required:a,included:true}}function h(e){return e.filter(t=>t.selected)}function g(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 f(e,t){let n=e.org.name||s("orgName"),o=e.org.website||s("website"),a=new Date().toISOString().slice(0,10);return i("introduction","Introduction & Scope",`This Privacy Policy explains how ${n} ("we", "us", or "our") collects, uses, stores, and protects personal data when you use our services and visit our website at ${o}. 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 ${n}, whether collected online or offline.
2
+
3
+ Effective Date: ${a}.
4
+
5
+ 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 m(e,t){let n=e.org.name||s("orgName"),o=h(e.dataCategories),a={identity:"Identity & Contact Information",financial:"Financial Information",behavioral:"Technical & Behavioral Data",sensitive:"Sensitive / Special-Category Data",children:"Children's Data"},r="",c=["identity","financial","behavioral","sensitive","children"];for(let d of c){let u=o.filter(l=>l.group===d);if(u.length>0){r+=`
6
+ ${a[d]}:
7
+ `;for(let l of u)r+=`- ${l.label}: ${l.dataPoints.join(", ")}.
8
+ `;}}return r===""&&(r=`
9
+ - Personal data categories have not yet been specified.
10
+ `),i("data-collection","Data We Collect",`${n} 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).
11
+ `+r+`
12
+ 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 y(e,t){let n=e.org.name||s("orgName"),o=[];return (e.purposes.includes("service_delivery")||e.purposes.length===0)&&(o.push("- Consent: where you have given clear, informed, and voluntary consent for specific processing activities (NDPA Section 25)."),o.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")&&o.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")&&o.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")&&o.push("- Public Interest / Research: where processing is necessary for scientific or historical research purposes, or statistical purposes, subject to appropriate safeguards."),o.length===0&&(o.push("- Consent: where you have given clear, informed, and voluntary consent for specific processing activities (NDPA Section 25)."),o.push("- Contract: where processing is necessary for the performance of a contract to which you are a party (NDPA Section 25).")),i("legal-basis","Legal Basis for Processing",`${n} processes personal data under one or more of the following lawful bases as prescribed by the Nigeria Data Protection Act (NDPA) 2023:
13
+
14
+ `+o.join(`
15
+ `)+`
16
+
17
+ We will always inform you of the specific legal basis applicable to each processing activity at the time of data collection.`,t,true)}function b(e,t){let o=(e.purposes.length>0?e.purposes:["service_delivery"]).map(a=>`- ${g(a)}`).join(`
18
+ `);return i("data-usage","How We Use Your Data",`We process the personal data we collect for the following purposes:
19
+
20
+ `+o+`
21
+
22
+ 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 w(e,t){let n=e.org.name||s("orgName"),o=e.thirdPartyProcessors,a;return o.length>0?a=`We share personal data with the following third-party processors under data processing agreements that comply with the NDPA 2023:
23
+
24
+ | Processor | Purpose | Country |
25
+ | --- | --- | --- |
26
+ `+o.map(c=>`| ${c.name} | ${c.purpose} | ${c.country} |`).join(`
27
+ `)+`
28
+
29
+ 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.",i("data-sharing","Data Sharing & Disclosure",`${n} does not sell personal data under any circumstances.
30
+
31
+ `+a+`
32
+
33
+ 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 v(e,t){let n=e.org.privacyEmail||s("privacyEmail");return i("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:
34
+
35
+ 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).
36
+ 2. Right to Rectification \u2014 You may request correction of inaccurate or incomplete personal data we hold about you (NDPA Section 35).
37
+ 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).
38
+ 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).
39
+ 5. Right to Restrict Processing \u2014 You may request that we limit the processing of your personal data in certain circumstances (NDPA Section 37).
40
+ 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).
41
+
42
+ You also have the right to withdraw your consent at any time, without affecting the lawfulness of processing carried out prior to withdrawal.
43
+
44
+ To exercise any of these rights, please contact us at ${n}. 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 P(e,t){let n=e.org.privacyEmail||s("privacyEmail"),o=e.org.industry,a="";return o==="fintech"?a=`
45
+ - Compliance with Payment Card Industry Data Security Standard (PCI-DSS) for cardholder data protection.
46
+ - End-to-end encryption of financial transactions.
47
+ - Multi-factor authentication for account access.`:o==="healthcare"?a=`
48
+ - HIPAA-aligned safeguards for health information, including access controls and audit logging.
49
+ - Segregation of medical data from other personal data.
50
+ - Role-based access controls restricting health data to authorised personnel.`:o==="ecommerce"?a=`
51
+ - PCI-DSS compliant payment processing.
52
+ - Secure checkout and tokenisation of payment credentials.`:o==="government"&&(a=`
53
+ - Compliance with Nigeria's Cybercrimes Act 2015 requirements.
54
+ - Government-grade access controls and audit trails.`),i("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:
55
+
56
+ - Encryption of personal data in transit (TLS 1.2+) and at rest (AES-256).
57
+ - Access controls and least-privilege principles for all systems handling personal data.
58
+ - Regular security assessments, penetration testing, and vulnerability scanning.
59
+ - Staff training on data protection obligations and information security best practices.
60
+ - Incident response procedures aligned with NDPA breach notification requirements (72-hour notification to NDPC).`+a+`
61
+
62
+ 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 ${n}.`,t,true)}function D(e,t){let n=e.org.name||s("orgName"),o=e.org.privacyEmail||s("privacyEmail"),a=[];e.org.address&&a.push(`Address: ${e.org.address}`),e.org.website&&a.push(`Website: ${e.org.website}`);let r=[];e.org.dpoName&&r.push(`Data Protection Officer: ${e.org.dpoName}`),e.org.dpoEmail&&r.push(`DPO Email: ${e.org.dpoEmail}`);let c=r.length>0?`
63
+
64
+ ${r.join(`
65
+ `)}`:"";return i("contact-info","Contact Information",`If you have questions, concerns, or requests regarding this privacy policy or our data protection practices, please contact us:
66
+
67
+ Organisation: ${n}
68
+ Email: ${o}`+(a.length>0?`
69
+ ${a.join(`
70
+ `)}`:"")+c+`
71
+
72
+ 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.
73
+
74
+ Nigeria Data Protection Commission
75
+ Website: https://ndpc.gov.ng
76
+ Email: info@ndpc.gov.ng`,t,true)}function S(e){return i("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:
77
+
78
+ - We do not knowingly collect personal data from children under the age of 13 without verifiable parental or guardian consent.
79
+ - 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.
80
+ - Parents and guardians may request access to, correction of, or deletion of their child's personal data at any time by contacting us.
81
+ - 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.
82
+ - A Data Protection Impact Assessment (DPIA) is conducted before any new processing activity involving children's data.
83
+
84
+ 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 N(e){return i("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.
85
+
86
+ We process sensitive personal data only where:
87
+
88
+ - You have given explicit consent for the specific processing purpose.
89
+ - Processing is necessary to protect your vital interests or those of another person.
90
+ - Processing is required for the establishment, exercise, or defence of legal claims.
91
+ - Processing is necessary for reasons of substantial public interest under Nigerian law.
92
+
93
+ 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 C(e,t){let n=e.thirdPartyProcessors.filter(a=>a.country.toLowerCase()!=="nigeria"),o="";return n.length>0&&(o=`
94
+
95
+ We currently transfer personal data to the following jurisdictions: ${Array.from(new Set(n.map(r=>r.country))).join(", ")}. Each transfer is subject to the safeguards described above.`),i("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:
96
+
97
+ - The receiving country has been assessed by the NDPC as providing an adequate level of data protection.
98
+ - We have put in place appropriate contractual safeguards, such as Standard Contractual Clauses approved by the NDPC.
99
+ - You have provided explicit consent to the transfer after being informed of the associated risks.
100
+ - The transfer is necessary for the performance of a contract between you and us, or for pre-contractual steps taken at your request.
101
+ - The NDPC has granted an administrative authorisation for the transfer.`+o,t,true)}function A(e){return i("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.
102
+
103
+ Where we use automated decision-making:
104
+
105
+ - We will inform you that automated processing is being used and provide meaningful information about the logic involved.
106
+ - You have the right to request human intervention in any automated decision.
107
+ - You have the right to express your point of view and contest the decision.
108
+ - We will carry out regular reviews of automated decision-making systems to ensure fairness, accuracy, and absence of bias.
109
+ - 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.
110
+
111
+ You may object to automated decision-making at any time by contacting us using the details provided in this policy.`,e,true)}function q(e,t){let n=e.org.name||s("orgName"),o=e.org.industry,a="";return o==="fintech"?a=`
112
+
113
+ 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.`:o==="healthcare"?a=`
114
+
115
+ 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.`:o==="ecommerce"?a=`
116
+
117
+ Order and transaction records are retained for six (6) years in accordance with Nigerian tax and commercial law requirements.`:o==="education"&&(a=`
118
+
119
+ 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.`),i("data-retention","Data Retention Schedule",`${n} 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:
120
+
121
+ - The nature and sensitivity of the personal data.
122
+ - The purposes for which the data is processed.
123
+ - Legal, regulatory, and contractual obligations (including NDPA 2023 requirements).
124
+ - Legitimate business needs such as maintaining records for audits, dispute resolution, and regulatory examinations.
125
+
126
+ General retention periods:
127
+ - Account data: retained for the duration of your relationship with us, plus three (3) years.
128
+ - Communication records: retained for two (2) years from the date of correspondence.
129
+ - Analytics and usage data: retained in identifiable form for twelve (12) months, then aggregated or anonymised.`+a+`
130
+
131
+ 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 T(e){let t=1,n=[];return n.push(f(e,t++)),n.push(m(e,t++)),n.push(y(e,t++)),n.push(b(e,t++)),n.push(w(e,t++)),n.push(v(e,t++)),n.push(P(e,t++)),n.push(D(e,t++)),e.hasChildrenData&&n.push(S(t++)),e.hasSensitiveData&&n.push(N(t++)),e.hasCrossBorderTransfer&&n.push(C(e,t++)),e.hasAutomatedDecisions&&n.push(A(t++)),n.push(q(e,t++)),n}export{p as a,I as b,T as c};//# sourceMappingURL=chunk-ZLSWOFAY.mjs.map
132
+ //# sourceMappingURL=chunk-ZLSWOFAY.mjs.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkI54CDQGN_js=require('./chunk-I54CDQGN.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var gi=({requestTypes:P,onSubmit:V,onValidationError:y,title:N="Submit a Data Subject Request",description:s="Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitButtonText:ii="Submit Request",className:q="",buttonClassName:ri="",showConfirmation:ei=true,confirmationMessage:ti="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:k=true,identifierTypes:F=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:oi=true,labels:v={},classNames:i,unstyled:e=false,isSubmitting:T=false,defaultValues:p,onReset:C})=>{var Y,H,L,U,W,J;let[c,j]=react.useState((p==null?void 0:p.requestType)||""),[$,w]=react.useState(((Y=p==null?void 0:p.dataSubject)==null?void 0:Y.fullName)||""),[S,E]=react.useState(((H=p==null?void 0:p.dataSubject)==null?void 0:H.email)||""),[I,B]=react.useState(((L=p==null?void 0:p.dataSubject)==null?void 0:L.phone)||""),[O,z]=react.useState(((U=p==null?void 0:p.dataSubject)==null?void 0:U.identifierType)||((W=F[0])==null?void 0:W.id)||""),[x,M]=react.useState(((J=p==null?void 0:p.dataSubject)==null?void 0:J.identifierValue)||""),[_,A]=react.useState((p==null?void 0:p.additionalInfo)||{}),[ni,D]=react.useState(false),[d,Z]=react.useState({}),di=()=>{var r;j(""),w(""),E(""),B(""),z(((r=F[0])==null?void 0:r.id)||""),M(""),A({}),D(false),Z({}),C==null||C();},a=P.find(r=>r.id===c),pi=r=>{j(r.target.value),A({});},h=(r,b)=>{A(l=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},l),{[r]:b}));},ai=()=>{let r={};return $.trim()||(r.fullName="Full name is required"),S.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(S)||(r.email="Email is invalid"):r.email="Email is required",c||(r.requestType="Please select a request type"),k&&!x.trim()&&(r.identifierValue="Identifier value is required"),a!=null&&a.requiresAdditionalInfo&&a.additionalFields&&a.additionalFields.forEach(b=>{b.required&&!_[b.id]&&(r[`additional_${b.id}`]=`${b.label} is required`);}),Z(r),r},ui=r=>{r.preventDefault();let b=ai();if(Object.keys(b).length>0){y==null||y(b);return}let l=Object.keys(_).length>0?Object.fromEntries(Object.entries(_).map(([u,m])=>[u,typeof m=="string"?chunkI54CDQGN_js.a(m):m])):void 0,R={requestType:c,dataSubject:{fullName:chunkI54CDQGN_js.a($),email:chunkI54CDQGN_js.a(S),phone:I?chunkI54CDQGN_js.a(I):void 0,identifierType:O,identifierValue:chunkI54CDQGN_js.a(x)},additionalInfo:l,submittedAt:Date.now()};V(R),ei&&D(true);},G=`ndpr-dsr-form__button ndpr-dsr-form__button--primary ${ri}`.trim(),bi="ndpr-dsr-form__button ndpr-dsr-form__button--secondary";return ni?jsxRuntime.jsxs("div",{"data-ndpr-component":"dsr-request-form","data-ndpr-state":"submitted",className:chunkE64TU6IU_js.a(`ndpr-dsr-form__success${q?` ${q}`:""}`,i==null?void 0:i.successMessage,e),"aria-live":"polite",children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("ndpr-dsr-form__success-title",i==null?void 0:i.title,e),children:"Request Submitted"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("ndpr-dsr-form__success-body",i==null?void 0:i.description,e),children:ti}),jsxRuntime.jsx("button",{onClick:()=>D(false),className:chunkE64TU6IU_js.a(G,(i==null?void 0:i.primaryButton)||(i==null?void 0:i.submitButton),e),children:"Submit Another Request"})]}):jsxRuntime.jsxs("div",{"data-ndpr-component":"dsr-request-form",className:chunkE64TU6IU_js.a(`ndpr-dsr-form${q?` ${q}`:""}`,i==null?void 0:i.root,e),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("ndpr-dsr-form__title",i==null?void 0:i.title,e),children:N}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("ndpr-dsr-form__description",i==null?void 0:i.description,e),children:s}),jsxRuntime.jsx("form",{onSubmit:ui,className:chunkE64TU6IU_js.a("",i==null?void 0:i.form,e),children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("ndpr-dsr-form__sections",i==null?void 0:i.fieldGroup,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:e?"":"ndpr-form-section__heading",children:"Personal Information"}),jsxRuntime.jsxs("div",{className:e?"":"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"fullName",className:chunkE64TU6IU_js.a("ndpr-form-field__label",i==null?void 0:i.label,e),children:[v.name||"Full Name"," ",jsxRuntime.jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"fullName",value:$,onChange:r=>w(r.target.value),className:chunkE64TU6IU_js.a("ndpr-form-field__input",i==null?void 0:i.input,e),required:true,"aria-required":"true","aria-invalid":!!d.fullName,"aria-describedby":d.fullName?"fullName-error":void 0}),d.fullName&&jsxRuntime.jsx("p",{id:"fullName-error",role:"alert",className:e?"":"ndpr-form-field__error",children:d.fullName})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"email",className:chunkE64TU6IU_js.a("ndpr-form-field__label",i==null?void 0:i.label,e),children:[v.email||"Email Address"," ",jsxRuntime.jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",id:"email",value:S,onChange:r=>E(r.target.value),className:chunkE64TU6IU_js.a("ndpr-form-field__input",i==null?void 0:i.input,e),required:true,"aria-required":"true","aria-invalid":!!d.email,"aria-describedby":d.email?"email-error":void 0}),d.email&&jsxRuntime.jsx("p",{id:"email-error",role:"alert",className:e?"":"ndpr-form-field__error",children:d.email})]}),oi&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"phone",className:chunkE64TU6IU_js.a("ndpr-form-field__label",i==null?void 0:i.label,e),children:"Phone Number (Optional)"}),jsxRuntime.jsx("input",{type:"tel",id:"phone",value:I,onChange:r=>B(r.target.value),className:chunkE64TU6IU_js.a("ndpr-form-field__input",i==null?void 0:i.input,e)})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:e?"":"ndpr-form-section__heading",children:"Request Details"}),jsxRuntime.jsxs("div",{className:e?"":"ndpr-form-field",children:[jsxRuntime.jsxs("label",{htmlFor:"requestType",className:chunkE64TU6IU_js.a("ndpr-form-field__label",i==null?void 0:i.label,e),children:[v.requestType||"Request Type"," ",jsxRuntime.jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsxs("select",{id:"requestType",value:c,onChange:pi,className:chunkE64TU6IU_js.a("ndpr-form-field__select",i==null?void 0:i.select,e),required:true,"aria-required":"true","aria-invalid":!!d.requestType,"aria-describedby":d.requestType?"requestType-error":void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select a request type"}),P.map(r=>jsxRuntime.jsx("option",{value:r.id,children:r.name},r.id))]}),d.requestType&&jsxRuntime.jsx("p",{id:"requestType-error",role:"alert",className:e?"":"ndpr-form-field__error",children:d.requestType})]}),a&&jsxRuntime.jsxs("div",{className:e?"":"ndpr-dsr-form__type-info",children:[jsxRuntime.jsx("p",{children:a.description}),jsxRuntime.jsxs("p",{children:["Estimated completion time: ",a.estimatedCompletionTime," ",a.estimatedCompletionTime===1?"day":"days"]})]}),jsxRuntime.jsxs("div",{className:e?"":"ndpr-form-field",children:[jsxRuntime.jsx("label",{htmlFor:"requestDescription",className:chunkE64TU6IU_js.a("ndpr-form-field__label",i==null?void 0:i.label,e),children:v.description||"Additional Information"}),jsxRuntime.jsx("textarea",{id:"requestDescription",className:chunkE64TU6IU_js.a("ndpr-form-field__textarea",i==null?void 0:i.textarea,e),rows:4,placeholder:"Please provide any additional details that might help us process your request"})]})]}),k&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:e?"":"ndpr-form-section__heading",children:"Identity Verification"}),jsxRuntime.jsx("p",{className:e?"":"ndpr-form-section__hint",children:"To protect your privacy, we need to verify your identity before processing your request."}),jsxRuntime.jsxs("div",{className:e?"":"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"identifierType",className:chunkE64TU6IU_js.a("ndpr-form-field__label",i==null?void 0:i.label,e),children:["Identifier Type ",jsxRuntime.jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("select",{id:"identifierType",value:O,onChange:r=>z(r.target.value),className:chunkE64TU6IU_js.a("ndpr-form-field__select",i==null?void 0:i.select,e),required:true,"aria-required":"true",children:F.map(r=>jsxRuntime.jsx("option",{value:r.id,children:r.label},r.id))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"identifierValue",className:chunkE64TU6IU_js.a("ndpr-form-field__label",i==null?void 0:i.label,e),children:["Identifier Value ",jsxRuntime.jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"identifierValue",value:x,onChange:r=>M(r.target.value),className:chunkE64TU6IU_js.a("ndpr-form-field__input",i==null?void 0:i.input,e),required:true,"aria-required":"true","aria-invalid":!!d.identifierValue,"aria-describedby":d.identifierValue?"identifierValue-error":void 0}),d.identifierValue&&jsxRuntime.jsx("p",{id:"identifierValue-error",role:"alert",className:e?"":"ndpr-form-field__error",children:d.identifierValue})]})]})]}),(a==null?void 0:a.requiresAdditionalInfo)&&a.additionalFields&&a.additionalFields.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:e?"":"ndpr-form-section__heading",children:"Additional Information"}),jsxRuntime.jsx("div",{className:e?"":"ndpr-form-section",children:a.additionalFields.map(r=>{var b,l,R;return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:r.id,className:chunkE64TU6IU_js.a("ndpr-form-field__label",i==null?void 0:i.label,e),children:[r.label," ",r.required&&jsxRuntime.jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),r.type==="text"&&jsxRuntime.jsx("input",{type:"text",id:r.id,value:String((b=_[r.id])!=null?b:""),onChange:u=>h(r.id,u.target.value),placeholder:r.placeholder,className:chunkE64TU6IU_js.a("ndpr-form-field__input",i==null?void 0:i.input,e),required:r.required,"aria-required":r.required||void 0,"aria-invalid":!!d[`additional_${r.id}`],"aria-describedby":d[`additional_${r.id}`]?`additional-${r.id}-error`:void 0}),r.type==="textarea"&&jsxRuntime.jsx("textarea",{id:r.id,value:String((l=_[r.id])!=null?l:""),onChange:u=>h(r.id,u.target.value),placeholder:r.placeholder,className:chunkE64TU6IU_js.a("ndpr-form-field__textarea",i==null?void 0:i.textarea,e),rows:4,required:r.required,"aria-required":r.required||void 0,"aria-invalid":!!d[`additional_${r.id}`],"aria-describedby":d[`additional_${r.id}`]?`additional-${r.id}-error`:void 0}),r.type==="select"&&r.options&&jsxRuntime.jsxs("select",{id:r.id,value:String((R=_[r.id])!=null?R:""),onChange:u=>h(r.id,u.target.value),className:chunkE64TU6IU_js.a("ndpr-form-field__select",i==null?void 0:i.select,e),required:r.required,"aria-required":r.required||void 0,"aria-invalid":!!d[`additional_${r.id}`],"aria-describedby":d[`additional_${r.id}`]?`additional-${r.id}-error`:void 0,children:[jsxRuntime.jsx("option",{value:"",children:r.placeholder||"Select an option"}),r.options.map(u=>jsxRuntime.jsx("option",{value:u,children:u},u))]}),r.type==="checkbox"&&jsxRuntime.jsxs("div",{className:e?"":"ndpr-form-field__checkbox-row",children:[jsxRuntime.jsx("input",{type:"checkbox",id:r.id,checked:!!_[r.id],onChange:u=>h(r.id,u.target.checked),className:e?"":"ndpr-form-field__checkbox",required:r.required,"aria-required":r.required||void 0,"aria-invalid":!!d[`additional_${r.id}`],"aria-describedby":d[`additional_${r.id}`]?`additional-${r.id}-error`:void 0}),jsxRuntime.jsx("label",{htmlFor:r.id,className:chunkE64TU6IU_js.a("ndpr-form-field__label",i==null?void 0:i.label,e),children:r.placeholder||r.label})]}),r.type==="file"&&jsxRuntime.jsx("input",{type:"file",id:r.id,onChange:u=>{var K;let m=(K=u.target.files)==null?void 0:K[0];m&&h(r.id,m.name);},className:chunkE64TU6IU_js.a("ndpr-form-field__input",i==null?void 0:i.input,e),required:r.required,"aria-required":r.required||void 0,"aria-invalid":!!d[`additional_${r.id}`],"aria-describedby":d[`additional_${r.id}`]?`additional-${r.id}-error`:void 0}),d[`additional_${r.id}`]&&jsxRuntime.jsx("p",{id:`additional-${r.id}-error`,role:"alert",className:e?"":"ndpr-form-field__error",children:d[`additional_${r.id}`]})]},r.id)})})]}),jsxRuntime.jsxs("div",{className:e?"":"ndpr-dsr-form__notice",children:[jsxRuntime.jsx("h3",{className:e?"":"ndpr-dsr-form__notice-title",children:"Privacy Notice"}),jsxRuntime.jsx("p",{className:e?"":"ndpr-dsr-form__notice-body",children:"The information you provide in this form will be used solely for the purpose of processing your data subject request. We will retain this information for as long as necessary to fulfill your request and to comply with our legal obligations. For more information, please refer to our Privacy Policy."})]}),jsxRuntime.jsxs("div",{className:e?"":"ndpr-dsr-form__actions",children:[T&&(i==null?void 0:i.loadingOverlay)&&jsxRuntime.jsx("div",{className:i.loadingOverlay}),jsxRuntime.jsx("button",{type:"submit",disabled:T,className:chunkE64TU6IU_js.a(G,(i==null?void 0:i.primaryButton)||(i==null?void 0:i.submitButton),e),children:T?"Submitting...":v.submit||ii}),jsxRuntime.jsx("button",{type:"button",onClick:di,className:chunkE64TU6IU_js.a(bi,void 0,e),children:"Reset"})]})]})})]})};exports.a=gi;//# sourceMappingURL=chunk-ZPKVLTSX.js.map
2
+ //# sourceMappingURL=chunk-ZPKVLTSX.js.map
@@ -1,7 +1,9 @@
1
- import { c as ConsentBannerProps } from './ConsentBanner-CDRT0o2k.mjs';
2
- export { C as ConsentAnalyticsEvent, a as ConsentBanner, b as ConsentBannerClassNames } from './ConsentBanner-CDRT0o2k.mjs';
3
- import { d as ConsentManagerProps, e as ConsentStorageProps } from './styling-uJLsBbER.mjs';
4
- export { C as ConsentManager, a as ConsentManagerClassNames, b as ConsentStorage, c as ConsentStorageClassNames, r as resolveClass } from './styling-uJLsBbER.mjs';
1
+ import { c as ConsentBannerProps } from './ConsentBanner-F5ayys5K.mjs';
2
+ export { C as ConsentAnalyticsEvent, a as ConsentBanner, b as ConsentBannerClassNames } from './ConsentBanner-F5ayys5K.mjs';
3
+ import { b as ConsentManagerProps } from './ConsentManager-C7I3PDe8.mjs';
4
+ export { C as ConsentManager, a as ConsentManagerClassNames } from './ConsentManager-C7I3PDe8.mjs';
5
+ import { b as ConsentStorageProps } from './styling-BMDGQDgS.mjs';
6
+ export { C as ConsentStorage, a as ConsentStorageClassNames, r as resolveClass } from './styling-BMDGQDgS.mjs';
5
7
  export { u as useConsent } from './useConsent-DCNkIJHR.mjs';
6
8
  export { C as ConsentAuditEntry, a as appendAuditEntry, c as createAuditEntry, g as getAuditLog, v as validateConsent, b as validateConsentOptions } from './consent-audit-BdByjYlM.mjs';
7
9
  import { C as ConsentOption, a as ConsentSettings } from './consent-CmVzqZUk.mjs';
package/dist/consent.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- import { c as ConsentBannerProps } from './ConsentBanner-Vxyt8SCX.js';
2
- export { C as ConsentAnalyticsEvent, a as ConsentBanner, b as ConsentBannerClassNames } from './ConsentBanner-Vxyt8SCX.js';
3
- import { d as ConsentManagerProps, e as ConsentStorageProps } from './styling-B7CBzYG7.js';
4
- export { C as ConsentManager, a as ConsentManagerClassNames, b as ConsentStorage, c as ConsentStorageClassNames, r as resolveClass } from './styling-B7CBzYG7.js';
1
+ import { c as ConsentBannerProps } from './ConsentBanner-VqIPophc.js';
2
+ export { C as ConsentAnalyticsEvent, a as ConsentBanner, b as ConsentBannerClassNames } from './ConsentBanner-VqIPophc.js';
3
+ import { b as ConsentManagerProps } from './ConsentManager-CQ2IZtUU.js';
4
+ export { C as ConsentManager, a as ConsentManagerClassNames } from './ConsentManager-CQ2IZtUU.js';
5
+ import { b as ConsentStorageProps } from './styling-BaoQtV06.js';
6
+ export { C as ConsentStorage, a as ConsentStorageClassNames, r as resolveClass } from './styling-BaoQtV06.js';
5
7
  export { u as useConsent } from './useConsent-dOcELSfX.js';
6
8
  export { C as ConsentAuditEntry, a as appendAuditEntry, c as createAuditEntry, g as getAuditLog, v as validateConsent, b as validateConsentOptions } from './consent-audit-DhbfMR0n.js';
7
9
  import { C as ConsentOption, a as ConsentSettings } from './consent-CmVzqZUk.js';
package/dist/consent.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk256APOQM_js=require('./chunk-256APOQM.js'),chunkNBSVFQ5G_js=require('./chunk-NBSVFQ5G.js'),chunkMJGOLP5M_js=require('./chunk-MJGOLP5M.js'),chunk7SMLHZ4B_js=require('./chunk-7SMLHZ4B.js');require('./chunk-A4PK7JB2.js');var chunkHO5M7M4M_js=require('./chunk-HO5M7M4M.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js');require('./chunk-ELKB2AFZ.js');var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var R=react.createContext(null);function s(){let t=react.useContext(R);if(!t)throw new Error("Consent compound components must be wrapped in <Consent.Provider>. Example: <Consent.Provider options={...}><Consent.Banner /></Consent.Provider>");return t}var x=({options:t,adapter:e,version:p,onChange:r,children:c})=>{let d=chunk7SMLHZ4B_js.a({options:t,adapter:e,version:p,onChange:r}),o=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},d),{options:t});return jsxRuntime.jsx(R.Provider,{value:o,children:c})};var v=({classNames:t,unstyled:e})=>{let{options:p,settings:r}=s(),[c,d]=react.useState(()=>{let o={};return p.forEach(a=>{var i,A;o[a.id]=(A=(i=r==null?void 0:r.consents[a.id])!=null?i:a.defaultValue)!=null?A:false;}),o});return jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",t==null?void 0:t.root,e),"data-ndpr-component":"consent-option-list",children:p.map(o=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start",t==null?void 0:t.optionItem,e),children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`consent-${o.id}`,type:"checkbox",checked:c[o.id]||false,onChange:a=>d(i=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{[o.id]:a.target.checked})),disabled:o.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,e),"aria-label":o.label})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${o.id}`,className:chunkE64TU6IU_js.a("font-medium",t==null?void 0:t.optionLabel,e),children:[o.label," ",o.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,e),children:o.description})]})]},o.id))})};var b=({children:t,className:e,unstyled:p})=>{let{acceptAll:r}=s();return jsxRuntime.jsx("button",{onClick:r,className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e,p),"data-ndpr-component":"consent-accept-button",children:t!=null?t:"Accept All"})};var y=({children:t,className:e,unstyled:p})=>{let{rejectAll:r}=s();return jsxRuntime.jsx("button",{onClick:r,className:chunkE64TU6IU_js.a("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",e,p),"data-ndpr-component":"consent-reject-button",children:t!=null?t:"Reject All"})};var B=({children:t,className:e,unstyled:p,consents:r})=>{let{updateConsent:c,options:d}=s();return jsxRuntime.jsx("button",{onClick:()=>{if(r)c(r);else {let a={};d.forEach(i=>{a[i.id]=i.required||false;}),c(a);}},className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e,p),"data-ndpr-component":"consent-save-button",children:t!=null?t:"Save Preferences"})};var D={Provider:x,OptionList:v,AcceptButton:b,RejectButton:y,SaveButton:B,Banner:chunkNBSVFQ5G_js.a,Settings:chunk256APOQM_js.a,Storage:chunk256APOQM_js.b};Object.defineProperty(exports,"ConsentManager",{enumerable:true,get:function(){return chunk256APOQM_js.a}});Object.defineProperty(exports,"ConsentStorage",{enumerable:true,get:function(){return chunk256APOQM_js.b}});Object.defineProperty(exports,"ConsentBanner",{enumerable:true,get:function(){return chunkNBSVFQ5G_js.a}});Object.defineProperty(exports,"appendAuditEntry",{enumerable:true,get:function(){return chunkMJGOLP5M_js.c}});Object.defineProperty(exports,"createAuditEntry",{enumerable:true,get:function(){return chunkMJGOLP5M_js.a}});Object.defineProperty(exports,"getAuditLog",{enumerable:true,get:function(){return chunkMJGOLP5M_js.b}});Object.defineProperty(exports,"useConsent",{enumerable:true,get:function(){return chunk7SMLHZ4B_js.a}});Object.defineProperty(exports,"validateConsent",{enumerable:true,get:function(){return chunkHO5M7M4M_js.a}});Object.defineProperty(exports,"validateConsentOptions",{enumerable:true,get:function(){return chunkHO5M7M4M_js.b}});Object.defineProperty(exports,"resolveClass",{enumerable:true,get:function(){return chunkE64TU6IU_js.a}});exports.Consent=D;exports.ConsentAcceptButton=b;exports.ConsentOptionList=v;exports.ConsentProvider=x;exports.ConsentRejectButton=y;exports.ConsentSaveButton=B;exports.useConsentCompound=s;//# sourceMappingURL=consent.js.map
1
+ 'use strict';var chunk3NQQSU4P_js=require('./chunk-3NQQSU4P.js'),chunkRLYTX3MM_js=require('./chunk-RLYTX3MM.js'),chunkSUEGUY35_js=require('./chunk-SUEGUY35.js'),chunkMJGOLP5M_js=require('./chunk-MJGOLP5M.js'),chunk7SMLHZ4B_js=require('./chunk-7SMLHZ4B.js');require('./chunk-A4PK7JB2.js');var chunkHO5M7M4M_js=require('./chunk-HO5M7M4M.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js');require('./chunk-ELKB2AFZ.js');var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var S=react.createContext(null);function p(){let t=react.useContext(S);if(!t)throw new Error("Consent compound components must be wrapped in <Consent.Provider>. Example: <Consent.Provider options={...}><Consent.Banner /></Consent.Provider>");return t}var x=({options:t,adapter:n,version:s,onChange:r,children:c})=>{let C=chunk7SMLHZ4B_js.a({options:t,adapter:n,version:s,onChange:r}),o=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},C),{options:t});return jsxRuntime.jsx(S.Provider,{value:o,children:c})};var v=({classNames:t,unstyled:n})=>{let{options:s,settings:r}=p(),[c,C]=react.useState(()=>{let o={};return s.forEach(i=>{var a,_;o[i.id]=(_=(a=r==null?void 0:r.consents[i.id])!=null?a:i.defaultValue)!=null?_:false;}),o});return jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("ndpr-consent-banner__options-list",t==null?void 0:t.root,n),"data-ndpr-component":"consent-option-list",children:s.map(o=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("ndpr-consent-banner__option",t==null?void 0:t.optionItem,n),children:[jsxRuntime.jsx("input",{id:`consent-${o.id}`,type:"checkbox",checked:c[o.id]||false,onChange:i=>C(a=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{[o.id]:i.target.checked})),disabled:o.required,className:chunkE64TU6IU_js.a("ndpr-consent-banner__option-checkbox",t==null?void 0:t.optionCheckbox,n),"aria-label":o.label}),jsxRuntime.jsxs("div",{className:n?"":"ndpr-consent-banner__option-text",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${o.id}`,className:chunkE64TU6IU_js.a("ndpr-consent-banner__option-label",t==null?void 0:t.optionLabel,n),children:[o.label,o.required&&jsxRuntime.jsx("span",{className:n?"":"ndpr-consent-banner__required-marker",children:" *"})]}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("ndpr-consent-banner__option-description",t==null?void 0:t.optionDescription,n),children:o.description})]})]},o.id))})};var g=({children:t,className:n,unstyled:s})=>{let{acceptAll:r}=p();return jsxRuntime.jsx("button",{onClick:r,className:chunkE64TU6IU_js.a("ndpr-consent-banner__button ndpr-consent-banner__button--primary",n,s),"data-ndpr-component":"consent-accept-button",children:t!=null?t:"Accept All"})};var B=({children:t,className:n,unstyled:s})=>{let{rejectAll:r}=p();return jsxRuntime.jsx("button",{onClick:r,className:chunkE64TU6IU_js.a("ndpr-consent-banner__button ndpr-consent-banner__button--secondary",n,s),"data-ndpr-component":"consent-reject-button",children:t!=null?t:"Reject All"})};var P=({children:t,className:n,unstyled:s,consents:r})=>{let{updateConsent:c,options:C}=p();return jsxRuntime.jsx("button",{onClick:()=>{if(r)c(r);else {let i={};C.forEach(a=>{i[a.id]=a.required||false;}),c(i);}},className:chunkE64TU6IU_js.a("ndpr-consent-banner__button ndpr-consent-banner__button--primary",n,s),"data-ndpr-component":"consent-save-button",children:t!=null?t:"Save Preferences"})};var I={Provider:x,OptionList:v,AcceptButton:g,RejectButton:B,SaveButton:P,Banner:chunkSUEGUY35_js.a,Settings:chunkRLYTX3MM_js.a,Storage:chunk3NQQSU4P_js.a};Object.defineProperty(exports,"ConsentStorage",{enumerable:true,get:function(){return chunk3NQQSU4P_js.a}});Object.defineProperty(exports,"ConsentManager",{enumerable:true,get:function(){return chunkRLYTX3MM_js.a}});Object.defineProperty(exports,"ConsentBanner",{enumerable:true,get:function(){return chunkSUEGUY35_js.a}});Object.defineProperty(exports,"appendAuditEntry",{enumerable:true,get:function(){return chunkMJGOLP5M_js.c}});Object.defineProperty(exports,"createAuditEntry",{enumerable:true,get:function(){return chunkMJGOLP5M_js.a}});Object.defineProperty(exports,"getAuditLog",{enumerable:true,get:function(){return chunkMJGOLP5M_js.b}});Object.defineProperty(exports,"useConsent",{enumerable:true,get:function(){return chunk7SMLHZ4B_js.a}});Object.defineProperty(exports,"validateConsent",{enumerable:true,get:function(){return chunkHO5M7M4M_js.a}});Object.defineProperty(exports,"validateConsentOptions",{enumerable:true,get:function(){return chunkHO5M7M4M_js.b}});Object.defineProperty(exports,"resolveClass",{enumerable:true,get:function(){return chunkE64TU6IU_js.a}});exports.Consent=I;exports.ConsentAcceptButton=g;exports.ConsentOptionList=v;exports.ConsentProvider=x;exports.ConsentRejectButton=B;exports.ConsentSaveButton=P;exports.useConsentCompound=p;//# sourceMappingURL=consent.js.map
2
2
  //# sourceMappingURL=consent.js.map
package/dist/consent.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import {b as b$1,a}from'./chunk-Q7VHB64E.mjs';export{a as ConsentManager,b as ConsentStorage}from'./chunk-Q7VHB64E.mjs';import {a as a$1}from'./chunk-4JKTIR33.mjs';export{a as ConsentBanner}from'./chunk-4JKTIR33.mjs';export{c as appendAuditEntry,a as createAuditEntry,b as getAuditLog}from'./chunk-P3PULLYP.mjs';import {a as a$2}from'./chunk-VWPGIES4.mjs';export{a as useConsent}from'./chunk-VWPGIES4.mjs';import'./chunk-R3OYAJI6.mjs';export{a as validateConsent,b as validateConsentOptions}from'./chunk-U62QYKVG.mjs';import {a as a$4}from'./chunk-AYKLAEOU.mjs';export{a as resolveClass}from'./chunk-AYKLAEOU.mjs';import'./chunk-6WIP33TW.mjs';import {b as b$2,a as a$3}from'./chunk-WWT2ZSNU.mjs';import {createContext,useContext,useState}from'react';import {jsx,jsxs}from'react/jsx-runtime';var R=createContext(null);function s(){let t=useContext(R);if(!t)throw new Error("Consent compound components must be wrapped in <Consent.Provider>. Example: <Consent.Provider options={...}><Consent.Banner /></Consent.Provider>");return t}var x=({options:t,adapter:e,version:p,onChange:r,children:c})=>{let d=a$2({options:t,adapter:e,version:p,onChange:r}),o=b$2(a$3({},d),{options:t});return jsx(R.Provider,{value:o,children:c})};var v=({classNames:t,unstyled:e})=>{let{options:p,settings:r}=s(),[c,d]=useState(()=>{let o={};return p.forEach(a=>{var i,A;o[a.id]=(A=(i=r==null?void 0:r.consents[a.id])!=null?i:a.defaultValue)!=null?A:false;}),o});return jsx("div",{className:a$4("space-y-3",t==null?void 0:t.root,e),"data-ndpr-component":"consent-option-list",children:p.map(o=>jsxs("div",{className:a$4("flex items-start",t==null?void 0:t.optionItem,e),children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`consent-${o.id}`,type:"checkbox",checked:c[o.id]||false,onChange:a=>d(i=>b$2(a$3({},i),{[o.id]:a.target.checked})),disabled:o.required,className:a$4("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,e),"aria-label":o.label})}),jsxs("div",{className:"ml-3 text-sm",children:[jsxs("label",{htmlFor:`consent-${o.id}`,className:a$4("font-medium",t==null?void 0:t.optionLabel,e),children:[o.label," ",o.required&&jsx("span",{className:"text-red-500",children:"*"})]}),jsx("p",{className:a$4("text-gray-600 dark:text-gray-400",t==null?void 0:t.optionDescription,e),children:o.description})]})]},o.id))})};var b=({children:t,className:e,unstyled:p})=>{let{acceptAll:r}=s();return jsx("button",{onClick:r,className:a$4("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e,p),"data-ndpr-component":"consent-accept-button",children:t!=null?t:"Accept All"})};var y=({children:t,className:e,unstyled:p})=>{let{rejectAll:r}=s();return jsx("button",{onClick:r,className:a$4("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",e,p),"data-ndpr-component":"consent-reject-button",children:t!=null?t:"Reject All"})};var B=({children:t,className:e,unstyled:p,consents:r})=>{let{updateConsent:c,options:d}=s();return jsx("button",{onClick:()=>{if(r)c(r);else {let a={};d.forEach(i=>{a[i.id]=i.required||false;}),c(a);}},className:a$4("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e,p),"data-ndpr-component":"consent-save-button",children:t!=null?t:"Save Preferences"})};var D={Provider:x,OptionList:v,AcceptButton:b,RejectButton:y,SaveButton:B,Banner:a$1,Settings:a,Storage:b$1};export{D as Consent,b as ConsentAcceptButton,v as ConsentOptionList,x as ConsentProvider,y as ConsentRejectButton,B as ConsentSaveButton,s as useConsentCompound};//# sourceMappingURL=consent.mjs.map
1
+ import {a}from'./chunk-IZCWCE7W.mjs';export{a as ConsentStorage}from'./chunk-IZCWCE7W.mjs';import {a as a$1}from'./chunk-EPT2K355.mjs';export{a as ConsentManager}from'./chunk-EPT2K355.mjs';import {a as a$2}from'./chunk-BN77GP4W.mjs';export{a as ConsentBanner}from'./chunk-BN77GP4W.mjs';export{c as appendAuditEntry,a as createAuditEntry,b as getAuditLog}from'./chunk-P3PULLYP.mjs';import {a as a$3}from'./chunk-VWPGIES4.mjs';export{a as useConsent}from'./chunk-VWPGIES4.mjs';import'./chunk-R3OYAJI6.mjs';export{a as validateConsent,b as validateConsentOptions}from'./chunk-U62QYKVG.mjs';import {a as a$5}from'./chunk-AYKLAEOU.mjs';export{a as resolveClass}from'./chunk-AYKLAEOU.mjs';import'./chunk-6WIP33TW.mjs';import {b,a as a$4}from'./chunk-WWT2ZSNU.mjs';import {createContext,useContext,useState}from'react';import {jsx,jsxs}from'react/jsx-runtime';var S=createContext(null);function p(){let t=useContext(S);if(!t)throw new Error("Consent compound components must be wrapped in <Consent.Provider>. Example: <Consent.Provider options={...}><Consent.Banner /></Consent.Provider>");return t}var x=({options:t,adapter:n,version:s,onChange:r,children:c})=>{let C=a$3({options:t,adapter:n,version:s,onChange:r}),o=b(a$4({},C),{options:t});return jsx(S.Provider,{value:o,children:c})};var v=({classNames:t,unstyled:n})=>{let{options:s,settings:r}=p(),[c,C]=useState(()=>{let o={};return s.forEach(i=>{var a,_;o[i.id]=(_=(a=r==null?void 0:r.consents[i.id])!=null?a:i.defaultValue)!=null?_:false;}),o});return jsx("div",{className:a$5("ndpr-consent-banner__options-list",t==null?void 0:t.root,n),"data-ndpr-component":"consent-option-list",children:s.map(o=>jsxs("div",{className:a$5("ndpr-consent-banner__option",t==null?void 0:t.optionItem,n),children:[jsx("input",{id:`consent-${o.id}`,type:"checkbox",checked:c[o.id]||false,onChange:i=>C(a=>b(a$4({},a),{[o.id]:i.target.checked})),disabled:o.required,className:a$5("ndpr-consent-banner__option-checkbox",t==null?void 0:t.optionCheckbox,n),"aria-label":o.label}),jsxs("div",{className:n?"":"ndpr-consent-banner__option-text",children:[jsxs("label",{htmlFor:`consent-${o.id}`,className:a$5("ndpr-consent-banner__option-label",t==null?void 0:t.optionLabel,n),children:[o.label,o.required&&jsx("span",{className:n?"":"ndpr-consent-banner__required-marker",children:" *"})]}),jsx("p",{className:a$5("ndpr-consent-banner__option-description",t==null?void 0:t.optionDescription,n),children:o.description})]})]},o.id))})};var g=({children:t,className:n,unstyled:s})=>{let{acceptAll:r}=p();return jsx("button",{onClick:r,className:a$5("ndpr-consent-banner__button ndpr-consent-banner__button--primary",n,s),"data-ndpr-component":"consent-accept-button",children:t!=null?t:"Accept All"})};var B=({children:t,className:n,unstyled:s})=>{let{rejectAll:r}=p();return jsx("button",{onClick:r,className:a$5("ndpr-consent-banner__button ndpr-consent-banner__button--secondary",n,s),"data-ndpr-component":"consent-reject-button",children:t!=null?t:"Reject All"})};var P=({children:t,className:n,unstyled:s,consents:r})=>{let{updateConsent:c,options:C}=p();return jsx("button",{onClick:()=>{if(r)c(r);else {let i={};C.forEach(a=>{i[a.id]=a.required||false;}),c(i);}},className:a$5("ndpr-consent-banner__button ndpr-consent-banner__button--primary",n,s),"data-ndpr-component":"consent-save-button",children:t!=null?t:"Save Preferences"})};var I={Provider:x,OptionList:v,AcceptButton:g,RejectButton:B,SaveButton:P,Banner:a$2,Settings:a$1,Storage:a};export{I as Consent,g as ConsentAcceptButton,v as ConsentOptionList,x as ConsentProvider,B as ConsentRejectButton,P as ConsentSaveButton,p as useConsentCompound};//# sourceMappingURL=consent.mjs.map
2
2
  //# sourceMappingURL=consent.mjs.map