@tantainnovative/ndpr-toolkit 2.4.1 → 3.2.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 (192) hide show
  1. package/README.md +226 -246
  2. package/dist/BreachReportForm-DpRrBoxU.d.ts +158 -0
  3. package/dist/BreachReportForm-yJ2Zl6gz.d.mts +158 -0
  4. package/dist/ConsentBanner-CDRT0o2k.d.mts +146 -0
  5. package/dist/ConsentBanner-Vxyt8SCX.d.ts +146 -0
  6. package/dist/{cross-border-entry-BrWVPly6.d.ts → CrossBorderTransferManager-D5Lc0e46.d.ts} +4 -5
  7. package/dist/{cross-border-entry-cCTvpwnT.d.mts → CrossBorderTransferManager-DkZhv9vD.d.mts} +4 -5
  8. package/dist/DPIAQuestionnaire-BkejviPj.d.mts +123 -0
  9. package/dist/DPIAQuestionnaire-DdSqXG3x.d.ts +123 -0
  10. package/dist/DSRRequestForm-BY8PogCU.d.mts +146 -0
  11. package/dist/DSRRequestForm-CHUg9cZh.d.ts +146 -0
  12. package/dist/DSRTracker-C6u_jAaK.d.mts +163 -0
  13. package/dist/DSRTracker-Dr_aT0pg.d.ts +163 -0
  14. package/dist/{lawful-basis-entry-CxZrofwG.d.mts → LawfulBasisTracker-CBqOxX1D.d.mts} +3 -5
  15. package/dist/{lawful-basis-entry-15qjKcNO.d.ts → LawfulBasisTracker-Cg30NbDA.d.ts} +3 -5
  16. package/dist/NDPRDashboard-CLJpEg0X.d.mts +44 -0
  17. package/dist/NDPRDashboard-DDWNd2Ah.d.ts +44 -0
  18. package/dist/{policy-E0fXZkda.d.mts → PolicyExporter-Bgi6nz82.d.mts} +5 -7
  19. package/dist/{policy-D2_jh5-T.d.ts → PolicyExporter-BnvuFncj.d.ts} +5 -7
  20. package/dist/{ropa-entry-B0D7X1GV.d.ts → ROPAManager-BS4eB8Hw.d.mts} +4 -5
  21. package/dist/{ropa-entry-DiOThOc2.d.mts → ROPAManager-qxTrXLkD.d.ts} +4 -5
  22. package/dist/RegulatoryReportGenerator-BUYgzTTT.d.ts +282 -0
  23. package/dist/RegulatoryReportGenerator-DwcHcEFp.d.mts +282 -0
  24. package/dist/StepIndicator-D-nwRTyo.d.mts +171 -0
  25. package/dist/StepIndicator-D9ZATz_O.d.ts +171 -0
  26. package/dist/adapters.d.mts +25 -0
  27. package/dist/adapters.d.ts +25 -0
  28. package/dist/adapters.js +2 -0
  29. package/dist/adapters.mjs +2 -0
  30. package/dist/breach.d.mts +36 -431
  31. package/dist/breach.d.ts +36 -431
  32. package/dist/breach.js +1 -1
  33. package/dist/breach.mjs +1 -1
  34. package/dist/chunk-27NYSWUG.mjs +2 -0
  35. package/dist/chunk-2ORDHJRD.js +2 -0
  36. package/dist/chunk-2W7ARAW2.js +2 -0
  37. package/dist/chunk-3F34NACG.js +2 -0
  38. package/dist/chunk-3UWT64FI.mjs +2 -0
  39. package/dist/chunk-3V23O4ZJ.js +2 -0
  40. package/dist/chunk-3XAUN5IM.mjs +3 -0
  41. package/dist/chunk-44W4H2EY.js +2 -0
  42. package/dist/chunk-5VMHKNJY.js +2 -0
  43. package/dist/chunk-6D3ZUGBB.mjs +2 -0
  44. package/dist/chunk-6E54NSAO.mjs +2 -0
  45. package/dist/chunk-7F5F5YWI.mjs +2 -0
  46. package/dist/chunk-DQLDX5X6.js +316 -0
  47. package/dist/chunk-FR7ZYZXB.js +2 -0
  48. package/dist/chunk-FY5G6DGZ.js +7 -0
  49. package/dist/chunk-G26I6MP5.mjs +2 -0
  50. package/dist/chunk-GCQRHMTQ.mjs +144 -0
  51. package/dist/chunk-GPJVTGHR.mjs +2 -0
  52. package/dist/chunk-GVANK6PL.js +3 -0
  53. package/dist/chunk-HNZK7LY3.mjs +2 -0
  54. package/dist/chunk-IKEPXHCZ.js +2 -0
  55. package/dist/chunk-IQQW52EF.js +2 -0
  56. package/dist/chunk-ISSGO2YT.mjs +72 -0
  57. package/dist/chunk-JZKH5RMC.js +3 -0
  58. package/dist/chunk-KHRBU5K7.js +2 -0
  59. package/dist/chunk-LFNA6WYQ.mjs +2 -0
  60. package/dist/chunk-LU4PFST7.js +144 -0
  61. package/dist/chunk-NPI5T6NH.mjs +7 -0
  62. package/dist/chunk-NPLXE43Q.mjs +2 -0
  63. package/dist/chunk-P7BSBCB3.js +2 -0
  64. package/dist/chunk-PEH5GIMN.js +2 -0
  65. package/dist/chunk-RSUDIFZV.mjs +2 -0
  66. package/dist/chunk-SBNAMPAP.mjs +2 -0
  67. package/dist/chunk-SVCRYM4I.mjs +2 -0
  68. package/dist/chunk-TKBZRULW.mjs +316 -0
  69. package/dist/chunk-TVW6KBVV.mjs +2 -0
  70. package/dist/chunk-U6VWHC46.js +72 -0
  71. package/dist/chunk-UK656RCG.js +2 -0
  72. package/dist/chunk-UNKXYVXY.js +2 -0
  73. package/dist/chunk-UOSEH6DC.js +2 -0
  74. package/dist/chunk-V37BM2LF.js +2 -0
  75. package/dist/chunk-V3MXWGXU.mjs +2 -0
  76. package/dist/chunk-VDZKGCAF.js +2 -0
  77. package/dist/chunk-WLSW4Z4W.mjs +2 -0
  78. package/dist/chunk-XSK4BSZJ.mjs +2 -0
  79. package/dist/chunk-YJCGEOLO.mjs +2 -0
  80. package/dist/chunk-ZCZ5RRZO.js +2 -0
  81. package/dist/chunk-ZQSX5ZHB.mjs +3 -0
  82. package/dist/compliance-score-racQe_E_.d.mts +115 -0
  83. package/dist/compliance-score-racQe_E_.d.ts +115 -0
  84. package/dist/consent.d.mts +67 -295
  85. package/dist/consent.d.ts +67 -295
  86. package/dist/consent.js +1 -1
  87. package/dist/consent.mjs +1 -1
  88. package/dist/core.d.mts +14 -48
  89. package/dist/core.d.ts +14 -48
  90. package/dist/core.js +1 -1
  91. package/dist/core.mjs +1 -1
  92. package/dist/cross-border-BBi9rZyO.d.mts +54 -0
  93. package/dist/cross-border-Dy-U9Hu6.d.ts +54 -0
  94. package/dist/{cross-border-BMcqLvjC.d.mts → cross-border-UyT00llA.d.mts} +1 -52
  95. package/dist/{cross-border-BMcqLvjC.d.ts → cross-border-UyT00llA.d.ts} +1 -52
  96. package/dist/cross-border.d.mts +32 -4
  97. package/dist/cross-border.d.ts +32 -4
  98. package/dist/cross-border.js +1 -1
  99. package/dist/cross-border.mjs +1 -1
  100. package/dist/dpia.d.mts +28 -284
  101. package/dist/dpia.d.ts +28 -284
  102. package/dist/dpia.js +1 -1
  103. package/dist/dpia.mjs +1 -1
  104. package/dist/dsr.d.mts +29 -300
  105. package/dist/dsr.d.ts +29 -300
  106. package/dist/dsr.js +1 -1
  107. package/dist/dsr.mjs +1 -1
  108. package/dist/hooks.d.mts +23 -10
  109. package/dist/hooks.d.ts +23 -10
  110. package/dist/hooks.js +1 -1
  111. package/dist/hooks.mjs +1 -1
  112. package/dist/index.d.mts +28 -19
  113. package/dist/index.d.ts +28 -19
  114. package/dist/index.js +1 -1
  115. package/dist/index.mjs +1 -1
  116. package/dist/lawful-basis.d.mts +31 -4
  117. package/dist/lawful-basis.d.ts +31 -4
  118. package/dist/lawful-basis.js +1 -1
  119. package/dist/lawful-basis.mjs +1 -1
  120. package/dist/policy-engine-C-tShzZH.d.mts +154 -0
  121. package/dist/policy-engine-DSQpT55_.d.ts +154 -0
  122. package/dist/policy-sections-CfNVBLCh.d.mts +54 -0
  123. package/dist/policy-sections-DqH0iZRf.d.ts +54 -0
  124. package/dist/policy.d.mts +117 -4
  125. package/dist/policy.d.ts +117 -4
  126. package/dist/policy.js +1 -1
  127. package/dist/policy.mjs +1 -1
  128. package/dist/presets.d.mts +114 -0
  129. package/dist/presets.d.ts +114 -0
  130. package/dist/presets.js +2 -0
  131. package/dist/presets.mjs +2 -0
  132. package/dist/{ropa-Li6UlL5H.d.ts → ropa-BDTM06tr.d.ts} +1 -49
  133. package/dist/{ropa-DP7pPPql.d.mts → ropa-CFHuT7jE.d.mts} +1 -49
  134. package/dist/ropa-CyynscU6.d.ts +51 -0
  135. package/dist/ropa-NIgxd8uP.d.mts +51 -0
  136. package/dist/ropa.d.mts +30 -4
  137. package/dist/ropa.d.ts +30 -4
  138. package/dist/ropa.js +1 -1
  139. package/dist/ropa.mjs +1 -1
  140. package/dist/sanitize-9mOO_cJW.d.mts +147 -0
  141. package/dist/sanitize-9mOO_cJW.d.ts +147 -0
  142. package/dist/styling-B7CBzYG7.d.ts +165 -0
  143. package/dist/styling-uJLsBbER.d.mts +165 -0
  144. package/dist/types-DK2CoKOC.d.mts +10 -0
  145. package/dist/types-DK2CoKOC.d.ts +10 -0
  146. package/dist/unstyled.d.mts +4 -4
  147. package/dist/unstyled.d.ts +4 -4
  148. package/dist/useAdaptivePolicyWizard-B9Op2gYM.d.ts +52 -0
  149. package/dist/useAdaptivePolicyWizard-N4eUM4Tj.d.mts +52 -0
  150. package/dist/{useBreach-BBSoIcZO.d.mts → useBreach-CPr86Yan.d.mts} +18 -2
  151. package/dist/{useBreach-lFLbSyAN.d.ts → useBreach-DkVXvtJK.d.ts} +18 -2
  152. package/dist/{useConsent-D0pAfTlb.d.ts → useConsent-DCNkIJHR.d.mts} +12 -2
  153. package/dist/{useConsent-DOt2Njst.d.mts → useConsent-dOcELSfX.d.ts} +12 -2
  154. package/dist/{useCrossBorderTransfer-DmtACeqW.d.ts → useCrossBorderTransfer-BGNZt2lk.d.mts} +15 -3
  155. package/dist/{useCrossBorderTransfer-BZVFCXfr.d.mts → useCrossBorderTransfer-COqjgjsu.d.ts} +15 -3
  156. package/dist/{useDPIA-DBsg2yZx.d.ts → useDPIA-Dl16Te3r.d.ts} +13 -2
  157. package/dist/{useDPIA-Da7-Q_yW.d.mts → useDPIA-DzWye8JB.d.mts} +13 -2
  158. package/dist/{useDSR-YYZ6FYFs.d.mts → useDSR-C1LksCfP.d.mts} +13 -2
  159. package/dist/{useDSR-CYI7WCXr.d.ts → useDSR-DZel52O1.d.ts} +13 -2
  160. package/dist/{useDefaultPrivacyPolicy-CUluF_ic.d.mts → useDefaultPrivacyPolicy-BsYttRey.d.mts} +13 -2
  161. package/dist/{useDefaultPrivacyPolicy-B7kTHbZh.d.ts → useDefaultPrivacyPolicy-C-mG-A5S.d.ts} +13 -2
  162. package/dist/{useLawfulBasis-CpWuHtyh.d.mts → useLawfulBasis-CKJ-kw84.d.mts} +13 -2
  163. package/dist/{useLawfulBasis-CCWF9waR.d.ts → useLawfulBasis-DFTmu1ca.d.ts} +13 -2
  164. package/dist/{useROPA-BhJ3kvHp.d.ts → useROPA-BSSU1rfx.d.ts} +14 -2
  165. package/dist/{useROPA-DLFdjkxP.d.mts → useROPA-C2hjaBTz.d.mts} +14 -2
  166. package/package.json +24 -3
  167. package/dist/chunk-2XFAV267.mjs +0 -2
  168. package/dist/chunk-32UIWTGD.js +0 -72
  169. package/dist/chunk-3YCV2BA6.js +0 -2
  170. package/dist/chunk-4A354HL3.js +0 -2
  171. package/dist/chunk-5ZBO2UPH.js +0 -2
  172. package/dist/chunk-6GGGTRDZ.mjs +0 -2
  173. package/dist/chunk-BZTTQS4A.mjs +0 -7
  174. package/dist/chunk-EKVTLHBQ.js +0 -2
  175. package/dist/chunk-GMLNWS2N.mjs +0 -2
  176. package/dist/chunk-IBEKLDBY.mjs +0 -2
  177. package/dist/chunk-ILCNDOBU.js +0 -2
  178. package/dist/chunk-K3GMTMQ6.js +0 -2
  179. package/dist/chunk-L52PDW6O.mjs +0 -2
  180. package/dist/chunk-LI6WJ3LZ.js +0 -2
  181. package/dist/chunk-LXRXDTPI.js +0 -2
  182. package/dist/chunk-NW4A3JW6.mjs +0 -2
  183. package/dist/chunk-OITITR6K.mjs +0 -2
  184. package/dist/chunk-PDJGTQMY.mjs +0 -2
  185. package/dist/chunk-T44JQT2O.mjs +0 -2
  186. package/dist/chunk-TCJCE6WN.js +0 -2
  187. package/dist/chunk-VMJBW3EF.mjs +0 -2
  188. package/dist/chunk-WSHSHIIM.mjs +0 -2
  189. package/dist/chunk-WW3X3ELF.js +0 -2
  190. package/dist/chunk-XMYUYQH7.mjs +0 -72
  191. package/dist/chunk-ZNTMZ6NM.js +0 -7
  192. package/dist/chunk-ZU73VG3X.js +0 -2
@@ -0,0 +1,3 @@
1
+ 'use strict';var chunkDQLDX5X6_js=require('./chunk-DQLDX5X6.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),Gr=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Gr__default=/*#__PURE__*/_interopDefault(Gr);var vr=["Organization","Data Collection","Processing","Review & Export"],ur=({currentStep:n,classNames:d,unstyled:r})=>jsxRuntime.jsx("div",{"data-ndpr-component":"policy-step-indicator",className:chunkE64TU6IU_js.a("w-full flex items-center justify-between px-2 py-4",d==null?void 0:d.root,r),children:vr.map((o,p)=>{let t=p+1,i=t<n,v=t===n,h=p===vr.length-1;return jsxRuntime.jsxs(Gr__default.default.Fragment,{children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col items-center gap-1",d==null?void 0:d.stepWrapper,r),children:[jsxRuntime.jsx("div",{"aria-current":v?"step":void 0,className:chunkE64TU6IU_js.a(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":v?"w-9 h-9 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] shadow-md":"w-8 h-8 bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-600 text-gray-400 dark:text-gray-500"].join(" "),i?d==null?void 0:d.stepCompleted:v?d==null?void 0:d.stepCurrent:d==null?void 0:d.stepUpcoming,r),children:i?jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("span",{className:"text-xs leading-none",children:t})}),jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(["text-xs font-medium hidden sm:block",i||v?"text-[rgb(var(--ndpr-primary))]":"text-gray-400 dark:text-gray-500"].join(" "),d==null?void 0:d.stepLabel,r),children:o})]}),!h&&jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),d==null?void 0:d.connector,r),"aria-hidden":"true"})]},t)})});var F="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",Ur="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",A=({label:n,required:d,children:r,classNames:o,unstyled:p})=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col",o==null?void 0:o.field,p),children:[jsxRuntime.jsxs("label",{className:chunkE64TU6IU_js.a(Ur,o==null?void 0:o.label,p),children:[n,d&&jsxRuntime.jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),r]}),yr=({context:n,onUpdateOrg:d,classNames:r,unstyled:o})=>{var t,i,v;let p=n.org;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-about",className:chunkE64TU6IU_js.a("space-y-6",r==null?void 0:r.root,o),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Organisation Details"}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 mt-1",r==null?void 0:r.subheading,o),children:["Tell us about your organisation. Fields marked ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})," are required."]})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,o),children:[jsxRuntime.jsx(A,{label:"Organisation Name",required:true,classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{type:"text",value:p.name,onChange:x=>d({name:x.target.value}),placeholder:"Acme Corporation",className:chunkE64TU6IU_js.a(F,r==null?void 0:r.input,o),"aria-required":"true"})}),jsxRuntime.jsx(A,{label:"Website",required:true,classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{type:"url",value:p.website,onChange:x=>d({website:x.target.value}),placeholder:"https://example.com",className:chunkE64TU6IU_js.a(F,r==null?void 0:r.input,o),"aria-required":"true"})}),jsxRuntime.jsx(A,{label:"Privacy Contact Email",required:true,classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{type:"email",value:p.privacyEmail,onChange:x=>d({privacyEmail:x.target.value}),placeholder:"privacy@example.com",className:chunkE64TU6IU_js.a(F,r==null?void 0:r.input,o),"aria-required":"true"})}),jsxRuntime.jsx(A,{label:"Industry",classNames:r,unstyled:o,children:jsxRuntime.jsxs("select",{value:p.industry,onChange:x=>d({industry:x.target.value}),className:chunkE64TU6IU_js.a(F,r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"fintech",children:"Fintech"}),jsxRuntime.jsx("option",{value:"healthcare",children:"Healthcare"}),jsxRuntime.jsx("option",{value:"ecommerce",children:"E-commerce"}),jsxRuntime.jsx("option",{value:"saas",children:"SaaS"}),jsxRuntime.jsx("option",{value:"education",children:"Education"}),jsxRuntime.jsx("option",{value:"government",children:"Government"}),jsxRuntime.jsx("option",{value:"other",children:"Other"})]})}),jsxRuntime.jsx(A,{label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{type:"text",value:(t=p.dpoName)!=null?t:"",onChange:x=>d({dpoName:x.target.value}),placeholder:"Jane Smith",className:chunkE64TU6IU_js.a(F,r==null?void 0:r.input,o)})}),jsxRuntime.jsx(A,{label:"DPO Email",classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{type:"email",value:(i=p.dpoEmail)!=null?i:"",onChange:x=>d({dpoEmail:x.target.value}),placeholder:"dpo@example.com",className:chunkE64TU6IU_js.a(F,r==null?void 0:r.input,o)})}),jsxRuntime.jsx(A,{label:"Registered Address",classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{type:"text",value:(v=p.address)!=null?v:"",onChange:x=>d({address:x.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:chunkE64TU6IU_js.a(F,r==null?void 0:r.input,o)})}),jsxRuntime.jsx(A,{label:"Organisation Size",classNames:r,unstyled:o,children:jsxRuntime.jsxs("select",{value:p.orgSize,onChange:x=>d({orgSize:x.target.value}),className:chunkE64TU6IU_js.a(F,r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"startup",children:"Startup (1\u201350 employees)"}),jsxRuntime.jsx("option",{value:"midsize",children:"Mid-size (51\u2013500 employees)"}),jsxRuntime.jsx("option",{value:"enterprise",children:"Enterprise (500+ employees)"})]})}),jsxRuntime.jsx(A,{label:"Country of Operation",classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{type:"text",value:p.country,onChange:x=>d({country:x.target.value}),placeholder:"Nigeria",className:chunkE64TU6IU_js.a(F,r==null?void 0:r.input,o)})})]})]})};var Vr={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},Xr=["identity","financial","behavioral","sensitive","children"],Yr=["sensitive","children"],hr=({categories:n,onToggle:d,classNames:r,unstyled:o})=>{let p=Xr.reduce((t,i)=>{let v=n.filter(x=>x.group===i);return v.length>0&&(t[i]=v),t},{});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-data",className:chunkE64TU6IU_js.a("space-y-8",r==null?void 0:r.root,o),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Data Categories"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 mt-1",r==null?void 0:r.subheading,o),children:"Select the categories of personal data your organisation collects. You must select at least one."})]}),Object.entries(p).map(([t,i])=>{let v=Yr.includes(t);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-3",r==null?void 0:r.group,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center gap-2",r==null?void 0:r.groupHeader,o),children:[jsxRuntime.jsx("h3",{className:chunkE64TU6IU_js.a("text-sm font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",r==null?void 0:r.groupTitle,o),children:Vr[t]}),v&&jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("text-xs font-medium text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20 px-2 py-0.5 rounded-full",r==null?void 0:r.sensitiveTag,o),children:"Sensitive"})]}),v&&jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-amber-700 dark:text-amber-400",r==null?void 0:r.sensitiveWarning,o),children:t==="children"?"Processing children's data requires parental consent under NDPA Section 31 and imposes heightened obligations.":"Sensitive/special-category data requires explicit consent and additional safeguards under NDPA Section 30."}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",r==null?void 0:r.cardsGrid,o),children:i.map(x=>jsxRuntime.jsx("button",{type:"button",onClick:()=>d(x.id),"aria-pressed":x.selected,className:chunkE64TU6IU_js.a(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",x.selected?"bg-[rgb(var(--ndpr-primary))]/5 border-[rgb(var(--ndpr-primary))] dark:bg-[rgb(var(--ndpr-primary))]/10":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"].join(" "),r==null?void 0:r.card,o),children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a(["mt-0.5 w-4 h-4 rounded border-2 flex-shrink-0 flex items-center justify-center",x.selected?"bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))]":"border-gray-300 dark:border-gray-600"].join(" "),r==null?void 0:r.checkbox,o),"aria-hidden":"true",children:x.selected&&jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-[rgb(var(--ndpr-primary-foreground))]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",r==null?void 0:r.cardLabel,o),children:x.label}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 mt-1 leading-relaxed",r==null?void 0:r.cardDataPoints,o),children:x.dataPoints.join(", ")})]})]})},x.id))})]},t)})]})};var Jr=[{value:"service_delivery",label:"Service Delivery",description:"Processing required to deliver the core product or service."},{value:"marketing",label:"Marketing & Communications",description:"Sending promotional messages, newsletters or offers."},{value:"analytics",label:"Analytics & Insights",description:"Analysing usage patterns to improve the product."},{value:"research",label:"Research & Development",description:"Using data to develop new features or products."},{value:"legal_compliance",label:"Legal Compliance",description:"Meeting statutory, regulatory or contractual obligations."},{value:"fraud_prevention",label:"Fraud Prevention & Security",description:"Detecting and preventing fraudulent activity."}],dr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",pr="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-4",gr=({id:n,checked:d,onChange:r})=>jsxRuntime.jsx("button",{id:n,type:"button",role:"switch","aria-checked":d,onClick:()=>r(!d),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",d?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-600"].join(" "),children:jsxRuntime.jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",d?"translate-x-5":"translate-x-0"].join(" ")})}),lr=({context:n,onTogglePurpose:d,onUpdateContext:r,onAddProcessor:o,onRemoveProcessor:p,classNames:t,unstyled:i})=>{let[v,x]=Gr.useState({name:"",purpose:"",country:""}),[h,c]=Gr.useState(false),a=()=>{let{name:g,purpose:u,country:P}=v;!g.trim()||!u.trim()||!P.trim()||(o({name:g.trim(),purpose:u.trim(),country:P.trim()}),x({name:"",purpose:"",country:""}),c(false));};return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-processing",className:chunkE64TU6IU_js.a("space-y-6",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.heading,i),children:"Processing Details"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 mt-1",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxRuntime.jsxs("section",{className:chunkE64TU6IU_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsxRuntime.jsx("h3",{id:"purposes-heading",className:chunkE64TU6IU_js.a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400",t==null?void 0:t.sectionDescription,i),children:"Select all purposes for which you process personal data. At least one is required."}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",t==null?void 0:t.purposeList,i),children:Jr.map(g=>{let u=n.purposes.includes(g.value);return jsxRuntime.jsxs("label",{className:chunkE64TU6IU_js.a("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsxRuntime.jsx("input",{type:"checkbox",checked:u,onChange:()=>d(g.value),className:chunkE64TU6IU_js.a("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.purposeLabel,i),children:g.label}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400",t==null?void 0:t.purposeDescription,i),children:g.description})]})]},g.value)})})]}),jsxRuntime.jsxs("section",{className:chunkE64TU6IU_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"thirdparty-heading",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h3",{id:"thirdparty-heading",className:chunkE64TU6IU_js.a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsxRuntime.jsx(gr,{id:"thirdparty-toggle",checked:n.thirdPartyProcessors.length>0||h,onChange:g=>{g?c(true):(n.thirdPartyProcessors.forEach((u,P)=>p(0)),c(false));}})]}),(n.thirdPartyProcessors.length>0||h)&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",t==null?void 0:t.processorSection,i),children:[n.thirdPartyProcessors.length>0&&jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("overflow-x-auto",t==null?void 0:t.processorTable,i),children:jsxRuntime.jsxs("table",{className:"w-full text-sm",children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsxs("tr",{className:chunkE64TU6IU_js.a("text-left text-xs font-medium text-gray-500 dark:text-gray-400 border-b border-gray-200 dark:border-gray-700",t==null?void 0:t.tableHeader,i),children:[jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Name"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Purpose"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Country"}),jsxRuntime.jsx("th",{className:"pb-2"})]})}),jsxRuntime.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:n.thirdPartyProcessors.map((g,u)=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:chunkE64TU6IU_js.a("py-2 pr-4 text-gray-900 dark:text-gray-100",t==null?void 0:t.tableCell,i),children:g.name}),jsxRuntime.jsx("td",{className:chunkE64TU6IU_js.a("py-2 pr-4 text-gray-700 dark:text-gray-300",t==null?void 0:t.tableCell,i),children:g.purpose}),jsxRuntime.jsx("td",{className:chunkE64TU6IU_js.a("py-2 pr-4 text-gray-700 dark:text-gray-300",t==null?void 0:t.tableCell,i),children:g.country}),jsxRuntime.jsx("td",{className:"py-2",children:jsxRuntime.jsx("button",{type:"button",onClick:()=>p(u),className:chunkE64TU6IU_js.a("text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 text-xs font-medium",t==null?void 0:t.removeButton,i),"aria-label":`Remove ${g.name}`,children:"Remove"})})]},u))})]})}),h?jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsxRuntime.jsx("input",{type:"text",placeholder:"Processor name",value:v.name,onChange:g=>x(u=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{name:g.target.value})),className:chunkE64TU6IU_js.a(dr,t==null?void 0:t.input,i)}),jsxRuntime.jsx("input",{type:"text",placeholder:"Purpose",value:v.purpose,onChange:g=>x(u=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{purpose:g.target.value})),className:chunkE64TU6IU_js.a(dr,t==null?void 0:t.input,i)}),jsxRuntime.jsx("input",{type:"text",placeholder:"Country",value:v.country,onChange:g=>x(u=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{country:g.target.value})),className:chunkE64TU6IU_js.a(dr,t==null?void 0:t.input,i)}),jsxRuntime.jsxs("div",{className:"sm:col-span-3 flex gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:a,className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>c(false),className:chunkE64TU6IU_js.a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxRuntime.jsxs("button",{type:"button",onClick:()=>c(true),className:chunkE64TU6IU_js.a("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsxRuntime.jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxRuntime.jsxs("section",{className:chunkE64TU6IU_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsxRuntime.jsx("h3",{id:"disclosures-heading",className:chunkE64TU6IU_js.a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",t==null?void 0:t.disclosureList,i),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you transfer personal data outside Nigeria? This triggers NDPA Chapter 6 obligations."})]}),jsxRuntime.jsx(gr,{id:"cross-border-toggle",checked:n.hasCrossBorderTransfer,onChange:g=>r({hasCrossBorderTransfer:g})})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you use algorithms or AI to make decisions about individuals? Requires disclosure under NDPA Section 37."})]}),jsxRuntime.jsx(gr,{id:"automated-toggle",checked:n.hasAutomatedDecisions,onChange:g=>r({hasAutomatedDecisions:g})})]})]})]})]})};var kr=({section:n,index:d,isCustom:r,isEditing:o,editedContent:p,onEdit:t,onSaveEdit:i,onCancelEdit:v,onMoveUp:x,onMoveDown:h,onDelete:c,classNames:a,unstyled:g})=>{let[u,P]=Gr.useState(p!=null?p:n.template);return Gr.useEffect(()=>{p!==void 0&&P(p);},[p]),Gr.useEffect(()=>{o&&P(p!=null?p:n.template);},[o,p,n.template]),jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-section-card",className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",a==null?void 0:a.root,g),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start justify-between gap-2",a==null?void 0:a.header,g),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center gap-3 min-w-0",a==null?void 0:a.titleRow,g),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("flex-shrink-0 w-7 h-7 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 text-xs font-semibold flex items-center justify-center",a==null?void 0:a.sectionNumber,g),"aria-hidden":"true",children:d+1}),jsxRuntime.jsxs("h4",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",a==null?void 0:a.sectionTitle,g),children:[n.title,r&&jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("ml-2 text-xs font-normal text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded",a==null?void 0:a.customBadge,g),children:"Custom"})]})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center gap-1 flex-shrink-0",a==null?void 0:a.actions,g),children:[x&&jsxRuntime.jsx("button",{type:"button",onClick:x,className:chunkE64TU6IU_js.a("p-1.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",a==null?void 0:a.moveButton,g),"aria-label":`Move "${n.title}" up`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}),h&&jsxRuntime.jsx("button",{type:"button",onClick:h,className:chunkE64TU6IU_js.a("p-1.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",a==null?void 0:a.moveButton,g),"aria-label":`Move "${n.title}" down`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}),!o&&jsxRuntime.jsx("button",{type:"button",onClick:t,className:chunkE64TU6IU_js.a("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",a==null?void 0:a.editButton,g),"aria-label":`Edit "${n.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),r&&c&&jsxRuntime.jsx("button",{type:"button",onClick:c,className:chunkE64TU6IU_js.a("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",a==null?void 0:a.deleteButton,g),"aria-label":`Delete "${n.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),o?jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-2",a==null?void 0:a.editArea,g),children:[jsxRuntime.jsx("textarea",{value:u,onChange:z=>P(z.target.value),rows:8,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm font-mono resize-y",a==null?void 0:a.textarea,g),"aria-label":`Edit content for ${n.title}`}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex gap-2",a==null?void 0:a.editActions,g),children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>i(u),className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",a==null?void 0:a.saveButton,g),children:"Save"}),jsxRuntime.jsx("button",{type:"button",onClick:v,className:chunkE64TU6IU_js.a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm",a==null?void 0:a.cancelButton,g),children:"Cancel"})]})]}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("text-sm text-gray-600 dark:text-gray-300 leading-relaxed line-clamp-4 whitespace-pre-wrap",a==null?void 0:a.content,g),children:n.template})]})};var Cr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",wr=({onAdd:n,nextOrder:d,classNames:r,unstyled:o})=>{let[p,t]=Gr.useState(""),[i,v]=Gr.useState(""),[x,h]=Gr.useState(""),c=()=>{if(!p.trim()){h("Section title is required.");return}if(!i.trim()){h("Section content is required.");return}h(""),n({title:p.trim(),content:i.trim(),order:d}),t(""),v("");};return jsxRuntime.jsxs("div",{"data-ndpr-component":"custom-section-form",className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-4",r==null?void 0:r.root,o),children:[jsxRuntime.jsx("h4",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Add Custom Section"}),x&&jsxRuntime.jsx("p",{role:"alert",className:chunkE64TU6IU_js.a("text-xs text-red-600 dark:text-red-400",r==null?void 0:r.error,o),children:x}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-3",r==null?void 0:r.fields,o),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"custom-section-title",className:chunkE64TU6IU_js.a("block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",r==null?void 0:r.label,o),children:["Section Title ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.jsx("input",{id:"custom-section-title",type:"text",value:p,onChange:a=>{t(a.target.value),x&&h("");},placeholder:"e.g. Cookie Policy",className:chunkE64TU6IU_js.a(Cr,r==null?void 0:r.input,o),"aria-required":"true"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"custom-section-content",className:chunkE64TU6IU_js.a("block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",r==null?void 0:r.label,o),children:["Content ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"custom-section-content",value:i,onChange:a=>{v(a.target.value),x&&h("");},placeholder:"Write the section content here...",rows:5,className:chunkE64TU6IU_js.a(`${Cr} resize-y`,r==null?void 0:r.textarea,o),"aria-required":"true"})]})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("flex items-center gap-2",r==null?void 0:r.footer,o),children:jsxRuntime.jsx("button",{type:"button",onClick:c,className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",r==null?void 0:r.addButton,o),children:"Add Section"})})]})};var Sr={compliant:{bg:"bg-green-50 dark:bg-green-900/20",text:"text-green-700 dark:text-green-300",border:"border-green-200 dark:border-green-700"},nearly_compliant:{bg:"bg-amber-50 dark:bg-amber-900/20",text:"text-amber-700 dark:text-amber-300",border:"border-amber-200 dark:border-amber-700"},not_compliant:{bg:"bg-red-50 dark:bg-red-900/20",text:"text-red-700 dark:text-red-300",border:"border-red-200 dark:border-red-700"}},Qr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},N=({icon:n,label:d,description:r,actionLabel:o,loading:p,onClick:t,classNames:i,unstyled:v})=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,v),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center gap-3",i==null?void 0:i.formatHeader,v),children:[jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,v),"aria-hidden":"true",children:n}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100",i==null?void 0:i.formatLabel,v),children:d}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400",i==null?void 0:i.formatDescription,v),children:r})]})]}),jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:p,className:chunkE64TU6IU_js.a("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,v),children:p?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),"Generating\u2026"]}):o})]}),mr=({complianceResult:n,onExportPDF:d,onExportDOCX:r,onExportHTML:o,onExportMarkdown:p,classNames:t,unstyled:i})=>{var P;let[v,x]=Gr.useState(false),[h,c]=Gr.useState(false),a=(P=Sr[n.rating])!=null?P:Sr.not_compliant,g=()=>chunkMQFZHA2D_js.d(null,null,function*(){x(true);try{yield d();}finally{x(false);}}),u=()=>chunkMQFZHA2D_js.d(null,null,function*(){c(true);try{yield r();}finally{c(false);}});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-export-panel",className:chunkE64TU6IU_js.a("space-y-6",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`rounded-lg border p-4 flex items-center gap-4 ${a.bg} ${a.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`text-3xl font-bold ${a.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${n.percentage}%`,children:[n.percentage,"%"]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-sm font-semibold ${a.text}`,t==null?void 0:t.complianceRating,i),children:Qr[n.rating]}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.complianceDetail,i),children:[n.score," / ",n.maxScore," points \u2022"," ",n.gaps.length," gap",n.gaps.length!==1?"s":""," remaining"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100 mb-3",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-1 sm:grid-cols-2 gap-3",t==null?void 0:t.formatsGrid,i),children:[jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 7v-1h4v1h-4zm0-3v-1h4v1h-4zm-2-5h8v1H8v-1z"})}),label:"PDF",description:"Professional formatted document, ideal for publishing.",actionLabel:"Download PDF",loading:v,onClick:g,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-5 8v-5h1.5l1 3 1-3H13v5h-1v-3.5l-.75 2.25h-.5L10 13.5V17H9zm5-1.5h.75c.55 0 .75-.25.75-.75 0-.4-.2-.65-.75-.65H14V15.5zm1 1.5h-2v-4h2c1.1 0 1.75.6 1.75 1.5 0 .55-.25.95-.65 1.15.5.2.8.65.8 1.2 0 1-.65 1.65-1.9 1.65V17zm-.25-1c.6 0 .9-.25.9-.75 0-.45-.3-.75-.9-.75H14V16h.75z"})}),label:"DOCX",description:"Editable Word document for further customisation.",actionLabel:"Download DOCX",loading:h,onClick:u,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsxs("svg",{className:"w-5 h-5 text-orange-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15H9V8h2v9zm4 0h-2V8h2v9z"}),jsxRuntime.jsx("path",{d:"M9.5 6.5h1v1h-1zm4 0h1v1h-1z"}),jsxRuntime.jsx("path",{d:"M5 5h14v2H5zm0 12h14v2H5z"})]}),label:"HTML",description:"Copy-ready HTML to embed on your website.",actionLabel:"Copy HTML",onClick:o,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-gray-500 dark:text-gray-300",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:p,classNames:t,unstyled:i})]})]})]})};var Lr=({sections:n,customSections:d,sectionOverrides:r,complianceResult:o,onEditSection:p,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:v,onExportPDF:x,onExportDOCX:h,onExportHTML:c,onExportMarkdown:a,classNames:g,unstyled:u})=>{let[P,z]=Gr.useState(null),[Q,Y]=Gr.useState(false),Z=new Set(d.map(f=>f.id)),er=(f,L)=>{p(f,L),z(null);},or=n.length>0?Math.max(...n.map(f=>{var L;return (L=f.order)!=null?L:0}))+1:1;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-review",className:chunkE64TU6IU_js.a("space-y-6",g==null?void 0:g.root,u),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-semibold text-gray-900 dark:text-gray-100",g==null?void 0:g.heading,u),children:"Review & Export"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 mt-1",g==null?void 0:g.subheading,u),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",g==null?void 0:g.sectionList,u),children:n.map((f,L)=>jsxRuntime.jsx(kr,{section:r[f.id]?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},f),{template:r[f.id]}):f,index:L,isCustom:Z.has(f.id),isEditing:P===f.id,editedContent:r[f.id],onEdit:()=>z(f.id),onSaveEdit:ir=>er(f.id,ir),onCancelEdit:()=>z(null),onMoveUp:L>0?()=>v(f.id,"up"):void 0,onMoveDown:L<n.length-1?()=>v(f.id,"down"):void 0,onDelete:Z.has(f.id)?()=>i(f.id):void 0,classNames:g,unstyled:u},f.id))}),!Q&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>Y(true),className:chunkE64TU6IU_js.a("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",g==null?void 0:g.addSectionButton,u),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",g==null?void 0:g.addSectionIcon,u),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),Q&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-2",g==null?void 0:g.customFormWrapper,u),children:[jsxRuntime.jsx(wr,{onAdd:f=>{t(f),Y(false);},nextOrder:or,classNames:g,unstyled:u}),jsxRuntime.jsx("button",{type:"button",onClick:()=>Y(false),className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 hover:underline",g==null?void 0:g.cancelCustomForm,u),children:"Cancel"})]}),jsxRuntime.jsx("hr",{className:chunkE64TU6IU_js.a("border-gray-200 dark:border-gray-700",g==null?void 0:g.divider,u)}),jsxRuntime.jsx(mr,{complianceResult:o,onExportPDF:x,onExportDOCX:h,onExportHTML:c,onExportMarkdown:a,classNames:g,unstyled:u})]})};var Dr={compliant:{stroke:"stroke-green-500 dark:stroke-green-400",text:"text-green-600 dark:text-green-400"},nearly_compliant:{stroke:"stroke-amber-500 dark:stroke-amber-400",text:"text-amber-600 dark:text-amber-400"},not_compliant:{stroke:"stroke-red-500 dark:stroke-red-400",text:"text-red-600 dark:text-red-400"}},Nr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Er=({score:n,maxScore:d,rating:r,classNames:o,unstyled:p})=>{var c,a;let t=d>0?Math.round(n/d*100):0,i=(c=Dr[r])!=null?c:Dr.not_compliant,v=36,x=2*Math.PI*v,h=x-t/100*x;return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:chunkE64TU6IU_js.a("flex flex-col items-center gap-2",o==null?void 0:o.root,p),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("relative w-24 h-24",o==null?void 0:o.svgWrapper,p),children:[jsxRuntime.jsxs("svg",{className:"w-24 h-24 -rotate-90",viewBox:"0 0 96 96","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:v,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:v,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:x,strokeDashoffset:h,style:{transition:"stroke-dashoffset 0.5s ease-out"}})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("absolute inset-0 flex flex-col items-center justify-center",o==null?void 0:o.centerText,p),children:jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a(`text-xl font-bold leading-none ${i.text}`,o==null?void 0:o.scoreValue,p),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-xs font-semibold text-center ${i.text}`,o==null?void 0:o.ratingLabel,p),children:(a=Nr[r])!=null?a:r}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 text-center",o==null?void 0:o.scoreDetail,p),children:[n," / ",d," pts"]})]})};var rt={critical:"text-red-600 dark:text-red-400",important:"text-amber-600 dark:text-amber-400",recommended:"text-blue-600 dark:text-blue-400"},Fr=({gap:n,isPassed:d,onFix:r,classNames:o,unstyled:p})=>{let[t,i]=Gr.useState(false);return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:chunkE64TU6IU_js.a("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",o==null?void 0:o.root,p),children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!d&&i(v=>!v),className:chunkE64TU6IU_js.a("w-full flex items-start gap-2 text-left group",o==null?void 0:o.row,p),"aria-expanded":d?void 0:t,"aria-disabled":d,children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",d?"bg-green-500":n.severity==="critical"?"bg-red-500":n.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),o==null?void 0:o.statusIcon,p),"aria-hidden":"true",children:d?jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-1",children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-xs font-medium ${d?"text-gray-700 dark:text-gray-300":"text-gray-900 dark:text-gray-100"}`,o==null?void 0:o.requirementLabel,p),children:n.requirement}),!d&&jsxRuntime.jsx("svg",{className:`flex-shrink-0 w-3 h-3 text-gray-400 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-400 dark:text-gray-500 mt-0.5",o==null?void 0:o.ndpaSection,p),children:["NDPA ",n.ndpaSection]})]})]}),!d&&t&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-2 ml-6 space-y-2",o==null?void 0:o.detail,p),children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-xs ${rt[n.severity]}`,o==null?void 0:o.message,p),children:n.message}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{r(n.requirementId),i(false);},className:chunkE64TU6IU_js.a("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",o==null?void 0:o.fixButton,p),children:n.fixLabel})]})]})};function et(n,d){let r=d.map(t=>({gap:{requirementId:t,requirement:t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),ndpaSection:"\u2014",severity:"recommended",message:"",fixType:"fill_field",fixLabel:""},isPassed:true})),o=n.map(t=>({gap:t,isPassed:false})),p={critical:0,important:1,recommended:2};return o.sort((t,i)=>p[t.gap.severity]-p[i.gap.severity]),[...o,...r]}var Ar=({complianceResult:n,onFix:d,classNames:r,unstyled:o})=>{let[p,t]=Gr.useState(false),i=et(n.gaps,n.passed);return jsxRuntime.jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,o),"aria-label":"NDPA compliance checker",children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.title,o),children:"NDPA Compliance"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t(v=>!v),className:chunkE64TU6IU_js.a("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,o),"aria-expanded":!p,"aria-label":p?"Expand compliance checker":"Collapse compliance checker",children:jsxRuntime.jsx("svg",{className:`w-4 h-4 transition-transform ${p?"-rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!p&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 space-y-4",r==null?void 0:r.body,o),children:[jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("flex justify-center",r==null?void 0:r.ringWrapper,o),children:jsxRuntime.jsx(Er,{score:n.score,maxScore:n.maxScore,rating:n.rating,classNames:r,unstyled:o})}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("grid grid-cols-3 gap-2 text-center",r==null?void 0:r.statsRow,o),children:[{count:n.gaps.filter(v=>v.severity==="critical").length,label:"Critical",color:"text-red-600 dark:text-red-400"},{count:n.gaps.filter(v=>v.severity==="important").length,label:"Important",color:"text-amber-600 dark:text-amber-400"},{count:n.passed.length,label:"Passed",color:"text-green-600 dark:text-green-400"}].map(({count:v,label:x,color:h})=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-base font-bold ${h}`,r==null?void 0:r.statValue,o),children:v}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400",r==null?void 0:r.statLabel,o),children:x})]},x))}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,o),children:i.length===0?jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 text-center py-4",r==null?void 0:r.emptyState,o),children:"No requirements to display."}):i.map(({gap:v,isPassed:x})=>jsxRuntime.jsx(Fr,{gap:v,isPassed:x,onFix:d,classNames:r,unstyled:o},v.requirementId))})]})]})};function ot(n){let d=Date.now()-n;return d<1e4?"just now":d<6e4?`${Math.floor(d/1e3)}s ago`:d<36e5?`${Math.floor(d/6e4)}m ago`:new Date(n).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var Mr=({lastSavedAt:n,isSaving:d,hasError:r,classNames:o,unstyled:p})=>{let t="idle";if(d?t="saving":r?t="error":n!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${n?ot(n):""}`;return jsxRuntime.jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:chunkE64TU6IU_js.a(`flex items-center gap-1.5 ${t==="error"?"text-red-500 dark:text-red-400":t==="saving"?"text-gray-400 dark:text-gray-500":"text-green-600 dark:text-green-400"}`,o==null?void 0:o.root,p),children:[t==="saving"&&jsxRuntime.jsxs("svg",{className:"animate-spin w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),t==="saved"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),t==="error"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("text-xs font-medium",o==null?void 0:o.text,p),children:i})]})};var ce=({adapter:n,onComplete:d,classNames:r,unstyled:o})=>{let{currentStep:p,nextStep:t,prevStep:i,canProceed:v,context:x,updateOrg:h,updateContext:c,toggleDataCategory:a,togglePurpose:g,addProcessor:u,removeProcessor:P,sections:z,customSections:Q,sectionOverrides:Y,editSectionContent:Z,addCustomSection:er,removeCustomSection:or,reorderSections:f,complianceResult:L,applyFix:ir,handleExportPDF:Br,handleExportDOCX:Ir,handleExportHTML:zr,handleExportMarkdown:jr,lastSavedAt:Or,isLoading:_r}=chunkDQLDX5X6_js.e({adapter:n,onComplete:d}),nr=(D,J)=>{let H=URL.createObjectURL(D),q=document.createElement("a");q.href=H,q.download=J,q.click(),URL.revokeObjectURL(H);},Hr=()=>chunkMQFZHA2D_js.d(null,null,function*(){let D=yield Br();nr(D,"privacy-policy.pdf");}),qr=()=>chunkMQFZHA2D_js.d(null,null,function*(){let D=yield Ir();nr(D,"privacy-policy.docx");}),Wr=()=>{let D=zr();navigator.clipboard.writeText(D).catch(()=>{let J=new Blob([D],{type:"text/html"}),H=URL.createObjectURL(J),q=window.open(H,"_blank");q?q.addEventListener("load",()=>URL.revokeObjectURL(H)):URL.revokeObjectURL(H);});},$r=()=>{let D=jr();navigator.clipboard.writeText(D).catch(()=>{let J=new Blob([D],{type:"text/markdown"});nr(J,"privacy-policy.md");});};return _r?jsxRuntime.jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkE64TU6IU_js.a("flex items-center justify-center min-h-64 text-gray-400 dark:text-gray-500",r==null?void 0:r.root,o),"aria-busy":"true","aria-label":"Loading policy wizard",children:[jsxRuntime.jsxs("svg",{className:"animate-spin w-6 h-6 mr-2",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),jsxRuntime.jsx("span",{className:"text-sm",children:"Loading\u2026"})]}):jsxRuntime.jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkE64TU6IU_js.a("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,o),children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center justify-between mb-6",r==null?void 0:r.topBar,o),children:[jsxRuntime.jsx("h1",{className:chunkE64TU6IU_js.a("text-2xl font-bold text-gray-900 dark:text-gray-100",r==null?void 0:r.wizardTitle,o),children:"Privacy Policy Builder"}),jsxRuntime.jsx(Mr,{lastSavedAt:Or,isSaving:false,hasError:false,classNames:r,unstyled:o})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,o),children:jsxRuntime.jsx(ur,{currentStep:p,classNames:r,unstyled:o})}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,o),children:[jsxRuntime.jsxs("main",{className:chunkE64TU6IU_js.a("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,o),children:[p===1&&jsxRuntime.jsx(yr,{context:x,onUpdateOrg:h,classNames:r,unstyled:o}),p===2&&jsxRuntime.jsx(hr,{categories:x.dataCategories,onToggle:a,classNames:r,unstyled:o}),p===3&&jsxRuntime.jsx(lr,{context:x,onTogglePurpose:g,onUpdateContext:c,onAddProcessor:u,onRemoveProcessor:P,classNames:r,unstyled:o}),p===4&&jsxRuntime.jsx(Lr,{sections:z,customSections:Q,sectionOverrides:Y,complianceResult:L,onEditSection:Z,onAddCustomSection:er,onRemoveCustomSection:or,onReorderSection:f,onExportPDF:Hr,onExportDOCX:qr,onExportHTML:Wr,onExportMarkdown:$r,classNames:r,unstyled:o}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,o),children:[jsxRuntime.jsx("button",{type:"button",onClick:i,disabled:p===1,className:chunkE64TU6IU_js.a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors",r==null?void 0:r.backButton,o),children:"Back"}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a("text-xs text-gray-400 dark:text-gray-500",r==null?void 0:r.stepCounter,o),children:["Step ",p," of 4"]})}),p<4?jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:!v,className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,o),children:"Next"}):jsxRuntime.jsx("span",{})]})]}),jsxRuntime.jsx("aside",{className:chunkE64TU6IU_js.a("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,o),children:jsxRuntime.jsx(Ar,{complianceResult:L,onFix:ir,classNames:r,unstyled:o})})]})]})})};
2
+ exports.a=ce;//# sourceMappingURL=chunk-JZKH5RMC.js.map
3
+ //# sourceMappingURL=chunk-JZKH5RMC.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkSWF3YVE5_js=require('./chunk-SWF3YVE5.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function E({initialData:S,adapter:l,onRecordAdd:p,onRecordUpdate:g,onRecordArchive:f}){let d=react.useRef(l);d.current=l;let[s,u]=react.useState(S),[v,P]=react.useState(l!==void 0);react.useEffect(()=>{if(!d.current)return;let t=false;try{let e=d.current.load();e instanceof Promise?e.then(r=>{t||(r&&u(r),P(!1));},()=>{t||P(!1);}):(e&&u(e),P(!1));}catch(e){t||P(false);}return ()=>{t=true;}},[]);let n=react.useCallback(t=>{d.current&&Promise.resolve(d.current.save(t)).catch(e=>{console.warn("[ndpr-toolkit] Failed to save ROPA:",e);});},[]),C=react.useCallback(t=>{u(e=>{let r=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{records:[...e.records,t],lastUpdated:Date.now()});return n(r),r}),p==null||p(t);},[p,n]),w=react.useCallback((t,e)=>{u(r=>{let a=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},r),{records:r.records.map(R=>R.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},R),e),{updatedAt:Date.now()}):R),lastUpdated:Date.now()});return n(a),a}),g==null||g(t,e);},[g,n]),x=react.useCallback(t=>{u(e=>{let r=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{records:e.records.map(a=>a.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{status:"archived",updatedAt:Date.now()}):a),lastUpdated:Date.now()});return n(r),r}),f==null||f(t);},[f,n]),D=react.useCallback(t=>s.records.find(e=>e.id===t),[s.records]),G=react.useCallback(()=>chunkSWF3YVE5_js.b(s),[s]),b=react.useCallback(()=>chunkSWF3YVE5_js.c(s),[s]),L=react.useCallback(()=>chunkSWF3YVE5_js.d(s),[s]);return {ropa:s,addRecord:C,updateRecord:w,archiveRecord:x,getRecord:D,getSummary:G,exportCSV:b,getComplianceGaps:L,isLoading:v}}exports.a=E;//# sourceMappingURL=chunk-KHRBU5K7.js.map
2
+ //# sourceMappingURL=chunk-KHRBU5K7.js.map
@@ -0,0 +1,2 @@
1
+ import {a as a$1}from'./chunk-RGYK4VAY.mjs';import {a as a$2}from'./chunk-SBNAMPAP.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect}from'react';function K(q,h){return h?a$2(q):{load:()=>null,save:()=>{},remove:()=>{}}}function W({categories:q,initialReports:h=[],adapter:g,storageKey:L="ndpr_breach_data",useLocalStorage:P=true,onReport:v,onAssessment:S,onNotification:I}){let D=g!=null?g:K(L,P),d=useRef(D);d.current=D;let[a$2,m]=useState(h),[u,A]=useState([]),[c,B]=useState([]),[U,N]=useState(true);useEffect(()=>{let e=false;try{let s=d.current.load(),r=t=>{var i,n,l;t&&(m((i=t.reports)!=null?i:[]),A((n=t.assessments)!=null?n:[]),B((l=t.notifications)!=null?l:[])),N(!1);};s instanceof Promise?s.then(t=>{e||r(t);},()=>{e||N(!1);}):r(s);}catch(s){e||N(false);}return ()=>{e=true;}},[]);let f=(e,s,r)=>{Promise.resolve(d.current.save({reports:e,assessments:s,notifications:r})).catch(t=>{console.warn("[ndpr-toolkit] Failed to save breach data:",t);});},y=e=>`${e}_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,_=e=>{let s=a({id:y("breach"),reportedAt:Date.now()},e),r=[...a$2,s];return m(r),f(r,u,c),v&&v(s),s},$=(e,s)=>{let r=a$2.findIndex(n=>n.id===e);if(r===-1)return null;let t=a(a({},a$2[r]),s),i=[...a$2];return i[r]=t,m(i),f(i,u,c),t},w=e=>a$2.find(s=>s.id===e)||null,j=(e,s)=>{let r=u.find(n=>n.breachId===e),t,i;return r?(i=b(a(a({},r),s),{assessedAt:Date.now()}),t=u.map(n=>n.id===r.id?i:n)):(i=a({id:y("assessment"),breachId:e,assessedAt:Date.now()},s),t=[...u,i]),A(t),f(a$2,t,c),S&&S(i),i},b$1=e=>u.find(s=>s.breachId===e)||null,x=e=>{let s=w(e),r=b$1(e);if(!s)return null;let{severityLevel:t,notificationRequired:i,timeframeHours:n,justification:l}=a$1(s,r||void 0),R=s.discoveredAt+n*60*60*1e3;return {ndpcNotificationRequired:i,ndpcNotificationDeadline:R,dataSubjectNotificationRequired:t==="high"||t==="critical",justification:l}};return {reports:a$2,assessments:u,notifications:c,reportBreach:_,updateReport:$,getReport:w,assessRisk:j,getAssessment:b$1,calculateNotificationRequirements:x,sendNotification:(e,s)=>{let r=c.find(n=>n.breachId===e),t,i;return r?(i=b(a(a({},r),s),{sentAt:Date.now()}),t=c.map(n=>n.id===r.id?i:n)):(i=a({id:y("notification"),breachId:e,sentAt:Date.now()},s),t=[...c,i]),B(t),f(a$2,u,t),I&&I(i),i},getNotification:e=>c.find(s=>s.breachId===e)||null,getBreachesRequiringNotification:(e=24)=>{let s=Date.now(),r=[];return a$2.forEach(t=>{if(c.some(E=>E.breachId===t.id))return;let i=b$1(t.id);if(!i)return;let n=x(t.id);if(!n||!n.ndpcNotificationRequired)return;let R=(n.ndpcNotificationDeadline-s)/(3600*1e3);R<=e&&r.push({report:t,assessment:i,requirements:n,hoursRemaining:R});}),r.sort((t,i)=>t.hoursRemaining-i.hoursRemaining)},clearBreachData:()=>{m([]),A([]),B([]),Promise.resolve(d.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove breach data:",e);});},isLoading:U}}export{W as a};//# sourceMappingURL=chunk-LFNA6WYQ.mjs.map
2
+ //# sourceMappingURL=chunk-LFNA6WYQ.mjs.map
@@ -0,0 +1,144 @@
1
+ 'use strict';var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js');var f=[{id:"full-name",label:"Full Name",group:"identity",dataPoints:["first name","last name","middle name","title"],selected:false},{id:"contact-details",label:"Contact Details",group:"identity",dataPoints:["email address","phone number","postal address"],selected:false},{id:"government-ids",label:"Government-Issued Identifiers",group:"identity",dataPoints:["NIN","passport number","driver's licence number","voter's card number"],selected:false},{id:"account-credentials",label:"Account Credentials",group:"identity",dataPoints:["username","hashed password","security questions"],selected:false},{id:"payment-info",label:"Payment Information",group:"financial",dataPoints:["credit/debit card number","bank account number","billing address"],selected:false},{id:"financial-records",label:"Financial Records",group:"financial",dataPoints:["transaction history","account balance","income details"],selected:false},{id:"bvn",label:"Bank Verification Number (BVN)",group:"financial",dataPoints:["BVN"],selected:false},{id:"device-info",label:"Device & Browser Information",group:"behavioral",dataPoints:["IP address","browser type","operating system","device identifiers"],selected:false},{id:"usage-data",label:"Usage & Analytics Data",group:"behavioral",dataPoints:["pages visited","click patterns","session duration","referral source"],selected:false},{id:"location-data",label:"Location Data",group:"behavioral",dataPoints:["GPS coordinates","city","country","timezone"],selected:false},{id:"cookies",label:"Cookies & Tracking Technologies",group:"behavioral",dataPoints:["cookie identifiers","pixel tags","local storage data"],selected:false},{id:"health-data",label:"Health & Medical Data",group:"sensitive",dataPoints:["medical history","prescriptions","health insurance details","disability status"],selected:false},{id:"biometric-data",label:"Biometric Data",group:"sensitive",dataPoints:["fingerprints","facial recognition data","voiceprints"],selected:false},{id:"ethnic-religious",label:"Ethnic Origin & Religious Beliefs",group:"sensitive",dataPoints:["ethnic origin","religious affiliation","political opinions"],selected:false},{id:"child-identity",label:"Child Identity Information",group:"children",dataPoints:["child's name","date of birth","school name","parent/guardian contact"],selected:false},{id:"child-activity",label:"Child Online Activity",group:"children",dataPoints:["content viewed","in-app activity","communications"],selected:false}];function R(){return {org:{name:"",website:"",privacyEmail:"",address:"",dpoName:"",dpoEmail:"",industry:"other",orgSize:"startup",country:"Nigeria"},dataCategories:f.map(e=>chunkMQFZHA2D_js.a({},e)),purposes:[],hasChildrenData:false,hasSensitiveData:false,hasFinancialData:false,hasCrossBorderTransfer:false,hasAutomatedDecisions:false,thirdPartyProcessors:[]}}function u(e,t){return e.sections.some(i=>i.id===t&&i.included)}function h(e,t){var n;let i=e.sections.find(a=>a.id===t&&a.included);return (n=i==null?void 0:i.template)!=null?n:""}function g(e){return e.sections.filter(t=>t.included).map(t=>t.template).join(`
2
+ `)}var m=[{id:"controller-identity",name:"Controller Identity",ndpaSection:"NDPA Section 24(1)(a)",severity:"critical",points:10,check:e=>{var t,i;return ((t=e.organizationInfo.name)!=null?t:"").trim().length>0&&((i=e.organizationInfo.privacyEmail)!=null?i:"").trim().length>0},gap:()=>({message:"The policy does not identify the data controller. The organisation name and contact email must be provided so data subjects know who is responsible for their data.",fixType:"fill_field",fixLabel:"Add organisation details",suggestedContent:"Provide your organisation's registered name and a valid privacy contact email address in the Organisation Info section."})},{id:"purpose-of-processing",name:"Purpose of Processing",ndpaSection:"NDPA Section 24(1)(b)",severity:"critical",points:10,check:(e,t)=>t.purposes.length>0,gap:()=>({message:"No processing purposes have been selected. The NDPA requires you to clearly state the specific purposes for which personal data is collected and processed.",fixType:"fill_field",fixLabel:"Select processing purposes",suggestedContent:"Select at least one processing purpose (e.g. service delivery, analytics, marketing) in the wizard."})},{id:"lawful-basis",name:"Lawful Basis Identified",ndpaSection:"NDPA Section 25",severity:"critical",points:10,check:e=>u(e,"legal-basis"),gap:()=>({message:"The policy does not include a section identifying the lawful basis for processing. Under the NDPA, every processing activity must be grounded in a lawful basis such as consent, contract, or legitimate interest.",fixType:"add_section",fixLabel:"Add legal basis section",suggestedContent:`We process personal data under one or more of the following lawful bases as prescribed by the NDPA 2023:
3
+
4
+ - Consent: where you have given clear, informed, and voluntary consent.
5
+ - Contract: where processing is necessary for the performance of a contract.
6
+ - Legal Obligation: where processing is required by Nigerian law.
7
+ - Legitimate Interest: where processing is necessary for our legitimate interests, provided they do not override your rights.`})},{id:"data-categories-disclosed",name:"Data Categories Disclosed",ndpaSection:"NDPA Section 24(1)(c)",severity:"critical",points:10,check:(e,t)=>t.dataCategories.some(i=>i.selected),gap:()=>({message:"No data categories have been selected. The NDPA requires you to disclose the categories of personal data you collect (e.g. identity, financial, behavioral data).",fixType:"fill_field",fixLabel:"Select data categories",suggestedContent:"Select the categories of personal data your organisation collects in the Data Collection step of the wizard."})},{id:"recipients-disclosed",name:"Recipients Disclosed",ndpaSection:"NDPA Section 24(1)(e)",severity:"critical",points:10,check:(e,t)=>{if(!u(e,"data-sharing"))return false;if(t.thirdPartyProcessors.length>0){let i=h(e,"data-sharing");return t.thirdPartyProcessors.every(n=>i.includes(n.name))}return true},gap:e=>({message:e.thirdPartyProcessors.length>0?"The data sharing section does not list all third-party processors. Each processor must be named with its purpose and location.":"The policy does not include a data sharing section. Even if you do not share data, you must state this clearly.",fixType:e.thirdPartyProcessors.length>0?"add_content":"add_section",fixLabel:e.thirdPartyProcessors.length>0?"Update sharing section":"Add data sharing section",suggestedContent:"We do not sell personal data. We may share your data with service providers under strict data processing agreements that comply with the NDPA 2023."})},{id:"retention-periods",name:"Retention Periods Specified",ndpaSection:"NDPA Section 24(1)(f)",severity:"critical",points:10,check:e=>u(e,"data-retention"),gap:()=>({message:"The policy does not include a data retention section. The NDPA requires you to specify the period for which personal data will be stored, or the criteria used to determine that period.",fixType:"add_section",fixLabel:"Add retention schedule",suggestedContent:"We retain personal data only for as long as necessary to fulfil the purposes for which it was collected, or as required by applicable Nigerian law. When personal data is no longer needed, it is securely deleted or anonymised."})},{id:"data-subject-rights",name:"Data Subject Rights Listed",ndpaSection:"NDPA Sections 34-39",severity:"important",points:7,check:e=>{if(!u(e,"data-subject-rights"))return false;let t=h(e,"data-subject-rights").toLowerCase();return ["access","rectification","erasure","portability","restrict","object"].every(n=>t.includes(n))},gap:()=>({message:"The data subject rights section is missing or does not cover all six NDPA rights: access, rectification, erasure, portability, restriction, and objection.",fixType:"add_content",fixLabel:"Add missing rights",suggestedContent:`Under the NDPA 2023, you have the following rights:
8
+ 1. Right of Access (Section 34)
9
+ 2. Right to Rectification (Section 35)
10
+ 3. Right to Erasure (Section 36)
11
+ 4. Right to Restrict Processing (Section 37)
12
+ 5. Right to Data Portability (Section 38)
13
+ 6. Right to Object (Section 37)`})},{id:"right-to-withdraw-consent",name:"Right to Withdraw Consent",ndpaSection:"NDPA Section 25(2)",severity:"important",points:7,check:e=>{let t=g(e).toLowerCase();return t.includes("withdraw")&&t.includes("consent")},gap:()=>({message:"The policy does not mention the right to withdraw consent. Data subjects must be informed that they can withdraw consent at any time without affecting the lawfulness of prior processing.",fixType:"add_content",fixLabel:"Add withdrawal clause",suggestedContent:"You have the right to withdraw your consent at any time, without affecting the lawfulness of processing carried out prior to withdrawal. To withdraw your consent, contact us at the email address provided in this policy."})},{id:"right-to-lodge-complaint",name:"Right to Lodge Complaint with NDPC",ndpaSection:"NDPA Section 40",severity:"important",points:7,check:e=>{let t=g(e).toLowerCase();return t.includes("ndpc")||t.includes("nigeria data protection commission")},gap:()=>({message:"The policy does not mention the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC). Data subjects must be informed of this right.",fixType:"add_content",fixLabel:"Add NDPC complaint reference",suggestedContent:"You have the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC) if you believe your data protection rights have been infringed. Website: https://ndpc.gov.ng"})},{id:"cross-border-safeguards",name:"Cross-Border Transfer Safeguards",ndpaSection:"NDPA Sections 43-44",severity:"important",points:7,check:(e,t)=>t.hasCrossBorderTransfer?u(e,"cross-border-transfers"):true,gap:()=>({message:"Cross-border data transfers are indicated but the policy lacks a section describing the safeguards in place. The NDPA requires disclosure of transfer mechanisms and adequacy assessments.",fixType:"add_section",fixLabel:"Add cross-border section",suggestedContent:"Where we transfer personal data outside Nigeria, we ensure compliance with Sections 43 and 44 of the NDPA 2023 by implementing appropriate safeguards, including adequacy assessments and Standard Contractual Clauses."})},{id:"automated-decision-disclosure",name:"Automated Decision-Making Disclosure",ndpaSection:"NDPA Section 39",severity:"important",points:7,check:(e,t)=>t.hasAutomatedDecisions?u(e,"automated-decision-making"):true,gap:()=>({message:"Automated decision-making is indicated but the policy does not include a section disclosing this. The NDPA requires you to inform data subjects about automated decisions, including the logic involved and the right to human intervention.",fixType:"add_section",fixLabel:"Add automated decisions section",suggestedContent:"We use automated decision-making in certain processes. You have the right to request human intervention, express your point of view, and contest automated decisions, in accordance with Section 39 of the NDPA 2023."})},{id:"children-data-protection",name:"Children's Data Protection",ndpaSection:"NDPA Section 31",severity:"recommended",points:5,check:(e,t)=>t.hasChildrenData?u(e,"children-data-protection"):true,gap:()=>({message:"Children's data processing is indicated but the policy does not include a dedicated children's data protection section. The NDPA requires enhanced protections including parental consent for children under 13.",fixType:"add_section",fixLabel:"Add children's data section",suggestedContent:"We do not knowingly collect personal data from children under the age of 13 without verifiable parental or guardian consent. Parents and guardians may request access to, correction of, or deletion of their child's data at any time."})},{id:"dpo-contact-info",name:"DPO Contact Information",ndpaSection:"NDPA Section 30",severity:"recommended",points:5,check:e=>{var t,i;return ((t=e.organizationInfo.dpoName)!=null?t:"").trim().length>0&&((i=e.organizationInfo.dpoEmail)!=null?i:"").trim().length>0},gap:()=>({message:"The Data Protection Officer (DPO) contact information is not provided. While not always mandatory, appointing a DPO and publishing their contact details is strongly recommended under the NDPA.",fixType:"fill_field",fixLabel:"Add DPO details",suggestedContent:"Provide the full name and email address of your Data Protection Officer in the Organisation Info section."})},{id:"security-measures",name:"Security Measures Described",ndpaSection:"NDPA Section 28",severity:"recommended",points:5,check:e=>u(e,"data-security"),gap:()=>({message:"The policy does not describe the technical and organisational security measures in place to protect personal data. Describing these measures builds trust and demonstrates NDPA compliance.",fixType:"add_section",fixLabel:"Add security section",suggestedContent:"We implement appropriate technical and organisational measures to protect personal data, including encryption in transit and at rest, access controls, regular security assessments, and incident response procedures aligned with NDPA breach notification requirements."})},{id:"policy-effective-date",name:"Policy Effective Date",ndpaSection:"NDPA Section 24",severity:"recommended",points:5,check:e=>e.effectiveDate>0,gap:()=>({message:"The policy does not have an effective date set. An effective date is important for version control and for data subjects to know when the policy was last updated.",fixType:"fill_field",fixLabel:"Set effective date",suggestedContent:"Set the policy's effective date to the date you intend to publish it."})}];function L(e,t){let i=m.reduce((r,l)=>r+l.points,0),n=0,a=[],o=[];for(let r of m)if(r.check(e,t))n+=r.points,o.push(r.id);else {let l=r.gap(t);a.push(chunkMQFZHA2D_js.a({requirementId:r.id,requirement:r.name,ndpaSection:r.ndpaSection,severity:r.severity},l));}let c=Math.round(n/i*100),d;return n>=100?d="compliant":n>=80?d="nearly_compliant":d="not_compliant",{score:n,maxScore:i,percentage:c,rating:d,gaps:a,passed:o}}function s(e,t,i,n,a){return {id:e,title:t,template:i,order:n,required:a,included:true}}function y(e){return e.filter(t=>t.selected)}function b(e){return {service_delivery:"Service Delivery \u2014 to provide, maintain, and improve the services you have requested from us",marketing:"Marketing \u2014 to send promotional communications where you have opted in to receive them",analytics:"Analytics \u2014 to analyse usage patterns and improve user experience",research:"Research \u2014 to conduct research and development for service improvement",legal_compliance:"Legal Compliance \u2014 to meet our obligations under Nigerian law, including the NDPA 2023",fraud_prevention:"Fraud Prevention \u2014 to detect, prevent, and respond to fraud, security threats, and abuse"}[e]}function v(e,t){let i=e.org.name||"[Organisation Name]",n=e.org.website||"[website]",a=new Date().toISOString().slice(0,10);return s("introduction","Introduction & Scope",`This Privacy Policy explains how ${i} ("we", "us", or "our") collects, uses, stores, and protects personal data when you use our services and visit our website at ${n}. This policy is issued in compliance with the Nigeria Data Protection Act (NDPA) 2023 and the Nigeria Data Protection Regulation (NDPR). It applies to all personal data processed by ${i}, whether collected online or offline.
14
+
15
+ Effective Date: ${a}.
16
+
17
+ We are committed to protecting your privacy and ensuring that your personal data is handled responsibly and in accordance with applicable data protection legislation.`,t,true)}function P(e,t){let i=e.org.name||"[Organisation Name]",n=y(e.dataCategories),a={identity:"Identity & Contact Information",financial:"Financial Information",behavioral:"Technical & Behavioral Data",sensitive:"Sensitive / Special-Category Data",children:"Children's Data"},o="",c=["identity","financial","behavioral","sensitive","children"];for(let d of c){let r=n.filter(l=>l.group===d);if(r.length>0){o+=`
18
+ ${a[d]}:
19
+ `;for(let l of r)o+=`- ${l.label}: ${l.dataPoints.join(", ")}.
20
+ `;}}return o===""&&(o=`
21
+ - Personal data categories have not yet been specified.
22
+ `),s("data-collection","Data We Collect",`${i} collects the following categories of personal data in the course of providing our services. Data may be collected directly from you (e.g. through forms, account registration, or correspondence) or automatically (e.g. through cookies, server logs, and similar technologies).
23
+ `+o+`
24
+ We only collect personal data that is adequate, relevant, and limited to what is necessary for the purposes described in this policy, in accordance with the NDPA 2023.`,t,true)}function w(e,t){let i=e.org.name||"[Organisation Name]",n=[];return (e.purposes.includes("service_delivery")||e.purposes.length===0)&&(n.push("- Consent: where you have given clear, informed, and voluntary consent for specific processing activities (NDPA Section 25)."),n.push("- Contract: where processing is necessary for the performance of a contract to which you are a party, or to take pre-contractual steps at your request (NDPA Section 25).")),e.purposes.includes("legal_compliance")&&n.push("- Legal Obligation: where processing is required for compliance with a legal obligation to which we are subject under Nigerian law."),e.purposes.includes("fraud_prevention")&&n.push("- Legitimate Interest: where processing is necessary for our legitimate interests (such as fraud prevention and network security), provided those interests are not overridden by your rights and freedoms (NDPA Section 25)."),e.purposes.includes("research")&&n.push("- Public Interest / Research: where processing is necessary for scientific or historical research purposes, or statistical purposes, subject to appropriate safeguards."),n.length===0&&(n.push("- Consent: where you have given clear, informed, and voluntary consent for specific processing activities (NDPA Section 25)."),n.push("- Contract: where processing is necessary for the performance of a contract to which you are a party (NDPA Section 25).")),s("legal-basis","Legal Basis for Processing",`${i} processes personal data under one or more of the following lawful bases as prescribed by the Nigeria Data Protection Act (NDPA) 2023:
25
+
26
+ `+n.join(`
27
+ `)+`
28
+
29
+ We will always inform you of the specific legal basis applicable to each processing activity at the time of data collection.`,t,true)}function D(e,t){let n=(e.purposes.length>0?e.purposes:["service_delivery"]).map(a=>`- ${b(a)}`).join(`
30
+ `);return s("data-usage","How We Use Your Data",`We process the personal data we collect for the following purposes:
31
+
32
+ `+n+`
33
+
34
+ We will not process your personal data for purposes incompatible with those stated above without providing you with prior notice and, where required by the NDPA, obtaining your consent.`,t,true)}function C(e,t){let i=e.org.name||"[Organisation Name]",n=e.thirdPartyProcessors,a;return n.length>0?a=`We share personal data with the following third-party processors under data processing agreements that comply with the NDPA 2023:
35
+
36
+ | Processor | Purpose | Country |
37
+ | --- | --- | --- |
38
+ `+n.map(c=>`| ${c.name} | ${c.purpose} | ${c.country} |`).join(`
39
+ `)+`
40
+
41
+ All processors are contractually required to implement appropriate technical and organisational measures to protect personal data.`:a="We do not currently share your personal data with third-party processors. Should this change, we will update this policy and, where required, obtain your consent before any sharing takes place.",s("data-sharing","Data Sharing & Disclosure",`${i} does not sell personal data under any circumstances.
42
+
43
+ `+a+`
44
+
45
+ We may also disclose personal data where required by law, regulation, or valid legal process, including requests from Nigerian regulatory and law enforcement authorities.`,t,true)}function S(e,t){let i=e.org.privacyEmail||"[privacy email]";return s("data-subject-rights","Your Rights as a Data Subject",`Under the Nigeria Data Protection Act (NDPA) 2023, you are entitled to the following rights regarding your personal data:
46
+
47
+ 1. Right of Access \u2014 You may request confirmation of whether we process your personal data and obtain a copy of that data (NDPA Section 34).
48
+ 2. Right to Rectification \u2014 You may request correction of inaccurate or incomplete personal data we hold about you (NDPA Section 35).
49
+ 3. Right to Erasure \u2014 You may request deletion of your personal data where there is no compelling legal reason for its continued processing (NDPA Section 36).
50
+ 4. Right to Data Portability \u2014 You may request to receive your personal data in a structured, commonly used, and machine-readable format (NDPA Section 38).
51
+ 5. Right to Restrict Processing \u2014 You may request that we limit the processing of your personal data in certain circumstances (NDPA Section 37).
52
+ 6. Right to Object \u2014 You may object to the processing of your personal data where processing is based on legitimate interest or is carried out for direct marketing purposes (NDPA Section 37).
53
+
54
+ You also have the right to withdraw your consent at any time, without affecting the lawfulness of processing carried out prior to withdrawal.
55
+
56
+ To exercise any of these rights, please contact us at ${i}. We will respond to your request within 30 days, as required by the NDPA. If you are unsatisfied with our response, you have the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC).`,t,true)}function N(e,t){let i=e.org.privacyEmail||"[privacy email]",n=e.org.industry,a="";return n==="fintech"?a=`
57
+ - Compliance with Payment Card Industry Data Security Standard (PCI-DSS) for cardholder data protection.
58
+ - End-to-end encryption of financial transactions.
59
+ - Multi-factor authentication for account access.`:n==="healthcare"?a=`
60
+ - HIPAA-aligned safeguards for health information, including access controls and audit logging.
61
+ - Segregation of medical data from other personal data.
62
+ - Role-based access controls restricting health data to authorised personnel.`:n==="ecommerce"?a=`
63
+ - PCI-DSS compliant payment processing.
64
+ - Secure checkout and tokenisation of payment credentials.`:n==="government"&&(a=`
65
+ - Compliance with Nigeria's Cybercrimes Act 2015 requirements.
66
+ - Government-grade access controls and audit trails.`),s("data-security","Data Security Measures",`We implement appropriate technical and organisational measures to protect personal data against unauthorised access, alteration, disclosure, or destruction. These measures include:
67
+
68
+ - Encryption of personal data in transit (TLS 1.2+) and at rest (AES-256).
69
+ - Access controls and least-privilege principles for all systems handling personal data.
70
+ - Regular security assessments, penetration testing, and vulnerability scanning.
71
+ - Staff training on data protection obligations and information security best practices.
72
+ - Incident response procedures aligned with NDPA breach notification requirements (72-hour notification to NDPC).`+a+`
73
+
74
+ While we employ industry-standard safeguards, no method of electronic transmission or storage is entirely secure. If you become aware of any security incident affecting your data, please contact us immediately at ${i}.`,t,true)}function A(e,t){let i=e.org.name||"[Organisation Name]",n=e.org.address||"[Address]",a=e.org.privacyEmail||"[privacy email]",o=e.org.website||"[website]",c=e.org.dpoName||"[DPO Name]",d=e.org.dpoEmail||"[DPO Email]";return s("contact-info","Contact Information",`If you have questions, concerns, or requests regarding this privacy policy or our data protection practices, please contact us:
75
+
76
+ Organisation: ${i}
77
+ Address: ${n}
78
+ Email: ${a}
79
+ Website: ${o}
80
+
81
+ Data Protection Officer: ${c}
82
+ DPO Email: ${d}
83
+
84
+ You also have the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC) if you believe your data protection rights have been infringed.
85
+
86
+ Nigeria Data Protection Commission
87
+ Website: https://ndpc.gov.ng
88
+ Email: info@ndpc.gov.ng`,t,true)}function T(e){return s("children-data-protection","Children's Data Protection",`We recognise the importance of protecting the privacy of children. In accordance with Section 31 of the NDPA 2023, we implement the following safeguards when processing children's personal data:
89
+
90
+ - We do not knowingly collect personal data from children under the age of 13 without verifiable parental or guardian consent.
91
+ - Where we process data of children between the ages of 13 and 17, we obtain consent from a parent or guardian, taking into account the child's age and maturity.
92
+ - Parents and guardians may request access to, correction of, or deletion of their child's personal data at any time by contacting us.
93
+ - We limit the collection of children's data to what is strictly necessary for the service provided and do not use it for marketing or profiling.
94
+ - A Data Protection Impact Assessment (DPIA) is conducted before any new processing activity involving children's data.
95
+
96
+ If we discover that we have inadvertently collected personal data from a child without appropriate consent, we will delete that data promptly.`,e,true)}function x(e){return s("sensitive-data-processing","Sensitive / Special-Category Data",`Certain categories of personal data are considered sensitive under the NDPA 2023 and require additional safeguards. Sensitive data includes information relating to health, biometric identifiers, ethnic origin, religious or political beliefs, and genetic data.
97
+
98
+ We process sensitive personal data only where:
99
+
100
+ - You have given explicit consent for the specific processing purpose.
101
+ - Processing is necessary to protect your vital interests or those of another person.
102
+ - Processing is required for the establishment, exercise, or defence of legal claims.
103
+ - Processing is necessary for reasons of substantial public interest under Nigerian law.
104
+
105
+ Enhanced security measures are applied to all sensitive data, including additional encryption, strict access controls, and enhanced audit logging. Sensitive data is stored separately from other personal data where technically feasible.`,e,true)}function k(e,t){let i=e.thirdPartyProcessors.filter(a=>a.country.toLowerCase()!=="nigeria"),n="";return i.length>0&&(n=`
106
+
107
+ We currently transfer personal data to the following jurisdictions: ${[...new Set(i.map(o=>o.country))].join(", ")}. Each transfer is subject to the safeguards described above.`),s("cross-border-transfers","Cross-Border Data Transfers",`Where we transfer personal data outside Nigeria, we do so in strict compliance with Sections 43 and 44 of the NDPA 2023. We ensure that any cross-border transfer of personal data is subject to one or more of the following safeguards:
108
+
109
+ - The receiving country has been assessed by the NDPC as providing an adequate level of data protection.
110
+ - We have put in place appropriate contractual safeguards, such as Standard Contractual Clauses approved by the NDPC.
111
+ - You have provided explicit consent to the transfer after being informed of the associated risks.
112
+ - The transfer is necessary for the performance of a contract between you and us, or for pre-contractual steps taken at your request.
113
+ - The NDPC has granted an administrative authorisation for the transfer.`+n,t,true)}function q(e){return s("automated-decision-making","Automated Decision-Making & Profiling",`In accordance with Section 39 of the NDPA 2023, we inform you of any automated decision-making processes, including profiling, that produce legal effects or similarly significant effects on you.
114
+
115
+ Where we use automated decision-making:
116
+
117
+ - We will inform you that automated processing is being used and provide meaningful information about the logic involved.
118
+ - You have the right to request human intervention in any automated decision.
119
+ - You have the right to express your point of view and contest the decision.
120
+ - We will carry out regular reviews of automated decision-making systems to ensure fairness, accuracy, and absence of bias.
121
+ - We will not base automated decisions solely on sensitive personal data unless you have given explicit consent or the processing is authorised by Nigerian law.
122
+
123
+ You may object to automated decision-making at any time by contacting us using the details provided in this policy.`,e,true)}function I(e,t){let i=e.org.name||"[Organisation Name]",n=e.org.industry,a="";return n==="fintech"?a=`
124
+
125
+ Financial transaction records are retained for a minimum of six (6) years in compliance with the Central Bank of Nigeria (CBN) guidelines and the Money Laundering (Prevention and Prohibition) Act.`:n==="healthcare"?a=`
126
+
127
+ Medical and health records are retained for a minimum of ten (10) years after the last date of treatment, or longer where required by applicable health regulations.`:n==="ecommerce"?a=`
128
+
129
+ Order and transaction records are retained for six (6) years in accordance with Nigerian tax and commercial law requirements.`:n==="education"&&(a=`
130
+
131
+ Student academic records may be retained indefinitely for verification purposes. Other personal data is retained only for the duration of enrolment plus five (5) years.`),s("data-retention","Data Retention Schedule",`${i} retains personal data only for as long as necessary to fulfil the purposes for which it was collected, or as required by applicable Nigerian law. Our retention periods are determined based on the following criteria:
132
+
133
+ - The nature and sensitivity of the personal data.
134
+ - The purposes for which the data is processed.
135
+ - Legal, regulatory, and contractual obligations (including NDPA 2023 requirements).
136
+ - Legitimate business needs such as maintaining records for audits, dispute resolution, and regulatory examinations.
137
+
138
+ General retention periods:
139
+ - Account data: retained for the duration of your relationship with us, plus three (3) years.
140
+ - Communication records: retained for two (2) years from the date of correspondence.
141
+ - Analytics and usage data: retained in identifiable form for twelve (12) months, then aggregated or anonymised.`+a+`
142
+
143
+ When personal data is no longer required, it is securely deleted or irreversibly anonymised in accordance with our internal data retention and disposal policy.`,t,true)}function j(e){let t=1,i=[];return i.push(v(e,t++)),i.push(P(e,t++)),i.push(w(e,t++)),i.push(D(e,t++)),i.push(C(e,t++)),i.push(S(e,t++)),i.push(N(e,t++)),i.push(A(e,t++)),e.hasChildrenData&&i.push(T(t++)),e.hasSensitiveData&&i.push(x(t++)),e.hasCrossBorderTransfer&&i.push(k(e,t++)),e.hasAutomatedDecisions&&i.push(q(t++)),i.push(I(e,t++)),i}exports.a=f;exports.b=R;exports.c=L;exports.d=j;//# sourceMappingURL=chunk-LU4PFST7.js.map
144
+ //# sourceMappingURL=chunk-LU4PFST7.js.map
@@ -0,0 +1,7 @@
1
+ import {a}from'./chunk-AYKLAEOU.mjs';import {jsxs,jsx}from'react/jsx-runtime';import D from'react';var S=({result:r,sections:m,showFullReport:p=true,allowPrint:x=true,allowExport:y=true,onExport:v,className:u="",buttonClassName:b="",classNames:k={},unstyled:N=false})=>{let i=(a$1,s)=>{let d=s?k[s]:void 0;return !d&&s==="printButton"&&(d=k.primaryButton),a(a$1,d,N)},g=a=>new Date(a).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),l=a=>{let s=r.answers[a];return s==null?"Not answered":typeof s=="boolean"?s?"Yes":"No":Array.isArray(s)?s.join(", "):String(s)},w=()=>{window.print();},C=a=>{v&&v(a);},h=a=>jsx("span",{className:i(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[a]}`,"riskBadge"),children:a.charAt(0).toUpperCase()+a.slice(1)});return jsxs("div",{className:`${i("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 print:shadow-none print:p-0","root")} ${u}`,children:[jsxs("div",{className:i("mb-8 border-b border-gray-200 dark:border-gray-700 pb-6 print:pb-4","header"),children:[jsxs("div",{className:"flex justify-between items-start",children:[jsxs("div",{children:[jsx("h1",{className:i("text-2xl font-bold text-gray-900 dark:text-white mb-2","title"),children:"Data Protection Impact Assessment Report"}),jsx("h2",{className:"text-xl text-gray-700 dark:text-gray-300 mb-4",children:r.title})]}),(x||y)&&jsxs("div",{className:"flex space-x-2 print:hidden",children:[x&&jsx("button",{onClick:w,className:`${i("px-3 py-1 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600","printButton")} ${b}`,children:jsxs("span",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})}),"Print"]})}),y&&jsx("div",{className:"relative inline-block",children:jsx("button",{onClick:()=>C("pdf"),className:`px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${b}`,children:jsxs("span",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Export PDF"]})})})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Assessor:"})," ",r.assessor.name,", ",r.assessor.role]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",r.assessor.email]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Started:"})," ",g(r.startedAt)]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Completed:"})," ",r.completedAt?g(r.completedAt):"In progress"]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Next review:"})," ",r.reviewDate?g(r.reviewDate):"Not scheduled"]})]})]})]}),jsxs("div",{className:i("mb-8","summary"),children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Executive Summary"}),jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("span",{className:"font-medium mr-2",children:"Overall Risk Level:"}),h(r.overallRiskLevel)]}),jsxs("div",{className:i("mb-2","conclusion"),children:[jsx("span",{className:"font-medium",children:"Conclusion:"})," ",r.conclusion]}),jsxs("div",{children:[jsx("span",{className:"font-medium",children:"Can Proceed:"})," ",r.canProceed?"Yes":"No"]})]}),jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Processing Activity Description"}),jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-4",children:r.processingDescription}),r.recommendations&&r.recommendations.length>0&&jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Key Recommendations"}),jsx("ul",{className:"list-disc pl-5 text-gray-700 dark:text-gray-300",children:r.recommendations.map((a,s)=>jsx("li",{className:i("","recommendation"),children:a},s))})]})]})]}),jsxs("div",{className:"mb-8",children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Identified Risks"}),r.risks.length===0?jsx("p",{className:"text-gray-700 dark:text-gray-300",children:"No risks identified."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:i("min-w-full divide-y divide-gray-200 dark:divide-gray-700","riskTable"),children:[jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Risk"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Likelihood"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Impact"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Risk Level"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Mitigated"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:r.risks.map(a=>jsxs("tr",{className:i("","riskRow"),children:[jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:a.description}),jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[a.likelihood," / 5"]}),jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[a.impact," / 5"]}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:h(a.level)}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:a.mitigated?jsx("span",{className:"text-green-600 dark:text-green-400",children:"Yes"}):jsx("span",{className:"text-red-600 dark:text-red-400",children:"No"})})]},a.id))})]})})]}),p&&jsxs("div",{children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Full Assessment Details"}),m.map(a=>{let s=a.questions.filter(d=>r.answers[d.id]!==void 0);return s.length===0?null:jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:a.title}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Question"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Answer"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:s.map(d=>jsxs("tr",{children:[jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:d.text}),jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-600 dark:text-gray-400",children:l(d.id)})]},d.id))})]})})]},a.id)})]}),jsxs("div",{className:"mt-8 pt-4 border-t border-gray-200 dark:border-gray-700 text-sm text-gray-600 dark:text-gray-400",children:[jsx("p",{children:"This DPIA was conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023."}),jsxs("p",{children:["DPIA Report Version: ",r.version]}),jsxs("p",{children:["Generated on: ",new Date().toLocaleDateString()]})]})]})};var F=({steps:r,onStepClick:m,clickable:p=true,orientation:x="horizontal",className:y="",activeStepClassName:v="",completedStepClassName:u="",incompleteStepClassName:b="",classNames:k={},unstyled:N=false})=>{let i=(n,l)=>a(n,l?k[l]:void 0,N),g=n=>{p&&m&&m(n);},c=x==="vertical";return jsx("div",{className:`${i(c?"flex flex-col space-y-4":"flex items-center justify-between","root")} ${y}`,children:r.map((n,l)=>{let w=l===r.length-1,C=n.active?i(`font-medium ${v||"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]"}`,"label"):n.completed?i(u||"text-green-600 dark:text-green-400","label"):i(b||"text-gray-600 dark:text-gray-400","label"),h=n.active?i("flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] border-2 border-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]","stepActive"):n.completed?i("flex items-center justify-center w-8 h-8 rounded-full bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-400 border-2 border-green-600 dark:border-green-400","stepCompleted"):i("flex items-center justify-center w-8 h-8 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400 border-2 border-gray-300 dark:border-gray-600","stepPending");return jsxs(D.Fragment,{children:[jsxs("div",{className:i(`${c?"flex items-start":"flex flex-col items-center"} ${p?"cursor-pointer":""}`,"step"),onClick:()=>g(n.id),children:[jsx("div",{className:`
2
+ flex items-center justify-center
3
+ ${c?"mr-4":""}
4
+ `,children:jsx("div",{className:h,children:n.icon?n.icon:n.completed?jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):jsx("span",{children:l+1})})}),jsxs("div",{className:`
5
+ ${c?"flex-1":"mt-2 text-center"}
6
+ `,children:[jsx("div",{className:`text-sm font-medium ${C}`,children:n.label}),n.description&&jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:n.description})]})]}),!w&&jsx("div",{className:i(c?"ml-4 h-8 border-l-2 border-gray-300 dark:border-gray-600":"w-full border-t-2 border-gray-300 dark:border-gray-600 hidden sm:block","connector")})]},n.id)})})};export{S as a,F as b};//# sourceMappingURL=chunk-NPI5T6NH.mjs.map
7
+ //# sourceMappingURL=chunk-NPI5T6NH.mjs.map
@@ -0,0 +1,2 @@
1
+ import {c}from'./chunk-QKK5S54L.mjs';import {a as a$1}from'./chunk-SBNAMPAP.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,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 e=false;try{let r=v.current.load();r instanceof Promise?r.then(t=>{e||(t&&u(t),T(!1));},()=>{e||T(!1);}):(r&&u(r),T(!1));}catch(r){e||T(false);}return ()=>{e=true;}},[]);let f=useCallback(e=>{Promise.resolve(v.current.save(e)).catch(r=>{console.warn("[ndpr-toolkit] Failed to save cross-border transfers:",r);});},[]),M=()=>"cbt_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),D=useCallback(e=>{let r=Date.now(),t=b(a({},e),{id:M(),createdAt:r,updatedAt:r});return u(a=>{let n=[...a,t];return f(n),n}),g&&g(t),t},[g,f]),k=useCallback((e,r)=>{let t=null;return u(a$1=>{let n=a$1.findIndex(A=>A.id===e);if(n===-1)return a$1;t=b(a(a({},a$1[n]),r),{updatedAt:Date.now()});let o=[...a$1];return o[n]=t,f(o),o}),t&&C&&C(t),t},[C,f]),I=useCallback(e=>{let r=false;return u(t=>{if(t.findIndex(o=>o.id===e)===-1)return t;r=true;let n=t.filter(o=>o.id!==e);return f(n),n}),r&&B&&B(e),r},[B,f]),L=useCallback(e=>i.find(r=>r.id===e)||null,[i]),U=useCallback(()=>{let e=Date.now(),r=i.filter(s=>s.status==="active"),t=["adequacy_decision","standard_clauses","binding_corporate_rules","ndpc_authorization","explicit_consent","contract_performance","public_interest","legal_claims","vital_interests"],a={};for(let s of t)a[s]=r.filter(c=>c.transferMechanism===s).length;let n=["adequate","inadequate","pending_review","unknown"],o={};for(let s of n)o[s]=r.filter(c=>c.adequacyStatus===s).length;let A=i.filter(s=>{var c,b;return s.status==="pending_approval"||((c=s.ndpcApproval)==null?void 0:c.required)&&!((b=s.ndpcApproval)!=null&&b.approved)}),P=720*60*60*1e3,V=i.filter(s=>s.reviewDate&&s.reviewDate<=e+P&&s.status==="active"),F=i.filter(s=>!s.tiaCompleted&&s.status==="active"),z=i.filter(s=>s.riskLevel==="high"&&s.status==="active");return {totalActiveTransfers:r.length,byMechanism:a,byAdequacy:o,pendingApproval:A,dueForReview:V,missingTIA:F,highRiskTransfers:z,lastUpdated:e}},[i]),O=useCallback(e=>c(e),[]);return {transfers:i,addTransfer:D,updateTransfer:k,removeTransfer:I,getTransfer:L,getSummary:U,validateTransfer:O,isLoading:x}}export{Q as a};//# sourceMappingURL=chunk-NPLXE43Q.mjs.map
2
+ //# sourceMappingURL=chunk-NPLXE43Q.mjs.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkIQF726GS_js=require('./chunk-IQF726GS.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function j(m,l){return l?chunkUK656RCG_js.a(m):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialTransfers:m=[],adapter:l,storageKey:R="ndpr_cross_border_transfers",useLocalStorage:q=true,onAdd:g,onUpdate:C,onRemove:B}={}){let y=l!=null?l:j(R,q),v=react.useRef(y);v.current=y;let[i,u]=react.useState(m),[x,T]=react.useState(true);react.useEffect(()=>{let e=false;try{let r=v.current.load();r instanceof Promise?r.then(t=>{e||(t&&u(t),T(!1));},()=>{e||T(!1);}):(r&&u(r),T(!1));}catch(r){e||T(false);}return ()=>{e=true;}},[]);let f=react.useCallback(e=>{Promise.resolve(v.current.save(e)).catch(r=>{console.warn("[ndpr-toolkit] Failed to save cross-border transfers:",r);});},[]),M=()=>"cbt_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),D=react.useCallback(e=>{let r=Date.now(),t=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{id:M(),createdAt:r,updatedAt:r});return u(a=>{let n=[...a,t];return f(n),n}),g&&g(t),t},[g,f]),k=react.useCallback((e,r)=>{let t=null;return u(a=>{let n=a.findIndex(A=>A.id===e);if(n===-1)return a;t=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},a[n]),r),{updatedAt:Date.now()});let o=[...a];return o[n]=t,f(o),o}),t&&C&&C(t),t},[C,f]),I=react.useCallback(e=>{let r=false;return u(t=>{if(t.findIndex(o=>o.id===e)===-1)return t;r=true;let n=t.filter(o=>o.id!==e);return f(n),n}),r&&B&&B(e),r},[B,f]),L=react.useCallback(e=>i.find(r=>r.id===e)||null,[i]),U=react.useCallback(()=>{let e=Date.now(),r=i.filter(s=>s.status==="active"),t=["adequacy_decision","standard_clauses","binding_corporate_rules","ndpc_authorization","explicit_consent","contract_performance","public_interest","legal_claims","vital_interests"],a={};for(let s of t)a[s]=r.filter(c=>c.transferMechanism===s).length;let n=["adequate","inadequate","pending_review","unknown"],o={};for(let s of n)o[s]=r.filter(c=>c.adequacyStatus===s).length;let A=i.filter(s=>{var c,b;return s.status==="pending_approval"||((c=s.ndpcApproval)==null?void 0:c.required)&&!((b=s.ndpcApproval)!=null&&b.approved)}),P=720*60*60*1e3,V=i.filter(s=>s.reviewDate&&s.reviewDate<=e+P&&s.status==="active"),F=i.filter(s=>!s.tiaCompleted&&s.status==="active"),z=i.filter(s=>s.riskLevel==="high"&&s.status==="active");return {totalActiveTransfers:r.length,byMechanism:a,byAdequacy:o,pendingApproval:A,dueForReview:V,missingTIA:F,highRiskTransfers:z,lastUpdated:e}},[i]),O=react.useCallback(e=>chunkIQF726GS_js.c(e),[]);return {transfers:i,addTransfer:D,updateTransfer:k,removeTransfer:I,getTransfer:L,getSummary:U,validateTransfer:O,isLoading:x}}exports.a=Q;//# sourceMappingURL=chunk-P7BSBCB3.js.map
2
+ //# sourceMappingURL=chunk-P7BSBCB3.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkEPF7J2FK_js=require('./chunk-EPF7J2FK.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var lr=({requestTypes:I,onSubmit:Q,onValidationError:q,title:X="Submit a Data Subject Request",description:V="Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitButtonText:s="Submit Request",className:A="",buttonClassName:D="",showConfirmation:N=true,confirmationMessage:rr="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:_=true,identifierTypes:k=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:er=true,labels:y={},classNames:r,unstyled:o=false,isSubmitting:f=false,defaultValues:g,onReset:S})=>{var G,Y,H,L,U,W;let[c,P]=react.useState((g==null?void 0:g.requestType)||""),[R,j]=react.useState(((G=g==null?void 0:g.dataSubject)==null?void 0:G.fullName)||""),[x,E]=react.useState(((Y=g==null?void 0:g.dataSubject)==null?void 0:Y.email)||""),[F,O]=react.useState(((H=g==null?void 0:g.dataSubject)==null?void 0:H.phone)||""),[B,z]=react.useState(((L=g==null?void 0:g.dataSubject)==null?void 0:L.identifierType)||((U=k[0])==null?void 0:U.id)||""),[T,M]=react.useState(((W=g==null?void 0:g.dataSubject)==null?void 0:W.identifierValue)||""),[b,w]=react.useState((g==null?void 0:g.additionalInfo)||{}),[ir,$]=react.useState(false),[d,Z]=react.useState({}),tr=()=>{var e;P(""),j(""),E(""),O(""),z(((e=k[0])==null?void 0:e.id)||""),M(""),w({}),$(false),Z({}),S==null||S();},u=I.find(e=>e.id===c),or=e=>{P(e.target.value),w({});},v=(e,a)=>{w(l=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},l),{[e]:a}));},nr=()=>{let e={};return R.trim()||(e.fullName="Full name is required"),x.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(x)||(e.email="Email is invalid"):e.email="Email is required",c||(e.requestType="Please select a request type"),_&&!T.trim()&&(e.identifierValue="Identifier value is required"),u!=null&&u.requiresAdditionalInfo&&u.additionalFields&&u.additionalFields.forEach(a=>{a.required&&!b[a.id]&&(e[`additional_${a.id}`]=`${a.label} is required`);}),Z(e),e},dr=e=>{e.preventDefault();let a=nr();if(Object.keys(a).length>0){q==null||q(a);return}let l=Object.keys(b).length>0?Object.fromEntries(Object.entries(b).map(([ar,C])=>[ar,typeof C=="string"?chunkEPF7J2FK_js.a(C):C])):void 0,h={requestType:c,dataSubject:{fullName:chunkEPF7J2FK_js.a(R),email:chunkEPF7J2FK_js.a(x),phone:F?chunkEPF7J2FK_js.a(F):void 0,identifierType:B,identifierValue:chunkEPF7J2FK_js.a(T)},additionalInfo:l,submittedAt:Date.now()};Q(h),N&&$(true);};return ir?jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${A}`,r==null?void 0:r.successMessage,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-lg font-bold text-green-800 dark:text-green-200 mb-2",r==null?void 0:r.title,o),children:"Request Submitted"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-green-700 dark:text-green-300",r==null?void 0:r.description,o),children:rr}),jsxRuntime.jsx("button",{onClick:()=>$(false),className:chunkE64TU6IU_js.a(`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${D}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Submit Another Request"})]}):jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${A}`,r==null?void 0:r.root,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:X}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("mb-6 text-gray-600 dark:text-gray-300",r==null?void 0:r.description,o),children:V}),jsxRuntime.jsx("form",{onSubmit:dr,className:chunkE64TU6IU_js.a("",r==null?void 0:r.form,o),children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",r==null?void 0:r.fieldGroup,o),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Personal Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"fullName",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[y.name||"Full Name"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"fullName",value:R,onChange:e=>j(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),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:"mt-1 text-sm text-red-500",children:d.fullName})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"email",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[y.email||"Email Address"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",id:"email",value:x,onChange:e=>E(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),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:"mt-1 text-sm text-red-500",children:d.email})]}),er&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"phone",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:"Phone Number (Optional)"}),jsxRuntime.jsx("input",{type:"tel",id:"phone",value:F,onChange:e=>O(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Request Details"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"requestType",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[y.requestType||"Request Type"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsxs("select",{id:"requestType",value:c,onChange:or,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:true,"aria-invalid":!!d.requestType,"aria-describedby":d.requestType?"requestType-error":void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select a request type"}),I.map(e=>jsxRuntime.jsx("option",{value:e.id,children:e.name},e.id))]}),d.requestType&&jsxRuntime.jsx("p",{id:"requestType-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.requestType})]}),u&&jsxRuntime.jsxs("div",{className:"mb-4 p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:u.description}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Estimated completion time: ",u.estimatedCompletionTime," ",u.estimatedCompletionTime===1?"day":"days"]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{htmlFor:"requestDescription",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:y.description||"Additional Information"}),jsxRuntime.jsx("textarea",{id:"requestDescription",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.textarea,o),rows:4,placeholder:"Please provide any additional details that might help us process your request"})]})]}),_&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Identity Verification"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3",children:"To protect your privacy, we need to verify your identity before processing your request."}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"identifierType",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:["Identifier Type ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{id:"identifierType",value:B,onChange:e=>z(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:true,children:k.map(e=>jsxRuntime.jsx("option",{value:e.id,children:e.label},e.id))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"identifierValue",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:["Identifier Value ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"identifierValue",value:T,onChange:e=>M(e.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),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:"mt-1 text-sm text-red-500",children:d.identifierValue})]})]})]}),(u==null?void 0:u.requiresAdditionalInfo)&&u.additionalFields&&u.additionalFields.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxRuntime.jsx("div",{className:"space-y-4",children:u.additionalFields.map(e=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[e.label," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),e.type==="text"&&jsxRuntime.jsx("input",{type:"text",id:e.id,value:b[e.id]||"",onChange:a=>v(e.id,a.target.value),placeholder:e.placeholder,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),e.type==="textarea"&&jsxRuntime.jsx("textarea",{id:e.id,value:b[e.id]||"",onChange:a=>v(e.id,a.target.value),placeholder:e.placeholder,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.textarea,o),rows:4,required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),e.type==="select"&&e.options&&jsxRuntime.jsxs("select",{id:e.id,value:b[e.id]||"",onChange:a=>v(e.id,a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0,children:[jsxRuntime.jsx("option",{value:"",children:e.placeholder||"Select an option"}),e.options.map(a=>jsxRuntime.jsx("option",{value:a,children:a},a))]}),e.type==="checkbox"&&jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{type:"checkbox",id:e.id,checked:!!b[e.id],onChange:a=>v(e.id,a.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0})}),jsxRuntime.jsx("div",{className:"ml-3 text-sm",children:jsxRuntime.jsx("label",{htmlFor:e.id,className:"text-gray-700 dark:text-gray-300",children:e.placeholder||e.label})})]}),e.type==="file"&&jsxRuntime.jsx("input",{type:"file",id:e.id,onChange:a=>{var h;let l=(h=a.target.files)==null?void 0:h[0];l&&v(e.id,l);},className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:e.required,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),d[`additional_${e.id}`]&&jsxRuntime.jsx("p",{id:`additional-${e.id}-error`,role:"alert",className:"mt-1 text-sm text-red-500",children:d[`additional_${e.id}`]})]},e.id))})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Privacy Notice"}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300",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:"mt-6 flex gap-3 relative",children:[f&&(r==null?void 0:r.loadingOverlay)&&jsxRuntime.jsx("div",{className:r.loadingOverlay}),jsxRuntime.jsx("button",{type:"submit",disabled:f,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 ${D} ${f?"opacity-50 cursor-not-allowed":""}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:f?"Submitting...":y.submit||s}),jsxRuntime.jsx("button",{type:"button",onClick:tr,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,o),children:"Reset"})]})]})})]})};exports.a=lr;//# sourceMappingURL=chunk-PEH5GIMN.js.map
2
+ //# sourceMappingURL=chunk-PEH5GIMN.js.map
@@ -0,0 +1,2 @@
1
+ import {a as a$1}from'./chunk-2SYNHRP6.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var oe=({requests:k,onSelectRequest:T,onUpdateStatus:$,onAssignRequest:I,title:H="Data Subject Request Dashboard",description:X="Track and manage data subject requests in compliance with NDPA Part IV requirements.",className:J="",buttonClassName:V="",showRequestDetails:K=true,showRequestTimeline:Y=true,showDeadlineAlerts:F=true,assignees:i=[],classNames:s,unstyled:f=false})=>{let[R,y]=useState(null),[N,B]=useState(k),[j,O]=useState("all"),[C,M]=useState("all"),[A,_]=useState(""),[P,z]=useState("createdAt"),[L,Z]=useState("desc"),[D,G]=useState("");useEffect(()=>{let e=[...k];if(j!=="all"&&(e=e.filter(r=>r.status===j)),C!=="all"&&(e=e.filter(r=>r.type===C)),A){let r=A.toLowerCase();e=e.filter(p=>p.subject.name.toLowerCase().includes(r)||p.subject.email.toLowerCase().includes(r)||p.description&&p.description.toLowerCase().includes(r));}e.sort((r,p)=>{let w=0;switch(P){case "createdAt":w=r.createdAt-p.createdAt;break;case "dueDate":w=(r.dueDate||0)-(p.dueDate||0);break;case "type":w=r.type.localeCompare(p.type);break;case "status":w=r.status.localeCompare(p.status);break;default:w=r.createdAt-p.createdAt;}return L==="asc"?w:-w}),B(e);},[k,j,C,A,P,L]),useEffect(()=>{N.length>0&&!R&&y(N[0].id);},[N,R]);let Q=e=>{y(e),T&&T(e);},U=e=>{R&&$&&$(R,e);},W=()=>{R&&D&&I&&(I(R,D),G(""));},h=e=>new Date(e).toLocaleDateString(),E=e=>{let r=Date.now(),p=(e-r)/(1440*60*1e3);return Math.ceil(p)},m=R?k.find(e=>e.id===R):null,t=e=>{let r={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},p={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${r[e]}`,children:p[e]})},l=e=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{pending:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",inProgress:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",completed:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",rejected:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",awaitingVerification:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"}[e]}`,s==null?void 0:s.statusBadge,f),children:e==="inProgress"?"In Progress":e==="awaitingVerification"?"Awaiting Verification":e.charAt(0).toUpperCase()+e.slice(1)}),g=e=>{if(!e.dueDate)return null;let r=E(e.dueDate);return r<=0?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Deadline Passed"}),jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The response deadline has passed. Immediate action is required."})]}):r<=3?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Deadline Approaching"}),jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",r," day",r!==1?"s":""," remaining until the response deadline."]})]}):r<=7?jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Deadline Approaching"}),jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:[r," days remaining until the response deadline."]})]}):jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Deadline Tracking"}),jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:[r," days remaining until the response deadline."]})]})},x=e=>{let r=[{title:"Request Received",date:e.createdAt,completed:true,description:`Request was received on ${h(e.createdAt)}.`}];return e.verifiedAt?r.push({title:"Identity Verified",date:e.verifiedAt,completed:true,description:`Data subject's identity was verified on ${h(e.verifiedAt)}.`}):e.status==="awaitingVerification"&&r.push({title:"Identity Verification",date:Date.now(),completed:false,description:"Awaiting verification of data subject's identity."}),(e.status==="inProgress"||e.status==="completed"||e.status==="rejected")&&r.push({title:"Processing Started",date:e.updatedAt,completed:true,description:`Request processing started on ${h(e.updatedAt)}.`}),e.status==="completed"?r.push({title:"Request Completed",date:e.completedAt||Date.now(),completed:true,description:`Request was completed on ${h(e.completedAt||Date.now())}.`}):e.status==="rejected"&&r.push({title:"Request Rejected",date:e.completedAt||Date.now(),completed:true,description:`Request was rejected on ${h(e.completedAt||Date.now())}.${e.rejectionReason?` Reason: ${e.rejectionReason}`:""}`}),e.dueDate&&r.push({title:"Response Deadline",date:e.dueDate,completed:Date.now()>e.dueDate,description:`Response is due by ${h(e.dueDate)}.`}),jsxs("div",{className:"mt-6",children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:r.map((p,w)=>jsxs("li",{className:"mb-6 ml-4",children:[jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${p.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-600 dark:text-gray-500",children:p.date?h(p.date):"Pending"}),jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:p.title}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:p.description})]},w))})]})},o=()=>[{value:"all",label:"All Types"},{value:"information",label:"Information (NDPA Section 29)"},{value:"access",label:"Access (NDPA Section 30)"},{value:"rectification",label:"Rectification (NDPA Section 31)"},{value:"erasure",label:"Erasure (NDPA Section 32)"},{value:"restriction",label:"Restriction (NDPA Section 33)"},{value:"portability",label:"Portability (NDPA Section 34)"},{value:"objection",label:"Objection (NDPA Section 35)"},{value:"automated_decision_making",label:"Automated Decision-Making (NDPA Section 36)"}].map(r=>jsx("option",{value:r.value,children:r.label},r.value)),u=()=>[{value:"all",label:"All Statuses"},{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(r=>jsx("option",{value:r.value,children:r.label},r.value)),v=()=>[{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(r=>jsx("option",{value:r.value,children:r.label},r.value));return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${J}`,s==null?void 0:s.root,f),children:[jsxs("div",{className:a("",s==null?void 0:s.header,f),children:[jsx("h2",{className:a("text-xl font-bold mb-2",s==null?void 0:s.title,f),children:H}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:X})]}),jsxs("div",{className:a("mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",s==null?void 0:s.filters,f),children:[jsxs("div",{children:[jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsx("select",{id:"statusFilter",value:j,onChange:e=>O(e.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:u()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"typeFilter",className:"block text-sm font-medium mb-1",children:"Request Type Filter"}),jsx("select",{id:"typeFilter",value:C,onChange:e=>M(e.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:o()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxs("select",{id:"sortBy",value:P,onChange:e=>z(e.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsx("option",{value:"createdAt",children:"Date Received"}),jsx("option",{value:"dueDate",children:"Due Date"}),jsx("option",{value:"type",children:"Request Type"}),jsx("option",{value:"status",children:"Status"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"searchTerm",value:A,onChange:e=>_(e.target.value),placeholder:"Search requests...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxs("div",{className:"md:col-span-1",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"DSR Requests"}),N.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data subject requests found."}):jsx("div",{className:a("space-y-2 max-h-96 overflow-y-auto pr-2",s==null?void 0:s.requestList,f),children:N.map(e=>{let r=e.dueDate?E(e.dueDate):null,p=null;return r!==null&&(r<=0?p=jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):r<=3?p=jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):r<=7&&(p=jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Soon"}))),jsxs("div",{className:a(`p-3 rounded-md cursor-pointer ${R===e.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,s==null?void 0:s.requestItem,f),onClick:()=>Q(e.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:e.subject.name}),t(e.type)]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:e.subject.email}),jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Received: ",h(e.createdAt)]}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsx("div",{children:l(e.status)}),jsx("div",{children:p})]})]},e.id)})})]}),jsx("div",{className:a("md:col-span-2",s==null?void 0:s.detailPanel,f),children:m?jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsx("h3",{className:"text-lg font-medium",children:m.subject.name}),jsxs("div",{className:"flex space-x-2",children:[t(m.type),l(m.status)]})]}),F&&m.dueDate&&jsx("div",{className:"mb-4",children:g(m)}),K&&jsxs("div",{className:"mb-6",children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Email:"})," ",m.subject.email]}),m.subject.phone&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Phone:"})," ",m.subject.phone]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Received:"})," ",h(m.createdAt)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Request Type:"})," ",{information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"}[m.type]||m.type]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",m.status==="inProgress"?"In Progress":m.status==="awaitingVerification"?"Awaiting Verification":m.status.charAt(0).toUpperCase()+m.status.slice(1)]}),m.dueDate&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Due Date:"})," ",h(m.dueDate)]})]})]}),m.description&&jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium",children:"Request Details:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:m.description})]}),m.additionalInfo&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium",children:"Additional Information:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:typeof m.additionalInfo=="object"?JSON.stringify(m.additionalInfo,null,2):String(m.additionalInfo||"No additional information provided")})]})]}),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("h3",{className:"text-md font-medium mb-2",children:"Update Status"}),jsxs("div",{className:"flex space-x-2",children:[jsx("select",{value:m.status,onChange:e=>U(e.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:v()}),jsx("button",{onClick:()=>U(m.status),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${V}`,children:"Update"})]})]}),i.length>0&&jsxs("div",{children:[jsx("h3",{className:"text-md font-medium mb-2",children:"Assign Request"}),jsxs("div",{className:"flex space-x-2",children:[jsxs("select",{value:D,onChange:e=>G(e.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsx("option",{value:"",children:"Select Assignee"}),i.map(e=>jsx("option",{value:e,children:e},e))]}),jsx("button",{onClick:W,disabled:!D,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] disabled:bg-gray-300 disabled:text-gray-500 ${V}`,children:"Assign"})]})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Request Summary"}),jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:jsx("pre",{children:JSON.stringify(a$1(m),null,2)})})})]}),Y&&x(m)]}):jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a request to view details"})})})]})]})};var ue=({requests:k,onSelectRequest:T,title:$="DSR Request Tracker",description:I="Track the status and progress of data subject requests as required by NDPA Part IV.",className:H="",buttonClassName:X="",showSummaryStats:J=true,showTypeBreakdown:V=true,showStatusBreakdown:K=true,showTimelineChart:Y=true,showOverdueRequests:F=true,classNames:i,unstyled:s=false})=>{let[f,R]=useState("30days"),[y,N]=useState(k),[B,j]=useState([]),[O,C]=useState([]);useEffect(()=>{let t=Date.now(),l;switch(f){case "7days":l=k.filter(o=>t-o.createdAt<=10080*60*1e3);break;case "30days":l=k.filter(o=>t-o.createdAt<=720*60*60*1e3);break;case "90days":l=k.filter(o=>t-o.createdAt<=2160*60*60*1e3);break;default:l=[...k];}N(l);let g=l.filter(o=>o.dueDate&&t>o.dueDate&&o.status!=="completed"&&o.status!=="rejected");j(g);let x=l.filter(o=>o.dueDate&&t<o.dueDate&&o.dueDate-t<=10080*60*1e3&&o.status!=="completed"&&o.status!=="rejected");C(x);},[k,f]);let M=t=>{T&&T(t);},A=t=>new Date(t).toLocaleDateString(),_=t=>{let l=Date.now(),g=(t-l)/(1440*60*1e3);return Math.ceil(g)},P=()=>{let t=y.filter(g=>g.status==="completed"&&g.completedAt&&g.createdAt);if(t.length===0)return null;let l=t.reduce((g,x)=>{let o=((x.completedAt||0)-x.createdAt)/864e5;return g+o},0);return Number((l/t.length).toFixed(1))},z=()=>{let t=y.filter(g=>(g.status==="completed"||g.status==="rejected")&&g.completedAt&&g.dueDate);if(t.length===0)return null;let l=t.filter(g=>(g.completedAt||0)<=(g.dueDate||0));return Math.round(l.length/t.length*100)},L=()=>{let t={};return y.forEach(l=>{t[l.type]=(t[l.type]||0)+1;}),{information:t.information||0,access:t.access||0,rectification:t.rectification||0,erasure:t.erasure||0,restriction:t.restriction||0,portability:t.portability||0,objection:t.objection||0,automated_decision_making:t.automated_decision_making||0}},Z=()=>{let t={};return y.forEach(l=>{t[l.status]=(t[l.status]||0)+1;}),{pending:t.pending||0,awaitingVerification:t.awaitingVerification||0,inProgress:t.inProgress||0,completed:t.completed||0,rejected:t.rejected||0}},D=t=>{let l={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},g={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${l[t]}`,children:g[t]})},Q=()=>{let t=y.length,l=y.filter(u=>u.status!=="completed"&&u.status!=="rejected").length;y.filter(u=>u.status==="completed"||u.status==="rejected").length;let x=P(),o=z();return jsxs("div",{className:a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",i==null?void 0:i.stats,s),children:[jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,s),children:[jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Total Requests"}),jsx("p",{className:"text-2xl font-bold",children:t})]}),jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,s),children:[jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Pending Requests"}),jsx("p",{className:"text-2xl font-bold",children:l})]}),jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,s),children:[jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Avg. Response Time"}),jsx("p",{className:"text-2xl font-bold",children:x!==null?`${x} days`:"N/A"})]}),jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,s),children:[jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Compliance Rate"}),jsx("p",{className:"text-2xl font-bold",children:o!==null?`${o}%`:"N/A"})]})]})},U=()=>{let t=L(),l=y.length,g=Object.entries(t).sort(([,x],[,o])=>o-x).map(([x])=>x);return jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",i==null?void 0:i.table,s),children:[jsx("h3",{className:a("text-lg font-medium mb-4",i==null?void 0:i.tableHeader,s),children:"Request Types"}),l===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsx("div",{className:"space-y-4",children:g.map(x=>{let o=t[x],u=Math.round(o/l*100);return jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-center mb-1",children:[jsxs("div",{className:"flex items-center",children:[D(x),jsxs("span",{className:"ml-2 text-sm",children:[o," requests"]})]}),jsxs("span",{className:"text-sm font-medium",children:[u,"%"]})]}),jsx("div",{className:"w-full bg-gray-200 dark:bg-gray-600 rounded-full h-2.5",children:jsx("div",{className:"bg-[rgb(var(--ndpr-primary))] h-2.5 rounded-full",style:{width:`${u}%`}})})]},x)})})]})},W=()=>{let t=Z(),l=y.length,g=["pending","awaitingVerification","inProgress","completed","rejected"],x={pending:"bg-yellow-500",awaitingVerification:"bg-purple-500",inProgress:"bg-blue-500",completed:"bg-green-500",rejected:"bg-red-500"};return jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",i==null?void 0:i.table,s),children:[jsx("h3",{className:a("text-lg font-medium mb-4",i==null?void 0:i.tableHeader,s),children:"Request Status"}),l===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxs("div",{children:[jsx("div",{className:"flex h-4 mb-2",children:g.map(o=>{let u=t[o],v=u/l*100;return v>0?jsx("div",{className:`${x[o]} first:rounded-l-full last:rounded-r-full`,style:{width:`${v}%`},title:`${o}: ${u} (${Math.round(v)}%)`},o):null})}),jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 mt-4",children:g.map(o=>{let u=t[o],v=Math.round(u/l*100);return jsxs("div",{className:"flex items-center",children:[jsx("div",{className:`w-3 h-3 rounded-full ${x[o]} mr-2`}),jsxs("div",{children:[jsx("p",{className:"text-xs font-medium",children:o==="inProgress"?"In Progress":o==="awaitingVerification"?"Awaiting Verification":o.charAt(0).toUpperCase()+o.slice(1)}),jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:[u," (",v,"%)"]})]})]},o)})})]})]})},h=()=>{let t={};y.forEach(u=>{let v=new Date(u.createdAt),e=`${v.getFullYear()}-${String(v.getMonth()+1).padStart(2,"0")}`;t[e]=(t[e]||0)+1;});let g=Object.keys(t).sort().slice(-6),x=Math.max(...Object.values(t).filter(u=>u>0),1),o=u=>{let[v,e]=u.split("-");return `${e}/${v.slice(2)}`};return jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),g.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxs("div",{className:"h-40",children:[jsx("div",{className:"flex h-32 items-end justify-between space-x-2",children:g.map(u=>{let v=t[u],e=`${v/x*100}%`;return jsx("div",{className:"flex flex-col items-center flex-1",children:jsx("div",{className:"w-full bg-[rgb(var(--ndpr-primary))] rounded-t",style:{height:e},title:`${o(u)}: ${v} requests`})},u)})}),jsx("div",{className:"flex justify-between mt-2",children:g.map(u=>jsx("div",{className:"text-xs text-center",children:o(u)},u))})]})]})},E=()=>jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Overdue Requests"}),B.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No overdue requests."}):jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:B.map(t=>jsxs("div",{className:a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md cursor-pointer hover:bg-red-100 dark:hover:bg-red-900/30",i==null?void 0:i.tableRow,s),onClick:()=>M(t.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:t.subject.name}),D(t.type)]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.subject.email}),jsxs("div",{className:"flex justify-between items-center",children:[jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:["Due: ",A(t.dueDate||0)]}),jsxs("p",{className:"text-xs font-bold text-red-600 dark:text-red-400",children:["Overdue by ",Math.abs(_(t.dueDate||0))," days"]})]})]},t.id))})]}),m=()=>jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Upcoming Deadlines"}),O.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No upcoming deadlines in the next 7 days."}):jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:O.map(t=>{let l=_(t.dueDate||0);return jsxs("div",{className:a("p-3 bg-yellow-50 dark:bg-yellow-900/20 rounded-md cursor-pointer hover:bg-yellow-100 dark:hover:bg-yellow-900/30",i==null?void 0:i.tableRow,s),onClick:()=>M(t.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:t.subject.name}),D(t.type)]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.subject.email}),jsxs("div",{className:"flex justify-between items-center",children:[jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:["Due: ",A(t.dueDate||0)]}),jsxs("p",{className:`text-xs font-bold ${l<=3?"text-red-600 dark:text-red-400":"text-yellow-600 dark:text-yellow-400"}`,children:["Due in ",l," days"]})]})]},t.id)})})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${H}`,i==null?void 0:i.root,s),children:[jsxs("div",{className:a("flex flex-col md:flex-row md:justify-between md:items-center mb-6",i==null?void 0:i.header,s),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-bold mb-2",i==null?void 0:i.title,s),children:$}),jsx("p",{className:"text-gray-600 dark:text-gray-300",children:I})]}),jsxs("div",{className:"mt-4 md:mt-0",children:[jsx("label",{htmlFor:"timeframe",className:"block text-sm font-medium mb-1",children:"Timeframe"}),jsxs("select",{id:"timeframe",value:f,onChange:t=>R(t.target.value),className:"px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsx("option",{value:"7days",children:"Last 7 Days"}),jsx("option",{value:"30days",children:"Last 30 Days"}),jsx("option",{value:"90days",children:"Last 90 Days"}),jsx("option",{value:"all",children:"All Time"})]})]})]}),J&&Q(),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxs("div",{children:[V&&U(),K&&W()]}),jsxs("div",{children:[Y&&h(),F&&E(),F&&m()]})]})]})};export{oe as a,ue as b};//# sourceMappingURL=chunk-RSUDIFZV.mjs.map
2
+ //# sourceMappingURL=chunk-RSUDIFZV.mjs.map
@@ -0,0 +1,2 @@
1
+ function r(t){return {load(){if(typeof window=="undefined")return null;try{let e=localStorage.getItem(t);return e?JSON.parse(e):null}catch(e){return null}},save(e){typeof window!="undefined"&&localStorage.setItem(t,JSON.stringify(e));},remove(){typeof window!="undefined"&&localStorage.removeItem(t);}}}export{r as a};//# sourceMappingURL=chunk-SBNAMPAP.mjs.map
2
+ //# sourceMappingURL=chunk-SBNAMPAP.mjs.map
@@ -0,0 +1,2 @@
1
+ import {d,a as a$1}from'./chunk-TXBZPCGF.mjs';import {a as a$2}from'./chunk-SBNAMPAP.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function F(v,c){return c?a$2(v):{load:()=>null,save:()=>{},remove:()=>{}}}function z({initialActivities:v=[],adapter:c,storageKey:b$1="ndpr_lawful_basis_activities",useLocalStorage:R=true,onAdd:g,onUpdate:A,onRemove:y}={}){let p=c!=null?c:F(b$1,R),f=useRef(p);f.current=p;let[o,u]=useState(v),[x,l]=useState(true);useEffect(()=>{let t=false;try{let i=f.current.load();i instanceof Promise?i.then(e=>{t||(e&&u(e),l(!1));},()=>{t||l(!1);}):(i&&u(i),l(!1));}catch(i){t||l(false);}return ()=>{t=true;}},[]);let a$2=useCallback(t=>{Promise.resolve(f.current.save(t)).catch(i=>{console.warn("[ndpr-toolkit] Failed to save lawful basis activities:",i);});},[]),_=()=>"lb_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),h=useCallback(t=>{let i=Date.now(),e=b(a({},t),{id:_(),createdAt:i,updatedAt:i});return u(s=>{let r=[...s,e];return a$2(r),r}),g&&g(e),e},[g,a$2]),O=useCallback((t,i)=>{let e=null;return u(s=>{let r=s.findIndex(k=>k.id===t);if(r===-1)return s;e=b(a(a({},s[r]),i),{id:s[r].id,updatedAt:Date.now()});let P=[...s];return P[r]=e,a$2(P),P}),e&&A&&A(e),e},[A,a$2]),D=useCallback(t=>{u(i=>{let e=i.filter(s=>s.id!==t);return a$2(e),e}),y&&y(t);},[y,a$2]),I=useCallback(t=>o.find(i=>i.id===t)||null,[o]),U=useCallback(()=>d(o),[o]),V=useCallback(t=>a$1(t),[]);return {activities:o,addActivity:h,updateActivity:O,removeActivity:D,getActivity:I,getSummary:U,validateActivity:V,isLoading:x}}export{z as a};//# sourceMappingURL=chunk-SVCRYM4I.mjs.map
2
+ //# sourceMappingURL=chunk-SVCRYM4I.mjs.map