@tantainnovative/ndpr-toolkit 3.5.1 → 3.5.5

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 (177) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/README.md +12 -7
  3. package/dist/adapters.js +1 -2
  4. package/dist/adapters.mjs +1 -2
  5. package/dist/breach.d.mts +80 -1
  6. package/dist/breach.d.ts +80 -1
  7. package/dist/breach.js +1 -2
  8. package/dist/breach.mjs +1 -2
  9. package/dist/{chunk-PATONNTZ.mjs → chunk-3HOXQNCH.mjs} +1 -2
  10. package/dist/{chunk-MJGOLP5M.js → chunk-3IA3KDII.js} +1 -2
  11. package/dist/{chunk-M2TPT5GB.js → chunk-3JPDTXGC.js} +1 -2
  12. package/dist/{chunk-BKRETVJ6.js → chunk-3YTAOT5O.js} +1 -2
  13. package/dist/{chunk-GOU6FU6Y.js → chunk-4CVBQC66.js} +1 -2
  14. package/dist/{chunk-E4NCJ7RD.mjs → chunk-4G3SRVRI.mjs} +1 -2
  15. package/dist/{chunk-6QPRDQZF.js → chunk-4QXTB3L6.js} +1 -2
  16. package/dist/{chunk-XNSZ7KUH.js → chunk-5GVMKUMP.js} +1 -2
  17. package/dist/chunk-66NQ5CVY.mjs +1 -0
  18. package/dist/{chunk-JBSCER34.js → chunk-6NXXQYQL.js} +1 -2
  19. package/dist/chunk-732C2EVN.js +1 -0
  20. package/dist/chunk-7BJXI2HI.mjs +1 -0
  21. package/dist/{chunk-C5QO3SX4.js → chunk-7IFSWCQP.js} +1 -2
  22. package/dist/{chunk-A4PK7JB2.js → chunk-7ZZO7GVB.js} +1 -2
  23. package/dist/chunk-AME4HJR4.js +1 -0
  24. package/dist/chunk-AOHKVFAS.mjs +322 -0
  25. package/dist/{chunk-HO5M7M4M.js → chunk-B46SJB5V.js} +1 -2
  26. package/dist/chunk-BFAX7JQA.mjs +1 -0
  27. package/dist/{chunk-ID2NYIVE.mjs → chunk-BNHQFZHL.mjs} +2 -3
  28. package/dist/{chunk-RLYTX3MM.js → chunk-BRS52EDT.js} +1 -2
  29. package/dist/{chunk-OPYQIJKY.js → chunk-C7IDR2IV.js} +1 -2
  30. package/dist/{chunk-CISJAQ6W.mjs → chunk-COD3RMTL.mjs} +1 -2
  31. package/dist/chunk-CR2QZTGW.js +1 -0
  32. package/dist/{chunk-6WIP33TW.mjs → chunk-DBZSN4WP.mjs} +1 -2
  33. package/dist/{chunk-74Z23WUA.mjs → chunk-EEQALYOY.mjs} +1 -2
  34. package/dist/chunk-EFIBHKQE.mjs +1 -0
  35. package/dist/{chunk-GKKAK6ES.mjs → chunk-EWVK45Z3.mjs} +1 -2
  36. package/dist/{chunk-QSVVAZVT.mjs → chunk-EXEXUAF6.mjs} +1 -2
  37. package/dist/chunk-EZCGTHQV.js +6 -0
  38. package/dist/{chunk-SYMQJO2W.mjs → chunk-GTYXVAJX.mjs} +2 -3
  39. package/dist/{chunk-6FGCGLH5.mjs → chunk-H3XJV2IR.mjs} +1 -2
  40. package/dist/chunk-HBLGN4SD.js +1 -0
  41. package/dist/{chunk-MCWV7S2G.js → chunk-HHK5LHEG.js} +1 -2
  42. package/dist/{chunk-XHROISIF.mjs → chunk-HWHBINVN.mjs} +1 -2
  43. package/dist/{chunk-3EGQWLJ6.js → chunk-I2LMQWK3.js} +2 -3
  44. package/dist/{chunk-NQNFS3QI.js → chunk-I3Y4LOSL.js} +4 -5
  45. package/dist/chunk-ITCY2Z66.mjs +4 -0
  46. package/dist/{chunk-Z6IIMLZU.mjs → chunk-KDAZQO3N.mjs} +1 -2
  47. package/dist/{chunk-J5WCPZLW.js → chunk-L2BRFMVS.js} +1 -2
  48. package/dist/chunk-L2VO3MEJ.js +1 -0
  49. package/dist/{chunk-R5FW5XUQ.mjs → chunk-LQTARVPU.mjs} +1 -2
  50. package/dist/{chunk-6TA2MVTU.mjs → chunk-LRRENTT5.mjs} +1 -2
  51. package/dist/{chunk-LIM64IV2.js → chunk-LVGT3DLT.js} +2 -3
  52. package/dist/{chunk-TXBZPCGF.mjs → chunk-LWIKDDSU.mjs} +1 -2
  53. package/dist/chunk-MPBPAEZC.mjs +1 -0
  54. package/dist/{chunk-Z73T6MWY.js → chunk-N3MQQUQP.js} +39 -35
  55. package/dist/{chunk-RY3PGVLZ.mjs → chunk-NBZUZYTB.mjs} +1 -2
  56. package/dist/{chunk-HGGLW5TE.js → chunk-NUWVPRNI.js} +1 -2
  57. package/dist/chunk-O45PKBZA.mjs +6 -0
  58. package/dist/chunk-O6CUBNXK.mjs +3 -0
  59. package/dist/{chunk-7SMLHZ4B.js → chunk-P4LNLCSF.js} +1 -2
  60. package/dist/{chunk-VWPGIES4.mjs → chunk-PCU6GKBE.mjs} +1 -2
  61. package/dist/chunk-PGI2LM6P.js +103 -0
  62. package/dist/{chunk-U62QYKVG.mjs → chunk-PJNKQPQP.mjs} +1 -2
  63. package/dist/{chunk-LSNL4XR5.js → chunk-PZRQWPWD.js} +1 -2
  64. package/dist/chunk-Q64735OC.js +144 -0
  65. package/dist/chunk-QPRYXVH2.js +1 -0
  66. package/dist/{chunk-MQFZHA2D.js → chunk-RFPLZDIO.js} +1 -2
  67. package/dist/chunk-RMQ7OLNY.mjs +144 -0
  68. package/dist/{chunk-2AW7KAZO.mjs → chunk-RPXRPGHL.mjs} +1 -2
  69. package/dist/chunk-RYREGZVQ.js +1 -0
  70. package/dist/{chunk-B4Z5MBUC.mjs → chunk-RZ6GC6WN.mjs} +1 -2
  71. package/dist/chunk-S6COXIZA.js +2 -0
  72. package/dist/chunk-SFGW37LE.mjs +1 -0
  73. package/dist/{chunk-3NQQSU4P.js → chunk-SJDDNB6M.js} +1 -2
  74. package/dist/{chunk-H3EYBSVP.mjs → chunk-TMXK4QKK.mjs} +2 -3
  75. package/dist/{chunk-P42Z5CFE.js → chunk-TQZWJGJ2.js} +1 -2
  76. package/dist/{chunk-EPT2K355.mjs → chunk-U5RWJRGA.mjs} +1 -2
  77. package/dist/{chunk-R3OYAJI6.mjs → chunk-UASG46LP.mjs} +1 -2
  78. package/dist/{chunk-RXL6CZAI.js → chunk-UAV7V4EM.js} +1 -2
  79. package/dist/chunk-UI536RU2.js +3 -0
  80. package/dist/{chunk-7AVN424U.js → chunk-UTFBKL73.js} +1 -2
  81. package/dist/{chunk-I54CDQGN.js → chunk-UXUMYP4L.js} +1 -2
  82. package/dist/{chunk-P3PULLYP.mjs → chunk-V7UFP6QU.mjs} +1 -2
  83. package/dist/{chunk-I4M2AA3N.js → chunk-VJTQXVAF.js} +1 -2
  84. package/dist/{chunk-ELKB2AFZ.js → chunk-VWED6UTN.js} +1 -2
  85. package/dist/{chunk-LU7PKE7Y.mjs → chunk-VYAL2TGT.mjs} +1 -2
  86. package/dist/chunk-W47OSMT6.js +2 -0
  87. package/dist/chunk-W65ZWTLD.mjs +1 -0
  88. package/dist/{chunk-5HL4UBFV.js → chunk-WDDCKYWA.js} +1 -2
  89. package/dist/{chunk-DJGS7SSN.mjs → chunk-WTGKZX7J.mjs} +1 -2
  90. package/dist/{chunk-TDDAYVKK.js → chunk-WZYCBW2R.js} +1 -2
  91. package/dist/chunk-X3GCGC3H.mjs +103 -0
  92. package/dist/chunk-XJO4DH3L.mjs +2 -0
  93. package/dist/{chunk-LWXZMKC2.js → chunk-XO3VQYTL.js} +7 -8
  94. package/dist/{chunk-IZCWCE7W.mjs → chunk-XOH4WXOZ.mjs} +1 -2
  95. package/dist/{chunk-SHMJNRHO.mjs → chunk-XP5PL6K7.mjs} +1 -2
  96. package/dist/{chunk-CKGJK4D7.mjs → chunk-Y3MKMAFQ.mjs} +2 -3
  97. package/dist/chunk-YFBDJ4FH.js +1 -0
  98. package/dist/chunk-YTU4FNM2.mjs +1 -0
  99. package/dist/{chunk-TV4U6AIS.js → chunk-Z763UI5U.js} +1 -2
  100. package/dist/chunk-ZHFLBL63.mjs +2 -0
  101. package/dist/{chunk-RRVKUCFR.mjs → chunk-ZIZL37BG.mjs} +1 -2
  102. package/dist/{chunk-WWT2ZSNU.mjs → chunk-ZJYULEER.mjs} +1 -2
  103. package/dist/{chunk-LJNNPAFU.mjs → chunk-ZQZJNKVB.mjs} +1 -2
  104. package/dist/chunk-ZVOIR4QH.js +4 -0
  105. package/dist/consent.js +1 -2
  106. package/dist/consent.mjs +1 -2
  107. package/dist/core.d.mts +98 -19
  108. package/dist/core.d.ts +98 -19
  109. package/dist/core.js +1 -2
  110. package/dist/core.mjs +1 -2
  111. package/dist/cross-border.d.mts +36 -14
  112. package/dist/cross-border.d.ts +36 -14
  113. package/dist/cross-border.js +1 -2
  114. package/dist/cross-border.mjs +1 -2
  115. package/dist/dpia.d.mts +4 -4
  116. package/dist/dpia.d.ts +4 -4
  117. package/dist/dpia.js +1 -2
  118. package/dist/dpia.mjs +1 -2
  119. package/dist/dsr.d.mts +30 -17
  120. package/dist/dsr.d.ts +30 -17
  121. package/dist/dsr.js +1 -2
  122. package/dist/dsr.mjs +1 -2
  123. package/dist/hooks.d.mts +113 -20
  124. package/dist/hooks.d.ts +113 -20
  125. package/dist/hooks.js +1 -2
  126. package/dist/hooks.mjs +1 -2
  127. package/dist/index.d.mts +422 -26
  128. package/dist/index.d.ts +422 -26
  129. package/dist/index.js +1 -2
  130. package/dist/index.mjs +1 -2
  131. package/dist/lawful-basis.js +1 -2
  132. package/dist/lawful-basis.mjs +1 -2
  133. package/dist/policy.js +1 -2
  134. package/dist/policy.mjs +1 -2
  135. package/dist/presets.d.mts +54 -5
  136. package/dist/presets.d.ts +54 -5
  137. package/dist/presets.js +1 -2
  138. package/dist/presets.mjs +1 -2
  139. package/dist/ropa.js +1 -2
  140. package/dist/ropa.mjs +1 -2
  141. package/dist/server.d.mts +89 -19
  142. package/dist/server.d.ts +89 -19
  143. package/dist/server.js +1 -2
  144. package/dist/server.mjs +1 -2
  145. package/dist/styles.css +34 -0
  146. package/dist/unstyled.d.mts +3 -1
  147. package/dist/unstyled.d.ts +3 -1
  148. package/dist/unstyled.js +1 -2
  149. package/dist/unstyled.mjs +1 -2
  150. package/package.json +59 -20
  151. package/dist/chunk-3VQAYQR7.js +0 -7
  152. package/dist/chunk-6HZL2WDU.mjs +0 -2
  153. package/dist/chunk-75TJPK2N.mjs +0 -2
  154. package/dist/chunk-ABDB7LEV.mjs +0 -2
  155. package/dist/chunk-AYKLAEOU.mjs +0 -2
  156. package/dist/chunk-C4YM4UMI.js +0 -2
  157. package/dist/chunk-CKJAECGV.js +0 -2
  158. package/dist/chunk-CPK5D5FY.js +0 -132
  159. package/dist/chunk-CWHBCQGT.mjs +0 -2
  160. package/dist/chunk-E64TU6IU.js +0 -2
  161. package/dist/chunk-F5TXUA4O.mjs +0 -4
  162. package/dist/chunk-GN5C32JB.mjs +0 -2
  163. package/dist/chunk-GRLIPT5V.mjs +0 -132
  164. package/dist/chunk-I557S566.mjs +0 -15
  165. package/dist/chunk-JFFOPHU3.mjs +0 -318
  166. package/dist/chunk-KF3EFJEF.mjs +0 -3
  167. package/dist/chunk-ORFC66EA.js +0 -4
  168. package/dist/chunk-S4GRSNB4.js +0 -2
  169. package/dist/chunk-SCWNM4PC.mjs +0 -2
  170. package/dist/chunk-SKKOMFXH.js +0 -81
  171. package/dist/chunk-TCN22KYP.mjs +0 -7
  172. package/dist/chunk-TUNQUVHU.mjs +0 -81
  173. package/dist/chunk-VIQUXWJC.js +0 -2
  174. package/dist/chunk-WTJGLNTB.js +0 -3
  175. package/dist/chunk-XIM7KMD6.js +0 -2
  176. package/dist/chunk-YPKUHSK4.js +0 -15
  177. package/dist/chunk-ZPKVLTSX.js +0 -2
@@ -1,2 +1 @@
1
- 'use strict';var chunkGOU6FU6Y_js=require('./chunk-GOU6FU6Y.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var T=[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_interest",label:"Public Interest (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}],ee=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"archived",label:"Archived"}],Ee=[{value:"data_subject",label:"Directly from Data Subject"},{value:"third_party",label:"Third Party"},{value:"public_source",label:"Public Source"},{value:"other",label:"Other"}];function Oe(){let l=Date.now();return {id:`proc_${l}_${Math.random().toString(36).substring(2,11)}`,name:"",description:"",controllerDetails:{name:"",contact:"",address:""},lawfulBasis:"consent",lawfulBasisJustification:"",purposes:[],dataCategories:[],dataSubjectCategories:[],recipients:[],retentionPeriod:"",securityMeasures:[],dataSource:"data_subject",dpiaRequired:false,automatedDecisionMaking:false,status:"active",createdAt:l,updatedAt:l}}function te(l){return l?new Date(l).toLocaleDateString():"N/A"}var $e=({ropa:l,onAddRecord:R,onUpdateRecord:D,onArchiveRecord:w,title:re="Record of Processing Activities (ROPA)",description:ie="Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",className:ae="",buttonClassName:B="",classNames:e,unstyled:n})=>{let[f,b]=react.useState("list"),[S,ne]=react.useState(""),[P,de]=react.useState("all"),[k,le]=react.useState("all"),[o,h]=react.useState(null),[U,C]=react.useState([]),[F,$]=react.useState(""),[I,H]=react.useState(""),[M,V]=react.useState(""),[L,J]=react.useState(""),[E,z]=react.useState(""),[O,G]=react.useState(""),[j,W]=react.useState(""),g=react.useMemo(()=>chunkGOU6FU6Y_js.b(l),[l]),_=react.useMemo(()=>chunkGOU6FU6Y_js.d(l),[l]),K=react.useMemo(()=>{let r=[...l.records];if(P!=="all"&&(r=r.filter(a=>a.status===P)),k!=="all"&&(r=r.filter(a=>a.lawfulBasis===k)),S){let a=S.toLowerCase();r=r.filter(p=>p.name.toLowerCase().includes(a)||p.description.toLowerCase().includes(a)||p.dataCategories.some(m=>m.toLowerCase().includes(a))||p.department&&p.department.toLowerCase().includes(a));}return r},[l.records,P,k,S]);react.useEffect(()=>{o&&($(o.purposes.join(", ")),H(o.dataCategories.join(", ")),V((o.sensitiveDataCategories||[]).join(", ")),J(o.dataSubjectCategories.join(", ")),z(o.recipients.join(", ")),G(o.securityMeasures.join(", ")),W((o.systemsUsed||[]).join(", ")));},[o==null?void 0:o.id]);let oe=react.useCallback(()=>{let r=Oe();r.controllerDetails.name=l.organizationName,r.controllerDetails.contact=l.organizationContact,r.controllerDetails.address=l.organizationAddress,l.ndpcRegistrationNumber&&(r.controllerDetails.registrationNumber=l.ndpcRegistrationNumber),l.dpoDetails&&(r.controllerDetails.dpoContact=l.dpoDetails.email),h(r),C([]),b("form");},[l.organizationName,l.organizationContact,l.organizationAddress,l.ndpcRegistrationNumber,l.dpoDetails]),pe=react.useCallback(r=>{h(chunkMQFZHA2D_js.a({},r)),C([]),b("form");},[]),v=r=>r.split(",").map(a=>a.trim()).filter(a=>a.length>0),ue=react.useCallback(()=>{if(!o)return;let r=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},o),{purposes:v(F),dataCategories:v(I),sensitiveDataCategories:v(M),dataSubjectCategories:v(L),recipients:v(E),securityMeasures:v(O),systemsUsed:v(j),updatedAt:Date.now()});r.sensitiveDataCategories&&r.sensitiveDataCategories.length===0&&(r.sensitiveDataCategories=void 0),r.systemsUsed&&r.systemsUsed.length===0&&(r.systemsUsed=void 0);let a=chunkGOU6FU6Y_js.a(r);if(!a.valid){C(a.errors);return}l.records.find(m=>m.id===r.id)?D==null||D(r.id,r):R==null||R(r),h(null),C([]),b("list");},[o,F,I,M,L,E,O,j,l.records,D,R]),ce=react.useCallback(r=>{w==null||w(r);},[w]),se=react.useCallback(()=>{let r=chunkGOU6FU6Y_js.c(l),a=new Blob([r],{type:"text/csv;charset=utf-8;"}),p=URL.createObjectURL(a),m=document.createElement("a");m.href=p,m.download=`ropa_${l.organizationName.replace(/\s+/g,"_").toLowerCase()}_${new Date().toISOString().slice(0,10)}.csv`,m.click(),setTimeout(()=>URL.revokeObjectURL(p),100);},[l]),Q=react.useCallback(()=>{h(null),C([]),b("list");},[]),c=react.useCallback((r,a)=>{h(p=>p&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},p),{[r]:a}));},[]),q=react.useCallback((r,a)=>{h(p=>p&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},p),{controllerDetails:chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},p.controllerDetails),{[r]:a})}));},[]),ge=react.useCallback(r=>!!r.nextReviewDate&&r.nextReviewDate<=Date.now(),[]),me=react.useCallback(r=>{ne(r.target.value);},[]),ve=react.useCallback(r=>{de(r.target.value);},[]),fe=react.useCallback(r=>{le(r.target.value);},[]),be=react.useCallback(r=>{$(r.target.value);},[]),he=react.useCallback(r=>{H(r.target.value);},[]),_e=react.useCallback(r=>{V(r.target.value);},[]),xe=react.useCallback(r=>{J(r.target.value);},[]),Ce=react.useCallback(r=>{z(r.target.value);},[]),ye=react.useCallback(r=>{G(r.target.value);},[]),Re=react.useCallback(r=>{W(r.target.value);},[]),De=react.useCallback(()=>b("list"),[]),we=react.useCallback(()=>b("summary"),[]),Se=react.useCallback(r=>{let a={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--warning",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},p={active:"Active",inactive:"Inactive",archived:"Archived"};return jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${a[r]}`,e==null?void 0:e.statusBadge,n),children:p[r]})},[e==null?void 0:e.statusBadge,n]),Pe=react.useCallback(r=>jsxRuntime.jsx("span",{className:"ndpr-badge ndpr-badge--info",children:{consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"}[r]}),[]),ke=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",e==null?void 0:e.orgInfo,n),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Organization"}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:l.organizationName})]}),l.dpoDetails&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Data Protection Officer"}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:l.dpoDetails.name}),jsxRuntime.jsx("p",{className:"ndpr-form-field__hint",children:l.dpoDetails.email})]}),l.ndpcRegistrationNumber&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"NDPC Registration No."}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:l.ndpcRegistrationNumber})]})]}),jsxRuntime.jsxs("div",{className:"mt-2 text-xs ndpr-text-muted",children:["Version ",l.version," | Last Updated: ",te(l.lastUpdated)]})]}),Ae=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",e==null?void 0:e.summary,n),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.totalRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-info",children:"Total Records"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-success",children:g.activeRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-success",children:"Active"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.crossBorderRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-info",children:"Cross-Border"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:_.length}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-warning",children:"Records with Gaps"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"By Lawful Basis"}),T.map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r.label.split(" (")[0]}),jsxRuntime.jsx("span",{className:"font-medium",children:g.byLawfulBasis[r.value]||0})]},r.value))]}),jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Sensitive Data"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.sensitiveDataRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"DPIA Required"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.dpiaRequiredRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Automated Decisions"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.automatedDecisionRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Due for Review"}),jsxRuntime.jsx("span",{className:`font-medium ${g.recordsDueForReview.length>0?"ndpr-text-destructive":""}`,children:g.recordsDueForReview.length})]})]}),g.topDepartments.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Top Departments"}),g.topDepartments.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r.department}),jsxRuntime.jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]}),_.length>0&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md",e==null?void 0:e.complianceGap,n),role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-2",children:"Compliance Gaps Detected"}),_.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium ndpr-text-destructive",children:r.recordName}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((a,p)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]},r.recordId)),_.length>5&&jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["...and ",_.length-5," more record(s) with gaps."]})]})]}),Be=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaSearch",className:"ndpr-form-field__label",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"ropaSearch",value:S,onChange:me,placeholder:"Search records...",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaStatusFilter",className:"ndpr-form-field__label",children:"Status"}),jsxRuntime.jsxs("select",{id:"ropaStatusFilter",value:P,onChange:ve,className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),ee.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaBasisFilter",className:"ndpr-form-field__label",children:"Lawful Basis"}),jsxRuntime.jsxs("select",{id:"ropaBasisFilter",value:k,onChange:fe,className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsxRuntime.jsx("option",{value:"all",children:"All Bases"}),T.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label.split(" (")[0]},r.value))]})]}),jsxRuntime.jsxs("div",{className:"flex items-end space-x-2",children:[jsxRuntime.jsx("button",{onClick:oe,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${B}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:"Add Record"}),jsxRuntime.jsx("button",{onClick:se,"aria-label":"Export ROPA records as CSV",className:chunkE64TU6IU_js.a(`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 text-sm ${B}`,(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.exportButton),n),children:"Export CSV"})]})]}),K.length===0?jsxRuntime.jsx("p",{className:"ndpr-empty-state",children:"No processing records found."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkE64TU6IU_js.a("w-full text-sm text-left",e==null?void 0:e.table,n),children:[jsxRuntime.jsx("thead",{className:chunkE64TU6IU_js.a("ndpr-table__head",e==null?void 0:e.tableHeader,n),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Name"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Data Categories"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Last Reviewed"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{children:K.map(r=>{let a=ge(r),p=_.some(m=>m.recordId===r.id);return jsxRuntime.jsxs("tr",{className:chunkE64TU6IU_js.a(`border-b dark:border-gray-600 ${a?"bg-red-50 dark:bg-red-900/10":p?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} hover:bg-gray-50 dark:hover:bg-gray-700`,e==null?void 0:e.tableRow,n),children:[jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"font-medium",children:r.name}),r.department&&jsxRuntime.jsx("p",{className:"ndpr-form-field__hint",children:r.department}),a&&jsxRuntime.jsx("span",{className:"text-xs ndpr-text-destructive font-medium",children:"Review Overdue"})]})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:Pe(r.lawfulBasis)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:Se(r.status)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:te(r.lastReviewedAt)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsxs("div",{className:"ndpr-card__footer",children:[jsxRuntime.jsx("button",{onClick:()=>pe(r),"aria-label":`Edit record: ${r.name}`,className:"ndpr-text-primary hover:underline text-xs",children:"Edit"}),r.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>ce(r.id),"aria-label":`Archive record: ${r.name}`,className:"ndpr-text-muted hover:underline text-xs",children:"Archive"})]})})]},r.id)})})]})})]}),Fe=react.useMemo(()=>o?!l.records.find(r=>r.id===o.id):true,[o,l.records]),Ie=()=>{if(!o)return null;let r=Fe;return jsxRuntime.jsxs("div",{"data-ndpr-component":"ropa-manager",className:chunkE64TU6IU_js.a("",e==null?void 0:e.form,n),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex justify-between items-center mb-4",e==null?void 0:e.header,n),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:r?"Add Processing Record":"Edit Processing Record"}),jsxRuntime.jsx("button",{onClick:Q,className:"ndpr-button ndpr-button--ghost ndpr-button--sm",children:"Cancel"})]}),U.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:U.map((a,p)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-section",children:[jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Basic Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordName",className:"ndpr-form-field__label",children:"Activity Name *"}),jsxRuntime.jsx("input",{type:"text",id:"recordName",value:o.name,onChange:a=>c("name",a.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customer Account Management"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordDepartment",className:"ndpr-form-field__label",children:"Department"}),jsxRuntime.jsx("input",{type:"text",id:"recordDepartment",value:o.department||"",onChange:a=>c("department",a.target.value||void 0),className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Marketing"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"recordDescription",className:"ndpr-form-field__label",children:"Description *"}),jsxRuntime.jsx("textarea",{id:"recordDescription",value:o.description,onChange:a=>c("description",a.target.value),rows:3,"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe what personal data processing is performed..."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordStatus",className:"ndpr-form-field__label",children:"Status *"}),jsxRuntime.jsx("select",{id:"recordStatus",value:o.status,onChange:a=>c("status",a.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:ee.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Controller Details"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerName",className:"ndpr-form-field__label",children:"Controller Name *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerName",value:o.controllerDetails.name,onChange:a=>q("name",a.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerContact",className:"ndpr-form-field__label",children:"Controller Contact *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerContact",value:o.controllerDetails.contact,onChange:a=>q("contact",a.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"controllerAddress",className:"ndpr-form-field__label",children:"Controller Address *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerAddress",value:o.controllerDetails.address,onChange:a=>q("address",a.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Lawful Basis (NDPA Section 25)"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasis",className:"ndpr-form-field__label",children:"Lawful Basis *"}),jsxRuntime.jsx("select",{id:"lawfulBasis",value:o.lawfulBasis,onChange:a=>c("lawfulBasis",a.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:T.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasisJustification",className:"ndpr-form-field__label",children:"Justification *"}),jsxRuntime.jsx("textarea",{id:"lawfulBasisJustification",value:o.lawfulBasisJustification,onChange:a=>c("lawfulBasisJustification",a.target.value),rows:2,"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Explain why this lawful basis applies..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Data Details"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"purposes",className:"ndpr-form-field__label",children:"Purposes * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"purposes",value:F,onChange:be,"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Account management, Service delivery"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataCategories",className:"ndpr-form-field__label",children:"Data Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"dataCategories",value:I,onChange:he,"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Name, Email, Phone number"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sensitiveData",className:"ndpr-form-field__label",children:"Sensitive Data Categories (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"sensitiveData",value:M,onChange:_e,className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Health data, Biometric data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"subjectCategories",className:"ndpr-form-field__label",children:"Data Subject Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"subjectCategories",value:L,onChange:xe,"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customers, Employees"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recipients",className:"ndpr-form-field__label",children:"Recipients * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"recipients",value:E,onChange:Ce,"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Payment processors, Cloud service providers"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSource",className:"ndpr-form-field__label",children:"Data Source *"}),jsxRuntime.jsx("select",{id:"dataSource",value:o.dataSource,onChange:a=>c("dataSource",a.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:Ee.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),o.dataSource==="third_party"&&jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"thirdPartyDetails",className:"ndpr-form-field__label",children:"Third-Party Source Details *"}),jsxRuntime.jsx("input",{type:"text",id:"thirdPartyDetails",value:o.thirdPartySourceDetails||"",onChange:a=>c("thirdPartySourceDetails",a.target.value||void 0),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the third-party data source..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Retention and Security"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionPeriod",className:"ndpr-form-field__label",children:"Retention Period *"}),jsxRuntime.jsx("input",{type:"text",id:"retentionPeriod",value:o.retentionPeriod,onChange:a=>c("retentionPeriod",a.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., 5 years after account closure"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionJustification",className:"ndpr-form-field__label",children:"Retention Justification"}),jsxRuntime.jsx("input",{type:"text",id:"retentionJustification",value:o.retentionJustification||"",onChange:a=>c("retentionJustification",a.target.value||void 0),className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Why this retention period is necessary..."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"securityMeasures",className:"ndpr-form-field__label",children:"Security Measures * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"securityMeasures",value:O,onChange:ye,"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Encryption at rest, Access controls, Audit logging"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"systemsUsed",className:"ndpr-form-field__label",children:"Systems Used (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"systemsUsed",value:j,onChange:Re,className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., CRM, ERP, Cloud Storage"})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"dpiaRequired",checked:o.dpiaRequired,onChange:a=>c("dpiaRequired",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"dpiaRequired",className:"ndpr-text-sm ndpr-font-medium",children:"DPIA Required"})]}),o.dpiaRequired&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpiaReference",className:"ndpr-form-field__label",children:"DPIA Reference *"}),jsxRuntime.jsx("input",{type:"text",id:"dpiaReference",value:o.dpiaReference||"",onChange:a=>c("dpiaReference",a.target.value||void 0),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Reference to the completed DPIA"})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"automatedDecisionMaking",checked:o.automatedDecisionMaking,onChange:a=>c("automatedDecisionMaking",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMaking",className:"ndpr-text-sm ndpr-font-medium",children:"Automated Decision-Making"})]}),o.automatedDecisionMaking&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMakingDetails",className:"ndpr-form-field__label",children:"Automated Decision-Making Details *"}),jsxRuntime.jsx("textarea",{id:"automatedDecisionMakingDetails",value:o.automatedDecisionMakingDetails||"",onChange:a=>c("automatedDecisionMakingDetails",a.target.value||void 0),rows:2,"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the automated decision-making process..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Review Schedule"}),jsxRuntime.jsx("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"nextReviewDate",className:"ndpr-form-field__label",children:"Next Review Date"}),jsxRuntime.jsx("input",{type:"date",id:"nextReviewDate",value:o.nextReviewDate?new Date(o.nextReviewDate).toISOString().slice(0,10):"",onChange:a=>c("nextReviewDate",a.target.value?new Date(a.target.value).getTime():void 0),className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]})})]}),jsxRuntime.jsxs("div",{className:"flex justify-end space-x-3",children:[jsxRuntime.jsx("button",{onClick:Q,className:"ndpr-button ndpr-button--secondary ndpr-button--sm",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:ue,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${B}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:r?"Add Record":"Save Changes"})]})]})]})},Me=()=>jsxRuntime.jsxs("div",{className:"ndpr-section-divider ndpr-text-sm",children:[jsxRuntime.jsx("button",{onClick:De,className:`pb-2 text-sm font-medium ${f==="list"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Processing Records"}),jsxRuntime.jsx("button",{onClick:we,className:`pb-2 text-sm font-medium ${f==="summary"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Compliance Summary"})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,e==null?void 0:e.root,n),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("ndpr-section-heading",e==null?void 0:e.title,n),children:re}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:ie}),ke(),f!=="form"&&Me(),f==="list"&&Be(),f==="summary"&&Ae(),f==="form"&&Ie()]})};exports.a=$e;//# sourceMappingURL=chunk-XNSZ7KUH.js.map
2
- //# sourceMappingURL=chunk-XNSZ7KUH.js.map
1
+ 'use strict';var chunk4CVBQC66_js=require('./chunk-4CVBQC66.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var T=[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_interest",label:"Public Interest (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}],ee=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"archived",label:"Archived"}],Ee=[{value:"data_subject",label:"Directly from Data Subject"},{value:"third_party",label:"Third Party"},{value:"public_source",label:"Public Source"},{value:"other",label:"Other"}];function Oe(){let l=Date.now();return {id:`proc_${l}_${Math.random().toString(36).substring(2,11)}`,name:"",description:"",controllerDetails:{name:"",contact:"",address:""},lawfulBasis:"consent",lawfulBasisJustification:"",purposes:[],dataCategories:[],dataSubjectCategories:[],recipients:[],retentionPeriod:"",securityMeasures:[],dataSource:"data_subject",dpiaRequired:false,automatedDecisionMaking:false,status:"active",createdAt:l,updatedAt:l}}function te(l){return l?new Date(l).toLocaleDateString():"N/A"}var $e=({ropa:l,onAddRecord:R,onUpdateRecord:D,onArchiveRecord:w,title:re="Record of Processing Activities (ROPA)",description:ie="Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",className:ae="",buttonClassName:B="",classNames:e,unstyled:n})=>{let[f,b]=react.useState("list"),[S,ne]=react.useState(""),[P,de]=react.useState("all"),[k,le]=react.useState("all"),[o,h]=react.useState(null),[U,C]=react.useState([]),[F,$]=react.useState(""),[I,H]=react.useState(""),[M,V]=react.useState(""),[L,J]=react.useState(""),[E,z]=react.useState(""),[O,G]=react.useState(""),[j,W]=react.useState(""),g=react.useMemo(()=>chunk4CVBQC66_js.b(l),[l]),_=react.useMemo(()=>chunk4CVBQC66_js.d(l),[l]),K=react.useMemo(()=>{let r=[...l.records];if(P!=="all"&&(r=r.filter(a=>a.status===P)),k!=="all"&&(r=r.filter(a=>a.lawfulBasis===k)),S){let a=S.toLowerCase();r=r.filter(p=>p.name.toLowerCase().includes(a)||p.description.toLowerCase().includes(a)||p.dataCategories.some(m=>m.toLowerCase().includes(a))||p.department&&p.department.toLowerCase().includes(a));}return r},[l.records,P,k,S]);react.useEffect(()=>{o&&($(o.purposes.join(", ")),H(o.dataCategories.join(", ")),V((o.sensitiveDataCategories||[]).join(", ")),J(o.dataSubjectCategories.join(", ")),z(o.recipients.join(", ")),G(o.securityMeasures.join(", ")),W((o.systemsUsed||[]).join(", ")));},[o==null?void 0:o.id]);let oe=react.useCallback(()=>{let r=Oe();r.controllerDetails.name=l.organizationName,r.controllerDetails.contact=l.organizationContact,r.controllerDetails.address=l.organizationAddress,l.ndpcRegistrationNumber&&(r.controllerDetails.registrationNumber=l.ndpcRegistrationNumber),l.dpoDetails&&(r.controllerDetails.dpoContact=l.dpoDetails.email),h(r),C([]),b("form");},[l.organizationName,l.organizationContact,l.organizationAddress,l.ndpcRegistrationNumber,l.dpoDetails]),pe=react.useCallback(r=>{h(chunkRFPLZDIO_js.a({},r)),C([]),b("form");},[]),v=r=>r.split(",").map(a=>a.trim()).filter(a=>a.length>0),ue=react.useCallback(()=>{if(!o)return;let r=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},o),{purposes:v(F),dataCategories:v(I),sensitiveDataCategories:v(M),dataSubjectCategories:v(L),recipients:v(E),securityMeasures:v(O),systemsUsed:v(j),updatedAt:Date.now()});r.sensitiveDataCategories&&r.sensitiveDataCategories.length===0&&(r.sensitiveDataCategories=void 0),r.systemsUsed&&r.systemsUsed.length===0&&(r.systemsUsed=void 0);let a=chunk4CVBQC66_js.a(r);if(!a.valid){C(a.errors);return}l.records.find(m=>m.id===r.id)?D==null||D(r.id,r):R==null||R(r),h(null),C([]),b("list");},[o,F,I,M,L,E,O,j,l.records,D,R]),ce=react.useCallback(r=>{w==null||w(r);},[w]),se=react.useCallback(()=>{let r=chunk4CVBQC66_js.c(l),a=new Blob([r],{type:"text/csv;charset=utf-8;"}),p=URL.createObjectURL(a),m=document.createElement("a");m.href=p,m.download=`ropa_${l.organizationName.replace(/\s+/g,"_").toLowerCase()}_${new Date().toISOString().slice(0,10)}.csv`,m.click(),setTimeout(()=>URL.revokeObjectURL(p),100);},[l]),Q=react.useCallback(()=>{h(null),C([]),b("list");},[]),c=react.useCallback((r,a)=>{h(p=>p&&chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},p),{[r]:a}));},[]),q=react.useCallback((r,a)=>{h(p=>p&&chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},p),{controllerDetails:chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},p.controllerDetails),{[r]:a})}));},[]),ge=react.useCallback(r=>!!r.nextReviewDate&&r.nextReviewDate<=Date.now(),[]),me=react.useCallback(r=>{ne(r.target.value);},[]),ve=react.useCallback(r=>{de(r.target.value);},[]),fe=react.useCallback(r=>{le(r.target.value);},[]),be=react.useCallback(r=>{$(r.target.value);},[]),he=react.useCallback(r=>{H(r.target.value);},[]),_e=react.useCallback(r=>{V(r.target.value);},[]),xe=react.useCallback(r=>{J(r.target.value);},[]),Ce=react.useCallback(r=>{z(r.target.value);},[]),ye=react.useCallback(r=>{G(r.target.value);},[]),Re=react.useCallback(r=>{W(r.target.value);},[]),De=react.useCallback(()=>b("list"),[]),we=react.useCallback(()=>b("summary"),[]),Se=react.useCallback(r=>{let a={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--warning",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},p={active:"Active",inactive:"Inactive",archived:"Archived"};return jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${a[r]}`,e==null?void 0:e.statusBadge,n),children:p[r]})},[e==null?void 0:e.statusBadge,n]),Pe=react.useCallback(r=>jsxRuntime.jsx("span",{className:"ndpr-badge ndpr-badge--info",children:{consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"}[r]}),[]),ke=()=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",e==null?void 0:e.orgInfo,n),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Organization"}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:l.organizationName})]}),l.dpoDetails&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Data Protection Officer"}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:l.dpoDetails.name}),jsxRuntime.jsx("p",{className:"ndpr-form-field__hint",children:l.dpoDetails.email})]}),l.ndpcRegistrationNumber&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"NDPC Registration No."}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:l.ndpcRegistrationNumber})]})]}),jsxRuntime.jsxs("div",{className:"mt-2 text-xs ndpr-text-muted",children:["Version ",l.version," | Last Updated: ",te(l.lastUpdated)]})]}),Ae=()=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mb-6",e==null?void 0:e.summary,n),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.totalRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-info",children:"Total Records"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-success",children:g.activeRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-success",children:"Active"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.crossBorderRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-info",children:"Cross-Border"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:_.length}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-warning",children:"Records with Gaps"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"By Lawful Basis"}),T.map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r.label.split(" (")[0]}),jsxRuntime.jsx("span",{className:"font-medium",children:g.byLawfulBasis[r.value]||0})]},r.value))]}),jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Sensitive Data"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.sensitiveDataRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"DPIA Required"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.dpiaRequiredRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Automated Decisions"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.automatedDecisionRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Due for Review"}),jsxRuntime.jsx("span",{className:`font-medium ${g.recordsDueForReview.length>0?"ndpr-text-destructive":""}`,children:g.recordsDueForReview.length})]})]}),g.topDepartments.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Top Departments"}),g.topDepartments.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r.department}),jsxRuntime.jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]}),_.length>0&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md",e==null?void 0:e.complianceGap,n),role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-2",children:"Compliance Gaps Detected"}),_.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium ndpr-text-destructive",children:r.recordName}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((a,p)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]},r.recordId)),_.length>5&&jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["...and ",_.length-5," more record(s) with gaps."]})]})]}),Be=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaSearch",className:"ndpr-form-field__label",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"ropaSearch",value:S,onChange:me,placeholder:"Search records...",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaStatusFilter",className:"ndpr-form-field__label",children:"Status"}),jsxRuntime.jsxs("select",{id:"ropaStatusFilter",value:P,onChange:ve,className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),ee.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaBasisFilter",className:"ndpr-form-field__label",children:"Lawful Basis"}),jsxRuntime.jsxs("select",{id:"ropaBasisFilter",value:k,onChange:fe,className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsxRuntime.jsx("option",{value:"all",children:"All Bases"}),T.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label.split(" (")[0]},r.value))]})]}),jsxRuntime.jsxs("div",{className:"flex items-end space-x-2",children:[jsxRuntime.jsx("button",{onClick:oe,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${B}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:"Add Record"}),jsxRuntime.jsx("button",{onClick:se,"aria-label":"Export ROPA records as CSV",className:chunkAME4HJR4_js.a(`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 text-sm ${B}`,(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.exportButton),n),children:"Export CSV"})]})]}),K.length===0?jsxRuntime.jsx("p",{className:"ndpr-empty-state",children:"No processing records found."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkAME4HJR4_js.a("w-full text-sm text-left",e==null?void 0:e.table,n),children:[jsxRuntime.jsx("thead",{className:chunkAME4HJR4_js.a("ndpr-table__head",e==null?void 0:e.tableHeader,n),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Name"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Data Categories"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Last Reviewed"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{children:K.map(r=>{let a=ge(r),p=_.some(m=>m.recordId===r.id);return jsxRuntime.jsxs("tr",{className:chunkAME4HJR4_js.a(`border-b dark:border-gray-600 ${a?"bg-red-50 dark:bg-red-900/10":p?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} hover:bg-gray-50 dark:hover:bg-gray-700`,e==null?void 0:e.tableRow,n),children:[jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"font-medium",children:r.name}),r.department&&jsxRuntime.jsx("p",{className:"ndpr-form-field__hint",children:r.department}),a&&jsxRuntime.jsx("span",{className:"text-xs ndpr-text-destructive font-medium",children:"Review Overdue"})]})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:Pe(r.lawfulBasis)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:Se(r.status)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:te(r.lastReviewedAt)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsxs("div",{className:"ndpr-card__footer",children:[jsxRuntime.jsx("button",{onClick:()=>pe(r),"aria-label":`Edit record: ${r.name}`,className:"ndpr-text-primary hover:underline text-xs",children:"Edit"}),r.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>ce(r.id),"aria-label":`Archive record: ${r.name}`,className:"ndpr-text-muted hover:underline text-xs",children:"Archive"})]})})]},r.id)})})]})})]}),Fe=react.useMemo(()=>o?!l.records.find(r=>r.id===o.id):true,[o,l.records]),Ie=()=>{if(!o)return null;let r=Fe;return jsxRuntime.jsxs("div",{"data-ndpr-component":"ropa-manager",className:chunkAME4HJR4_js.a("",e==null?void 0:e.form,n),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex justify-between items-center mb-4",e==null?void 0:e.header,n),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:r?"Add Processing Record":"Edit Processing Record"}),jsxRuntime.jsx("button",{onClick:Q,className:"ndpr-button ndpr-button--ghost ndpr-button--sm",children:"Cancel"})]}),U.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:U.map((a,p)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-section",children:[jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Basic Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordName",className:"ndpr-form-field__label",children:"Activity Name *"}),jsxRuntime.jsx("input",{type:"text",id:"recordName",value:o.name,onChange:a=>c("name",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customer Account Management"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordDepartment",className:"ndpr-form-field__label",children:"Department"}),jsxRuntime.jsx("input",{type:"text",id:"recordDepartment",value:o.department||"",onChange:a=>c("department",a.target.value||void 0),className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Marketing"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"recordDescription",className:"ndpr-form-field__label",children:"Description *"}),jsxRuntime.jsx("textarea",{id:"recordDescription",value:o.description,onChange:a=>c("description",a.target.value),rows:3,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe what personal data processing is performed..."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordStatus",className:"ndpr-form-field__label",children:"Status *"}),jsxRuntime.jsx("select",{id:"recordStatus",value:o.status,onChange:a=>c("status",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:ee.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Controller Details"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerName",className:"ndpr-form-field__label",children:"Controller Name *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerName",value:o.controllerDetails.name,onChange:a=>q("name",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerContact",className:"ndpr-form-field__label",children:"Controller Contact *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerContact",value:o.controllerDetails.contact,onChange:a=>q("contact",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"controllerAddress",className:"ndpr-form-field__label",children:"Controller Address *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerAddress",value:o.controllerDetails.address,onChange:a=>q("address",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Lawful Basis (NDPA Section 25)"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasis",className:"ndpr-form-field__label",children:"Lawful Basis *"}),jsxRuntime.jsx("select",{id:"lawfulBasis",value:o.lawfulBasis,onChange:a=>c("lawfulBasis",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:T.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasisJustification",className:"ndpr-form-field__label",children:"Justification *"}),jsxRuntime.jsx("textarea",{id:"lawfulBasisJustification",value:o.lawfulBasisJustification,onChange:a=>c("lawfulBasisJustification",a.target.value),rows:2,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Explain why this lawful basis applies..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Data Details"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"purposes",className:"ndpr-form-field__label",children:"Purposes * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"purposes",value:F,onChange:be,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Account management, Service delivery"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataCategories",className:"ndpr-form-field__label",children:"Data Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"dataCategories",value:I,onChange:he,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Name, Email, Phone number"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sensitiveData",className:"ndpr-form-field__label",children:"Sensitive Data Categories (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"sensitiveData",value:M,onChange:_e,className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Health data, Biometric data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"subjectCategories",className:"ndpr-form-field__label",children:"Data Subject Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"subjectCategories",value:L,onChange:xe,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customers, Employees"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recipients",className:"ndpr-form-field__label",children:"Recipients * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"recipients",value:E,onChange:Ce,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Payment processors, Cloud service providers"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSource",className:"ndpr-form-field__label",children:"Data Source *"}),jsxRuntime.jsx("select",{id:"dataSource",value:o.dataSource,onChange:a=>c("dataSource",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:Ee.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),o.dataSource==="third_party"&&jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"thirdPartyDetails",className:"ndpr-form-field__label",children:"Third-Party Source Details *"}),jsxRuntime.jsx("input",{type:"text",id:"thirdPartyDetails",value:o.thirdPartySourceDetails||"",onChange:a=>c("thirdPartySourceDetails",a.target.value||void 0),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the third-party data source..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Retention and Security"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionPeriod",className:"ndpr-form-field__label",children:"Retention Period *"}),jsxRuntime.jsx("input",{type:"text",id:"retentionPeriod",value:o.retentionPeriod,onChange:a=>c("retentionPeriod",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., 5 years after account closure"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionJustification",className:"ndpr-form-field__label",children:"Retention Justification"}),jsxRuntime.jsx("input",{type:"text",id:"retentionJustification",value:o.retentionJustification||"",onChange:a=>c("retentionJustification",a.target.value||void 0),className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Why this retention period is necessary..."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"securityMeasures",className:"ndpr-form-field__label",children:"Security Measures * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"securityMeasures",value:O,onChange:ye,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Encryption at rest, Access controls, Audit logging"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"systemsUsed",className:"ndpr-form-field__label",children:"Systems Used (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"systemsUsed",value:j,onChange:Re,className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., CRM, ERP, Cloud Storage"})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"dpiaRequired",checked:o.dpiaRequired,onChange:a=>c("dpiaRequired",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"dpiaRequired",className:"ndpr-text-sm ndpr-font-medium",children:"DPIA Required"})]}),o.dpiaRequired&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpiaReference",className:"ndpr-form-field__label",children:"DPIA Reference *"}),jsxRuntime.jsx("input",{type:"text",id:"dpiaReference",value:o.dpiaReference||"",onChange:a=>c("dpiaReference",a.target.value||void 0),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Reference to the completed DPIA"})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"automatedDecisionMaking",checked:o.automatedDecisionMaking,onChange:a=>c("automatedDecisionMaking",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMaking",className:"ndpr-text-sm ndpr-font-medium",children:"Automated Decision-Making"})]}),o.automatedDecisionMaking&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMakingDetails",className:"ndpr-form-field__label",children:"Automated Decision-Making Details *"}),jsxRuntime.jsx("textarea",{id:"automatedDecisionMakingDetails",value:o.automatedDecisionMakingDetails||"",onChange:a=>c("automatedDecisionMakingDetails",a.target.value||void 0),rows:2,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the automated decision-making process..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Review Schedule"}),jsxRuntime.jsx("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"nextReviewDate",className:"ndpr-form-field__label",children:"Next Review Date"}),jsxRuntime.jsx("input",{type:"date",id:"nextReviewDate",value:o.nextReviewDate?new Date(o.nextReviewDate).toISOString().slice(0,10):"",onChange:a=>c("nextReviewDate",a.target.value?new Date(a.target.value).getTime():void 0),className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]})})]}),jsxRuntime.jsxs("div",{className:"flex justify-end space-x-3",children:[jsxRuntime.jsx("button",{onClick:Q,className:"ndpr-button ndpr-button--secondary ndpr-button--sm",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:ue,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${B}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:r?"Add Record":"Save Changes"})]})]})]})},Me=()=>jsxRuntime.jsxs("div",{className:"ndpr-section-divider ndpr-text-sm",children:[jsxRuntime.jsx("button",{onClick:De,className:`pb-2 text-sm font-medium ${f==="list"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Processing Records"}),jsxRuntime.jsx("button",{onClick:we,className:`pb-2 text-sm font-medium ${f==="summary"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Compliance Summary"})]});return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,e==null?void 0:e.root,n),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",e==null?void 0:e.title,n),children:re}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:ie}),ke(),f!=="form"&&Me(),f==="list"&&Be(),f==="summary"&&Ae(),f==="form"&&Ie()]})};exports.a=$e;
@@ -0,0 +1 @@
1
+ import {b}from'./chunk-RZ6GC6WN.mjs';import {a}from'./chunk-SFGW37LE.mjs';import {useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var oe=({requests:R,onSelectRequest:P,onUpdateStatus:I,onAssignRequest:V,title:H="Data Subject Request Dashboard",description:X="Track and manage data subject requests in compliance with NDPA Part IV requirements.",className:W="",buttonClassName:_="",showRequestDetails:J=true,showRequestTimeline:Y=true,showDeadlineAlerts:F=true,assignees:i=[],classNames:l,unstyled:k=false})=>{let[y,f]=useState(null),[D,B]=useState(R),[j,O]=useState("all"),[C,T]=useState("all"),[A,M]=useState(""),[$,z]=useState("createdAt"),[U,Z]=useState("desc"),[S,G]=useState("");useEffect(()=>{let e=[...R];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 h=0;switch($){case "createdAt":h=r.createdAt-p.createdAt;break;case "dueDate":h=(r.dueDate||0)-(p.dueDate||0);break;case "type":h=r.type.localeCompare(p.type);break;case "status":h=r.status.localeCompare(p.status);break;default:h=r.createdAt-p.createdAt;}return U==="asc"?h:-h}),B(e);},[R,j,C,A,$,U]),useEffect(()=>{D.length>0&&(y&&D.some(r=>r.id===y)||f(D[0].id));},[D,y]);let E=e=>{f(e),P&&P(e);},L=e=>{y&&I&&I(y,e);},Q=()=>{y&&S&&V&&(V(y,S),G(""));},w=e=>new Date(e).toLocaleDateString(),q=e=>{let r=Date.now(),p=(e-r)/(1440*60*1e3);return Math.ceil(p)},m=y?R.find(e=>e.id===y):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",withdraw_consent:"bg-pink-100 text-pink-800 dark:bg-pink-900 dark:text-pink-200"},p={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making",withdraw_consent:"Withdraw Consent"};return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${r[e]}`,children:p[e]})},s=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]}`,l==null?void 0:l.statusBadge,k),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=q(e.dueDate);return r<=0?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",role:"alert","aria-live":"polite",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",role:"alert","aria-live":"polite",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","aria-live":"polite",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","aria-live":"polite",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 ${w(e.createdAt)}.`}];return e.verifiedAt?r.push({title:"Identity Verified",date:e.verifiedAt,completed:true,description:`Data subject's identity was verified on ${w(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 ${w(e.updatedAt)}.`}),e.status==="completed"?r.push({title:"Request Completed",date:e.completedAt||Date.now(),completed:true,description:`Request was completed on ${w(e.completedAt||Date.now())}.`}):e.status==="rejected"&&r.push({title:"Request Rejected",date:e.completedAt||Date.now(),completed:true,description:`Request was rejected on ${w(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 ${w(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,h)=>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?w(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})]},h))})]})},o=()=>[{value:"all",label:"All Types"},{value:"information",label:"Information (NDPA Section 27)"},{value:"access",label:"Access (NDPA Section 34(1)(a))"},{value:"rectification",label:"Rectification (NDPA Section 34(1)(c))"},{value:"erasure",label:"Erasure (NDPA Section 34(1)(d))"},{value:"restriction",label:"Restriction (NDPA Section 34(1)(e))"},{value:"portability",label:"Portability (NDPA Section 38)"},{value:"objection",label:"Objection (NDPA Section 36)"},{value:"automated_decision_making",label:"Automated Decision-Making (NDPA Section 37)"},{value:"withdraw_consent",label:"Withdraw Consent (NDPA Section 35)"}].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 ${W}`,l==null?void 0:l.root,k),children:[jsxs("div",{className:a("",l==null?void 0:l.header,k),children:[jsx("h2",{className:a("text-xl font-bold mb-2",l==null?void 0:l.title,k),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",l==null?void 0:l.filters,k),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=>T(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:$,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=>M(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"}),D.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",l==null?void 0:l.requestList,k),children:D.map(e=>{let r=e.dueDate?q(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",{role:"button",tabIndex:0,"aria-label":`View request from ${e.subject.name}`,"aria-selected":y===e.id,className:a(`p-3 rounded-md cursor-pointer ${y===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"}`,l==null?void 0:l.requestItem,k),onClick:()=>E(e.id),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),E(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: ",w(e.createdAt)]}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsx("div",{children:s(e.status)}),jsx("div",{children:p})]})]},e.id)})})]}),jsx("div",{className:a("md:col-span-2",l==null?void 0:l.detailPanel,k),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),s(m.status)]})]}),F&&m.dueDate&&jsx("div",{className:"mb-4",children:g(m)}),J&&jsxs("div",{className:"mb-6",children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"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:"})," ",w(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:"})," ",w(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",{id:"update-status-heading",className:"text-md font-medium mb-2",children:"Update Status"}),jsxs("div",{className:"flex space-x-2",children:[jsx("select",{"aria-label":"Update request status",value:m.status,onChange:e=>L(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:()=>L(m.status),"aria-label":"Apply status update",className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${_}`,children:"Update"})]})]}),i.length>0&&jsxs("div",{children:[jsx("h3",{id:"assign-request-heading",className:"text-md font-medium mb-2",children:"Assign Request"}),jsxs("div",{className:"flex space-x-2",children:[jsxs("select",{"aria-label":"Select assignee",value:S,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:Q,disabled:!S,"aria-label":"Assign request to selected person",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 ${_}`,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(b(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:R,onSelectRequest:P,title:I="DSR Request Tracker",description:V="Track the status and progress of data subject requests as required by NDPA Part IV.",className:H="",buttonClassName:X="",showSummaryStats:W=true,showTypeBreakdown:_=true,showStatusBreakdown:J=true,showTimelineChart:Y=true,showOverdueRequests:F=true,classNames:i,unstyled:l=false})=>{let[k,y]=useState("30days"),[f,D]=useState(R),[B,j]=useState([]),[O,C]=useState([]);useEffect(()=>{let t=Date.now(),s;switch(k){case "7days":s=R.filter(o=>t-o.createdAt<=10080*60*1e3);break;case "30days":s=R.filter(o=>t-o.createdAt<=720*60*60*1e3);break;case "90days":s=R.filter(o=>t-o.createdAt<=2160*60*60*1e3);break;default:s=[...R];}D(s);let g=s.filter(o=>o.dueDate&&t>o.dueDate&&o.status!=="completed"&&o.status!=="rejected");j(g);let x=s.filter(o=>o.dueDate&&t<o.dueDate&&o.dueDate-t<=10080*60*1e3&&o.status!=="completed"&&o.status!=="rejected");C(x);},[R,k]);let T=t=>{P&&P(t);},A=t=>new Date(t).toLocaleDateString(),M=t=>{let s=Date.now(),g=(t-s)/(1440*60*1e3);return Math.ceil(g)},$=()=>{let t=f.filter(g=>g.status==="completed"&&g.completedAt&&g.createdAt);if(t.length===0)return null;let s=t.reduce((g,x)=>{let o=((x.completedAt||0)-x.createdAt)/864e5;return g+o},0);return Number((s/t.length).toFixed(1))},z=()=>{let t=f.filter(g=>(g.status==="completed"||g.status==="rejected")&&g.completedAt&&g.dueDate);if(t.length===0)return null;let s=t.filter(g=>(g.completedAt||0)<=(g.dueDate||0));return Math.round(s.length/t.length*100)},U=()=>{let t={};return f.forEach(s=>{t[s.type]=(t[s.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,withdraw_consent:t.withdraw_consent||0}},Z=()=>{let t={};return f.forEach(s=>{t[s.status]=(t[s.status]||0)+1;}),{pending:t.pending||0,awaitingVerification:t.awaitingVerification||0,inProgress:t.inProgress||0,completed:t.completed||0,rejected:t.rejected||0}},S=t=>{let s={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",withdraw_consent:"bg-pink-100 text-pink-800 dark:bg-pink-900 dark:text-pink-200"},g={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making",withdraw_consent:"Withdraw Consent"};return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${s[t]}`,children:g[t]})},E=()=>{let t=f.length,s=f.filter(u=>u.status!=="completed"&&u.status!=="rejected").length;f.filter(u=>u.status==="completed"||u.status==="rejected").length;let x=$(),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,l),children:[jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,l),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,l),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:s})]}),jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,l),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,l),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"})]})]})},L=()=>{let t=U(),s=f.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,l),children:[jsx("h3",{className:a("text-lg font-medium mb-4",i==null?void 0:i.tableHeader,l),children:"Request Types"}),s===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/s*100);return jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-center mb-1",children:[jsxs("div",{className:"flex items-center",children:[S(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)})})]})},Q=()=>{let t=Z(),s=f.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,l),children:[jsx("h3",{className:a("text-lg font-medium mb-4",i==null?void 0:i.tableHeader,l),children:"Request Status"}),s===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/s*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/s*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)})})]})]})},w=()=>{let t={};f.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))})]})]})},q=()=>jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6","aria-live":"polite",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",{role:"button",tabIndex:0,"aria-label":`View overdue request from ${t.subject.name}`,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,l),onClick:()=>T(t.id),onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),T(t.id));},children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:t.subject.name}),S(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(M(t.dueDate||0))," days"]})]})]},t.id))})]}),m=()=>jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6","aria-live":"polite",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 s=M(t.dueDate||0);return jsxs("div",{role:"button",tabIndex:0,"aria-label":`View upcoming deadline for ${t.subject.name}`,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,l),onClick:()=>T(t.id),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),T(t.id));},children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:t.subject.name}),S(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 ${s<=3?"text-red-600 dark:text-red-400":"text-yellow-600 dark:text-yellow-400"}`,children:["Due in ",s," 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,l),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,l),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-bold mb-2",i==null?void 0:i.title,l),children:I}),jsx("p",{className:"text-gray-600 dark:text-gray-300",children:V})]}),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:k,onChange:t=>y(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"})]})]})]}),W&&E(),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxs("div",{children:[_&&L(),J&&Q()]}),jsxs("div",{children:[Y&&w(),F&&q(),F&&m()]})]})]})};export{oe as a,ue as b};
@@ -1,2 +1 @@
1
- 'use strict';var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js');function l(e,t={}){var a;let o=(a=t.headers)!=null?a:{};return {load(){return chunkMQFZHA2D_js.d(this,null,function*(){try{let r=yield fetch(e,{method:"GET",headers:chunkMQFZHA2D_js.a({},o)});return r.ok?yield r.json():null}catch(r){return null}})},save(r){return chunkMQFZHA2D_js.d(this,null,function*(){try{let n=yield fetch(e,{method:"POST",headers:chunkMQFZHA2D_js.a({"Content-Type":"application/json"},o),body:JSON.stringify(r)});n.ok||console.warn(`[ndpr-toolkit] Failed to save to ${e}: ${n.status}`);}catch(n){console.warn(`[ndpr-toolkit] Failed to save to ${e}`);}})},remove(){return chunkMQFZHA2D_js.d(this,null,function*(){try{let r=yield fetch(e,{method:"DELETE",headers:chunkMQFZHA2D_js.a({},o)});r.ok||console.warn(`[ndpr-toolkit] Failed to delete from ${e}: ${r.status}`);}catch(r){console.warn(`[ndpr-toolkit] Failed to delete from ${e}`);}})}}}function u(e){let t=e!=null?e:null;return {load(){return t},save(o){t=o;},remove(){t=null;}}}function f(e,...t){return {load(){return e.load()},save(o){let a=e.save(o),s=()=>{for(let r of t)try{r.save(o);}catch(n){console.warn("[ndpr-toolkit] Secondary adapter save failed:",n);}};if(a instanceof Promise)return a.then(()=>s());s();},remove(){let o=e.remove(),a=()=>{for(let s of t)try{s.remove();}catch(r){console.warn("[ndpr-toolkit] Secondary adapter remove failed:",r);}};if(o instanceof Promise)return o.then(()=>a());a();}}}exports.a=l;exports.b=u;exports.c=f;//# sourceMappingURL=chunk-JBSCER34.js.map
2
- //# sourceMappingURL=chunk-JBSCER34.js.map
1
+ 'use strict';var chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js');function l(e,t={}){var a;let o=(a=t.headers)!=null?a:{};return {load(){return chunkRFPLZDIO_js.d(this,null,function*(){try{let r=yield fetch(e,{method:"GET",headers:chunkRFPLZDIO_js.a({},o)});return r.ok?yield r.json():null}catch(r){return null}})},save(r){return chunkRFPLZDIO_js.d(this,null,function*(){try{let n=yield fetch(e,{method:"POST",headers:chunkRFPLZDIO_js.a({"Content-Type":"application/json"},o),body:JSON.stringify(r)});n.ok||console.warn(`[ndpr-toolkit] Failed to save to ${e}: ${n.status}`);}catch(n){console.warn(`[ndpr-toolkit] Failed to save to ${e}`);}})},remove(){return chunkRFPLZDIO_js.d(this,null,function*(){try{let r=yield fetch(e,{method:"DELETE",headers:chunkRFPLZDIO_js.a({},o)});r.ok||console.warn(`[ndpr-toolkit] Failed to delete from ${e}: ${r.status}`);}catch(r){console.warn(`[ndpr-toolkit] Failed to delete from ${e}`);}})}}}function u(e){let t=e!=null?e:null;return {load(){return t},save(o){t=o;},remove(){t=null;}}}function f(e,...t){return {load(){return e.load()},save(o){let a=e.save(o),s=()=>{for(let r of t)try{r.save(o);}catch(n){console.warn("[ndpr-toolkit] Secondary adapter save failed:",n);}};if(a instanceof Promise)return a.then(()=>s());s();},remove(){let o=e.remove(),a=()=>{for(let s of t)try{s.remove();}catch(r){console.warn("[ndpr-toolkit] Secondary adapter remove failed:",r);}};if(o instanceof Promise)return o.then(()=>a());a();}}}exports.a=l;exports.b=u;exports.c=f;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkL2VO3MEJ_js=require('./chunk-L2VO3MEJ.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),reactDom=require('react-dom'),jsxRuntime=require('react/jsx-runtime');var Sn=({options:d,onSave:Y,title:K="We Value Your Privacy",description:Q="We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",acceptAllButtonText:U="Accept All",rejectAllButtonText:X="Reject All",customizeButtonText:Z="Customize",saveButtonText:s="Save Preferences",position:m="bottom",variant:h="bar",zIndex:I=9999,version:_="1.0",show:C,manageStorage:x=true,storageKey:y="ndpr_consent",className:$="",buttonClassName:A="",primaryButtonClassName:N="",secondaryButtonClassName:nn="",classNames:n,unstyled:o,onAnalytics:B})=>{let[u,c]=react.useState(false),[l,R]=react.useState(false),[a,k]=react.useState({}),[T,tn]=react.useState(false),en=chunkL2VO3MEJ_js.a({active:u}),z=react.useRef(null),E=react.useRef(false);react.useEffect(()=>{tn(true);},[]);let p=react.useCallback((t,e)=>{B==null||B(chunkRFPLZDIO_js.a({action:t,timestamp:Date.now(),version:_},e!==void 0?{categories:e}:{}));},[B,_]);react.useEffect(()=>{let t={};if(d.forEach(e=>{t[e.id]=e.defaultValue||false;}),k(t),C===void 0)if(!x)c(true);else {let e=localStorage.getItem(y);if(e)try{JSON.parse(e).version!==_?c(!0):c(!1);}catch(w){c(true);}else c(true);}else c(C);},[d,y,_,x]),react.useEffect(()=>{C!==void 0&&c(C);},[C]);let on=()=>{let t={};d.forEach(e=>{t[e.id]=true;}),p("accepted_all",t),P(t);},q=()=>{let t={};d.forEach(e=>{t[e.id]=e.required||false;}),p("rejected_all",t),P(t);},rn=(t,e)=>{k(w=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},w),{[t]:e}));},dn=()=>{let t={};d.forEach(e=>{t[e.id]=true;}),k(t);},cn=()=>{let t={};d.forEach(e=>{t[e.id]=e.required||false;}),k(t);},H=d.length>0&&d.every(t=>a[t.id]),un=()=>{p("customized",a),P(a);},P=t=>{let e={consents:t,timestamp:Date.now(),version:_,method:l?"customize":"banner",hasInteracted:true};x&&localStorage.setItem(y,JSON.stringify(e)),Y(e),c(false),R(false);};if(react.useEffect(()=>{if(!u)return;let t=e=>{e.key==="Escape"&&(p("dismissed"),q());};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[u,p,d,l]),react.useEffect(()=>{u&&!E.current&&(E.current=true,p("shown")),u||(E.current=false);},[u,p]),react.useEffect(()=>{if(l&&z.current){let t=z.current;t.style.maxHeight="0px",t.style.opacity="0",t.offsetHeight,t.style.maxHeight=`${t.scrollHeight}px`,t.style.opacity="1";}},[l]),!u)return null;let f=h==="modal"?"center":m,O=f==="inline",j=f==="center",g=["ndpr-consent-banner"];h!=="bar"&&g.push(`ndpr-consent-banner--${h}`),f==="top"?g.push("ndpr-consent-banner--top"):f==="bottom"?g.push("ndpr-consent-banner--bottom"):f==="inline"&&g.push("ndpr-consent-banner--inline"),$&&g.push($);let pn=g.join(" "),F=`ndpr-consent-banner__button ndpr-consent-banner__button--primary ${A} ${N}`.trim(),bn=`ndpr-consent-banner__button ndpr-consent-banner__button--secondary ${A} ${nn}`.trim(),ln=`ndpr-consent-banner__button ndpr-consent-banner__button--ghost ${A}`.trim(),fn=(n==null?void 0:n.primaryButton)||(n==null?void 0:n.acceptButton)||F,G=(n==null?void 0:n.secondaryButton)||(n==null?void 0:n.rejectButton)||bn,gn=(n==null?void 0:n.customizeButton)||ln,vn=(n==null?void 0:n.saveButton)||F,D=jsxRuntime.jsx("div",{ref:en,tabIndex:-1,"data-ndpr-component":"consent-banner","data-ndpr-variant":h,"data-ndpr-position":f,className:chunkAME4HJR4_js.a(pn,n==null?void 0:n.root,o),style:!O&&!j?{zIndex:I}:void 0,role:"dialog","aria-modal":j||void 0,"aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__container",n==null?void 0:n.container,o),children:[jsxRuntime.jsx("h2",{id:"consent-banner-title",className:chunkAME4HJR4_js.a("ndpr-consent-banner__title",n==null?void 0:n.title,o),children:K}),jsxRuntime.jsx("p",{id:"consent-banner-description",className:chunkAME4HJR4_js.a("ndpr-consent-banner__description",n==null?void 0:n.description,o),children:Q}),l&&jsxRuntime.jsxs("div",{ref:z,className:chunkAME4HJR4_js.a("ndpr-consent-banner__customize-panel",n==null?void 0:n.customizePanel,o),children:[jsxRuntime.jsx("div",{className:o?"":"ndpr-consent-banner__select-all-row",children:jsxRuntime.jsx("button",{type:"button",onClick:H?cn:dn,className:chunkAME4HJR4_js.a("ndpr-consent-banner__select-all-button",n==null?void 0:n.selectAllButton,o),children:H?"Deselect All":"Select All"})}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__options-list",n==null?void 0:n.optionsList,o),children:d.map(t=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__option",n==null?void 0:n.optionItem,o),children:[jsxRuntime.jsx("input",{id:`consent-${t.id}`,type:"checkbox",checked:a[t.id]||false,onChange:e=>rn(t.id,e.target.checked),disabled:t.required,className:chunkAME4HJR4_js.a("ndpr-consent-banner__option-checkbox",n==null?void 0:n.optionCheckbox,o)}),jsxRuntime.jsxs("div",{className:o?"":"ndpr-consent-banner__option-text",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${t.id}`,className:chunkAME4HJR4_js.a("ndpr-consent-banner__option-label",n==null?void 0:n.optionLabel,o),children:[t.label,t.required&&jsxRuntime.jsx("span",{className:o?"":"ndpr-consent-banner__required-marker",children:" *"})]}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__option-description",n==null?void 0:n.optionDescription,o),children:t.description})]})]},t.id))}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__buttons",n==null?void 0:n.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:un,className:chunkAME4HJR4_js.a(vn,n==null?void 0:n.saveButton,o),children:s}),jsxRuntime.jsx("button",{onClick:()=>R(false),className:chunkAME4HJR4_js.a(G,n==null?void 0:n.rejectButton,o),children:"Back"})]})]}),!l&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__buttons",n==null?void 0:n.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:on,className:chunkAME4HJR4_js.a(fn,n==null?void 0:n.acceptButton,o),children:U}),jsxRuntime.jsx("button",{onClick:q,className:chunkAME4HJR4_js.a(G,n==null?void 0:n.rejectButton,o),children:X}),jsxRuntime.jsx("button",{onClick:()=>R(true),className:chunkAME4HJR4_js.a(gn,n==null?void 0:n.customizeButton,o),children:Z})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("ndpr-consent-banner__footer-text",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(O)return D;if(j){let t=jsxRuntime.jsx("div",{className:o?"":"ndpr-consent-banner__overlay",style:{zIndex:I},children:D});return T?reactDom.createPortal(t,document.body):null}return T?reactDom.createPortal(D,document.body):null};exports.a=Sn;
@@ -0,0 +1 @@
1
+ var n={AT:{country:"Austria",isoCode:"AT",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},BE:{country:"Belgium",isoCode:"BE",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},BG:{country:"Bulgaria",isoCode:"BG",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},HR:{country:"Croatia",isoCode:"HR",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},CY:{country:"Cyprus",isoCode:"CY",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},CZ:{country:"Czech Republic",isoCode:"CZ",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},DK:{country:"Denmark",isoCode:"DK",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},EE:{country:"Estonia",isoCode:"EE",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},FI:{country:"Finland",isoCode:"FI",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},FR:{country:"France",isoCode:"FR",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},DE:{country:"Germany",isoCode:"DE",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR with additional national provisions (BDSG).",lastUpdated:"2024-01-01"},GR:{country:"Greece",isoCode:"GR",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},HU:{country:"Hungary",isoCode:"HU",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},IE:{country:"Ireland",isoCode:"IE",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR. Hosts many multinational data processors.",lastUpdated:"2024-01-01"},IT:{country:"Italy",isoCode:"IT",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},LV:{country:"Latvia",isoCode:"LV",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},LT:{country:"Lithuania",isoCode:"LT",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},LU:{country:"Luxembourg",isoCode:"LU",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},MT:{country:"Malta",isoCode:"MT",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},NL:{country:"Netherlands",isoCode:"NL",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},PL:{country:"Poland",isoCode:"PL",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},PT:{country:"Portugal",isoCode:"PT",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},RO:{country:"Romania",isoCode:"RO",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},SK:{country:"Slovakia",isoCode:"SK",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},SI:{country:"Slovenia",isoCode:"SI",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},ES:{country:"Spain",isoCode:"ES",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},SE:{country:"Sweden",isoCode:"SE",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},IS:{country:"Iceland",isoCode:"IS",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EEA member; GDPR applies through EEA Agreement.",lastUpdated:"2024-01-01"},LI:{country:"Liechtenstein",isoCode:"LI",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EEA member; GDPR applies through EEA Agreement.",lastUpdated:"2024-01-01"},NO:{country:"Norway",isoCode:"NO",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EEA member; GDPR applies through EEA Agreement.",lastUpdated:"2024-01-01"},GB:{country:"United Kingdom",isoCode:"GB",adequacyStatus:"adequate",recognizedBy:"self-assessment",notes:"Protected by UK GDPR and the Data Protection Act 2018. EU adequacy decision granted post-Brexit.",lastUpdated:"2024-01-01"},US:{country:"United States",isoCode:"US",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"No comprehensive federal data protection law. Adequacy depends on transfer mechanism used (e.g. EU-US Data Privacy Framework, standard contractual clauses). Sector-specific laws exist (HIPAA, CCPA, etc.).",lastUpdated:"2024-01-01"},CA:{country:"Canada",isoCode:"CA",adequacyStatus:"adequate",recognizedBy:"self-assessment",notes:"Protected by PIPEDA (Personal Information Protection and Electronic Documents Act) and provincial privacy laws. Recognized as adequate by the EU.",lastUpdated:"2024-01-01"},ZA:{country:"South Africa",isoCode:"ZA",adequacyStatus:"adequate",recognizedBy:"self-assessment",notes:"Protected by POPIA (Protection of Personal Information Act, 2013). Comprehensive data protection framework with an independent Information Regulator.",lastUpdated:"2024-01-01"},GH:{country:"Ghana",isoCode:"GH",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Data Protection Act 2012 (Act 843) establishes a data protection framework. Enforcement capacity is still developing.",lastUpdated:"2024-01-01"},KE:{country:"Kenya",isoCode:"KE",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Data Protection Act 2019 provides a modern framework. The Office of the Data Protection Commissioner is operational but still maturing.",lastUpdated:"2024-01-01"},RW:{country:"Rwanda",isoCode:"RW",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Law No. 058/2021 on the Protection of Personal Data and Privacy. Framework is relatively new.",lastUpdated:"2024-01-01"},EG:{country:"Egypt",isoCode:"EG",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Personal Data Protection Law No. 151 of 2020. Implementation and enforcement are still in early stages.",lastUpdated:"2024-01-01"},TZ:{country:"Tanzania",isoCode:"TZ",adequacyStatus:"not_adequate",recognizedBy:"self-assessment",notes:"No comprehensive data protection legislation in force.",lastUpdated:"2024-01-01"},UG:{country:"Uganda",isoCode:"UG",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Data Protection and Privacy Act 2019 provides a framework, but enforcement capacity is limited.",lastUpdated:"2024-01-01"},SN:{country:"Senegal",isoCode:"SN",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Law No. 2008-12 on the Protection of Personal Data. One of the earlier African data protection laws.",lastUpdated:"2024-01-01"},MA:{country:"Morocco",isoCode:"MA",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Law No. 09-08 on the Protection of Individuals with Regard to the Processing of Personal Data (2009). Recognized as adequate by the EU.",lastUpdated:"2024-01-01"},MU:{country:"Mauritius",isoCode:"MU",adequacyStatus:"adequate",recognizedBy:"self-assessment",notes:"Data Protection Act 2017 provides a comprehensive framework modelled on international standards.",lastUpdated:"2024-01-01"},CN:{country:"China",isoCode:"CN",adequacyStatus:"not_adequate",recognizedBy:"self-assessment",notes:"Personal Information Protection Law (PIPL) enacted in 2021 but government access provisions and limited independent oversight raise concerns. Transfers require security assessments or standard contracts.",lastUpdated:"2024-01-01"},IN:{country:"India",isoCode:"IN",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Digital Personal Data Protection Act 2023 enacted. Implementation rules and enforcement mechanisms are still being finalized.",lastUpdated:"2024-01-01"},SG:{country:"Singapore",isoCode:"SG",adequacyStatus:"adequate",recognizedBy:"self-assessment",notes:"Personal Data Protection Act 2012 (PDPA) provides a robust framework. Strong enforcement by the PDPC.",lastUpdated:"2024-01-01"},JP:{country:"Japan",isoCode:"JP",adequacyStatus:"adequate",recognizedBy:"EU",notes:"Act on the Protection of Personal Information (APPI). Recognized as adequate by the EU under mutual adequacy arrangement.",lastUpdated:"2024-01-01"},KR:{country:"South Korea",isoCode:"KR",adequacyStatus:"adequate",recognizedBy:"EU",notes:"Personal Information Protection Act (PIPA). Recognized as adequate by the EU.",lastUpdated:"2024-01-01"},AE:{country:"United Arab Emirates",isoCode:"AE",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Federal Decree-Law No. 45 of 2021 on Personal Data Protection. DIFC and ADGM free zones have their own data protection regulations with stronger frameworks.",lastUpdated:"2024-01-01"},SA:{country:"Saudi Arabia",isoCode:"SA",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Personal Data Protection Law (Royal Decree M/19, 2021). Framework is new and enforcement is still developing.",lastUpdated:"2024-01-01"},IL:{country:"Israel",isoCode:"IL",adequacyStatus:"adequate",recognizedBy:"EU",notes:"Protection of Privacy Law 5741-1981 and regulations. Recognized as adequate by the EU.",lastUpdated:"2024-01-01"},BR:{country:"Brazil",isoCode:"BR",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Lei Geral de Protecao de Dados (LGPD, 2020) provides a comprehensive framework. The ANPD is actively enforcing.",lastUpdated:"2024-01-01"},AR:{country:"Argentina",isoCode:"AR",adequacyStatus:"adequate",recognizedBy:"EU",notes:"Personal Data Protection Act No. 25,326. Recognized as adequate by the EU.",lastUpdated:"2024-01-01"},AU:{country:"Australia",isoCode:"AU",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Privacy Act 1988 provides protection but does not fully align with GDPR-level standards. Reform efforts are ongoing.",lastUpdated:"2024-01-01"},NZ:{country:"New Zealand",isoCode:"NZ",adequacyStatus:"adequate",recognizedBy:"EU",notes:"Privacy Act 2020 provides a comprehensive framework. Recognized as adequate by the EU.",lastUpdated:"2024-01-01"},CH:{country:"Switzerland",isoCode:"CH",adequacyStatus:"adequate",recognizedBy:"EU",notes:"Federal Act on Data Protection (FADP, revised 2023). Recognized as adequate by the EU.",lastUpdated:"2024-01-01"},RU:{country:"Russia",isoCode:"RU",adequacyStatus:"not_adequate",recognizedBy:"self-assessment",notes:"Federal Law on Personal Data (No. 152-FZ). Data localization requirements and government access concerns.",lastUpdated:"2024-01-01"}};function y(e){let t=e.trim().toUpperCase();if(n[t])return n[t];let a=e.trim().toLowerCase();for(let s of Object.values(n))if(s.country.toLowerCase()===a)return s}function q(){return Object.values(n).filter(e=>e.adequacyStatus==="adequate")}function g(e){let t=y(e);return t?t.adequacyStatus!=="adequate":true}function u(e){return e==="standard_clauses"||e==="binding_corporate_rules"||e==="ndpc_authorization"}function f(e){return {adequacy_decision:"Adequacy Decision (NDPA Section 42) \u2014 Transfer to a country, region, or specified sector that the NDPC has determined provides an adequate level of data protection.",standard_clauses:"Standard Contractual Clauses (NDPA Section 41(1)(a)) \u2014 Transfer based on contractual clauses that afford adequate protection. The NDPC may approve such clauses under Section 42(4)\u2013(5).",binding_corporate_rules:"Binding Corporate Rules (NDPA Section 41(1)(a)) \u2014 Transfer within a group of undertakings based on binding corporate rules that afford adequate protection. The NDPC may approve BCRs under Section 42(5).",ndpc_authorization:"NDPC-Approved Instrument (NDPA Section 42(5)) \u2014 Transfer authorized by an NDPC-approved code of conduct, certification mechanism, or similar instrument that meets the protection standards of the Act.",explicit_consent:"Explicit Consent (NDPA Section 43(1)(a)) \u2014 Transfer based on the consent of the data subject after being informed of the possible risks due to the absence of adequate protections.",contract_performance:"Contract Performance (NDPA Section 43(1)(b)) \u2014 Transfer necessary for the performance of a contract to which the data subject is a party, or for pre-contractual steps at the data subject's request.",public_interest:"Public Interest (NDPA Section 43(1)(d)) \u2014 Transfer necessary for important reasons of public interest.",legal_claims:"Legal Claims (NDPA Section 43(1)(e)) \u2014 Transfer necessary for the establishment, exercise, or defense of legal claims.",vital_interests:"Vital Interests (NDPA Section 43(1)(f)) \u2014 Transfer necessary to protect the vital interests of a data subject or of other persons where the data subject is physically or legally incapable of giving consent."}[e]}function U(e){var s,r;let t=[],a=[];return e.id||t.push("Transfer ID is required."),(!e.destinationCountry||e.destinationCountry.trim()==="")&&t.push("Destination country is required."),(!e.recipientOrganization||e.recipientOrganization.trim()==="")&&t.push("Recipient organization is required."),(!((s=e.recipientContact)!=null&&s.name)||e.recipientContact.name.trim()==="")&&t.push("Recipient contact name is required."),(!((r=e.recipientContact)!=null&&r.email)||e.recipientContact.email.trim()==="")&&t.push("Recipient contact email is required."),(!e.purpose||e.purpose.trim()==="")&&t.push("Purpose of the transfer is required."),e.transferMechanism||t.push("Transfer mechanism is required."),(!e.dataCategories||e.dataCategories.length===0)&&t.push("At least one data category must be specified."),(!e.riskAssessment||e.riskAssessment.trim()==="")&&t.push("Risk assessment summary is required."),(!e.safeguards||e.safeguards.length===0)&&t.push("At least one safeguard must be documented for the transfer."),u(e.transferMechanism)&&(e.ndpcApproval?(e.ndpcApproval.required||a.push("NDPC approval is marked as not required, but the selected transfer mechanism requires NDPC approval."),e.ndpcApproval.required&&!e.ndpcApproval.applied&&t.push("NDPC approval is required but an application has not been submitted."),e.ndpcApproval.applied&&!e.ndpcApproval.approved&&e.status==="active"&&t.push('Transfer is marked as active but NDPC approval has not been granted. Status should be "pending_approval".')):t.push(`NDPC approval documentation is required for transfers using ${l(e.transferMechanism)}.`)),e.tiaCompleted||a.push("A Transfer Impact Assessment (TIA) has not been completed for this transfer."),e.adequacyStatus==="inadequate"&&e.transferMechanism==="adequacy_decision"&&t.push("Cannot rely on adequacy decision (Section 42) when the destination country is marked as inadequate."),e.endDate&&e.startDate>e.endDate&&t.push("Start date must be before end date."),e.includesSensitiveData&&e.riskLevel!=="high"&&a.push("Transfer includes sensitive personal data but the risk level is not set to high. Consider reviewing the risk assessment."),e.reviewDate||a.push("No review date has been set for this transfer. Periodic reviews are recommended."),{isValid:t.length===0,errors:t,warnings:a}}function b(e){var d,c;let t=[],a=[],s=0,p={adequate:0,pending_review:2,unknown:3,inadequate:4}[e.adequacyStatus];s+=p,e.adequacyStatus==="inadequate"?(t.push("Destination country does not have an adequate level of data protection."),a.push("Implement supplementary technical and organizational measures.")):e.adequacyStatus==="unknown"?(t.push("Data protection adequacy of the destination country has not been assessed."),a.push("Conduct an adequacy assessment of the destination country.")):e.adequacyStatus==="pending_review"&&(t.push("Destination country adequacy is currently under review."),a.push("Monitor the adequacy review outcome and plan for contingencies."));let i={adequacy_decision:0,standard_clauses:1,binding_corporate_rules:1,ndpc_authorization:1,contract_performance:2,explicit_consent:2,legal_claims:2,public_interest:2,vital_interests:3}[e.transferMechanism];s+=i,i>=2&&(t.push(`Transfer relies on a derogation mechanism (${l(e.transferMechanism)}), which provides fewer structural safeguards.`),a.push("Consider whether a stronger transfer mechanism (adequacy decision, standard clauses, or BCRs) could be used instead.")),e.includesSensitiveData&&(s+=3,t.push("Transfer includes sensitive personal data, increasing the potential impact of unauthorized access."),a.push("Ensure encryption in transit and at rest, and apply strict access controls.")),e.estimatedDataSubjects&&e.estimatedDataSubjects>1e4?(s+=2,t.push("Large number of data subjects involved increases the scope of potential harm."),a.push("Consider data minimization strategies and ensure robust incident response procedures.")):e.estimatedDataSubjects&&e.estimatedDataSubjects>1e3&&(s+=1,t.push("Moderate number of data subjects involved.")),e.tiaCompleted||(s+=2,t.push("Transfer Impact Assessment has not been completed."),a.push("Complete a Transfer Impact Assessment before proceeding with the transfer.")),u(e.transferMechanism)&&((d=e.ndpcApproval)!=null&&d.approved||(s+=2,t.push("NDPC approval is required but has not been granted."),a.push("Obtain NDPC approval before activating the transfer."))),(((c=e.safeguards)==null?void 0:c.length)||0)<3&&(s+=1,t.push("Limited number of safeguards documented."),a.push("Document additional technical, organizational, and contractual safeguards.")),e.frequency==="continuous"&&(s+=1,t.push("Continuous data transfer increases exposure window."),a.push("Implement real-time monitoring and anomaly detection for the transfer."));let o;return s<=4?o="low":s<=9?o="medium":o="high",{riskLevel:o,riskScore:s,factors:t,recommendations:a}}function l(e){return {adequacy_decision:"Adequacy Decision",standard_clauses:"Standard Contractual Clauses",binding_corporate_rules:"Binding Corporate Rules",ndpc_authorization:"NDPC Authorization",explicit_consent:"Explicit Consent",contract_performance:"Contract Performance",public_interest:"Public Interest",legal_claims:"Legal Claims",vital_interests:"Vital Interests"}[e]}export{n as a,y as b,q as c,g as d,u as e,f,U as g,b as h};
@@ -1,2 +1 @@
1
- 'use strict';var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js');var i={consent:{title:"We Value Your Privacy",description:"We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",acceptAll:"Accept All",rejectAll:"Reject All",customize:"Customize",savePreferences:"Save Preferences",selectAll:"Select All",deselectAll:"Deselect All",required:"Required",cookieNotice:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'},dsr:{title:"Submit a Data Subject Request",description:"Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitRequest:"Submit Request",reset:"Reset",fullName:"Full Name",email:"Email Address",phone:"Phone Number (Optional)",requestType:"Request Type",additionalInfo:"Additional Information",identityVerification:"Identity Verification",identifierType:"Identifier Type",identifierValue:"Identifier Value",privacyNotice:"The information you provide in this form will be used solely for the purpose of processing your data subject request.",successMessage:"Your request has been submitted successfully."},breach:{title:"Report a Data Breach",description:"Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40.",submitReport:"Submit Report",breachTitle:"Breach Title/Summary",category:"Category",discoveredAt:"Date Discovered",detailedDescription:"Detailed Description"},dpia:{title:"Data Protection Impact Assessment",next:"Next",previous:"Previous",complete:"Complete Assessment",progress:"Progress"},policy:{title:"Privacy Policy Generator",generate:"Generate Policy",preview:"Preview",export:"Export",sections:"Sections",variables:"Variables"},compliance:{score:"Compliance Score",excellent:"Excellent",good:"Good",needsWork:"Needs Work",critical:"Critical",recommendations:"Recommendations",passed:"Passed",gaps:"Gaps"},common:{loading:"Loading...",error:"An error occurred",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",add:"Add",back:"Back",next:"Next",search:"Search",noResults:"No results found"}};function a(e){if(!e)return i;let r=chunkMQFZHA2D_js.a({},i);for(let t of Object.keys(e))e[t]&&(r[t]=chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},i[t]),e[t]));return r}exports.a=i;exports.b=a;//# sourceMappingURL=chunk-C5QO3SX4.js.map
2
- //# sourceMappingURL=chunk-C5QO3SX4.js.map
1
+ 'use strict';var chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js');var i={consent:{title:"We Value Your Privacy",description:"We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",acceptAll:"Accept All",rejectAll:"Reject All",customize:"Customize",savePreferences:"Save Preferences",selectAll:"Select All",deselectAll:"Deselect All",required:"Required",cookieNotice:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'},dsr:{title:"Submit a Data Subject Request",description:"Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitRequest:"Submit Request",reset:"Reset",fullName:"Full Name",email:"Email Address",phone:"Phone Number (Optional)",requestType:"Request Type",additionalInfo:"Additional Information",identityVerification:"Identity Verification",identifierType:"Identifier Type",identifierValue:"Identifier Value",privacyNotice:"The information you provide in this form will be used solely for the purpose of processing your data subject request.",successMessage:"Your request has been submitted successfully."},breach:{title:"Report a Data Breach",description:"Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40.",submitReport:"Submit Report",breachTitle:"Breach Title/Summary",category:"Category",discoveredAt:"Date Discovered",detailedDescription:"Detailed Description"},dpia:{title:"Data Protection Impact Assessment",next:"Next",previous:"Previous",complete:"Complete Assessment",progress:"Progress"},policy:{title:"Privacy Policy Generator",generate:"Generate Policy",preview:"Preview",export:"Export",sections:"Sections",variables:"Variables"},compliance:{score:"Compliance Score",excellent:"Excellent",good:"Good",needsWork:"Needs Work",critical:"Critical",recommendations:"Recommendations",passed:"Passed",gaps:"Gaps"},common:{loading:"Loading...",error:"An error occurred",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",add:"Add",back:"Back",next:"Next",search:"Search",noResults:"No results found"}};function a(e){if(!e)return i;let r=chunkRFPLZDIO_js.a({},i);for(let t of Object.keys(e))e[t]&&(r[t]=chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},i[t]),e[t]));return r}exports.a=i;exports.b=a;
@@ -1,2 +1 @@
1
- 'use strict';function p(t){return {load(){if(typeof window=="undefined")return null;try{let e=sessionStorage.getItem(t);return e?JSON.parse(e):null}catch(e){return null}},save(e){if(typeof window!="undefined")try{sessionStorage.setItem(t,JSON.stringify(e));}catch(i){}},remove(){if(typeof window!="undefined")try{sessionStorage.removeItem(t);}catch(e){}}}}function m(t,e={}){let{domain:i,path:s="/",expires:d=365,secure:u=true,sameSite:c="Lax"}=e;return {load(){if(typeof document=="undefined")return null;try{let n=encodeURIComponent(t),a=document.cookie.split(";").map(o=>o.trim()).find(o=>o.startsWith(`${n}=`));if(!a)return null;let r=a.indexOf("=");return JSON.parse(decodeURIComponent(a.slice(r+1)))}catch(n){return null}},save(n){if(typeof document=="undefined")return;let a=u||c==="None",r=`${encodeURIComponent(t)}=${encodeURIComponent(JSON.stringify(n))}; path=${s}; samesite=${c}`;if(d>0){let o=new Date;o.setDate(o.getDate()+d),r+=`; expires=${o.toUTCString()}`;}i&&(r+=`; domain=${i}`),a&&(r+="; secure"),document.cookie=r;},remove(){if(typeof document=="undefined")return;let n=`${encodeURIComponent(t)}=; path=${s}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;i&&(n+=`; domain=${i}`),document.cookie=n;}}}exports.a=p;exports.b=m;//# sourceMappingURL=chunk-A4PK7JB2.js.map
2
- //# sourceMappingURL=chunk-A4PK7JB2.js.map
1
+ 'use strict';function p(t){return {load(){if(typeof window=="undefined")return null;try{let e=sessionStorage.getItem(t);return e?JSON.parse(e):null}catch(e){return null}},save(e){if(typeof window!="undefined")try{sessionStorage.setItem(t,JSON.stringify(e));}catch(i){}},remove(){if(typeof window!="undefined")try{sessionStorage.removeItem(t);}catch(e){}}}}function m(t,e={}){let{domain:i,path:s="/",expires:d=365,secure:u=true,sameSite:c="Lax"}=e;return {load(){if(typeof document=="undefined")return null;try{let n=encodeURIComponent(t),a=document.cookie.split(";").map(o=>o.trim()).find(o=>o.startsWith(`${n}=`));if(!a)return null;let r=a.indexOf("=");return JSON.parse(decodeURIComponent(a.slice(r+1)))}catch(n){return null}},save(n){if(typeof document=="undefined")return;let a=u||c==="None",r=`${encodeURIComponent(t)}=${encodeURIComponent(JSON.stringify(n))}; path=${s}; samesite=${c}`;if(d>0){let o=new Date;o.setDate(o.getDate()+d),r+=`; expires=${o.toUTCString()}`;}i&&(r+=`; domain=${i}`),a&&(r+="; secure"),document.cookie=r;},remove(){if(typeof document=="undefined")return;let n=`${encodeURIComponent(t)}=; path=${s}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;i&&(n+=`; domain=${i}`),document.cookie=n;}}}exports.a=p;exports.b=m;
@@ -0,0 +1 @@
1
+ 'use strict';function s(t,n,r){return r?n||"":n||t}exports.a=s;