@tantainnovative/ndpr-toolkit 3.2.0 → 3.2.1

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 (117) hide show
  1. package/dist/adapters.js +1 -1
  2. package/dist/adapters.mjs +1 -1
  3. package/dist/breach.js +1 -1
  4. package/dist/breach.mjs +1 -1
  5. package/dist/chunk-256APOQM.js +2 -0
  6. package/dist/chunk-2FWCVWKN.js +2 -0
  7. package/dist/chunk-3DJGO6WG.js +2 -0
  8. package/dist/chunk-4XCL62MJ.mjs +2 -0
  9. package/dist/chunk-555WWZ3W.js +2 -0
  10. package/dist/chunk-6BXUVS6E.js +81 -0
  11. package/dist/{chunk-KHRBU5K7.js → chunk-6RQGQZT2.js} +2 -2
  12. package/dist/chunk-6TA2MVTU.mjs +2 -0
  13. package/dist/chunk-6WIP33TW.mjs +2 -0
  14. package/dist/{chunk-2ORDHJRD.js → chunk-7AVN424U.js} +2 -2
  15. package/dist/{chunk-5VMHKNJY.js → chunk-7SMLHZ4B.js} +2 -2
  16. package/dist/chunk-A4PK7JB2.js +2 -0
  17. package/dist/chunk-ABDB7LEV.mjs +2 -0
  18. package/dist/chunk-BKRETVJ6.js +2 -0
  19. package/dist/chunk-CWUPGY3M.mjs +3 -0
  20. package/dist/chunk-DJGS7SSN.mjs +2 -0
  21. package/dist/{chunk-SVCRYM4I.mjs → chunk-E4NCJ7RD.mjs} +2 -2
  22. package/dist/chunk-E63VPR7U.js +2 -0
  23. package/dist/{chunk-TKBZRULW.mjs → chunk-EH2I4L7M.mjs} +27 -27
  24. package/dist/chunk-ELKB2AFZ.js +2 -0
  25. package/dist/chunk-FDDI426Y.mjs +2 -0
  26. package/dist/chunk-FOXZRRMW.mjs +2 -0
  27. package/dist/chunk-GKKAK6ES.mjs +3 -0
  28. package/dist/chunk-GOD4LA2J.mjs +2 -0
  29. package/dist/{chunk-SWF3YVE5.js → chunk-GOU6FU6Y.js} +3 -3
  30. package/dist/chunk-HO5M7M4M.js +2 -0
  31. package/dist/{chunk-SKJCQKFL.mjs → chunk-I23WPZNQ.mjs} +3 -3
  32. package/dist/chunk-I4M2AA3N.js +2 -0
  33. package/dist/chunk-I54CDQGN.js +3 -0
  34. package/dist/{chunk-6D3ZUGBB.mjs → chunk-IR7VCBWV.mjs} +2 -2
  35. package/dist/{chunk-4VVARDN2.mjs → chunk-K45S6YQV.mjs} +2 -2
  36. package/dist/chunk-KBAFOVE3.js +2 -0
  37. package/dist/{chunk-P7BSBCB3.js → chunk-KBP26GLC.js} +2 -2
  38. package/dist/{chunk-DQLDX5X6.js → chunk-KVOGOLIR.js} +27 -27
  39. package/dist/chunk-MDWG2KDA.mjs +2 -0
  40. package/dist/{chunk-ZQSX5ZHB.mjs → chunk-NN233SGA.mjs} +3 -3
  41. package/dist/chunk-NRQELKAE.js +2 -0
  42. package/dist/chunk-NUDVUAD4.mjs +81 -0
  43. package/dist/chunk-NXQMU36Z.mjs +2 -0
  44. package/dist/chunk-P42Z5CFE.js +2 -0
  45. package/dist/chunk-PATONNTZ.mjs +2 -0
  46. package/dist/{chunk-WLSW4Z4W.mjs → chunk-PM7O5IGE.mjs} +2 -2
  47. package/dist/chunk-Q7VHB64E.mjs +2 -0
  48. package/dist/{chunk-PEH5GIMN.js → chunk-QH6YUVJS.js} +2 -2
  49. package/dist/{chunk-BGHQTZAC.js → chunk-QY7PD5XB.js} +4 -4
  50. package/dist/chunk-R3OYAJI6.mjs +2 -0
  51. package/dist/chunk-S4GRSNB4.js +2 -0
  52. package/dist/chunk-SAA7UVI2.js +3 -0
  53. package/dist/{chunk-PYEX7DFR.mjs → chunk-SHMJNRHO.mjs} +3 -3
  54. package/dist/chunk-U62QYKVG.mjs +2 -0
  55. package/dist/{chunk-JZKH5RMC.js → chunk-UDNRAQLE.js} +3 -3
  56. package/dist/{chunk-5RSOLEEP.js → chunk-UXMGBIX6.js} +4 -4
  57. package/dist/{chunk-UZ5EZOA7.js → chunk-VK27WVV3.js} +2 -2
  58. package/dist/{chunk-G26I6MP5.mjs → chunk-VWPGIES4.mjs} +2 -2
  59. package/dist/{chunk-NPLXE43Q.mjs → chunk-XQ4M5FHC.mjs} +2 -2
  60. package/dist/{chunk-CAB7O3GR.mjs → chunk-ZEOQYWOE.mjs} +4 -4
  61. package/dist/consent.js +1 -1
  62. package/dist/consent.mjs +1 -1
  63. package/dist/core.js +1 -1
  64. package/dist/core.mjs +1 -1
  65. package/dist/cross-border.js +1 -1
  66. package/dist/cross-border.mjs +1 -1
  67. package/dist/dpia.js +1 -1
  68. package/dist/dpia.mjs +1 -1
  69. package/dist/dsr.js +1 -1
  70. package/dist/dsr.mjs +1 -1
  71. package/dist/hooks.js +1 -1
  72. package/dist/hooks.mjs +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/index.mjs +1 -1
  75. package/dist/lawful-basis.js +1 -1
  76. package/dist/lawful-basis.mjs +1 -1
  77. package/dist/policy.js +1 -1
  78. package/dist/policy.mjs +1 -1
  79. package/dist/presets.js +1 -1
  80. package/dist/presets.mjs +1 -1
  81. package/dist/ropa.js +1 -1
  82. package/dist/ropa.mjs +1 -1
  83. package/package.json +3 -2
  84. package/dist/chunk-27NYSWUG.mjs +0 -2
  85. package/dist/chunk-2SYNHRP6.mjs +0 -2
  86. package/dist/chunk-2W7ARAW2.js +0 -2
  87. package/dist/chunk-3F34NACG.js +0 -2
  88. package/dist/chunk-3V23O4ZJ.js +0 -2
  89. package/dist/chunk-3XAUN5IM.mjs +0 -3
  90. package/dist/chunk-6E54NSAO.mjs +0 -2
  91. package/dist/chunk-7F5F5YWI.mjs +0 -2
  92. package/dist/chunk-CMZTI7SG.js +0 -2
  93. package/dist/chunk-EPF7J2FK.js +0 -3
  94. package/dist/chunk-FR7ZYZXB.js +0 -2
  95. package/dist/chunk-FXTZDKDC.mjs +0 -3
  96. package/dist/chunk-GIV2OHE6.mjs +0 -2
  97. package/dist/chunk-GPJVTGHR.mjs +0 -2
  98. package/dist/chunk-GVANK6PL.js +0 -3
  99. package/dist/chunk-HNZK7LY3.mjs +0 -2
  100. package/dist/chunk-IKEPXHCZ.js +0 -2
  101. package/dist/chunk-IQQW52EF.js +0 -2
  102. package/dist/chunk-ISSGO2YT.mjs +0 -72
  103. package/dist/chunk-LFNA6WYQ.mjs +0 -2
  104. package/dist/chunk-PGSA2O5P.mjs +0 -2
  105. package/dist/chunk-RGYK4VAY.mjs +0 -2
  106. package/dist/chunk-RSUDIFZV.mjs +0 -2
  107. package/dist/chunk-RYZEIDNR.js +0 -2
  108. package/dist/chunk-SBNAMPAP.mjs +0 -2
  109. package/dist/chunk-SSGJREE3.js +0 -2
  110. package/dist/chunk-U6VWHC46.js +0 -72
  111. package/dist/chunk-UK656RCG.js +0 -2
  112. package/dist/chunk-UOSEH6DC.js +0 -2
  113. package/dist/chunk-VDZKGCAF.js +0 -2
  114. package/dist/chunk-XSK4BSZJ.mjs +0 -2
  115. package/dist/chunk-Y34DQYS7.js +0 -2
  116. package/dist/chunk-YJCGEOLO.mjs +0 -2
  117. package/dist/chunk-ZCZ5RRZO.js +0 -2
package/dist/adapters.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk3F34NACG_js=require('./chunk-3F34NACG.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js');function l(e,t={}){var a;let r=(a=t.headers)!=null?a:{};return {load(){return chunkMQFZHA2D_js.d(this,null,function*(){try{let o=yield fetch(e,{method:"GET",headers:chunkMQFZHA2D_js.a({},r)});return o.ok?yield o.json():null}catch(o){return null}})},save(o){return chunkMQFZHA2D_js.d(this,null,function*(){try{yield fetch(e,{method:"POST",headers:chunkMQFZHA2D_js.a({"Content-Type":"application/json"},r),body:JSON.stringify(o)});}catch(d){console.warn(`[ndpr-toolkit] Failed to save to ${e}`);}})},remove(){return chunkMQFZHA2D_js.d(this,null,function*(){try{yield fetch(e,{method:"DELETE",headers:chunkMQFZHA2D_js.a({},r)});}catch(o){console.warn(`[ndpr-toolkit] Failed to delete from ${e}`);}})}}}function f(e){let t=e!=null?e:null;return {load(){return t},save(r){t=r;},remove(){t=null;}}}function u(e,...t){return {load(){return e.load()},save(r){let a=e.save(r),p=()=>chunkMQFZHA2D_js.d(null,null,function*(){for(let o of t)try{yield o.save(r);}catch(d){console.warn("[ndpr-toolkit] Secondary adapter save failed:",d);}});return a instanceof Promise?a.then(()=>p()):p()},remove(){let r=e.remove(),a=()=>chunkMQFZHA2D_js.d(null,null,function*(){for(let p of t)try{yield p.remove();}catch(o){console.warn("[ndpr-toolkit] Secondary adapter remove failed:",o);}});return r instanceof Promise?r.then(()=>a()):a()}}}Object.defineProperty(exports,"cookieAdapter",{enumerable:true,get:function(){return chunk3F34NACG_js.b}});Object.defineProperty(exports,"sessionStorageAdapter",{enumerable:true,get:function(){return chunk3F34NACG_js.a}});Object.defineProperty(exports,"localStorageAdapter",{enumerable:true,get:function(){return chunkUK656RCG_js.a}});exports.apiAdapter=l;exports.composeAdapters=u;exports.memoryAdapter=f;//# sourceMappingURL=adapters.js.map
1
+ 'use strict';var chunkA4PK7JB2_js=require('./chunk-A4PK7JB2.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js');function m(e,t={}){var a;let r=(a=t.headers)!=null?a:{};return {load(){return chunkMQFZHA2D_js.d(this,null,function*(){try{let o=yield fetch(e,{method:"GET",headers:chunkMQFZHA2D_js.a({},r)});return o.ok?yield o.json():null}catch(o){return null}})},save(o){return chunkMQFZHA2D_js.d(this,null,function*(){try{let n=yield fetch(e,{method:"POST",headers:chunkMQFZHA2D_js.a({"Content-Type":"application/json"},r),body:JSON.stringify(o)});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 o=yield fetch(e,{method:"DELETE",headers:chunkMQFZHA2D_js.a({},r)});o.ok||console.warn(`[ndpr-toolkit] Failed to delete from ${e}: ${o.status}`);}catch(o){console.warn(`[ndpr-toolkit] Failed to delete from ${e}`);}})}}}function f(e){let t=e!=null?e:null;return {load(){return t},save(r){t=r;},remove(){t=null;}}}function u(e,...t){return {load(){return e.load()},save(r){let a=e.save(r),s=()=>{for(let o of t)try{o.save(r);}catch(n){console.warn("[ndpr-toolkit] Secondary adapter save failed:",n);}};if(a instanceof Promise)return a.then(()=>s());s();},remove(){let r=e.remove(),a=()=>{for(let s of t)try{s.remove();}catch(o){console.warn("[ndpr-toolkit] Secondary adapter remove failed:",o);}};if(r instanceof Promise)return r.then(()=>a());a();}}}Object.defineProperty(exports,"cookieAdapter",{enumerable:true,get:function(){return chunkA4PK7JB2_js.b}});Object.defineProperty(exports,"sessionStorageAdapter",{enumerable:true,get:function(){return chunkA4PK7JB2_js.a}});Object.defineProperty(exports,"localStorageAdapter",{enumerable:true,get:function(){return chunkELKB2AFZ_js.a}});exports.apiAdapter=m;exports.composeAdapters=u;exports.memoryAdapter=f;//# sourceMappingURL=adapters.js.map
2
2
  //# sourceMappingURL=adapters.js.map
package/dist/adapters.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export{b as cookieAdapter,a as sessionStorageAdapter}from'./chunk-YJCGEOLO.mjs';export{a as localStorageAdapter}from'./chunk-SBNAMPAP.mjs';import {d,a}from'./chunk-WWT2ZSNU.mjs';function l(e,t={}){var a$1;let r=(a$1=t.headers)!=null?a$1:{};return {load(){return d(this,null,function*(){try{let o=yield fetch(e,{method:"GET",headers:a({},r)});return o.ok?yield o.json():null}catch(o){return null}})},save(o){return d(this,null,function*(){try{yield fetch(e,{method:"POST",headers:a({"Content-Type":"application/json"},r),body:JSON.stringify(o)});}catch(d){console.warn(`[ndpr-toolkit] Failed to save to ${e}`);}})},remove(){return d(this,null,function*(){try{yield fetch(e,{method:"DELETE",headers:a({},r)});}catch(o){console.warn(`[ndpr-toolkit] Failed to delete from ${e}`);}})}}}function f(e){let t=e!=null?e:null;return {load(){return t},save(r){t=r;},remove(){t=null;}}}function u(e,...t){return {load(){return e.load()},save(r){let a=e.save(r),p=()=>d(null,null,function*(){for(let o of t)try{yield o.save(r);}catch(d){console.warn("[ndpr-toolkit] Secondary adapter save failed:",d);}});return a instanceof Promise?a.then(()=>p()):p()},remove(){let r=e.remove(),a=()=>d(null,null,function*(){for(let p of t)try{yield p.remove();}catch(o){console.warn("[ndpr-toolkit] Secondary adapter remove failed:",o);}});return r instanceof Promise?r.then(()=>a()):a()}}}export{l as apiAdapter,u as composeAdapters,f as memoryAdapter};//# sourceMappingURL=adapters.mjs.map
1
+ export{b as cookieAdapter,a as sessionStorageAdapter}from'./chunk-R3OYAJI6.mjs';export{a as localStorageAdapter}from'./chunk-6WIP33TW.mjs';import {d,a}from'./chunk-WWT2ZSNU.mjs';function m(e,t={}){var a$1;let r=(a$1=t.headers)!=null?a$1:{};return {load(){return d(this,null,function*(){try{let o=yield fetch(e,{method:"GET",headers:a({},r)});return o.ok?yield o.json():null}catch(o){return null}})},save(o){return d(this,null,function*(){try{let n=yield fetch(e,{method:"POST",headers:a({"Content-Type":"application/json"},r),body:JSON.stringify(o)});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 d(this,null,function*(){try{let o=yield fetch(e,{method:"DELETE",headers:a({},r)});o.ok||console.warn(`[ndpr-toolkit] Failed to delete from ${e}: ${o.status}`);}catch(o){console.warn(`[ndpr-toolkit] Failed to delete from ${e}`);}})}}}function f(e){let t=e!=null?e:null;return {load(){return t},save(r){t=r;},remove(){t=null;}}}function u(e,...t){return {load(){return e.load()},save(r){let a=e.save(r),s=()=>{for(let o of t)try{o.save(r);}catch(n){console.warn("[ndpr-toolkit] Secondary adapter save failed:",n);}};if(a instanceof Promise)return a.then(()=>s());s();},remove(){let r=e.remove(),a=()=>{for(let s of t)try{s.remove();}catch(o){console.warn("[ndpr-toolkit] Secondary adapter remove failed:",o);}};if(r instanceof Promise)return r.then(()=>a());a();}}}export{m as apiAdapter,u as composeAdapters,f as memoryAdapter};//# sourceMappingURL=adapters.mjs.map
2
2
  //# sourceMappingURL=adapters.mjs.map
package/dist/breach.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkU6VWHC46_js=require('./chunk-U6VWHC46.js'),chunkGVANK6PL_js=require('./chunk-GVANK6PL.js'),chunk2W7ARAW2_js=require('./chunk-2W7ARAW2.js'),chunkRYZEIDNR_js=require('./chunk-RYZEIDNR.js');require('./chunk-EPF7J2FK.js'),require('./chunk-E64TU6IU.js'),require('./chunk-UK656RCG.js');var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var p=react.createContext(null);function P(){let e=react.useContext(p);if(!e)throw new Error("Breach compound components must be wrapped in <Breach.Provider>. Example: <Breach.Provider categories={...}><Breach.ReportForm /></Breach.Provider>");return e}var s=({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u,children:d})=>{let y=chunk2W7ARAW2_js.a({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u}),l=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},y),{categories:e});return jsxRuntime.jsx(p.Provider,{value:l,children:d})};var A={Provider:s,ReportForm:chunkGVANK6PL_js.a,RiskAssessment:chunkU6VWHC46_js.a,NotificationManager:chunkU6VWHC46_js.b,ReportGenerator:chunkU6VWHC46_js.c};Object.defineProperty(exports,"BreachNotificationManager",{enumerable:true,get:function(){return chunkU6VWHC46_js.b}});Object.defineProperty(exports,"BreachRiskAssessment",{enumerable:true,get:function(){return chunkU6VWHC46_js.a}});Object.defineProperty(exports,"RegulatoryReportGenerator",{enumerable:true,get:function(){return chunkU6VWHC46_js.c}});Object.defineProperty(exports,"BreachReportForm",{enumerable:true,get:function(){return chunkGVANK6PL_js.a}});Object.defineProperty(exports,"useBreach",{enumerable:true,get:function(){return chunk2W7ARAW2_js.a}});Object.defineProperty(exports,"calculateBreachSeverity",{enumerable:true,get:function(){return chunkRYZEIDNR_js.a}});exports.Breach=A;exports.BreachProvider=s;exports.useBreachCompound=P;//# sourceMappingURL=breach.js.map
1
+ 'use strict';var chunk6BXUVS6E_js=require('./chunk-6BXUVS6E.js'),chunkSAA7UVI2_js=require('./chunk-SAA7UVI2.js'),chunkI4M2AA3N_js=require('./chunk-I4M2AA3N.js'),chunkBKRETVJ6_js=require('./chunk-BKRETVJ6.js');require('./chunk-I54CDQGN.js'),require('./chunk-E64TU6IU.js'),require('./chunk-ELKB2AFZ.js');var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var p=react.createContext(null);function P(){let e=react.useContext(p);if(!e)throw new Error("Breach compound components must be wrapped in <Breach.Provider>. Example: <Breach.Provider categories={...}><Breach.ReportForm /></Breach.Provider>");return e}var s=({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u,children:d})=>{let y=chunkI4M2AA3N_js.a({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u}),l=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},y),{categories:e});return jsxRuntime.jsx(p.Provider,{value:l,children:d})};var A={Provider:s,ReportForm:chunkSAA7UVI2_js.a,RiskAssessment:chunk6BXUVS6E_js.a,NotificationManager:chunk6BXUVS6E_js.b,ReportGenerator:chunk6BXUVS6E_js.c};Object.defineProperty(exports,"BreachNotificationManager",{enumerable:true,get:function(){return chunk6BXUVS6E_js.b}});Object.defineProperty(exports,"BreachRiskAssessment",{enumerable:true,get:function(){return chunk6BXUVS6E_js.a}});Object.defineProperty(exports,"RegulatoryReportGenerator",{enumerable:true,get:function(){return chunk6BXUVS6E_js.c}});Object.defineProperty(exports,"BreachReportForm",{enumerable:true,get:function(){return chunkSAA7UVI2_js.a}});Object.defineProperty(exports,"useBreach",{enumerable:true,get:function(){return chunkI4M2AA3N_js.a}});Object.defineProperty(exports,"calculateBreachSeverity",{enumerable:true,get:function(){return chunkBKRETVJ6_js.a}});exports.Breach=A;exports.BreachProvider=s;exports.useBreachCompound=P;//# sourceMappingURL=breach.js.map
2
2
  //# sourceMappingURL=breach.js.map
package/dist/breach.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import {c,b,a}from'./chunk-ISSGO2YT.mjs';export{b as BreachNotificationManager,a as BreachRiskAssessment,c as RegulatoryReportGenerator}from'./chunk-ISSGO2YT.mjs';import {a as a$1}from'./chunk-3XAUN5IM.mjs';export{a as BreachReportForm}from'./chunk-3XAUN5IM.mjs';import {a as a$2}from'./chunk-LFNA6WYQ.mjs';export{a as useBreach}from'./chunk-LFNA6WYQ.mjs';export{a as calculateBreachSeverity}from'./chunk-RGYK4VAY.mjs';import'./chunk-FXTZDKDC.mjs';import'./chunk-AYKLAEOU.mjs';import'./chunk-SBNAMPAP.mjs';import {b as b$1,a as a$3}from'./chunk-WWT2ZSNU.mjs';import {createContext,useContext}from'react';import {jsx}from'react/jsx-runtime';var p=createContext(null);function P(){let e=useContext(p);if(!e)throw new Error("Breach compound components must be wrapped in <Breach.Provider>. Example: <Breach.Provider categories={...}><Breach.ReportForm /></Breach.Provider>");return e}var s=({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u,children:d})=>{let y=a$2({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u}),l=b$1(a$3({},y),{categories:e});return jsx(p.Provider,{value:l,children:d})};var A={Provider:s,ReportForm:a$1,RiskAssessment:a,NotificationManager:b,ReportGenerator:c};export{A as Breach,s as BreachProvider,P as useBreachCompound};//# sourceMappingURL=breach.mjs.map
1
+ import {c,b,a}from'./chunk-NUDVUAD4.mjs';export{b as BreachNotificationManager,a as BreachRiskAssessment,c as RegulatoryReportGenerator}from'./chunk-NUDVUAD4.mjs';import {a as a$1}from'./chunk-CWUPGY3M.mjs';export{a as BreachReportForm}from'./chunk-CWUPGY3M.mjs';import {a as a$2}from'./chunk-PATONNTZ.mjs';export{a as useBreach}from'./chunk-PATONNTZ.mjs';export{a as calculateBreachSeverity}from'./chunk-DJGS7SSN.mjs';import'./chunk-GKKAK6ES.mjs';import'./chunk-AYKLAEOU.mjs';import'./chunk-6WIP33TW.mjs';import {b as b$1,a as a$3}from'./chunk-WWT2ZSNU.mjs';import {createContext,useContext}from'react';import {jsx}from'react/jsx-runtime';var p=createContext(null);function P(){let e=useContext(p);if(!e)throw new Error("Breach compound components must be wrapped in <Breach.Provider>. Example: <Breach.Provider categories={...}><Breach.ReportForm /></Breach.Provider>");return e}var s=({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u,children:d})=>{let y=a$2({categories:e,adapter:m,storageKey:h,useLocalStorage:B,initialReports:f,onReport:R,onAssessment:x,onNotification:u}),l=b$1(a$3({},y),{categories:e});return jsx(p.Provider,{value:l,children:d})};var A={Provider:s,ReportForm:a$1,RiskAssessment:a,NotificationManager:b,ReportGenerator:c};export{A as Breach,s as BreachProvider,P as useBreachCompound};//# sourceMappingURL=breach.mjs.map
2
2
  //# sourceMappingURL=breach.mjs.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var _=({options:b,settings:l,onSave:v,title:h="Manage Your Privacy Settings",description:R="Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function. Consent management is provided in accordance with NDPA Sections 25-26.",saveButtonText:B="Save Preferences",resetButtonText:x="Reset to Defaults",version:$="1.0",className:S="",buttonClassName:o="",primaryButtonClassName:i="",secondaryButtonClassName:y="",classNames:e,unstyled:s,showSuccessMessage:m=true,successMessage:k="Your preferences have been saved.",successMessageDuration:T=3e3})=>{let[p,t]=react.useState({}),[r,d]=react.useState(false),g=react.useRef(null);react.useEffect(()=>()=>{g.current&&clearTimeout(g.current);},[]),react.useEffect(()=>{if(l&&l.consents)t(l.consents);else {let n={};b.forEach(c=>{n[c.id]=c.defaultValue||false;}),t(n);}},[b,l]);let I=(n,c)=>{t(Y=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},Y),{[n]:c}));},M=()=>{let n={consents:p,timestamp:Date.now(),version:$,method:"manager",hasInteracted:true};v(n),m&&(d(true),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{d(false);},T));},O=()=>{let n={};b.forEach(c=>{n[c.id]=c.defaultValue||false;}),t(n);},w=(e==null?void 0:e.primaryButton)||(e==null?void 0:e.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${o} ${i}`,C=(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.resetButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${o} ${y}`;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 ${S}`,e==null?void 0:e.root,s),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",e==null?void 0:e.title,s),children:h}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("mb-6 text-gray-600 dark:text-gray-300",e==null?void 0:e.description,s),children:R}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-6",e==null?void 0:e.optionsList,s),children:b.map(n=>jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("border-b border-gray-200 dark:border-gray-700 pb-4 last:border-0",e==null?void 0:e.optionItem,s),children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:n.label}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:n.description})]}),jsxRuntime.jsx("div",{className:"ml-4 flex-shrink-0",children:jsxRuntime.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",className:"sr-only peer",checked:p[n.id]||false,onChange:c=>I(n.id,c.target.checked),disabled:n.required}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a(`w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-[rgb(var(--ndpr-ring)/0.3)] rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-[rgb(var(--ndpr-primary))] ${n.required?"opacity-60":""}`,e==null?void 0:e.toggle,s)}),jsxRuntime.jsxs("span",{className:"ml-3 text-sm font-medium text-gray-900 dark:text-gray-300",children:[p[n.id]?"Enabled":"Disabled",n.required&&jsxRuntime.jsx("span",{className:"text-xs text-red-500 ml-1",children:"(Required)"})]})]})})]})},n.id))}),r&&jsxRuntime.jsx("div",{className:"mt-4 p-3 bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200 rounded-md","aria-live":"polite",role:"status",children:k}),jsxRuntime.jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[jsxRuntime.jsx("button",{onClick:M,className:chunkE64TU6IU_js.a(w,e==null?void 0:e.saveButton,s),children:B}),jsxRuntime.jsx("button",{onClick:O,className:chunkE64TU6IU_js.a(C,e==null?void 0:e.resetButton,s),children:x})]}),jsxRuntime.jsxs("div",{className:"mt-4 text-xs text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsxs("p",{children:["Last updated: ",l?new Date(l.timestamp).toLocaleString():"Never"]}),jsxRuntime.jsxs("p",{children:["Version: ",$]})]})]})};var N=({settings:b,storageOptions:l={},onLoad:v,onSave:h,autoSave:R=true,autoLoad:B=true,classNames:x,unstyled:$,children:S})=>{let{storageKey:o="ndpr_consent",storageType:i="localStorage",cookieOptions:y={}}=l,[e,s]=react.useState(false),m=react.useCallback(()=>{let t=null;try{if(i==="localStorage"&&typeof window!="undefined"){let r=localStorage.getItem(o);r&&(t=JSON.parse(r));}else if(i==="sessionStorage"&&typeof window!="undefined"){let r=sessionStorage.getItem(o);r&&(t=JSON.parse(r));}else if(i==="cookie"&&typeof document!="undefined"){let d=document.cookie.split(";").find(g=>g.trim().startsWith(`${o}=`));if(d){let g=d.split("=")[1];t=JSON.parse(decodeURIComponent(g));}}s(!0),v&&v(t);}catch(r){console.error("Error loading consent settings:",r),s(true),v&&v(null);}return t},[i,o,v]),k=react.useCallback(t=>{try{let r=JSON.stringify(t);if(i==="localStorage"&&typeof window!="undefined")localStorage.setItem(o,r);else if(i==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(o,r);else if(i==="cookie"&&typeof document!="undefined"){let{domain:d,path:g="/",expires:I=365,secure:M=!0,sameSite:O="Lax"}=y,w=new Date;w.setDate(w.getDate()+I);let C=`${o}=${encodeURIComponent(r)}; path=${g}; expires=${w.toUTCString()}`;d&&(C+=`; domain=${d}`),M&&(C+="; secure"),C+=`; samesite=${O}`,document.cookie=C;}return h&&h(t),!0}catch(r){return console.error("Error saving consent settings:",r),false}},[i,o,y,h]),T=react.useCallback(()=>{try{if(i==="localStorage"&&typeof window!="undefined")localStorage.removeItem(o);else if(i==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(o);else if(i==="cookie"&&typeof document!="undefined"){let{domain:t,path:r="/"}=y,d=`${o}=; path=${r}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;t&&(d+=`; domain=${t}`),document.cookie=d;}return !0}catch(t){return console.error("Error clearing consent settings:",t),false}},[i,o,y]);react.useEffect(()=>{B&&!e&&m();},[B,e,m]),react.useEffect(()=>{R&&e&&k(b);},[b,R,e,k]);let p=chunkE64TU6IU_js.a("",x==null?void 0:x.root,$);if(typeof S=="function"){let t=S({loadSettings:m,saveSettings:k,clearSettings:T,loaded:e});return p?jsxRuntime.jsx("div",{className:p,children:t}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:t})}return p?jsxRuntime.jsx("div",{className:p,children:S}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:S})};exports.a=_;exports.b=N;//# sourceMappingURL=chunk-256APOQM.js.map
2
+ //# sourceMappingURL=chunk-256APOQM.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkNRQELKAE_js=require('./chunk-NRQELKAE.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var oe=({requests:R,onSelectRequest:T,onUpdateStatus:$,onAssignRequest:I,title:H="Data Subject Request Dashboard",description:X="Track and manage data subject requests in compliance with NDPA Part IV requirements.",className:J="",buttonClassName:V="",showRequestDetails:K=true,showRequestTimeline:Y=true,showDeadlineAlerts:F=true,assignees:i=[],classNames:s,unstyled:f=false})=>{let[h,y]=react.useState(null),[D,B]=react.useState(R),[j,O]=react.useState("all"),[C,M]=react.useState("all"),[A,_]=react.useState(""),[P,z]=react.useState("createdAt"),[L,Z]=react.useState("desc"),[S,G]=react.useState("");react.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 w=0;switch(P){case "createdAt":w=r.createdAt-p.createdAt;break;case "dueDate":w=(r.dueDate||0)-(p.dueDate||0);break;case "type":w=r.type.localeCompare(p.type);break;case "status":w=r.status.localeCompare(p.status);break;default:w=r.createdAt-p.createdAt;}return L==="asc"?w:-w}),B(e);},[R,j,C,A,P,L]),react.useEffect(()=>{D.length>0&&(h&&D.some(r=>r.id===h)||y(D[0].id));},[D,h]);let Q=e=>{y(e),T&&T(e);},U=e=>{h&&$&&$(h,e);},W=()=>{h&&S&&I&&(I(h,S),G(""));},k=e=>new Date(e).toLocaleDateString(),E=e=>{let r=Date.now(),p=(e-r)/(1440*60*1e3);return Math.ceil(p)},m=h?R.find(e=>e.id===h):null,t=e=>{let r={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},p={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${r[e]}`,children:p[e]})},l=e=>jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{pending:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",inProgress:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",completed:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",rejected:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",awaitingVerification:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"}[e]}`,s==null?void 0:s.statusBadge,f),children:e==="inProgress"?"In Progress":e==="awaitingVerification"?"Awaiting Verification":e.charAt(0).toUpperCase()+e.slice(1)}),g=e=>{if(!e.dueDate)return null;let r=E(e.dueDate);return r<=0?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Deadline Passed"}),jsxRuntime.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?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Deadline Approaching"}),jsxRuntime.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?jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Deadline Approaching"}),jsxRuntime.jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:[r," days remaining until the response deadline."]})]}):jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Deadline Tracking"}),jsxRuntime.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 ${k(e.createdAt)}.`}];return e.verifiedAt?r.push({title:"Identity Verified",date:e.verifiedAt,completed:true,description:`Data subject's identity was verified on ${k(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 ${k(e.updatedAt)}.`}),e.status==="completed"?r.push({title:"Request Completed",date:e.completedAt||Date.now(),completed:true,description:`Request was completed on ${k(e.completedAt||Date.now())}.`}):e.status==="rejected"&&r.push({title:"Request Rejected",date:e.completedAt||Date.now(),completed:true,description:`Request was rejected on ${k(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 ${k(e.dueDate)}.`}),jsxRuntime.jsxs("div",{className:"mt-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),jsxRuntime.jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:r.map((p,w)=>jsxRuntime.jsxs("li",{className:"mb-6 ml-4",children:[jsxRuntime.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"}`}),jsxRuntime.jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-600 dark:text-gray-500",children:p.date?k(p.date):"Pending"}),jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:p.title}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:p.description})]},w))})]})},o=()=>[{value:"all",label:"All Types"},{value:"information",label:"Information (NDPA Section 29)"},{value:"access",label:"Access (NDPA Section 30)"},{value:"rectification",label:"Rectification (NDPA Section 31)"},{value:"erasure",label:"Erasure (NDPA Section 32)"},{value:"restriction",label:"Restriction (NDPA Section 33)"},{value:"portability",label:"Portability (NDPA Section 34)"},{value:"objection",label:"Objection (NDPA Section 35)"},{value:"automated_decision_making",label:"Automated Decision-Making (NDPA Section 36)"}].map(r=>jsxRuntime.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=>jsxRuntime.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=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value));return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${J}`,s==null?void 0:s.root,f),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",s==null?void 0:s.header,f),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",s==null?void 0:s.title,f),children:H}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:X})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",s==null?void 0:s.filters,f),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxRuntime.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()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"typeFilter",className:"block text-sm font-medium mb-1",children:"Request Type Filter"}),jsxRuntime.jsx("select",{id:"typeFilter",value:C,onChange:e=>M(e.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:o()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxRuntime.jsxs("select",{id:"sortBy",value:P,onChange:e=>z(e.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"createdAt",children:"Date Received"}),jsxRuntime.jsx("option",{value:"dueDate",children:"Due Date"}),jsxRuntime.jsx("option",{value:"type",children:"Request Type"}),jsxRuntime.jsx("option",{value:"status",children:"Status"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchTerm",value:A,onChange:e=>_(e.target.value),placeholder:"Search requests...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"md:col-span-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"DSR Requests"}),D.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data subject requests found."}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",s==null?void 0:s.requestList,f),children:D.map(e=>{let r=e.dueDate?E(e.dueDate):null,p=null;return r!==null&&(r<=0?p=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):r<=3?p=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):r<=7&&(p=jsxRuntime.jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Soon"}))),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md cursor-pointer ${h===e.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,s==null?void 0:s.requestItem,f),onClick:()=>Q(e.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:e.subject.name}),t(e.type)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:e.subject.email}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Received: ",k(e.createdAt)]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsxRuntime.jsx("div",{children:l(e.status)}),jsxRuntime.jsx("div",{children:p})]})]},e.id)})})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("md:col-span-2",s==null?void 0:s.detailPanel,f),children:m?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:m.subject.name}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[t(m.type),l(m.status)]})]}),F&&m.dueDate&&jsxRuntime.jsx("div",{className:"mb-4",children:g(m)}),K&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Email:"})," ",m.subject.email]}),m.subject.phone&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Phone:"})," ",m.subject.phone]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Received:"})," ",k(m.createdAt)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.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]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.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&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Due Date:"})," ",k(m.dueDate)]})]})]}),m.description&&jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Request Details:"}),jsxRuntime.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&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Additional Information:"}),jsxRuntime.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")})]})]}),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-md font-medium mb-2",children:"Update Status"}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx("select",{value:m.status,onChange:e=>U(e.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:v()}),jsxRuntime.jsx("button",{onClick:()=>U(m.status),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${V}`,children:"Update"})]})]}),i.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-md font-medium mb-2",children:"Assign Request"}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsxs("select",{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:[jsxRuntime.jsx("option",{value:"",children:"Select Assignee"}),i.map(e=>jsxRuntime.jsx("option",{value:e,children:e},e))]}),jsxRuntime.jsx("button",{onClick:W,disabled:!S,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] disabled:bg-gray-300 disabled:text-gray-500 ${V}`,children:"Assign"})]})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Request Summary"}),jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsxRuntime.jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:jsxRuntime.jsx("pre",{children:JSON.stringify(chunkNRQELKAE_js.a(m),null,2)})})})]}),Y&&x(m)]}):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a request to view details"})})})]})]})};var ue=({requests:R,onSelectRequest:T,title:$="DSR Request Tracker",description:I="Track the status and progress of data subject requests as required by NDPA Part IV.",className:H="",buttonClassName:X="",showSummaryStats:J=true,showTypeBreakdown:V=true,showStatusBreakdown:K=true,showTimelineChart:Y=true,showOverdueRequests:F=true,classNames:i,unstyled:s=false})=>{let[f,h]=react.useState("30days"),[y,D]=react.useState(R),[B,j]=react.useState([]),[O,C]=react.useState([]);react.useEffect(()=>{let t=Date.now(),l;switch(f){case "7days":l=R.filter(o=>t-o.createdAt<=10080*60*1e3);break;case "30days":l=R.filter(o=>t-o.createdAt<=720*60*60*1e3);break;case "90days":l=R.filter(o=>t-o.createdAt<=2160*60*60*1e3);break;default:l=[...R];}D(l);let g=l.filter(o=>o.dueDate&&t>o.dueDate&&o.status!=="completed"&&o.status!=="rejected");j(g);let x=l.filter(o=>o.dueDate&&t<o.dueDate&&o.dueDate-t<=10080*60*1e3&&o.status!=="completed"&&o.status!=="rejected");C(x);},[R,f]);let M=t=>{T&&T(t);},A=t=>new Date(t).toLocaleDateString(),_=t=>{let l=Date.now(),g=(t-l)/(1440*60*1e3);return Math.ceil(g)},P=()=>{let t=y.filter(g=>g.status==="completed"&&g.completedAt&&g.createdAt);if(t.length===0)return null;let l=t.reduce((g,x)=>{let o=((x.completedAt||0)-x.createdAt)/864e5;return g+o},0);return Number((l/t.length).toFixed(1))},z=()=>{let t=y.filter(g=>(g.status==="completed"||g.status==="rejected")&&g.completedAt&&g.dueDate);if(t.length===0)return null;let l=t.filter(g=>(g.completedAt||0)<=(g.dueDate||0));return Math.round(l.length/t.length*100)},L=()=>{let t={};return y.forEach(l=>{t[l.type]=(t[l.type]||0)+1;}),{information:t.information||0,access:t.access||0,rectification:t.rectification||0,erasure:t.erasure||0,restriction:t.restriction||0,portability:t.portability||0,objection:t.objection||0,automated_decision_making:t.automated_decision_making||0}},Z=()=>{let t={};return y.forEach(l=>{t[l.status]=(t[l.status]||0)+1;}),{pending:t.pending||0,awaitingVerification:t.awaitingVerification||0,inProgress:t.inProgress||0,completed:t.completed||0,rejected:t.rejected||0}},S=t=>{let l={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},g={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${l[t]}`,children:g[t]})},Q=()=>{let t=y.length,l=y.filter(u=>u.status!=="completed"&&u.status!=="rejected").length;y.filter(u=>u.status==="completed"||u.status==="rejected").length;let x=P(),o=z();return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",i==null?void 0:i.stats,s),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,s),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Total Requests"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:t})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,s),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Pending Requests"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:l})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,s),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Avg. Response Time"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:x!==null?`${x} days`:"N/A"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,s),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Compliance Rate"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:o!==null?`${o}%`:"N/A"})]})]})},U=()=>{let t=L(),l=y.length,g=Object.entries(t).sort(([,x],[,o])=>o-x).map(([x])=>x);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",i==null?void 0:i.table,s),children:[jsxRuntime.jsx("h3",{className:chunkE64TU6IU_js.a("text-lg font-medium mb-4",i==null?void 0:i.tableHeader,s),children:"Request Types"}),l===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxRuntime.jsx("div",{className:"space-y-4",children:g.map(x=>{let o=t[x],u=Math.round(o/l*100);return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[S(x),jsxRuntime.jsxs("span",{className:"ml-2 text-sm",children:[o," requests"]})]}),jsxRuntime.jsxs("span",{className:"text-sm font-medium",children:[u,"%"]})]}),jsxRuntime.jsx("div",{className:"w-full bg-gray-200 dark:bg-gray-600 rounded-full h-2.5",children:jsxRuntime.jsx("div",{className:"bg-[rgb(var(--ndpr-primary))] h-2.5 rounded-full",style:{width:`${u}%`}})})]},x)})})]})},W=()=>{let t=Z(),l=y.length,g=["pending","awaitingVerification","inProgress","completed","rejected"],x={pending:"bg-yellow-500",awaitingVerification:"bg-purple-500",inProgress:"bg-blue-500",completed:"bg-green-500",rejected:"bg-red-500"};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",i==null?void 0:i.table,s),children:[jsxRuntime.jsx("h3",{className:chunkE64TU6IU_js.a("text-lg font-medium mb-4",i==null?void 0:i.tableHeader,s),children:"Request Status"}),l===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"flex h-4 mb-2",children:g.map(o=>{let u=t[o],v=u/l*100;return v>0?jsxRuntime.jsx("div",{className:`${x[o]} first:rounded-l-full last:rounded-r-full`,style:{width:`${v}%`},title:`${o}: ${u} (${Math.round(v)}%)`},o):null})}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 mt-4",children:g.map(o=>{let u=t[o],v=Math.round(u/l*100);return jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("div",{className:`w-3 h-3 rounded-full ${x[o]} mr-2`}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium",children:o==="inProgress"?"In Progress":o==="awaitingVerification"?"Awaiting Verification":o.charAt(0).toUpperCase()+o.slice(1)}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:[u," (",v,"%)"]})]})]},o)})})]})]})},k=()=>{let t={};y.forEach(u=>{let v=new Date(u.createdAt),e=`${v.getFullYear()}-${String(v.getMonth()+1).padStart(2,"0")}`;t[e]=(t[e]||0)+1;});let g=Object.keys(t).sort().slice(-6),x=Math.max(...Object.values(t).filter(u=>u>0),1),o=u=>{let[v,e]=u.split("-");return `${e}/${v.slice(2)}`};return jsxRuntime.jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),g.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxRuntime.jsxs("div",{className:"h-40",children:[jsxRuntime.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 jsxRuntime.jsx("div",{className:"flex flex-col items-center flex-1",children:jsxRuntime.jsx("div",{className:"w-full bg-[rgb(var(--ndpr-primary))] rounded-t",style:{height:e},title:`${o(u)}: ${v} requests`})},u)})}),jsxRuntime.jsx("div",{className:"flex justify-between mt-2",children:g.map(u=>jsxRuntime.jsx("div",{className:"text-xs text-center",children:o(u)},u))})]})]})},E=()=>jsxRuntime.jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Overdue Requests"}),B.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No overdue requests."}):jsxRuntime.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:B.map(t=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md cursor-pointer hover:bg-red-100 dark:hover:bg-red-900/30",i==null?void 0:i.tableRow,s),onClick:()=>M(t.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:t.subject.name}),S(t.type)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.subject.email}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:["Due: ",A(t.dueDate||0)]}),jsxRuntime.jsxs("p",{className:"text-xs font-bold text-red-600 dark:text-red-400",children:["Overdue by ",Math.abs(_(t.dueDate||0))," days"]})]})]},t.id))})]}),m=()=>jsxRuntime.jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Upcoming Deadlines"}),O.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No upcoming deadlines in the next 7 days."}):jsxRuntime.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:O.map(t=>{let l=_(t.dueDate||0);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-3 bg-yellow-50 dark:bg-yellow-900/20 rounded-md cursor-pointer hover:bg-yellow-100 dark:hover:bg-yellow-900/30",i==null?void 0:i.tableRow,s),onClick:()=>M(t.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:t.subject.name}),S(t.type)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.subject.email}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:["Due: ",A(t.dueDate||0)]}),jsxRuntime.jsxs("p",{className:`text-xs font-bold ${l<=3?"text-red-600 dark:text-red-400":"text-yellow-600 dark:text-yellow-400"}`,children:["Due in ",l," days"]})]})]},t.id)})})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${H}`,i==null?void 0:i.root,s),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col md:flex-row md:justify-between md:items-center mb-6",i==null?void 0:i.header,s),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",i==null?void 0:i.title,s),children:$}),jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:I})]}),jsxRuntime.jsxs("div",{className:"mt-4 md:mt-0",children:[jsxRuntime.jsx("label",{htmlFor:"timeframe",className:"block text-sm font-medium mb-1",children:"Timeframe"}),jsxRuntime.jsxs("select",{id:"timeframe",value:f,onChange:t=>h(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:[jsxRuntime.jsx("option",{value:"7days",children:"Last 7 Days"}),jsxRuntime.jsx("option",{value:"30days",children:"Last 30 Days"}),jsxRuntime.jsx("option",{value:"90days",children:"Last 90 Days"}),jsxRuntime.jsx("option",{value:"all",children:"All Time"})]})]})]}),J&&Q(),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{children:[V&&U(),K&&W()]}),jsxRuntime.jsxs("div",{children:[Y&&k(),F&&E(),F&&m()]})]})]})};exports.a=oe;exports.b=ue;//# sourceMappingURL=chunk-2FWCVWKN.js.map
2
+ //# sourceMappingURL=chunk-2FWCVWKN.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkNRQELKAE_js=require('./chunk-NRQELKAE.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function M(D,o){return o?chunkELKB2AFZ_js.a(D):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialRequests:D=[],requestTypes:o,adapter:f,storageKey:x="ndpr_dsr_requests",useLocalStorage:B=true,onSubmit:p,onUpdate:m}){let y=f!=null?f:M(x,B),q=react.useRef(y);q.current=y;let[r,R]=react.useState(D),[I,l]=react.useState(true);react.useEffect(()=>{let e=false;try{let t=q.current.load();t instanceof Promise?t.then(s=>{e||(s&&R(s),l(!1));},()=>{e||l(!1);}):(t&&R(t),l(!1));}catch(t){e||l(false);}return ()=>{e=true;}},[]);let c=react.useCallback(e=>{Promise.resolve(q.current.save(e)).catch(t=>{console.warn("[ndpr-toolkit] Failed to save DSR requests:",t);});},[]),L=()=>"dsr_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),O=react.useCallback(e=>{let t=o.find(g=>g.id===e.type),s=(t==null?void 0:t.estimatedCompletionTime)||30,u=Date.now(),a=u+s*24*60*60*1e3,v=e,{createdAt:A}=v,i=chunkMQFZHA2D_js.c(v,["createdAt"]),d=chunkMQFZHA2D_js.a({id:L(),status:"pending",createdAt:u,updatedAt:u,dueDate:a},i);return R(g=>{let b=[...g,d];return c(b),b}),p&&p(d),d},[o,c,p]),_=react.useCallback((e,t)=>{let s=null;return R(u=>{let a=u.findIndex(d=>d.id===e);if(a===-1)return u;let A=u[a];s=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},A),t),{updatedAt:Date.now()});let i=[...u];return i[a]=s,c(i),i}),s&&m&&m(s),s},[c,m]),k=react.useCallback(e=>r.find(t=>t.id===e)||null,[r]),U=react.useCallback(e=>r.filter(t=>t.status===e),[r]),F=react.useCallback(e=>r.filter(t=>t.type===e),[r]);return {requests:r,submitRequest:O,updateRequest:_,getRequest:k,getRequestsByStatus:U,getRequestsByType:F,getRequestType:e=>o.find(t=>t.id===e),formatRequest:e=>{let{formattedRequest:t}=chunkNRQELKAE_js.a(e);return t},clearRequests:()=>{R([]),Promise.resolve(q.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove DSR requests:",e);});},isLoading:I}}exports.a=Q;//# sourceMappingURL=chunk-3DJGO6WG.js.map
2
+ //# sourceMappingURL=chunk-3DJGO6WG.js.map
@@ -0,0 +1,2 @@
1
+ import {a as a$1}from'./chunk-AYKLAEOU.mjs';import {a,b}from'./chunk-WWT2ZSNU.mjs';import {useState,useRef,useEffect,useCallback}from'react';import {createPortal}from'react-dom';import {jsx,jsxs}from'react/jsx-runtime';var pt=({options:d,onSave:W,title:Y="We Value Your Privacy",description:m="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:K="Accept All",rejectAllButtonText:Q="Reject All",customizeButtonText:U="Customize",saveButtonText:X="Save Preferences",position:A="bottom",zIndex:T=9999,version:f="1.0",show:p,manageStorage:R=true,storageKey:E="ndpr_consent",className:Z="",buttonClassName:h="",primaryButtonClassName:q="",secondaryButtonClassName:s="",classNames:t,unstyled:o,onAnalytics:y})=>{let[g,u]=useState(false),[v,a$2]=useState(false),[C,B]=useState({}),[H,N]=useState(false),z=useRef(null),$=useRef(null),j=useRef(false);useEffect(()=>{N(true);},[]);let l=useCallback((e,n)=>{y==null||y(a({action:e,timestamp:Date.now(),version:f},n!==void 0?{categories:n}:{}));},[y,f]);useEffect(()=>{let e={};if(d.forEach(n=>{e[n.id]=n.defaultValue||false;}),B(e),p===void 0)if(!R)u(true);else {let n=localStorage.getItem(E);if(n)try{JSON.parse(n).version!==f?u(!0):u(!1);}catch(L){u(true);}else u(true);}else u(p);},[d,E,f,R]),useEffect(()=>{p!==void 0&&u(p);},[p]);let tt=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),l("accepted_all",e),P(e);},et=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),l("rejected_all",e),P(e);},nt=(e,n)=>{B(L=>b(a({},L),{[e]:n}));},rt=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),B(e);},ot=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),B(e);},_=d.length>0&&d.every(e=>C[e.id]),it=()=>{l("customized",C),P(C);},P=e=>{let n={consents:e,timestamp:Date.now(),version:f,method:v?"customize":"banner",hasInteracted:true};R&&localStorage.setItem(E,JSON.stringify(n)),W(n),u(false),a$2(false);},M=useCallback(()=>{l("dismissed"),u(false),a$2(false);},[l]);if(useEffect(()=>{if(!g)return;let e=n=>{n.key==="Escape"&&M();};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[g,M]),useEffect(()=>{g&&!j.current&&(j.current=true,l("shown")),g||(j.current=false);},[g,l]),useEffect(()=>{g&&z.current&&z.current.focus();},[g]),useEffect(()=>{if(v&&$.current){let e=$.current;e.style.maxHeight="0px",e.style.opacity="0",e.offsetHeight,e.style.maxHeight=`${e.scrollHeight}px`,e.style.opacity="1";}},[v]),!g)return null;let dt=(t==null?void 0:t.primaryButton)||(t==null?void 0:t.acceptButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${h} ${q}`,F=(t==null?void 0:t.secondaryButton)||(t==null?void 0:t.rejectButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${h} ${s}`,ut=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${h}`,gt=(t==null?void 0:t.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${h} ${q}`,k=A==="inline",w=A==="center",x;k||w?x="":A==="top"?x="fixed inset-x-0 top-0":x="fixed inset-x-0 bottom-0";let D=jsx("div",{ref:z,tabIndex:-1,"data-ndpr-component":"consent-banner",className:a$1(`${k?"":x} bg-white dark:bg-gray-800 shadow-lg p-3 sm:p-4 border border-gray-200 dark:border-gray-700 ${w?"max-w-lg w-full":""} ${Z}`,t==null?void 0:t.root,o),style:!k&&!w?{zIndex:T}:void 0,role:"dialog","aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxs("div",{className:a$1("max-w-6xl mx-auto",t==null?void 0:t.container,o),children:[jsx("h2",{id:"consent-banner-title",className:a$1("text-lg font-bold mb-2",t==null?void 0:t.title,o),children:Y}),jsx("p",{id:"consent-banner-description",className:a$1("text-sm sm:text-base mb-4",t==null?void 0:t.description,o),children:m}),v&&jsxs("div",{ref:$,className:a$1("mb-4 p-3 sm:p-4 rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50",t==null?void 0:t.customizePanel,o),style:{overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out"},children:[jsx("div",{className:"mb-3 flex items-center justify-end",children:jsx("button",{type:"button",onClick:_?ot:rt,className:a$1("text-sm font-medium text-[rgb(var(--ndpr-primary))] hover:underline",t==null?void 0:t.selectAllButton,o),children:_?"Deselect All":"Select All"})}),jsx("div",{className:a$1("space-y-3",t==null?void 0:t.optionsList,o),children:d.map(e=>jsxs("div",{className:a$1("flex items-start",t==null?void 0:t.optionItem,o),children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`consent-${e.id}`,type:"checkbox",checked:C[e.id]||false,onChange:n=>nt(e.id,n.target.checked),disabled:e.required,className:a$1("h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",t==null?void 0:t.optionCheckbox,o)})}),jsxs("div",{className:"ml-3 text-sm",children:[jsxs("label",{htmlFor:`consent-${e.id}`,className:a$1("font-medium",t==null?void 0:t.optionLabel,o),children:[e.label," ",e.required&&jsx("span",{className:"text-red-500",children:"*"})]}),jsx("p",{className:a$1("text-gray-600 dark:text-gray-400",t==null?void 0:t.optionDescription,o),children:e.description})]})]},e.id))}),jsxs("div",{className:a$1("mt-4 flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsx("button",{onClick:it,className:a$1(gt,t==null?void 0:t.saveButton,o),children:X}),jsx("button",{onClick:()=>a$2(false),className:a$1(F,t==null?void 0:t.rejectButton,o),children:"Back"})]})]}),!v&&jsxs("div",{className:a$1("flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsx("button",{onClick:tt,className:a$1(dt,t==null?void 0:t.acceptButton,o),children:K}),jsx("button",{onClick:et,className:a$1(F,t==null?void 0:t.rejectButton,o),children:Q}),jsx("button",{onClick:()=>a$2(true),className:a$1(ut,t==null?void 0:t.customizeButton,o),children:U})]}),jsx("div",{className:a$1("mt-2 text-xs text-gray-600 dark:text-gray-400",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(k)return D;if(w){let e=jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:T},children:[jsx("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),jsx("div",{className:"relative",children:D})]});return H?createPortal(e,document.body):null}return H?createPortal(D,document.body):null};export{pt as a};//# sourceMappingURL=chunk-4XCL62MJ.mjs.map
2
+ //# sourceMappingURL=chunk-4XCL62MJ.mjs.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),reactDom=require('react-dom'),jsxRuntime=require('react/jsx-runtime');var pt=({options:d,onSave:W,title:Y="We Value Your Privacy",description:m="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:K="Accept All",rejectAllButtonText:Q="Reject All",customizeButtonText:U="Customize",saveButtonText:X="Save Preferences",position:A="bottom",zIndex:T=9999,version:f="1.0",show:p,manageStorage:R=true,storageKey:E="ndpr_consent",className:Z="",buttonClassName:h="",primaryButtonClassName:q="",secondaryButtonClassName:s="",classNames:t,unstyled:o,onAnalytics:y})=>{let[g,u]=react.useState(false),[v,a]=react.useState(false),[C,B]=react.useState({}),[H,N]=react.useState(false),z=react.useRef(null),$=react.useRef(null),j=react.useRef(false);react.useEffect(()=>{N(true);},[]);let l=react.useCallback((e,n)=>{y==null||y(chunkMQFZHA2D_js.a({action:e,timestamp:Date.now(),version:f},n!==void 0?{categories:n}:{}));},[y,f]);react.useEffect(()=>{let e={};if(d.forEach(n=>{e[n.id]=n.defaultValue||false;}),B(e),p===void 0)if(!R)u(true);else {let n=localStorage.getItem(E);if(n)try{JSON.parse(n).version!==f?u(!0):u(!1);}catch(L){u(true);}else u(true);}else u(p);},[d,E,f,R]),react.useEffect(()=>{p!==void 0&&u(p);},[p]);let tt=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),l("accepted_all",e),P(e);},et=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),l("rejected_all",e),P(e);},nt=(e,n)=>{B(L=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},L),{[e]:n}));},rt=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),B(e);},ot=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),B(e);},_=d.length>0&&d.every(e=>C[e.id]),it=()=>{l("customized",C),P(C);},P=e=>{let n={consents:e,timestamp:Date.now(),version:f,method:v?"customize":"banner",hasInteracted:true};R&&localStorage.setItem(E,JSON.stringify(n)),W(n),u(false),a(false);},M=react.useCallback(()=>{l("dismissed"),u(false),a(false);},[l]);if(react.useEffect(()=>{if(!g)return;let e=n=>{n.key==="Escape"&&M();};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[g,M]),react.useEffect(()=>{g&&!j.current&&(j.current=true,l("shown")),g||(j.current=false);},[g,l]),react.useEffect(()=>{g&&z.current&&z.current.focus();},[g]),react.useEffect(()=>{if(v&&$.current){let e=$.current;e.style.maxHeight="0px",e.style.opacity="0",e.offsetHeight,e.style.maxHeight=`${e.scrollHeight}px`,e.style.opacity="1";}},[v]),!g)return null;let dt=(t==null?void 0:t.primaryButton)||(t==null?void 0:t.acceptButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${h} ${q}`,F=(t==null?void 0:t.secondaryButton)||(t==null?void 0:t.rejectButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${h} ${s}`,ut=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${h}`,gt=(t==null?void 0:t.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${h} ${q}`,k=A==="inline",w=A==="center",x;k||w?x="":A==="top"?x="fixed inset-x-0 top-0":x="fixed inset-x-0 bottom-0";let D=jsxRuntime.jsx("div",{ref:z,tabIndex:-1,"data-ndpr-component":"consent-banner",className:chunkE64TU6IU_js.a(`${k?"":x} bg-white dark:bg-gray-800 shadow-lg p-3 sm:p-4 border border-gray-200 dark:border-gray-700 ${w?"max-w-lg w-full":""} ${Z}`,t==null?void 0:t.root,o),style:!k&&!w?{zIndex:T}:void 0,role:"dialog","aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("max-w-6xl mx-auto",t==null?void 0:t.container,o),children:[jsxRuntime.jsx("h2",{id:"consent-banner-title",className:chunkE64TU6IU_js.a("text-lg font-bold mb-2",t==null?void 0:t.title,o),children:Y}),jsxRuntime.jsx("p",{id:"consent-banner-description",className:chunkE64TU6IU_js.a("text-sm sm:text-base mb-4",t==null?void 0:t.description,o),children:m}),v&&jsxRuntime.jsxs("div",{ref:$,className:chunkE64TU6IU_js.a("mb-4 p-3 sm:p-4 rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50",t==null?void 0:t.customizePanel,o),style:{overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out"},children:[jsxRuntime.jsx("div",{className:"mb-3 flex items-center justify-end",children:jsxRuntime.jsx("button",{type:"button",onClick:_?ot:rt,className:chunkE64TU6IU_js.a("text-sm font-medium text-[rgb(var(--ndpr-primary))] hover:underline",t==null?void 0:t.selectAllButton,o),children:_?"Deselect All":"Select All"})}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",t==null?void 0:t.optionsList,o),children:d.map(e=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start",t==null?void 0:t.optionItem,o),children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`consent-${e.id}`,type:"checkbox",checked:C[e.id]||false,onChange:n=>nt(e.id,n.target.checked),disabled:e.required,className:chunkE64TU6IU_js.a("h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",t==null?void 0:t.optionCheckbox,o)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${e.id}`,className:chunkE64TU6IU_js.a("font-medium",t==null?void 0:t.optionLabel,o),children:[e.label," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-400",t==null?void 0:t.optionDescription,o),children:e.description})]})]},e.id))}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-4 flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:it,className:chunkE64TU6IU_js.a(gt,t==null?void 0:t.saveButton,o),children:X}),jsxRuntime.jsx("button",{onClick:()=>a(false),className:chunkE64TU6IU_js.a(F,t==null?void 0:t.rejectButton,o),children:"Back"})]})]}),!v&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:tt,className:chunkE64TU6IU_js.a(dt,t==null?void 0:t.acceptButton,o),children:K}),jsxRuntime.jsx("button",{onClick:et,className:chunkE64TU6IU_js.a(F,t==null?void 0:t.rejectButton,o),children:Q}),jsxRuntime.jsx("button",{onClick:()=>a(true),className:chunkE64TU6IU_js.a(ut,t==null?void 0:t.customizeButton,o),children:U})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("mt-2 text-xs text-gray-600 dark:text-gray-400",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(k)return D;if(w){let e=jsxRuntime.jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:T},children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"relative",children:D})]});return H?reactDom.createPortal(e,document.body):null}return H?reactDom.createPortal(D,document.body):null};exports.a=pt;//# sourceMappingURL=chunk-555WWZ3W.js.map
2
+ //# sourceMappingURL=chunk-555WWZ3W.js.map
@@ -0,0 +1,81 @@
1
+ 'use strict';var chunkBKRETVJ6_js=require('./chunk-BKRETVJ6.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ve=({breachData:g,initialAssessment:u={},onComplete:w,title:J="Breach Risk Assessment",description:_="Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",submitButtonText:K="Complete Assessment",className:ae="",buttonClassName:Z="",classNames:v={},unstyled:d=false,showBreachSummary:l=true,showNotificationRequirements:A=true})=>{let[j,se]=react.useState(u.confidentialityImpact||3),[P,b]=react.useState(u.integrityImpact||3),[D,C]=react.useState(u.availabilityImpact||3),[q,B]=react.useState(u.harmLikelihood||3),[E,I]=react.useState(u.harmSeverity||3),[M,O]=react.useState(u.risksToRightsAndFreedoms!==void 0?u.risksToRightsAndFreedoms:false),[G,W]=react.useState(u.highRisksToRightsAndFreedoms!==void 0?u.highRisksToRightsAndFreedoms:false),[Q,ie]=react.useState(u.justification||""),[Y,re]=react.useState(0),[R,h]=react.useState("low"),[x,f]=react.useState(false),[y,X]=react.useState(0),[U,z]=react.useState(0),[p,k]=react.useState(false);react.useEffect(()=>{let ee=j*.2+P*.1+D*.1+q*.3+E*.3;re(Number(ee.toFixed(1)));let L;ee<2?L="low":ee<3?L="medium":ee<4?L="high":L="critical",h(L),f(M||L==="high"||L==="critical");let ne=g.discoveredAt+4320*60*1e3;X(ne);let ce=Date.now(),pe=(ne-ce)/(3600*1e3);z(Number(pe.toFixed(1)));},[j,P,D,q,E,M,g.discoveredAt]);let T=o=>new Date(o).toLocaleString(),H=o=>{o.preventDefault();let N={id:u.id||`assessment_${Date.now()}`,breachId:g.id,assessedAt:Date.now(),assessor:u.assessor||{name:"Assessment User",role:"Data Protection Officer",email:"dpo@example.com"},confidentialityImpact:j,integrityImpact:P,availabilityImpact:D,harmLikelihood:q,harmSeverity:E,overallRiskScore:Y,riskLevel:R,risksToRightsAndFreedoms:M,highRisksToRightsAndFreedoms:G,justification:Q};w(N),k(true);},s=o=>{switch(o){case 1:return "Minimal";case 2:return "Low";case 3:return "Moderate";case 4:return "High";case 5:return "Severe";default:return "Unknown"}},m=o=>jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[o]}`,v.riskBadge,d),children:o.charAt(0).toUpperCase()+o.slice(1)});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,v.root,d),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",v.title,d),children:J}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:_}),l&&jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-2",children:"Breach Summary"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Title:"})," ",g.title]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Discovered:"})," ",T(g.discoveredAt)]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",g.status.charAt(0).toUpperCase()+g.status.slice(1)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",g.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",g.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",g.estimatedAffectedSubjects||"Unknown"]})]})]})]}),p?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Assessment Results"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Overall Risk Level:"})," ",m(R)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",Y," / 5"]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Assessed On:"})," ",T(Date.now())]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",M?"Yes":"No"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",G?"Yes":"No"]})]})]}),jsxRuntime.jsxs("div",{className:"mt-3",children:[jsxRuntime.jsx("p",{className:"text-sm mb-1",children:jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})}),jsxRuntime.jsx("p",{className:"text-sm bg-white dark:bg-gray-800 p-2 rounded",children:Q})]})]}),A&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`mb-6 p-4 rounded-md ${x?U>24?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20":"bg-green-50 dark:bg-green-900/20"}`,v.notificationStatus,d),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Requirements"}),x?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:`text-sm font-bold mb-2 ${U>24?"text-yellow-800 dark:text-yellow-200":"text-red-800 dark:text-red-200"}`,children:"NDPC Notification Required"}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"Under the NDPA (Section 40), this breach must be reported to the NDPC within 72 hours of discovery."}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notification Deadline:"})," ",T(y)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsxRuntime.jsx("span",{className:U<24?"text-red-600 dark:text-red-400 font-bold":"",children:U>0?`${U} hours`:"Deadline passed"})]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",G?"Required (NDPA Section 40(4))":"Not required unless directed by NDPC"]})]}):jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-bold mb-2 text-green-800 dark:text-green-200",children:"NDPC Notification Not Required"}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"Based on this assessment, this breach does not need to be reported to the NDPC."}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"However, the breach should still be documented internally for compliance purposes."})]}),jsxRuntime.jsxs("div",{className:"mt-3 text-sm",children:[jsxRuntime.jsx("p",{className:"font-medium",children:"Next Steps:"}),jsxRuntime.jsx("ul",{className:"list-disc pl-5 mt-1",children:x?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("li",{children:"Prepare a notification report for the NDPC"}),jsxRuntime.jsx("li",{children:"Document all aspects of the breach and your response"}),G&&jsxRuntime.jsx("li",{children:"Prepare communications for affected data subjects"}),jsxRuntime.jsx("li",{children:"Implement measures to mitigate the impact of the breach"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("li",{children:"Document the breach and this assessment in your internal records"}),jsxRuntime.jsx("li",{children:"Implement measures to prevent similar breaches in the future"}),jsxRuntime.jsx("li",{children:"Review and update security measures as needed"})]})})]})]}),jsxRuntime.jsx("button",{onClick:()=>k(false),className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${Z}`,v.primaryButton||v.submitButton,d),children:"Edit Assessment"})]}):jsxRuntime.jsx("form",{onSubmit:H,children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Assessment"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"confidentialityImpact",className:"block text-sm font-medium mb-1",children:["Confidentiality Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the confidentiality of data been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"confidentialityImpact",min:"1",max:"5",step:"1",value:j,onChange:o=>se(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(j)," (",j,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"integrityImpact",className:"block text-sm font-medium mb-1",children:["Integrity Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the integrity of data been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"integrityImpact",min:"1",max:"5",step:"1",value:P,onChange:o=>b(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(P)," (",P,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"availabilityImpact",className:"block text-sm font-medium mb-1",children:["Availability Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the availability of data or systems been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"availabilityImpact",min:"1",max:"5",step:"1",value:D,onChange:o=>C(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(D)," (",D,")"]})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Risk to Data Subjects"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"harmLikelihood",className:"block text-sm font-medium mb-1",children:["Likelihood of Harm (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How likely is it that data subjects will experience harm?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"harmLikelihood",min:"1",max:"5",step:"1",value:q,onChange:o=>B(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(q)," (",q,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"harmSeverity",className:"block text-sm font-medium mb-1",children:["Severity of Harm (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How severe would the harm be to affected data subjects?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"harmSeverity",min:"1",max:"5",step:"1",value:E,onChange:o=>I(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(E)," (",E,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:M,onChange:o=>O(o.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"risksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a risk to the rights and freedoms of data subjects"})]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40), breaches that pose a risk to rights and freedoms must be reported to the NDPC within 72 hours."})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"highRisksToRightsAndFreedoms",checked:G,onChange:o=>W(o.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"highRisksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a high risk to the rights and freedoms of data subjects"})]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40(4)), breaches that pose a high risk to rights and freedoms also require notification to affected data subjects without undue delay."})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Overall Assessment"}),jsxRuntime.jsxs("div",{className:"mb-4 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Overall Risk Score:"}),jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a("",v.riskScore,d),children:[Y," / 5"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Level:"}),m(R)]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:["Justification for Assessment ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"justification",value:Q,onChange:o=>ie(o.target.value),rows:4,placeholder:"Explain the reasoning behind your assessment, including any factors that influenced your decision.",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true})]})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This assessment will determine if notification is required for this breach."})]}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{type:"submit",className:chunkE64TU6IU_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${Z}`,v.primaryButton||v.submitButton,d),children:K})})]})})]})};var Ce=({breachReports:g,riskAssessments:u,regulatoryNotifications:w,onSelectBreach:J,onRequestAssessment:_,onRequestNotification:K,title:ae="Breach Notification Manager",description:Z="Manage data breach notifications and track compliance with NDPA Section 40 requirements.",className:v="",buttonClassName:d="",classNames:l={},unstyled:A=false,showBreachDetails:j=true,showNotificationTimeline:se=true,showDeadlineAlerts:P=true})=>{var H;let[b,D]=react.useState(null),[C,q]=react.useState(g),[B,E]=react.useState("all"),[I,M]=react.useState(""),[O,G]=react.useState("discoveredAt"),[W,Q]=react.useState("desc");react.useEffect(()=>{let s=[...g];if(B!=="all"&&(s=s.filter(m=>m.status===B)),I){let m=I.toLowerCase();s=s.filter(o=>o.title.toLowerCase().includes(m)||o.description.toLowerCase().includes(m)||o.affectedSystems.some(N=>N.toLowerCase().includes(m))||o.dataTypes.some(N=>N.toLowerCase().includes(m)));}s.sort((m,o)=>{let N=0;switch(O){case "title":N=m.title.localeCompare(o.title);break;case "discoveredAt":N=m.discoveredAt-o.discoveredAt;break;case "status":N=m.status.localeCompare(o.status);break;case "riskLevel":let F=u.find(L=>L.breachId===m.id),$=u.find(L=>L.breachId===o.id),oe=(F==null?void 0:F.riskLevel)||"unknown",ee=($==null?void 0:$.riskLevel)||"unknown";N=oe.localeCompare(ee);break;default:N=m.discoveredAt-o.discoveredAt;}return W==="asc"?N:-N}),q(s);},[g,B,I,O,W,u]),react.useEffect(()=>{C.length>0&&(b&&C.some(m=>m.id===b)||D(C[0].id));},[C,b]);let ie=s=>{D(s),J&&J(s);},Y=()=>{b&&_&&_(b);},re=()=>{b&&K&&K(b);},R=s=>new Date(s).toLocaleString(),h=b?g.find(s=>s.id===b):null,x=b?u.find(s=>s.breachId===b):null,f=b?w.find(s=>s.breachId===b):null,y=h?X(h,x):null;function X(s,m){let o=chunkBKRETVJ6_js.a(s,m||void 0),N=s.discoveredAt+o.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:o.notificationRequired,ndpcNotificationDeadline:N,dataSubjectNotificationRequired:(m==null?void 0:m.highRisksToRightsAndFreedoms)||false,justification:o.justification}}function U(s){let m=Date.now(),o=(s-m)/(3600*1e3);return Number(o.toFixed(1))}let z=s=>s?jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[s]}`,l.statusBadge,A),children:s.charAt(0).toUpperCase()+s.slice(1)}):null,p=s=>jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{ongoing:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",contained:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",resolved:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"}[s]||"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}`,l.statusBadge,A),children:s.charAt(0).toUpperCase()+s.slice(1)}),k=()=>{if(!h||!y)return null;if(!y.ndpcNotificationRequired)return jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Not Required"}),jsxRuntime.jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"Based on the risk assessment, NDPC notification is not required for this breach."})]});if(f)return jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Sent"}),jsxRuntime.jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:["Notification was sent to the NDPC on ",R(f.sentAt),"."]})]});let s=U(y.ndpcNotificationDeadline);return s<=0?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Notification Deadline Passed"}),jsxRuntime.jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The 72-hour deadline for NDPC notification has passed. Notification should be sent immediately."})]}):s<=24?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Notification Due Soon"}),jsxRuntime.jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",s," hours remaining until the NDPC notification deadline."]})]}):jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Notification Required"}),jsxRuntime.jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:["NDPC notification is required by ",R(y.ndpcNotificationDeadline)," (",s," hours remaining)."]})]})},T=()=>{if(!h)return null;let s=[{title:"Breach Discovered",date:h.discoveredAt,completed:true,description:`Breach was discovered on ${R(h.discoveredAt)}.`},{title:"Risk Assessment",date:x==null?void 0:x.assessedAt,completed:!!x,description:x?`Risk assessment completed on ${R(x.assessedAt)}.`:"Risk assessment has not been completed yet."}];return y!=null&&y.ndpcNotificationRequired&&s.push({title:"NDPC Notification",date:f==null?void 0:f.sentAt,completed:!!f,description:f?`Notification sent to the NDPC on ${R(f.sentAt)}.`:`Notification must be sent to the NDPC by ${R(y.ndpcNotificationDeadline)}.`}),y!=null&&y.dataSubjectNotificationRequired&&s.push({title:"Data Subject Notification",date:void 0,completed:false,description:"Notification to affected data subjects is required but has not been sent yet."}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-6",l.timeline,A),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Notification Timeline"}),jsxRuntime.jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:s.map((m,o)=>jsxRuntime.jsxs("li",{className:chunkE64TU6IU_js.a("mb-6 ml-4",l.timelineStep,A),children:[jsxRuntime.jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${m.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsxRuntime.jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-600 dark:text-gray-500",children:m.date?R(m.date):"Pending"}),jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:m.title}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:m.description})]},o))})]})};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${v}`,l.root,A),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",l.header,A),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",l.title,A),children:ae}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:Z})]}),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxRuntime.jsxs("select",{id:"statusFilter",value:B,onChange:s=>E(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),jsxRuntime.jsx("option",{value:"ongoing",children:"Ongoing"}),jsxRuntime.jsx("option",{value:"contained",children:"Contained"}),jsxRuntime.jsx("option",{value:"resolved",children:"Resolved"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxRuntime.jsxs("select",{id:"sortBy",value:O,onChange:s=>G(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"discoveredAt",children:"Discovery Date"}),jsxRuntime.jsx("option",{value:"title",children:"Title"}),jsxRuntime.jsx("option",{value:"status",children:"Status"}),jsxRuntime.jsx("option",{value:"riskLevel",children:"Risk Level"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchTerm",value:I,onChange:s=>M(s.target.value),placeholder:"Search breaches...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"md:col-span-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Breach Reports"}),C.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No breach reports found."}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",l.breachList,A),children:C.map(s=>{let m=u.find($=>$.breachId===s.id),o=w.find($=>$.breachId===s.id),N=X(s,m),F=null;if(N!=null&&N.ndpcNotificationRequired)if(o)F=jsxRuntime.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Notified"});else {let $=U(N.ndpcNotificationDeadline);$<=0?F=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):$<=24?F=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):F=jsxRuntime.jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Required"});}else F=jsxRuntime.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Not Required"});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md cursor-pointer ${b===s.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,l.breachItem,A),onClick:()=>ie(s.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:s.title}),p(s.status)]}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Discovered: ",new Date(s.discoveredAt).toLocaleDateString()]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsxRuntime.jsx("div",{children:m&&z(m.riskLevel)}),jsxRuntime.jsx("div",{children:F})]})]},s.id)})})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("md:col-span-2",l.detailPanel,A),children:h?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:h.title}),p(h.status)]}),P&&jsxRuntime.jsx("div",{className:"mb-4",children:k()}),j&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Discovered:"})," ",R(h.discoveredAt)]}),h.occurredAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Occurred:"})," ",R(h.occurredAt)]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reporter:"})," ",h.reporter.name]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",h.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",h.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",h.estimatedAffectedSubjects||"Unknown"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Description:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:h.description})]}),h.initialActions&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Initial Actions Taken:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:h.initialActions})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),x?jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Risk Level:"}),z(x.riskLevel)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",x.overallRiskScore," / 5"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",x.risksToRightsAndFreedoms?"Yes":"No"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",x.highRisksToRightsAndFreedoms?"Yes":"No"]}),jsxRuntime.jsx("p",{className:"text-sm mb-1",children:jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 bg-white dark:bg-gray-800 p-2 rounded-md",children:x.justification})]}):jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"Risk assessment has not been conducted yet."}),jsxRuntime.jsx("button",{onClick:Y,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Conduct Risk Assessment"})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),f?jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notification Sent:"})," ",R(f.sentAt)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Method:"})," ",f.method.charAt(0).toUpperCase()+f.method.slice(1)]}),f.referenceNumber&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference Number:"})," ",f.referenceNumber]}),(f.ndpcContact||f.nitdaContact)&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(H=f.ndpcContact||f.nitdaContact)==null?void 0:H.name]})]}):jsxRuntime.jsx("div",{children:y!=null&&y.ndpcNotificationRequired?jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"NDPC notification is required but has not been sent yet."}),jsxRuntime.jsx("button",{onClick:re,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Generate Notification"})]}):jsxRuntime.jsx("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:"NDPC notification is not required for this breach."})})})]}),se&&T()]}):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a breach to view details"})})})]})]})};var Te=({breachData:g,assessmentData:u,organizationInfo:w,onGenerate:J,title:_="Generate NDPC Notification Report",description:K="Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements.",generateButtonText:ae="Generate Report",className:Z="",buttonClassName:v="",classNames:d={},unstyled:l=false,showPreview:A=true,allowEditing:j=true,allowDownload:se=true,downloadFormat:P="pdf"})=>{let[b,D]=react.useState(""),[C,q]=react.useState(""),[B,E]=react.useState(""),[I,M]=react.useState(""),[O,G]=react.useState("email"),[W,Q]=react.useState(""),[ie,Y]=react.useState(""),[re,R]=react.useState(false),[h,x]=react.useState(false);react.useEffect(()=>{let p=y();D(p),R(true);},[g,u,w]);let f=p=>new Date(p).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),y=()=>`
2
+ NDPC DATA BREACH NOTIFICATION
3
+
4
+ Date: ${new Date().toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})}
5
+
6
+ Reference: NDPA Section 40 - Breach Notification
7
+
8
+ ORGANIZATION DETAILS
9
+ -------------------
10
+ Organization Name: ${w.name}
11
+ ${w.registrationNumber?`Registration Number: ${w.registrationNumber}`:""}
12
+ Address: ${w.address}
13
+ ${w.website?`Website: ${w.website}`:""}
14
+
15
+ DATA PROTECTION OFFICER
16
+ ----------------------
17
+ Name: ${w.dpoName}
18
+ Email: ${w.dpoEmail}
19
+ ${w.dpoPhone?`Phone: ${w.dpoPhone}`:""}
20
+
21
+ BREACH DETAILS
22
+ -------------
23
+ Breach Title: ${g.title}
24
+ Date Discovered: ${f(g.discoveredAt)}
25
+ ${g.occurredAt?`Date Occurred: ${f(g.occurredAt)}`:"Date Occurred: Unknown"}
26
+ Status: ${g.status.charAt(0).toUpperCase()+g.status.slice(1)}
27
+
28
+ Description of the Breach:
29
+ ${g.description}
30
+
31
+ Affected Systems/Applications:
32
+ ${g.affectedSystems.join(", ")}
33
+
34
+ Types of Personal Data Involved:
35
+ ${g.dataTypes.join(", ")}
36
+
37
+ Estimated Number of Data Subjects Affected:
38
+ ${g.estimatedAffectedSubjects||"Unknown"}
39
+
40
+ RISK ASSESSMENT
41
+ --------------
42
+ ${u?`
43
+ Overall Risk Level: ${u.riskLevel.charAt(0).toUpperCase()+u.riskLevel.slice(1)}
44
+ Risk to Rights and Freedoms of Data Subjects: ${u.risksToRightsAndFreedoms?"Yes":"No"}
45
+ High Risk to Rights and Freedoms of Data Subjects: ${u.highRisksToRightsAndFreedoms?"Yes":"No"}
46
+
47
+ Justification for Risk Assessment:
48
+ ${u.justification}
49
+ `:"Risk assessment has not been conducted yet."}
50
+
51
+ MEASURES TAKEN
52
+ -------------
53
+ Measures taken or proposed to address the breach:
54
+ ${g.initialActions||"To be determined"}
55
+
56
+ Measures taken or proposed to mitigate possible adverse effects:
57
+ [Please specify measures taken to mitigate adverse effects]
58
+
59
+ NOTIFICATION TO DATA SUBJECTS (NDPA Section 40(4))
60
+ ----------------------------
61
+ Have data subjects been notified: [Yes/No]
62
+ If yes, date of notification: [Date]
63
+ If no, planned date of notification: [Date]
64
+ Reason for delay (if applicable): [Reason]
65
+
66
+ ADDITIONAL INFORMATION
67
+ ---------------------
68
+ [Any additional information relevant to the breach]
69
+
70
+ This notification is made in compliance with the Nigeria Data Protection Act (NDPA), Section 40.
71
+ `,X=p=>{p.preventDefault();let k={id:`notification_${Date.now()}`,breachId:g.id,sentAt:Date.now(),method:O,referenceNumber:W||void 0,ndpcContact:C?{name:C,email:B,phone:I||void 0}:void 0,content:b,attachments:[]};J(k),x(true);},U=()=>{let p,k,T;switch(P){case "html":{p="text/html",k="html",T=`<!DOCTYPE html>
72
+ <html lang="en">
73
+ <head>
74
+ <meta charset="UTF-8">
75
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
76
+ <title>NDPC Breach Notification Report</title>
77
+ <style>body{font-family:monospace;white-space:pre-wrap;max-width:800px;margin:2rem auto;padding:0 1rem;}</style>
78
+ </head>
79
+ <body>${b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}</body>
80
+ </html>`;break}case "pdf":p="text/plain",k="pdf.txt",T=b;break;case "docx":p="text/plain",k="docx.txt",T=b;break;default:p="text/plain",k="txt",T=b;}let H=document.createElement("a"),s=new Blob([T],{type:p});H.href=URL.createObjectURL(s),H.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.${k}`,document.body.appendChild(H),H.click(),document.body.removeChild(H);},z=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(k=>jsxRuntime.jsx("option",{value:k.value,children:k.label},k.value));return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Z}`,d.root,l),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",d.header,l),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",d.title,l),children:_}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:K})]}),h?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-green-50 dark:bg-green-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Generated Successfully"}),jsxRuntime.jsx("p",{className:"text-green-700 dark:text-green-300",children:"Your NDPC notification report has been generated and is ready for submission. Please review the report carefully before submitting it to the NDPC."})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Submission Details"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Method:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:O.charAt(0).toUpperCase()+O.slice(1)})]}),C&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Contact Name:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:C})]}),B&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Contact Email:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:B})]}),I&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Contact Phone:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:I})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Date Generated:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:f(Date.now())})]}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Breach ID:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:g.id})]}),W&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Reference Number:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:W})]})]})]})]}),A&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Preview"}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-gray-50 dark:bg-gray-700 p-4 rounded-md",d.reportPreview,l),children:jsxRuntime.jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:b})})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-3",children:[se&&jsxRuntime.jsxs("button",{onClick:U,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${v}`,d.secondaryButton||d.downloadButton,l),children:["Download Report (",P.toUpperCase(),")"]}),jsxRuntime.jsx("button",{onClick:()=>x(false),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${v}`,children:"Edit Report"})]})]}):jsxRuntime.jsx("form",{onSubmit:X,children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Notification Method"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"method",className:"block text-sm font-medium mb-1",children:["Method of Submission ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{id:"method",value:O,onChange:p=>G(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,children:z()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"referenceNumber",className:"block text-sm font-medium mb-1",children:"Reference Number (if available)"}),jsxRuntime.jsx("input",{type:"text",id:"referenceNumber",value:W,onChange:p=>Q(p.target.value),placeholder:"e.g. NDPC/BR/2024/001",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"NDPC Contact (if known)"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactName",className:"block text-sm font-medium mb-1",children:"Contact Name"}),jsxRuntime.jsx("input",{type:"text",id:"contactName",value:C,onChange:p=>q(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactEmail",className:"block text-sm font-medium mb-1",children:"Contact Email"}),jsxRuntime.jsx("input",{type:"email",id:"contactEmail",value:B,onChange:p=>E(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactPhone",className:"block text-sm font-medium mb-1",children:"Contact Phone"}),jsxRuntime.jsx("input",{type:"tel",id:"contactPhone",value:I,onChange:p=>M(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"additionalInfo",className:"block text-sm font-medium mb-1",children:"Additional Information to Include"}),jsxRuntime.jsx("textarea",{id:"additionalInfo",value:ie,onChange:p=>Y(p.target.value),rows:3,placeholder:"Any additional information you want to include in the report",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),j&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Content"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reportContent",className:"block text-sm font-medium mb-1",children:["Edit Report Content ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"reportContent",value:b,onChange:p=>D(p.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] font-mono text-sm",required:true})]})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This report will help you comply with this requirement."})]}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{type:"submit",className:chunkE64TU6IU_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${v}`,d.primaryButton||d.generateButton,l),children:ae})})]})})]})};exports.a=ve;exports.b=Ce;exports.c=Te;//# sourceMappingURL=chunk-6BXUVS6E.js.map
81
+ //# sourceMappingURL=chunk-6BXUVS6E.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkSWF3YVE5_js=require('./chunk-SWF3YVE5.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function E({initialData:S,adapter:l,onRecordAdd:p,onRecordUpdate:g,onRecordArchive:f}){let d=react.useRef(l);d.current=l;let[s,u]=react.useState(S),[v,P]=react.useState(l!==void 0);react.useEffect(()=>{if(!d.current)return;let t=false;try{let e=d.current.load();e instanceof Promise?e.then(r=>{t||(r&&u(r),P(!1));},()=>{t||P(!1);}):(e&&u(e),P(!1));}catch(e){t||P(false);}return ()=>{t=true;}},[]);let n=react.useCallback(t=>{d.current&&Promise.resolve(d.current.save(t)).catch(e=>{console.warn("[ndpr-toolkit] Failed to save ROPA:",e);});},[]),C=react.useCallback(t=>{u(e=>{let r=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{records:[...e.records,t],lastUpdated:Date.now()});return n(r),r}),p==null||p(t);},[p,n]),w=react.useCallback((t,e)=>{u(r=>{let a=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},r),{records:r.records.map(R=>R.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},R),e),{updatedAt:Date.now()}):R),lastUpdated:Date.now()});return n(a),a}),g==null||g(t,e);},[g,n]),x=react.useCallback(t=>{u(e=>{let r=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{records:e.records.map(a=>a.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{status:"archived",updatedAt:Date.now()}):a),lastUpdated:Date.now()});return n(r),r}),f==null||f(t);},[f,n]),D=react.useCallback(t=>s.records.find(e=>e.id===t),[s.records]),G=react.useCallback(()=>chunkSWF3YVE5_js.b(s),[s]),b=react.useCallback(()=>chunkSWF3YVE5_js.c(s),[s]),L=react.useCallback(()=>chunkSWF3YVE5_js.d(s),[s]);return {ropa:s,addRecord:C,updateRecord:w,archiveRecord:x,getRecord:D,getSummary:G,exportCSV:b,getComplianceGaps:L,isLoading:v}}exports.a=E;//# sourceMappingURL=chunk-KHRBU5K7.js.map
2
- //# sourceMappingURL=chunk-KHRBU5K7.js.map
1
+ 'use strict';var chunkGOU6FU6Y_js=require('./chunk-GOU6FU6Y.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function E({initialData:S,adapter:l,onRecordAdd:p,onRecordUpdate:g,onRecordArchive:f}){let d=react.useRef(l);d.current=l;let[s,u]=react.useState(S),[v,P]=react.useState(l!==void 0);react.useEffect(()=>{if(!d.current)return;let t=false;try{let e=d.current.load();e instanceof Promise?e.then(r=>{t||(r&&u(r),P(!1));},()=>{t||P(!1);}):(e&&u(e),P(!1));}catch(e){t||P(false);}return ()=>{t=true;}},[]);let n=react.useCallback(t=>{d.current&&Promise.resolve(d.current.save(t)).catch(e=>{console.warn("[ndpr-toolkit] Failed to save ROPA:",e);});},[]),C=react.useCallback(t=>{u(e=>{let r=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{records:[...e.records,t],lastUpdated:Date.now()});return n(r),r}),p==null||p(t);},[p,n]),w=react.useCallback((t,e)=>{u(r=>{let a=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},r),{records:r.records.map(R=>R.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},R),e),{updatedAt:Date.now()}):R),lastUpdated:Date.now()});return n(a),a}),g==null||g(t,e);},[g,n]),x=react.useCallback(t=>{u(e=>{let r=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{records:e.records.map(a=>a.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{status:"archived",updatedAt:Date.now()}):a),lastUpdated:Date.now()});return n(r),r}),f==null||f(t);},[f,n]),D=react.useCallback(t=>s.records.find(e=>e.id===t),[s.records]),G=react.useCallback(()=>chunkGOU6FU6Y_js.b(s),[s]),b=react.useCallback(()=>chunkGOU6FU6Y_js.c(s),[s]),L=react.useCallback(()=>chunkGOU6FU6Y_js.d(s),[s]);return {ropa:s,addRecord:C,updateRecord:w,archiveRecord:x,getRecord:D,getSummary:G,exportCSV:b,getComplianceGaps:L,isLoading:v}}exports.a=E;//# sourceMappingURL=chunk-6RQGQZT2.js.map
2
+ //# sourceMappingURL=chunk-6RQGQZT2.js.map
@@ -0,0 +1,2 @@
1
+ function h(n){var c;let i={low:0,medium:0,high:0,critical:0},l=0,o=[];((c=n.risks)!=null?c:[]).forEach(e=>{i[e.level]++,e.score>l&&(l=e.score),(e.level==="high"||e.level==="critical")&&!e.mitigated&&o.push(e);});let s;i.critical>0?s="critical":i.high>2||i.high>0&&i.medium>3?s="high":i.high>0||i.medium>1?s="medium":s="low";let r=s==="high"||s==="critical",a=o.length===0,t=[];return o.length>0&&t.push(`Mitigate the following high/critical risks before proceeding: ${o.map(e=>e.description).join(", ")}`),r&&t.push("Consult with the NDPC (Nigeria Data Protection Commission) before proceeding with this processing activity, as required by NDPA Section 39."),i.medium>0&&t.push("Implement additional safeguards to reduce medium-level risks where possible."),s!=="low"?t.push("Schedule a review of this DPIA in 6 months to reassess risks and effectiveness of mitigation measures."):t.push("Schedule a review of this DPIA in 12 months as part of regular compliance activities."),{overallRiskLevel:s,requiresConsultation:r,canProceed:a,recommendations:t}}export{h as a};//# sourceMappingURL=chunk-6TA2MVTU.mjs.map
2
+ //# sourceMappingURL=chunk-6TA2MVTU.mjs.map
@@ -0,0 +1,2 @@
1
+ function n(e){return {load(){if(typeof window=="undefined")return null;try{let t=localStorage.getItem(e);return t?JSON.parse(t):null}catch(t){return null}},save(t){if(typeof window!="undefined")try{localStorage.setItem(e,JSON.stringify(t));}catch(r){}},remove(){if(typeof window!="undefined")try{localStorage.removeItem(e);}catch(t){}}}}export{n as a};//# sourceMappingURL=chunk-6WIP33TW.mjs.map
2
+ //# sourceMappingURL=chunk-6WIP33TW.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkTDDAYVKK_js=require('./chunk-TDDAYVKK.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function F(v,c){return c?chunkUK656RCG_js.a(v):{load:()=>null,save:()=>{},remove:()=>{}}}function z({initialActivities:v=[],adapter:c,storageKey:b="ndpr_lawful_basis_activities",useLocalStorage:R=true,onAdd:g,onUpdate:A,onRemove:y}={}){let p=c!=null?c:F(b,R),f=react.useRef(p);f.current=p;let[o,u]=react.useState(v),[x,l]=react.useState(true);react.useEffect(()=>{let t=false;try{let i=f.current.load();i instanceof Promise?i.then(e=>{t||(e&&u(e),l(!1));},()=>{t||l(!1);}):(i&&u(i),l(!1));}catch(i){t||l(false);}return ()=>{t=true;}},[]);let a=react.useCallback(t=>{Promise.resolve(f.current.save(t)).catch(i=>{console.warn("[ndpr-toolkit] Failed to save lawful basis activities:",i);});},[]),_=()=>"lb_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),h=react.useCallback(t=>{let i=Date.now(),e=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{id:_(),createdAt:i,updatedAt:i});return u(s=>{let r=[...s,e];return a(r),r}),g&&g(e),e},[g,a]),O=react.useCallback((t,i)=>{let e=null;return u(s=>{let r=s.findIndex(k=>k.id===t);if(r===-1)return s;e=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},s[r]),i),{id:s[r].id,updatedAt:Date.now()});let P=[...s];return P[r]=e,a(P),P}),e&&A&&A(e),e},[A,a]),D=react.useCallback(t=>{u(i=>{let e=i.filter(s=>s.id!==t);return a(e),e}),y&&y(t);},[y,a]),I=react.useCallback(t=>o.find(i=>i.id===t)||null,[o]),U=react.useCallback(()=>chunkTDDAYVKK_js.d(o),[o]),V=react.useCallback(t=>chunkTDDAYVKK_js.a(t),[]);return {activities:o,addActivity:h,updateActivity:O,removeActivity:D,getActivity:I,getSummary:U,validateActivity:V,isLoading:x}}exports.a=z;//# sourceMappingURL=chunk-2ORDHJRD.js.map
2
- //# sourceMappingURL=chunk-2ORDHJRD.js.map
1
+ 'use strict';var chunkTDDAYVKK_js=require('./chunk-TDDAYVKK.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function F(v,c){return c?chunkELKB2AFZ_js.a(v):{load:()=>null,save:()=>{},remove:()=>{}}}function z({initialActivities:v=[],adapter:c,storageKey:b="ndpr_lawful_basis_activities",useLocalStorage:R=true,onAdd:g,onUpdate:A,onRemove:y}={}){let p=c!=null?c:F(b,R),f=react.useRef(p);f.current=p;let[o,u]=react.useState(v),[x,l]=react.useState(true);react.useEffect(()=>{let t=false;try{let i=f.current.load();i instanceof Promise?i.then(e=>{t||(e&&u(e),l(!1));},()=>{t||l(!1);}):(i&&u(i),l(!1));}catch(i){t||l(false);}return ()=>{t=true;}},[]);let a=react.useCallback(t=>{Promise.resolve(f.current.save(t)).catch(i=>{console.warn("[ndpr-toolkit] Failed to save lawful basis activities:",i);});},[]),_=()=>"lb_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),h=react.useCallback(t=>{let i=Date.now(),e=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{id:_(),createdAt:i,updatedAt:i});return u(s=>{let r=[...s,e];return a(r),r}),g&&g(e),e},[g,a]),O=react.useCallback((t,i)=>{let e=null;return u(s=>{let r=s.findIndex(k=>k.id===t);if(r===-1)return s;e=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},s[r]),i),{id:s[r].id,updatedAt:Date.now()});let P=[...s];return P[r]=e,a(P),P}),e&&A&&A(e),e},[A,a]),D=react.useCallback(t=>{u(i=>{let e=i.filter(s=>s.id!==t);return a(e),e}),y&&y(t);},[y,a]),I=react.useCallback(t=>o.find(i=>i.id===t)||null,[o]),U=react.useCallback(()=>chunkTDDAYVKK_js.d(o),[o]),V=react.useCallback(t=>chunkTDDAYVKK_js.a(t),[]);return {activities:o,addActivity:h,updateActivity:O,removeActivity:D,getActivity:I,getSummary:U,validateActivity:V,isLoading:x}}exports.a=z;//# sourceMappingURL=chunk-7AVN424U.js.map
2
+ //# sourceMappingURL=chunk-7AVN424U.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk3F34NACG_js=require('./chunk-3F34NACG.js'),chunkY34DQYS7_js=require('./chunk-Y34DQYS7.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),react=require('react');function F(n){if(!n)return chunkUK656RCG_js.a("ndpr_consent");let{storageKey:o="ndpr_consent",storageType:i="localStorage"}=n;return i==="sessionStorage"?chunk3F34NACG_js.a(o):i==="cookie"?chunk3F34NACG_js.b(o,n.cookieOptions):chunkUK656RCG_js.a(o)}function k(n,o,i,r,a,g,l){if(n){i(n);let{valid:s,errors:c}=chunkY34DQYS7_js.a(n);r(s),a(c),g(!(s&&n.version===o));}else g(true);l(false);}function z({options:n,adapter:o,storageOptions:i,version:r="1.0",onChange:a}){let g=o!=null?o:F(i),l=react.useRef(g);l.current=g;let[s,c]=react.useState(null),[y,d]=react.useState(false),[E,C]=react.useState(false),[w,S]=react.useState([]),[I,v]=react.useState(true);react.useEffect(()=>{let e=false;try{let t=l.current.load();t instanceof Promise?t.then(m=>{e||k(m,r,c,C,S,d,v);},()=>{e||(d(!0),v(!1));}):k(t,r,c,C,S,d,v);}catch(t){e||(d(true),v(false));}return ()=>{e=true;}},[r]);let h=react.useCallback(e=>{let{valid:t,errors:m}=chunkY34DQYS7_js.a(e);C(t),S(m),a==null||a(e),Promise.resolve(l.current.save(e)).catch(P=>{console.warn("[ndpr-toolkit] Failed to save consent:",P);});},[a]),f=react.useCallback(e=>{let t={consents:e,timestamp:Date.now(),version:r,method:"explicit",hasInteracted:true};c(t),h(t),d(false);},[r,h]),L=react.useCallback(()=>{let e={};n.forEach(t=>{e[t.id]=true;}),f(e);},[n,f]),U=react.useCallback(()=>{let e={};n.forEach(t=>{e[t.id]=t.required||false;}),f(e);},[n,f]),V=react.useCallback(e=>!!(s!=null&&s.consents[e]),[s]),j=react.useCallback(()=>{c(null),d(true),C(false),S([]),Promise.resolve(l.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove consent:",e);});},[]);return {settings:s,hasConsent:V,updateConsent:f,acceptAll:L,rejectAll:U,shouldShowBanner:y,isValid:E,validationErrors:w,resetConsent:j,isLoading:I}}exports.a=z;//# sourceMappingURL=chunk-5VMHKNJY.js.map
2
- //# sourceMappingURL=chunk-5VMHKNJY.js.map
1
+ 'use strict';var chunkA4PK7JB2_js=require('./chunk-A4PK7JB2.js'),chunkHO5M7M4M_js=require('./chunk-HO5M7M4M.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),react=require('react');function F(n){if(!n)return chunkELKB2AFZ_js.a("ndpr_consent");let{storageKey:o="ndpr_consent",storageType:i="localStorage"}=n;return i==="sessionStorage"?chunkA4PK7JB2_js.a(o):i==="cookie"?chunkA4PK7JB2_js.b(o,n.cookieOptions):chunkELKB2AFZ_js.a(o)}function k(n,o,i,r,a,g,l){if(n){i(n);let{valid:s,errors:c}=chunkHO5M7M4M_js.a(n);r(s),a(c),g(!(s&&n.version===o));}else g(true);l(false);}function z({options:n,adapter:o,storageOptions:i,version:r="1.0",onChange:a}){let g=o!=null?o:F(i),l=react.useRef(g);l.current=g;let[s,c]=react.useState(null),[y,d]=react.useState(false),[E,C]=react.useState(false),[w,S]=react.useState([]),[I,v]=react.useState(true);react.useEffect(()=>{let e=false;try{let t=l.current.load();t instanceof Promise?t.then(m=>{e||k(m,r,c,C,S,d,v);},()=>{e||(d(!0),v(!1));}):k(t,r,c,C,S,d,v);}catch(t){e||(d(true),v(false));}return ()=>{e=true;}},[r]);let h=react.useCallback(e=>{let{valid:t,errors:m}=chunkHO5M7M4M_js.a(e);C(t),S(m),a==null||a(e),Promise.resolve(l.current.save(e)).catch(P=>{console.warn("[ndpr-toolkit] Failed to save consent:",P);});},[a]),f=react.useCallback(e=>{let t={consents:e,timestamp:Date.now(),version:r,method:"explicit",hasInteracted:true};c(t),h(t),d(false);},[r,h]),L=react.useCallback(()=>{let e={};n.forEach(t=>{e[t.id]=true;}),f(e);},[n,f]),U=react.useCallback(()=>{let e={};n.forEach(t=>{e[t.id]=t.required||false;}),f(e);},[n,f]),V=react.useCallback(e=>!!(s!=null&&s.consents[e]),[s]),j=react.useCallback(()=>{c(null),d(true),C(false),S([]),Promise.resolve(l.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove consent:",e);});},[]);return {settings:s,hasConsent:V,updateConsent:f,acceptAll:L,rejectAll:U,shouldShowBanner:y,isValid:E,validationErrors:w,resetConsent:j,isLoading:I}}exports.a=z;//# sourceMappingURL=chunk-7SMLHZ4B.js.map
2
+ //# sourceMappingURL=chunk-7SMLHZ4B.js.map
@@ -0,0 +1,2 @@
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
@@ -0,0 +1,2 @@
1
+ var p=["critical","high","medium","low"];function m(e){let i=new Date(e).getTime();if(isNaN(i))return 1/0;let t=(Date.now()-i)/(1e3*60*60*24*30.44);return Math.max(0,t)}function u(e){if(e.length===0)return 100;let i=e.filter(t=>t.pass).length;return Math.round(i/e.length*100)}function f(e){return [{key:"hasConsentMechanism",label:"Consent collection mechanism",priority:"critical",effort:"high",recommendation:"Implement a clear, affirmative consent collection mechanism before processing personal data.",ndpaSection:"Section 25",pass:e.hasConsentMechanism},{key:"hasPurposeSpecification",label:"Purpose specification at collection",priority:"critical",effort:"medium",recommendation:"Specify and communicate the purpose of data collection at the point of consent.",ndpaSection:"Section 25",pass:e.hasPurposeSpecification},{key:"hasWithdrawalMechanism",label:"Consent withdrawal mechanism",priority:"high",effort:"medium",recommendation:"Provide a simple mechanism for data subjects to withdraw consent at any time.",ndpaSection:"Section 26",pass:e.hasWithdrawalMechanism},{key:"hasMinorProtection",label:"Minor (child) data protection controls",priority:"high",effort:"high",recommendation:"Implement age-verification and parental-consent controls for processing data of minors.",ndpaSection:"Section 26",pass:e.hasMinorProtection},{key:"consentRecordsRetained",label:"Consent records retained",priority:"medium",effort:"low",recommendation:"Retain records of all consents obtained, including what was agreed to and when.",ndpaSection:"Section 25",pass:e.consentRecordsRetained}]}function g(e){let i=e.responseTimelineDays<=30;return [{key:"hasRequestMechanism",label:"DSR submission mechanism",priority:"critical",effort:"high",recommendation:"Implement a formal channel (e.g. a web form or email address) for data subjects to submit requests.",ndpaSection:"Section 34",pass:e.hasRequestMechanism},{key:"supportsAccess",label:"Right of access supported",priority:"high",effort:"medium",recommendation:"Enable data subjects to request and receive a copy of their personal data.",ndpaSection:"Section 34",pass:e.supportsAccess},{key:"supportsRectification",label:"Right to rectification supported",priority:"high",effort:"medium",recommendation:"Allow data subjects to request correction of inaccurate or incomplete personal data.",ndpaSection:"Section 35",pass:e.supportsRectification},{key:"supportsErasure",label:"Right to erasure supported",priority:"high",effort:"high",recommendation:"Implement processes to delete personal data upon valid erasure requests.",ndpaSection:"Section 36",pass:e.supportsErasure},{key:"supportsPortability",label:"Right to data portability supported",priority:"medium",effort:"high",recommendation:"Provide personal data in a structured, machine-readable format upon request.",ndpaSection:"Section 37",pass:e.supportsPortability},{key:"supportsObjection",label:"Right to object supported",priority:"medium",effort:"medium",recommendation:"Honour objections to processing where no compelling legitimate grounds override the data subject's interests.",ndpaSection:"Section 38",pass:e.supportsObjection},{key:"responseTimeline",label:"DSR response within 30 days",priority:"high",effort:"medium",recommendation:"Reduce DSR response time to 30 days or less as required by the NDPA.",ndpaSection:"Section 39",pass:i}]}function y(e){return [{key:"conductedForHighRisk",label:"DPIA conducted for high-risk processing",priority:"critical",effort:"high",recommendation:"Conduct a Data Protection Impact Assessment before undertaking high-risk processing activities.",ndpaSection:"Section 28",pass:e.conductedForHighRisk},{key:"documentedRisks",label:"Risks documented in DPIA",priority:"high",effort:"medium",recommendation:"Document identified risks to data subjects' rights and freedoms within the DPIA.",ndpaSection:"Section 28",pass:e.documentedRisks},{key:"mitigationMeasures",label:"Mitigation measures documented",priority:"high",effort:"medium",recommendation:"Document mitigation measures and residual risk acceptance within the DPIA.",ndpaSection:"Section 28",pass:e.mitigationMeasures}]}function b(e){return [{key:"hasNotificationProcess",label:"Breach notification process in place",priority:"critical",effort:"high",recommendation:"Establish a documented breach notification process covering detection, assessment, and reporting.",ndpaSection:"Section 40",pass:e.hasNotificationProcess},{key:"notifiesWithin72Hours",label:"NDPC notified within 72 hours",priority:"critical",effort:"medium",recommendation:"Ensure the NDPC is notified of qualifying breaches within 72 hours of discovery.",ndpaSection:"Section 40",pass:e.notifiesWithin72Hours},{key:"hasRiskAssessment",label:"Breach risk assessment performed",priority:"high",effort:"medium",recommendation:"Perform a risk assessment for every identified breach to determine notification obligations.",ndpaSection:"Section 40",pass:e.hasRiskAssessment},{key:"hasRecordKeeping",label:"Breach records maintained",priority:"medium",effort:"low",recommendation:"Maintain a breach register documenting all incidents, assessments, and actions taken.",ndpaSection:"Section 40",pass:e.hasRecordKeeping}]}function S(e){let t=m(e.lastUpdated)<=13;return [{key:"hasPrivacyPolicy",label:"Privacy policy exists",priority:"critical",effort:"high",recommendation:"Draft and publish a comprehensive privacy policy that satisfies NDPA requirements.",ndpaSection:"Section 29",pass:e.hasPrivacyPolicy},{key:"isPubliclyAccessible",label:"Privacy policy publicly accessible",priority:"high",effort:"low",recommendation:"Make the privacy policy easily accessible to data subjects on your website or app.",ndpaSection:"Section 29",pass:e.isPubliclyAccessible},{key:"policyUpToDate",label:"Privacy policy reviewed within 13 months",priority:"medium",effort:"medium",recommendation:"Review and update the privacy policy at least annually to reflect current practices.",ndpaSection:"Section 29",pass:t},{key:"coversAllSections",label:"Privacy policy covers all required sections",priority:"high",effort:"medium",recommendation:"Ensure the privacy policy addresses all NDPA-mandated disclosures including lawful basis, retention, and subject rights.",ndpaSection:"Section 29",pass:e.coversAllSections}]}function R(e){return [{key:"documentedForAllProcessing",label:"Lawful basis documented for all processing",priority:"critical",effort:"high",recommendation:"Identify and document a valid lawful basis for every processing activity before it begins.",ndpaSection:"Section 25(1)",pass:e.documentedForAllProcessing},{key:"hasLegitimateInterestAssessment",label:"Legitimate interest assessment completed",priority:"medium",effort:"medium",recommendation:"Complete a Legitimate Interest Assessment (LIA) where legitimate interests is the chosen lawful basis.",ndpaSection:"Section 25(1)",pass:e.hasLegitimateInterestAssessment}]}function v(e){return [{key:"hasTransferMechanisms",label:"Transfer mechanisms in place",priority:"critical",effort:"high",recommendation:"Implement appropriate transfer mechanisms (SCCs, BCRs, or adequacy decisions) for all cross-border transfers.",ndpaSection:"Section 43",pass:e.hasTransferMechanisms},{key:"adequacyAssessed",label:"Adequacy of destination country assessed",priority:"high",effort:"medium",recommendation:"Assess whether the destination country provides an adequate level of data protection before transferring.",ndpaSection:"Section 43",pass:e.adequacyAssessed},{key:"ndpcApprovalObtained",label:"NDPC approval obtained where required",priority:"high",effort:"high",recommendation:"Obtain NDPC approval for transfers to countries without adequacy decisions where required.",ndpaSection:"Section 44",pass:e.ndpcApprovalObtained}]}function w(e){let t=m(e.lastReviewed)<=6;return [{key:"maintained",label:"Record of Processing Activities maintained",priority:"critical",effort:"high",recommendation:"Create and maintain a comprehensive Record of Processing Activities (ROPA) as required by the NDPA.",ndpaSection:"Section 30",pass:e.maintained},{key:"includesAllProcessing",label:"ROPA includes all processing activities",priority:"high",effort:"medium",recommendation:"Ensure the ROPA captures every processing activity across all departments and systems.",ndpaSection:"Section 30",pass:e.includesAllProcessing},{key:"ropaUpToDate",label:"ROPA reviewed within 6 months",priority:"medium",effort:"low",recommendation:"Review and update the ROPA at least every six months to reflect changes in processing activities.",ndpaSection:"Section 30",pass:t}]}var k=[{name:"consent",weight:.2,ndpaSections:["Section 25","Section 26"],evaluate:e=>f(e.consent)},{name:"dsr",weight:.15,ndpaSections:["Section 34","Section 35","Section 36","Section 37","Section 38","Section 39"],evaluate:e=>g(e.dsr)},{name:"breach",weight:.15,ndpaSections:["Section 40"],evaluate:e=>b(e.breach)},{name:"policy",weight:.12,ndpaSections:["Section 29"],evaluate:e=>S(e.policy)},{name:"dpia",weight:.12,ndpaSections:["Section 28"],evaluate:e=>y(e.dpia)},{name:"lawfulBasis",weight:.1,ndpaSections:["Section 25(1)"],evaluate:e=>R(e.lawfulBasis)},{name:"crossBorder",weight:.08,ndpaSections:["Section 43","Section 44"],evaluate:e=>v(e.crossBorder)},{name:"ropa",weight:.08,ndpaSections:["Section 30"],evaluate:e=>w(e.ropa)}];function P(e){return e>=90?"excellent":e>=70?"good":e>=40?"needs-work":"critical"}function A(e){let i={},t=[],s=0;for(let o of k){let a=o.evaluate(e),c=u(a),l=c*o.weight;s+=l;let d=[];for(let n of a)n.pass||(d.push(n.label),t.push({module:o.name,key:n.key,label:n.label,priority:n.priority,effort:n.effort,recommendation:n.recommendation,ndpaSection:n.ndpaSection}));i[o.name]={name:o.name,score:c,maxScore:100,weightedScore:Math.round(l*100)/100,ndpaSections:o.ndpaSections,gaps:d};}t.sort((o,a)=>p.indexOf(o.priority)-p.indexOf(a.priority));let r=Math.round(s),h=[{section:"Section 25",title:"Consent and lawful basis for processing"},{section:"Section 26",title:"Withdrawal of consent and minor protection"},{section:"Section 28",title:"Data Protection Impact Assessment"},{section:"Section 29",title:"Privacy notice requirements"},{section:"Section 30",title:"Records of processing activities"},{section:"Section 34",title:"Right of access"},{section:"Section 35",title:"Right to rectification"},{section:"Section 36",title:"Right to erasure"},{section:"Section 37",title:"Right to data portability"},{section:"Section 38",title:"Right to object"},{section:"Section 39",title:"Response timelines for data subject requests"},{section:"Section 40",title:"Data breach notification"},{section:"Section 43",title:"Cross-border transfer restrictions"},{section:"Section 44",title:"NDPC approval for cross-border transfers"}];return {score:r,rating:P(r),modules:i,recommendations:t,regulatoryReferences:h,generatedAt:new Date().toISOString()}}export{A as a};//# sourceMappingURL=chunk-ABDB7LEV.mjs.map
2
+ //# sourceMappingURL=chunk-ABDB7LEV.mjs.map
@@ -0,0 +1,2 @@
1
+ 'use strict';function R(e,s){if(s){let{riskLevel:t,risksToRightsAndFreedoms:o,highRisksToRightsAndFreedoms:d}=s;return {severityLevel:t,notificationRequired:o,urgentNotificationRequired:d,timeframeHours:72,justification:s.justification||"Based on risk assessment results"}}let r={ongoing:e.status==="ongoing",sensitiveData:["health","financial","biometric","children","location","religious","political","ethnic"].some(t=>e.dataTypes.includes(t)),largeScale:(e.estimatedAffectedSubjects||0)>1e3,delayedDiscovery:e.occurredAt&&e.discoveredAt-e.occurredAt>10080*60*1e3},c=Object.values(r).filter(Boolean).length,i;c===0?i="low":c===1?i="medium":c===2?i="high":i="critical";let a=i!=="low",l=i==="high"||i==="critical",u=72,n=Object.entries(r).filter(([t,o])=>o).map(([t,o])=>t).join(", "),f=n?`${i.charAt(0).toUpperCase()+i.slice(1)} risk (factors: ${n})`:`${i.charAt(0).toUpperCase()+i.slice(1)} risk`;return {severityLevel:i,notificationRequired:a,urgentNotificationRequired:l,timeframeHours:u,justification:f}}exports.a=R;//# sourceMappingURL=chunk-BKRETVJ6.js.map
2
+ //# sourceMappingURL=chunk-BKRETVJ6.js.map
@@ -0,0 +1,3 @@
1
+ import {a as a$2}from'./chunk-GKKAK6ES.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {a as a$1,b}from'./chunk-WWT2ZSNU.mjs';import {useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';var qe=({categories:pe,onSubmit:ge,onValidationError:N,title:be="Report a Data Breach",formDescription:fe="Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40. All fields marked with * are required.",submitButtonText:ue="Submit Report",className:M="",buttonClassName:z="",classNames:d={},unstyled:c=false,isSubmitting:f=false,showConfirmation:he=true,confirmationMessage:ve="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:ye=true,maxAttachments:A=5,maxFileSize:k=5*1024*1024,allowedFileTypes:w=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"],defaultValues:t,onReset:S})=>{var ie,oe,se,ne,de;let L=r=>{if(!r)return "";let o=new Date(r),l=s=>String(s).padStart(2,"0");return `${o.getFullYear()}-${l(o.getMonth()+1)}-${l(o.getDate())}T${l(o.getHours())}:${l(o.getMinutes())}`},[D,O]=useState((t==null?void 0:t.title)||""),[C,Y]=useState((t==null?void 0:t.description)||""),[F,U]=useState((t==null?void 0:t.category)||""),[T,H]=useState(L(t==null?void 0:t.discoveredAt)),[R,_]=useState(L(t==null?void 0:t.occurredAt)),[B,Z]=useState(((ie=t==null?void 0:t.reporter)==null?void 0:ie.name)||""),[v,G]=useState(((oe=t==null?void 0:t.reporter)==null?void 0:oe.email)||""),[j,K]=useState(((se=t==null?void 0:t.reporter)==null?void 0:se.department)||""),[E,W]=useState(((ne=t==null?void 0:t.reporter)==null?void 0:ne.phone)||""),[J,Q]=useState((t==null?void 0:t.affectedSystems)||[]),[xe,X]=useState(((de=t==null?void 0:t.affectedSystems)==null?void 0:de.join(", "))||""),[q,V]=useState((t==null?void 0:t.dataTypes)||[]),[u,ee]=useState((t==null?void 0:t.estimatedAffectedSubjects)!=null?String(t.estimatedAffectedSubjects):""),[re,te]=useState((t==null?void 0:t.status)||"ongoing"),[I,ae]=useState((t==null?void 0:t.initialActions)||""),[y,$]=useState([]),[Ne,P]=useState(false),[i,h]=useState({}),Ae=()=>{O(""),Y(""),U(""),H(""),_(""),Z(""),G(""),K(""),W(""),Q([]),X(""),V([]),ee(""),te("ongoing"),ae(""),$([]),P(false),h({}),S==null||S();},ke=r=>{let o=r.target.value;X(o);let l=o.split(",").map(s=>s.trim()).filter(Boolean);Q(l);},we=r=>{V(o=>o.includes(r)?o.filter(l=>l!==r):[...o,r]);},Se=r=>{var me;let o=r.target.files;if(!o)return;let l=[],s={};if(y.length+o.length>A){s.attachments=`Maximum of ${A} files allowed`,h(p=>a$1(a$1({},p),s));return}for(let p=0;p<o.length;p++){let x=o[p];if(x.size>k){s.attachments=`File ${x.name} exceeds the maximum size of ${k/(1024*1024)}MB`;continue}let ce="."+((me=x.name.split(".").pop())==null?void 0:me.toLowerCase());if(!w.includes(ce)){s.attachments=`File type ${ce} is not allowed`;continue}l.push(x);}l.length>0&&$(p=>[...p,...l]),Object.keys(s).length>0?h(p=>a$1(a$1({},p),s)):h(p=>b(a$1({},p),{attachments:""}));},De=r=>{$(o=>o.filter((l,s)=>s!==r));},Ce=()=>{let r={};return D.trim()||(r.breachTitle="Breach title is required"),C.trim()||(r.description="Description is required"),F||(r.category="Category is required"),T||(r.discoveredAt="Discovery date is required"),B.trim()||(r.reporterName="Reporter name is required"),v.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(v)||(r.reporterEmail="Reporter email is invalid"):r.reporterEmail="Reporter email is required",j.trim()||(r.reporterDepartment="Reporter department is required"),J.length===0&&(r.affectedSystems="At least one affected system is required"),q.length===0&&(r.dataTypes="At least one data type is required"),u&&isNaN(Number(u))&&(r.estimatedAffectedSubjects="Estimated affected subjects must be a number"),h(r),r},Fe=r=>{r.preventDefault();let o=Ce();if(Object.keys(o).length>0){N==null||N(o);return}let l={title:a$2(D),description:a$2(C),category:F,discoveredAt:new Date(T).getTime(),occurredAt:R?new Date(R).getTime():void 0,reportedAt:Date.now(),reporter:{name:a$2(B),email:a$2(v),department:a$2(j),phone:E?a$2(E):void 0},affectedSystems:J.map(s=>a$2(s)),dataTypes:q,estimatedAffectedSubjects:u?Number(u):void 0,status:re,initialActions:I?a$2(I):void 0,attachments:y.map(s=>({name:s.name,type:s.type,size:s.size,file:s}))};ge(l),he&&P(true);};if(Ne)return jsxs("div",{className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${M}`,children:[jsx("h2",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Submitted"}),jsx("p",{className:"text-green-700 dark:text-green-300",children:ve}),jsxs("div",{className:"mt-4 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold text-yellow-800 dark:text-yellow-200 mb-2",children:"Important: Next Steps"}),jsx("p",{className:"text-yellow-700 dark:text-yellow-300 text-sm",children:"Under the NDPA (Section 40), data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsx("button",{onClick:()=>P(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${z}`,children:"Report Another Breach"})]});let Te=[{id:"personal",label:"Personal Information (names, addresses)"},{id:"contact",label:"Contact Information (email, phone)"},{id:"financial",label:"Financial Information (bank details, payment info)"},{id:"health",label:"Health Information"},{id:"identification",label:"Identification Documents (ID cards, passports)"},{id:"login",label:"Login Credentials"},{id:"biometric",label:"Biometric Data"},{id:"children",label:"Children's Data"},{id:"location",label:"Location Data"},{id:"communications",label:"Communications Content"}];return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${M}`,d.root,c),children:[jsx("h2",{className:a("text-xl font-bold mb-2",d.title,c),children:be}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:fe}),jsx("form",{onSubmit:Fe,className:a("",d.form,c),children:jsxs("div",{className:"space-y-6",children:[jsxs("div",{className:a("",d.fieldGroup,c),children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Breach Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"breachTitle",className:a("block text-sm font-medium mb-1",d.label,c),children:["Breach Title/Summary ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"breachTitle",value:D,onChange:r=>O(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",d.input,c),required:true,"aria-invalid":!!i.breachTitle,"aria-describedby":i.breachTitle?"breachTitle-error":void 0}),i.breachTitle&&jsx("p",{id:"breachTitle-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.breachTitle})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"category",className:a("block text-sm font-medium mb-1",d.label,c),children:["Breach Category ",jsx("span",{className:"text-red-500",children:"*"})]}),jsxs("select",{id:"category",value:F,onChange:r=>U(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",d.select,c),required:true,"aria-invalid":!!i.category,"aria-describedby":i.category?"category-error":void 0,children:[jsx("option",{value:"",children:"Select a category"}),pe.map(r=>jsx("option",{value:r.id,children:r.name},r.id))]}),i.category&&jsx("p",{id:"category-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.category})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"description",className:a("block text-sm font-medium mb-1",d.label,c),children:["Detailed Description ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"description",value:C,onChange:r=>Y(r.target.value),rows:4,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",d.textarea,c),required:true,"aria-invalid":!!i.description,"aria-describedby":i.description?"description-error":void 0}),i.description&&jsx("p",{id:"description-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.description})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"discoveredAt",className:"block text-sm font-medium mb-1",children:["Date Discovered ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"datetime-local",id:"discoveredAt",value:T,onChange:r=>H(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!i.discoveredAt,"aria-describedby":i.discoveredAt?"discoveredAt-error":void 0}),i.discoveredAt&&jsx("p",{id:"discoveredAt-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.discoveredAt})]}),jsxs("div",{children:[jsx("label",{htmlFor:"occurredAt",className:"block text-sm font-medium mb-1",children:"Date Occurred (if known)"}),jsx("input",{type:"datetime-local",id:"occurredAt",value:R,onChange:r=>_(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Reporter Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"reporterName",className:"block text-sm font-medium mb-1",children:["Your Name ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"reporterName",value:B,onChange:r=>Z(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!i.reporterName,"aria-describedby":i.reporterName?"reporterName-error":void 0}),i.reporterName&&jsx("p",{id:"reporterName-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.reporterName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"reporterEmail",className:"block text-sm font-medium mb-1",children:["Your Email ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"email",id:"reporterEmail",value:v,onChange:r=>G(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!i.reporterEmail,"aria-describedby":i.reporterEmail?"reporterEmail-error":void 0}),i.reporterEmail&&jsx("p",{id:"reporterEmail-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.reporterEmail})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"reporterDepartment",className:"block text-sm font-medium mb-1",children:["Your Department ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"reporterDepartment",value:j,onChange:r=>K(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!i.reporterDepartment,"aria-describedby":i.reporterDepartment?"reporterDepartment-error":void 0}),i.reporterDepartment&&jsx("p",{id:"reporterDepartment-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.reporterDepartment})]}),jsxs("div",{children:[jsx("label",{htmlFor:"reporterPhone",className:"block text-sm font-medium mb-1",children:"Your Phone Number (Optional)"}),jsx("input",{type:"tel",id:"reporterPhone",value:E,onChange:r=>W(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"affectedSystems",className:"block text-sm font-medium mb-1",children:["Affected Systems/Applications ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"affectedSystems",value:xe,onChange:ke,placeholder:"e.g. CRM, Email Server, Website (comma separated)",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!i.affectedSystems,"aria-describedby":i.affectedSystems?"affectedSystems-error":void 0}),i.affectedSystems&&jsx("p",{id:"affectedSystems-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.affectedSystems})]}),jsxs("div",{children:[jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"block text-sm font-medium mb-1",children:"Estimated Number of Affected Data Subjects"}),jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:u,onChange:r=>ee(r.target.value),placeholder:"e.g. 100",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))]","aria-invalid":!!i.estimatedAffectedSubjects,"aria-describedby":i.estimatedAffectedSubjects?"estimatedAffectedSubjects-error":void 0}),i.estimatedAffectedSubjects&&jsx("p",{id:"estimatedAffectedSubjects-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.estimatedAffectedSubjects})]}),jsxs("fieldset",{className:"md:col-span-2",children:[jsxs("legend",{className:"block text-sm font-medium mb-1",children:["Types of Data Involved ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:Te.map(r=>jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"checkbox",id:`dataType_${r.id}`,checked:q.includes(r.id),onChange:()=>we(r.id),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:`dataType_${r.id}`,className:"ml-2 text-sm text-gray-700 dark:text-gray-300",children:r.label})]},r.id))}),i.dataTypes&&jsx("p",{id:"dataTypes-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.dataTypes})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"status",className:"block text-sm font-medium mb-1",children:["Current Status ",jsx("span",{className:"text-red-500",children:"*"})]}),jsxs("select",{id:"status",value:re,onChange:r=>te(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",d.select,c),required:true,children:[jsx("option",{value:"ongoing",children:"Ongoing (breach is still active)"}),jsx("option",{value:"contained",children:"Contained (breach is stopped but not resolved)"}),jsx("option",{value:"resolved",children:"Resolved (breach is fully addressed)"})]})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"initialActions",className:"block text-sm font-medium mb-1",children:"Initial Actions Taken"}),jsx("textarea",{id:"initialActions",value:I,onChange:r=>ae(r.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",rows:3,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",d.textarea,c)})]})]})]}),ye&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Attachments"}),jsxs("div",{className:"mb-4",children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Upload Supporting Files (Optional)"}),jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:["Max ",A," files, ",k/(1024*1024),"MB each. Allowed types: ",w.join(", ")]}),jsx("input",{type:"file",onChange:Se,multiple:true,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))]",accept:w.join(",")}),i.attachments&&jsx("p",{id:"attachments-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.attachments})]}),y.length>0&&jsxs("div",{className:"mb-4",children:[jsx("h4",{className:"text-sm font-medium mb-2",children:"Attached Files:"}),jsx("ul",{className:"space-y-2",children:y.map((r,o)=>jsxs("li",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded",children:[jsxs("div",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 text-gray-500 dark:text-gray-400 mr-2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M8 4a3 3 0 00-3 3v4a5 5 0 0010 0V7a1 1 0 112 0v4a7 7 0 11-14 0V7a5 5 0 0110 0v4a3 3 0 11-6 0V7a1 1 0 012 0v4a1 1 0 102 0V7a3 3 0 00-3-3z",clipRule:"evenodd"})}),jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:r.name}),jsxs("span",{className:"ml-2 text-xs text-gray-600 dark:text-gray-400",children:["(",(r.size/1024).toFixed(1)," KB)"]})]}),jsx("button",{type:"button",onClick:()=>De(o),className:"text-red-500 hover:text-red-700",children:jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]},o))})]})]}),jsxs("div",{className:a("mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",d.notice,c),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsxs("div",{className:"mt-6 relative flex gap-3",children:[f&&d.loadingOverlay&&jsx("div",{className:d.loadingOverlay}),jsx("button",{type:"submit",disabled:f,className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${z} ${f?"opacity-50 cursor-not-allowed":""}`,d.primaryButton||d.submitButton,c),children:f?"Submitting...":ue}),jsx("button",{type:"button",onClick:Ae,disabled:f,className:a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,c),children:"Reset"})]})]})})]})};
2
+ export{qe as a};//# sourceMappingURL=chunk-CWUPGY3M.mjs.map
3
+ //# sourceMappingURL=chunk-CWUPGY3M.mjs.map