@tantainnovative/ndpr-toolkit 2.4.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +226 -246
- package/dist/BreachReportForm-DpRrBoxU.d.ts +158 -0
- package/dist/BreachReportForm-yJ2Zl6gz.d.mts +158 -0
- package/dist/ConsentBanner-CDRT0o2k.d.mts +146 -0
- package/dist/ConsentBanner-Vxyt8SCX.d.ts +146 -0
- package/dist/{cross-border-entry-BrWVPly6.d.ts → CrossBorderTransferManager-D5Lc0e46.d.ts} +4 -5
- package/dist/{cross-border-entry-cCTvpwnT.d.mts → CrossBorderTransferManager-DkZhv9vD.d.mts} +4 -5
- package/dist/DPIAQuestionnaire-BkejviPj.d.mts +123 -0
- package/dist/DPIAQuestionnaire-DdSqXG3x.d.ts +123 -0
- package/dist/DSRRequestForm-BY8PogCU.d.mts +146 -0
- package/dist/DSRRequestForm-CHUg9cZh.d.ts +146 -0
- package/dist/DSRTracker-C6u_jAaK.d.mts +163 -0
- package/dist/DSRTracker-Dr_aT0pg.d.ts +163 -0
- package/dist/{lawful-basis-entry-CxZrofwG.d.mts → LawfulBasisTracker-CBqOxX1D.d.mts} +3 -5
- package/dist/{lawful-basis-entry-15qjKcNO.d.ts → LawfulBasisTracker-Cg30NbDA.d.ts} +3 -5
- package/dist/NDPRDashboard-CLJpEg0X.d.mts +44 -0
- package/dist/NDPRDashboard-DDWNd2Ah.d.ts +44 -0
- package/dist/{policy-E0fXZkda.d.mts → PolicyExporter-BIqSVjfC.d.mts} +4 -98
- package/dist/{policy-D2_jh5-T.d.ts → PolicyExporter-BNWaPBGU.d.ts} +4 -98
- package/dist/PolicyGenerator-BvcWPbxp.d.mts +96 -0
- package/dist/PolicyGenerator-BzRwtlgn.d.ts +96 -0
- package/dist/{ropa-entry-B0D7X1GV.d.ts → ROPAManager-BS4eB8Hw.d.mts} +4 -5
- package/dist/{ropa-entry-DiOThOc2.d.mts → ROPAManager-qxTrXLkD.d.ts} +4 -5
- package/dist/RegulatoryReportGenerator-BUYgzTTT.d.ts +282 -0
- package/dist/RegulatoryReportGenerator-DwcHcEFp.d.mts +282 -0
- package/dist/StepIndicator-D-nwRTyo.d.mts +171 -0
- package/dist/StepIndicator-D9ZATz_O.d.ts +171 -0
- package/dist/adapters.d.mts +25 -0
- package/dist/adapters.d.ts +25 -0
- package/dist/adapters.js +2 -0
- package/dist/adapters.mjs +2 -0
- package/dist/breach.d.mts +36 -431
- package/dist/breach.d.ts +36 -431
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-27NYSWUG.mjs +2 -0
- package/dist/chunk-2ORDHJRD.js +2 -0
- package/dist/chunk-2W7ARAW2.js +2 -0
- package/dist/chunk-3F34NACG.js +2 -0
- package/dist/chunk-3RGJV3VF.js +7 -0
- package/dist/chunk-3UWT64FI.mjs +2 -0
- package/dist/chunk-3V23O4ZJ.js +2 -0
- package/dist/chunk-3XAUN5IM.mjs +3 -0
- package/dist/chunk-5VMHKNJY.js +2 -0
- package/dist/chunk-6D3ZUGBB.mjs +2 -0
- package/dist/chunk-6E54NSAO.mjs +2 -0
- package/dist/chunk-7F5F5YWI.mjs +2 -0
- package/dist/chunk-7FIUX3ZM.js +89 -0
- package/dist/chunk-FR7ZYZXB.js +2 -0
- package/dist/chunk-FY5G6DGZ.js +7 -0
- package/dist/chunk-G26I6MP5.mjs +2 -0
- package/dist/chunk-GPJVTGHR.mjs +2 -0
- package/dist/chunk-GVANK6PL.js +3 -0
- package/dist/chunk-HNZK7LY3.mjs +2 -0
- package/dist/chunk-IKEPXHCZ.js +2 -0
- package/dist/chunk-IQQW52EF.js +2 -0
- package/dist/chunk-ISSGO2YT.mjs +72 -0
- package/dist/chunk-J6IKAGUP.mjs +89 -0
- package/dist/chunk-KHRBU5K7.js +2 -0
- package/dist/chunk-KNE4NXCY.mjs +7 -0
- package/dist/chunk-LFNA6WYQ.mjs +2 -0
- package/dist/chunk-NPI5T6NH.mjs +7 -0
- package/dist/chunk-NPLXE43Q.mjs +2 -0
- package/dist/chunk-P7BSBCB3.js +2 -0
- package/dist/chunk-PEH5GIMN.js +2 -0
- package/dist/chunk-RSUDIFZV.mjs +2 -0
- package/dist/chunk-SBNAMPAP.mjs +2 -0
- package/dist/chunk-SVCRYM4I.mjs +2 -0
- package/dist/chunk-U6VWHC46.js +72 -0
- package/dist/chunk-UK656RCG.js +2 -0
- package/dist/chunk-UNKXYVXY.js +2 -0
- package/dist/chunk-UOSEH6DC.js +2 -0
- package/dist/chunk-V37BM2LF.js +2 -0
- package/dist/chunk-V3MXWGXU.mjs +2 -0
- package/dist/chunk-VDZKGCAF.js +2 -0
- package/dist/chunk-WLSW4Z4W.mjs +2 -0
- package/dist/chunk-XSK4BSZJ.mjs +2 -0
- package/dist/chunk-YJCGEOLO.mjs +2 -0
- package/dist/chunk-ZCZ5RRZO.js +2 -0
- package/dist/compliance-score-racQe_E_.d.mts +115 -0
- package/dist/compliance-score-racQe_E_.d.ts +115 -0
- package/dist/consent.d.mts +67 -295
- package/dist/consent.d.ts +67 -295
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +8 -5
- package/dist/core.d.ts +8 -5
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border-BBi9rZyO.d.mts +54 -0
- package/dist/cross-border-Dy-U9Hu6.d.ts +54 -0
- package/dist/{cross-border-BMcqLvjC.d.mts → cross-border-UyT00llA.d.mts} +1 -52
- package/dist/{cross-border-BMcqLvjC.d.ts → cross-border-UyT00llA.d.ts} +1 -52
- package/dist/cross-border.d.mts +32 -4
- package/dist/cross-border.d.ts +32 -4
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/dpia.d.mts +28 -284
- package/dist/dpia.d.ts +28 -284
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/dsr.d.mts +29 -300
- package/dist/dsr.d.ts +29 -300
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +21 -10
- package/dist/hooks.d.ts +21 -10
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +28 -18
- package/dist/index.d.ts +28 -18
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.d.mts +31 -4
- package/dist/lawful-basis.d.ts +31 -4
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy.d.mts +36 -4
- package/dist/policy.d.ts +36 -4
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets.d.mts +124 -0
- package/dist/presets.d.ts +124 -0
- package/dist/presets.js +2 -0
- package/dist/presets.mjs +2 -0
- package/dist/{ropa-Li6UlL5H.d.ts → ropa-BDTM06tr.d.ts} +1 -49
- package/dist/{ropa-DP7pPPql.d.mts → ropa-CFHuT7jE.d.mts} +1 -49
- package/dist/ropa-CyynscU6.d.ts +51 -0
- package/dist/ropa-NIgxd8uP.d.mts +51 -0
- package/dist/ropa.d.mts +30 -4
- package/dist/ropa.d.ts +30 -4
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/styling-B7CBzYG7.d.ts +165 -0
- package/dist/styling-uJLsBbER.d.mts +165 -0
- package/dist/types-DK2CoKOC.d.mts +10 -0
- package/dist/types-DK2CoKOC.d.ts +10 -0
- package/dist/unstyled.d.mts +4 -4
- package/dist/unstyled.d.ts +4 -4
- package/dist/{useBreach-BBSoIcZO.d.mts → useBreach-CPr86Yan.d.mts} +18 -2
- package/dist/{useBreach-lFLbSyAN.d.ts → useBreach-DkVXvtJK.d.ts} +18 -2
- package/dist/{useConsent-D0pAfTlb.d.ts → useConsent-DCNkIJHR.d.mts} +12 -2
- package/dist/{useConsent-DOt2Njst.d.mts → useConsent-dOcELSfX.d.ts} +12 -2
- package/dist/{useCrossBorderTransfer-DmtACeqW.d.ts → useCrossBorderTransfer-BGNZt2lk.d.mts} +15 -3
- package/dist/{useCrossBorderTransfer-BZVFCXfr.d.mts → useCrossBorderTransfer-COqjgjsu.d.ts} +15 -3
- package/dist/{useDPIA-DBsg2yZx.d.ts → useDPIA-Dl16Te3r.d.ts} +13 -2
- package/dist/{useDPIA-Da7-Q_yW.d.mts → useDPIA-DzWye8JB.d.mts} +13 -2
- package/dist/{useDSR-YYZ6FYFs.d.mts → useDSR-C1LksCfP.d.mts} +13 -2
- package/dist/{useDSR-CYI7WCXr.d.ts → useDSR-DZel52O1.d.ts} +13 -2
- package/dist/{useDefaultPrivacyPolicy-CUluF_ic.d.mts → useDefaultPrivacyPolicy-BsYttRey.d.mts} +13 -2
- package/dist/{useDefaultPrivacyPolicy-B7kTHbZh.d.ts → useDefaultPrivacyPolicy-C-mG-A5S.d.ts} +13 -2
- package/dist/{useLawfulBasis-CpWuHtyh.d.mts → useLawfulBasis-CKJ-kw84.d.mts} +13 -2
- package/dist/{useLawfulBasis-CCWF9waR.d.ts → useLawfulBasis-DFTmu1ca.d.ts} +13 -2
- package/dist/{useROPA-BhJ3kvHp.d.ts → useROPA-BSSU1rfx.d.ts} +14 -2
- package/dist/{useROPA-DLFdjkxP.d.mts → useROPA-C2hjaBTz.d.mts} +14 -2
- package/package.json +18 -2
- package/dist/chunk-2XFAV267.mjs +0 -2
- package/dist/chunk-32UIWTGD.js +0 -72
- package/dist/chunk-3YCV2BA6.js +0 -2
- package/dist/chunk-4A354HL3.js +0 -2
- package/dist/chunk-5ZBO2UPH.js +0 -2
- package/dist/chunk-6GGGTRDZ.mjs +0 -2
- package/dist/chunk-BGHQTZAC.js +0 -94
- package/dist/chunk-BZTTQS4A.mjs +0 -7
- package/dist/chunk-EKVTLHBQ.js +0 -2
- package/dist/chunk-GMLNWS2N.mjs +0 -2
- package/dist/chunk-IBEKLDBY.mjs +0 -2
- package/dist/chunk-K3GMTMQ6.js +0 -2
- package/dist/chunk-L52PDW6O.mjs +0 -2
- package/dist/chunk-LI6WJ3LZ.js +0 -2
- package/dist/chunk-LXRXDTPI.js +0 -2
- package/dist/chunk-NW4A3JW6.mjs +0 -2
- package/dist/chunk-OITITR6K.mjs +0 -2
- package/dist/chunk-PDJGTQMY.mjs +0 -2
- package/dist/chunk-SKJCQKFL.mjs +0 -94
- package/dist/chunk-T44JQT2O.mjs +0 -2
- package/dist/chunk-TCJCE6WN.js +0 -2
- package/dist/chunk-VMJBW3EF.mjs +0 -2
- package/dist/chunk-WW3X3ELF.js +0 -2
- package/dist/chunk-XMYUYQH7.mjs +0 -72
- package/dist/chunk-ZNTMZ6NM.js +0 -7
- package/dist/chunk-ZU73VG3X.js +0 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';var chunkRYZEIDNR_js=require('./chunk-RYZEIDNR.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ve=({breachData:g,initialAssessment:u={},onComplete:k,title:V="Breach Risk Assessment",description:Y="Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",submitButtonText:J="Complete Assessment",className:ee="",buttonClassName:_="",classNames:h={},unstyled:d=false,showBreachSummary:l=true,showNotificationRequirements:R=true})=>{let[L,te]=react.useState(u.confidentialityImpact||3),[$,v]=react.useState(u.integrityImpact||3),[D,C]=react.useState(u.availabilityImpact||3),[j,B]=react.useState(u.harmLikelihood||3),[q,P]=react.useState(u.harmSeverity||3),[U,E]=react.useState(u.risksToRightsAndFreedoms!==void 0?u.risksToRightsAndFreedoms:false),[H,M]=react.useState(u.highRisksToRightsAndFreedoms!==void 0?u.highRisksToRightsAndFreedoms:false),[K,ae]=react.useState(u.justification||""),[W,se]=react.useState(0),[w,f]=react.useState("low"),[x,b]=react.useState(false),[y,Z]=react.useState(0),[O,Q]=react.useState(0),[p,S]=react.useState(false);react.useEffect(()=>{let X=L*.2+$*.1+D*.1+j*.3+q*.3;se(Number(X.toFixed(1)));let F;X<2?F="low":X<3?F="medium":X<4?F="high":F="critical",f(F),b(U||F==="high"||F==="critical");let ne=g.discoveredAt+4320*60*1e3;Z(ne);let ce=Date.now(),pe=(ne-ce)/(3600*1e3);Q(Number(pe.toFixed(1)));},[L,$,D,j,q,U,g.discoveredAt]);let ie=o=>new Date(o).toLocaleString(),re=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:L,integrityImpact:$,availabilityImpact:D,harmLikelihood:j,harmSeverity:q,overallRiskScore:W,riskLevel:w,risksToRightsAndFreedoms:U,highRisksToRightsAndFreedoms:H,justification:K};k(N),S(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"}},c=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]}`,h.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 ${ee}`,h.root,d),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",h.title,d),children:V}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:Y}),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:"})," ",ie(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:"})," ",c(w)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",W," / 5"]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Assessed On:"})," ",ie(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:"})," ",U?"Yes":"No"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",H?"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:K})]})]}),R&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`mb-6 p-4 rounded-md ${x?O>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"}`,h.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 ${O>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:"})," ",ie(y)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsxRuntime.jsx("span",{className:O<24?"text-red-600 dark:text-red-400 font-bold":"",children:O>0?`${O} hours`:"Deadline passed"})]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",H?"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"}),H&&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:()=>S(false),className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${_}`,h.primaryButton||h.submitButton,d),children:"Edit Assessment"})]}):jsxRuntime.jsx("form",{onSubmit:re,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:L,onChange:o=>te(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",h.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(L)," (",L,")"]})]})]}),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:$,onChange:o=>v(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",h.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s($)," (",$,")"]})]})]}),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",h.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:j,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",h.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:"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:q,onChange:o=>P(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",h.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("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:U,onChange:o=>E(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:H,onChange:o=>M(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("",h.riskScore,d),children:[W," / 5"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Level:"}),c(w)]})]}),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:K,onChange:o=>ae(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 ${_}`,h.primaryButton||h.submitButton,d),children:J})})]})})]})};var Ce=({breachReports:g,riskAssessments:u,regulatoryNotifications:k,onSelectBreach:V,onRequestAssessment:Y,onRequestNotification:J,title:ee="Breach Notification Manager",description:_="Manage data breach notifications and track compliance with NDPA Section 40 requirements.",className:h="",buttonClassName:d="",classNames:l={},unstyled:R=false,showBreachDetails:L=true,showNotificationTimeline:te=true,showDeadlineAlerts:$=true})=>{var re;let[v,D]=react.useState(null),[C,j]=react.useState(g),[B,q]=react.useState("all"),[P,U]=react.useState(""),[E,H]=react.useState("discoveredAt"),[M,K]=react.useState("desc");react.useEffect(()=>{let s=[...g];if(B!=="all"&&(s=s.filter(c=>c.status===B)),P){let c=P.toLowerCase();s=s.filter(o=>o.title.toLowerCase().includes(c)||o.description.toLowerCase().includes(c)||o.affectedSystems.some(N=>N.toLowerCase().includes(c))||o.dataTypes.some(N=>N.toLowerCase().includes(c)));}s.sort((c,o)=>{let N=0;switch(E){case "title":N=c.title.localeCompare(o.title);break;case "discoveredAt":N=c.discoveredAt-o.discoveredAt;break;case "status":N=c.status.localeCompare(o.status);break;case "riskLevel":let I=u.find(F=>F.breachId===c.id),T=u.find(F=>F.breachId===o.id),oe=(I==null?void 0:I.riskLevel)||"unknown",X=(T==null?void 0:T.riskLevel)||"unknown";N=oe.localeCompare(X);break;default:N=c.discoveredAt-o.discoveredAt;}return M==="asc"?N:-N}),j(s);},[g,B,P,E,M,u]),react.useEffect(()=>{C.length>0&&!v&&D(C[0].id);},[C,v]);let ae=s=>{D(s),V&&V(s);},W=()=>{v&&Y&&Y(v);},se=()=>{v&&J&&J(v);},w=s=>new Date(s).toLocaleString(),f=v?g.find(s=>s.id===v):null,x=v?u.find(s=>s.breachId===v):null,b=v?k.find(s=>s.breachId===v):null,y=f?Z(f,x):null;function Z(s,c){let o=chunkRYZEIDNR_js.a(s,c||void 0),N=s.discoveredAt+o.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:o.notificationRequired,ndpcNotificationDeadline:N,dataSubjectNotificationRequired:(c==null?void 0:c.highRisksToRightsAndFreedoms)||false,justification:o.justification}}function O(s){let c=Date.now(),o=(s-c)/(3600*1e3);return Number(o.toFixed(1))}let Q=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,R),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,R),children:s.charAt(0).toUpperCase()+s.slice(1)}),S=()=>{if(!f||!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(b)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 ",w(b.sentAt),"."]})]});let s=O(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 ",w(y.ndpcNotificationDeadline)," (",s," hours remaining)."]})]})},ie=()=>{if(!f)return null;let s=[{title:"Breach Discovered",date:f.discoveredAt,completed:true,description:`Breach was discovered on ${w(f.discoveredAt)}.`},{title:"Risk Assessment",date:x==null?void 0:x.assessedAt,completed:!!x,description:x?`Risk assessment completed on ${w(x.assessedAt)}.`:"Risk assessment has not been completed yet."}];return y!=null&&y.ndpcNotificationRequired&&s.push({title:"NDPC Notification",date:b==null?void 0:b.sentAt,completed:!!b,description:b?`Notification sent to the NDPC on ${w(b.sentAt)}.`:`Notification must be sent to the NDPC by ${w(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,R),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((c,o)=>jsxRuntime.jsxs("li",{className:chunkE64TU6IU_js.a("mb-6 ml-4",l.timelineStep,R),children:[jsxRuntime.jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${c.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:c.date?w(c.date):"Pending"}),jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:c.title}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:c.description})]},o))})]})};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${h}`,l.root,R),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",l.header,R),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",l.title,R),children:ee}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:_})]}),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=>q(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:E,onChange:s=>H(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:P,onChange:s=>U(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,R),children:C.map(s=>{let c=u.find(T=>T.breachId===s.id),o=k.find(T=>T.breachId===s.id),N=Z(s,c),I=null;if(N!=null&&N.ndpcNotificationRequired)if(o)I=jsxRuntime.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Notified"});else {let T=O(N.ndpcNotificationDeadline);T<=0?I=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):T<=24?I=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):I=jsxRuntime.jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Required"});}else I=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 ${v===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,R),onClick:()=>ae(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:c&&Q(c.riskLevel)}),jsxRuntime.jsx("div",{children:I})]})]},s.id)})})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("md:col-span-2",l.detailPanel,R),children:f?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:f.title}),p(f.status)]}),$&&jsxRuntime.jsx("div",{className:"mb-4",children:S()}),L&&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:"})," ",w(f.discoveredAt)]}),f.occurredAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Occurred:"})," ",w(f.occurredAt)]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reporter:"})," ",f.reporter.name]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",f.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",f.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",f.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:f.description})]}),f.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:f.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:"}),Q(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:W,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"}),b?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:"})," ",w(b.sentAt)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Method:"})," ",b.method.charAt(0).toUpperCase()+b.method.slice(1)]}),b.referenceNumber&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference Number:"})," ",b.referenceNumber]}),(b.ndpcContact||b.nitdaContact)&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(re=b.ndpcContact||b.nitdaContact)==null?void 0:re.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:se,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."})})})]}),te&&ie()]}):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:k,onGenerate:V,title:Y="Generate NDPC Notification Report",description:J="Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements.",generateButtonText:ee="Generate Report",className:_="",buttonClassName:h="",classNames:d={},unstyled:l=false,showPreview:R=true,allowEditing:L=true,allowDownload:te=true,downloadFormat:$="pdf"})=>{let[v,D]=react.useState(""),[C,j]=react.useState(""),[B,q]=react.useState(""),[P,U]=react.useState(""),[E,H]=react.useState("email"),[M,K]=react.useState(""),[ae,W]=react.useState(""),[se,w]=react.useState(false),[f,x]=react.useState(false);react.useEffect(()=>{if(!se){let p=y();D(p),w(true);}},[g,u,k]);let b=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: ${k.name}
|
|
11
|
+
${k.registrationNumber?`Registration Number: ${k.registrationNumber}`:""}
|
|
12
|
+
Address: ${k.address}
|
|
13
|
+
${k.website?`Website: ${k.website}`:""}
|
|
14
|
+
|
|
15
|
+
DATA PROTECTION OFFICER
|
|
16
|
+
----------------------
|
|
17
|
+
Name: ${k.dpoName}
|
|
18
|
+
Email: ${k.dpoEmail}
|
|
19
|
+
${k.dpoPhone?`Phone: ${k.dpoPhone}`:""}
|
|
20
|
+
|
|
21
|
+
BREACH DETAILS
|
|
22
|
+
-------------
|
|
23
|
+
Breach Title: ${g.title}
|
|
24
|
+
Date Discovered: ${b(g.discoveredAt)}
|
|
25
|
+
${g.occurredAt?`Date Occurred: ${b(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
|
+
`,Z=p=>{p.preventDefault();let S={id:`notification_${Date.now()}`,breachId:g.id,sentAt:Date.now(),method:E,referenceNumber:M||void 0,ndpcContact:C?{name:C,email:B,phone:P||void 0}:void 0,content:v,attachments:[]};V(S),x(true);},O=()=>{let p=document.createElement("a"),S=new Blob([v],{type:"text/plain"});p.href=URL.createObjectURL(S),p.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.txt`,document.body.appendChild(p),p.click(),document.body.removeChild(p);},Q=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(S=>jsxRuntime.jsx("option",{value:S.value,children:S.label},S.value));return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${_}`,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:Y}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:J})]}),f?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:E.charAt(0).toUpperCase()+E.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})]}),P&&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:P})]})]}),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:b(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})]}),M&&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:M})]})]})]})]}),R&&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:v})})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-3",children:[te&&jsxRuntime.jsxs("button",{onClick:O,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${h}`,d.secondaryButton||d.downloadButton,l),children:["Download Report (",$.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 ${h}`,children:"Edit Report"})]})]}):jsxRuntime.jsx("form",{onSubmit:Z,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:E,onChange:p=>H(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:Q()})]}),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:M,onChange:p=>K(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=>j(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=>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:"contactPhone",className:"block text-sm font-medium mb-1",children:"Contact Phone"}),jsxRuntime.jsx("input",{type:"tel",id:"contactPhone",value:P,onChange:p=>U(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:ae,onChange:p=>W(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))]"})]})]}),L&&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:v,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 ${h}`,d.primaryButton||d.generateButton,l),children:ee})})]})})]})};exports.a=ve;exports.b=Ce;exports.c=Te;//# sourceMappingURL=chunk-U6VWHC46.js.map
|
|
72
|
+
//# sourceMappingURL=chunk-U6VWHC46.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';function r(t){return {load(){if(typeof window=="undefined")return null;try{let e=localStorage.getItem(t);return e?JSON.parse(e):null}catch(e){return null}},save(e){typeof window!="undefined"&&localStorage.setItem(t,JSON.stringify(e));},remove(){typeof window!="undefined"&&localStorage.removeItem(t);}}}exports.a=r;//# sourceMappingURL=chunk-UK656RCG.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-UK656RCG.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),jsxRuntime=require('react/jsx-runtime');var T=({sections:o,answers:p,onAnswerChange:n,currentSectionIndex:g,onNextSection:k,onPrevSection:h,validationErrors:N={},readOnly:i=false,className:w="",buttonClassName:y="",nextButtonText:$="Next",prevButtonText:P="Previous",submitButtonText:B="Submit",showProgress:A=true,progress:u,classNames:v={},unstyled:C=false})=>{let c=o[g],D=g===o.length-1,l=(e,s)=>{let r=s?v[s]:void 0;return !r&&s==="nextButton"&&(r=v.primaryButton),!r&&s==="prevButton"&&(r=v.secondaryButton),chunkE64TU6IU_js.a(e,r,C)},I=e=>e.showWhen?e.showWhen.every(s=>{let r=p[s.questionId];switch(s.operator){case "equals":return r===s.value;case "contains":return Array.isArray(r)?r.includes(s.value):false;case "greaterThan":return typeof r=="number"?r>s.value:false;case "lessThan":return typeof r=="number"?r<s.value:false;default:return true}}):true,m=e=>l(`w-full px-3 py-2 border rounded-md ${e?"border-red-500":"border-gray-300 dark:border-gray-600"} focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100`,"input"),Q=e=>{if(!I(e))return null;let s=N[e.id],r=p[e.id];return jsxRuntime.jsxs("div",{className:l("mb-6","question"),children:[jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:l("block text-sm font-medium text-gray-900 dark:text-gray-100","questionText"),children:[e.text,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),e.guidance&&jsxRuntime.jsx("p",{className:l("mt-1 text-sm text-gray-600 dark:text-gray-400","guidance"),children:e.guidance})]}),e.type==="text"&&jsxRuntime.jsx("input",{type:"text",id:e.id,value:r||"",onChange:a=>n(e.id,a.target.value),disabled:i,className:m(s)}),e.type==="textarea"&&jsxRuntime.jsx("textarea",{id:e.id,value:r||"",onChange:a=>n(e.id,a.target.value),disabled:i,rows:4,className:m(s)}),e.type==="select"&&e.options&&jsxRuntime.jsxs("select",{id:e.id,value:r||"",onChange:a=>n(e.id,a.target.value),disabled:i,className:m(s),children:[jsxRuntime.jsx("option",{value:"",children:"Select an option"}),e.options.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))]}),e.type==="radio"&&e.options&&jsxRuntime.jsx("div",{className:l("space-y-2","radioGroup"),children:e.options.map(a=>jsxRuntime.jsxs("div",{className:l("flex items-center","radioOption"),children:[jsxRuntime.jsx("input",{type:"radio",id:`${e.id}_${a.value}`,name:e.id,value:a.value,checked:r===a.value,onChange:()=>n(e.id,a.value),disabled:i,className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] border-gray-300 dark:border-gray-600"}),jsxRuntime.jsxs("label",{htmlFor:`${e.id}_${a.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:[a.label,a.riskLevel&&jsxRuntime.jsxs("span",{className:`ml-2 text-xs px-2 py-1 rounded ${a.riskLevel==="low"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":a.riskLevel==="medium"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:[a.riskLevel.charAt(0).toUpperCase()+a.riskLevel.slice(1)," Risk"]})]})]},a.value))}),e.type==="checkbox"&&e.options&&jsxRuntime.jsx("div",{className:"space-y-2",children:e.options.map(a=>jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"checkbox",id:`${e.id}_${a.value}`,value:a.value,checked:Array.isArray(r)?r.includes(a.value):false,onChange:b=>{let x=Array.isArray(r)?[...r]:[];b.target.checked?n(e.id,[...x,a.value]):n(e.id,x.filter(L=>L!==a.value));},disabled:i,className:"h-4 w-4 rounded text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] border-gray-300 dark:border-gray-600"}),jsxRuntime.jsx("label",{htmlFor:`${e.id}_${a.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:a.label})]},a.value))}),e.type==="scale"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"flex justify-between mb-2",children:e.scaleLabels&&Object.entries(e.scaleLabels).map(([a,b])=>jsxRuntime.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 text-center",style:{width:`${100/Object.keys(e.scaleLabels||{}).length}%`},children:b},a))}),jsxRuntime.jsx("input",{type:"range",id:e.id,min:e.minValue||1,max:e.maxValue||5,value:r||e.minValue||1,onChange:a=>n(e.id,parseInt(a.target.value,10)),disabled:i,className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"}),jsxRuntime.jsxs("div",{className:"mt-1 text-sm text-gray-600 dark:text-gray-400 text-center",children:["Selected value: ",r||e.minValue||1]})]}),s&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:s})]},e.id)};return c?jsxRuntime.jsxs("div",{className:`${l("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6","root")} ${w}`,children:[A&&jsxRuntime.jsxs("div",{className:l("mb-6","header"),children:[jsxRuntime.jsxs("div",{className:"flex justify-between text-sm text-gray-600 dark:text-gray-400 mb-1",children:[jsxRuntime.jsxs("span",{children:["Section ",g+1," of ",o.length]}),jsxRuntime.jsx("span",{children:u!==void 0?`${u}% Complete`:""})]}),jsxRuntime.jsx("div",{className:l("w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700","progressBar"),children:jsxRuntime.jsx("div",{className:"bg-[rgb(var(--ndpr-primary))] h-2.5 rounded-full",style:{width:`${u!==void 0?u:(g+1)/o.length*100}%`}})})]}),jsxRuntime.jsx("h2",{className:l("text-xl font-bold mb-2 text-gray-900 dark:text-white","title"),children:c.title}),c.description&&jsxRuntime.jsx("p",{className:l("mb-6 text-gray-600 dark:text-gray-300","sectionTitle"),children:c.description}),jsxRuntime.jsx("div",{className:l("space-y-6","section"),children:c.questions.map(e=>Q(e))}),jsxRuntime.jsxs("div",{className:l("mt-8 flex justify-between","navigation"),children:[jsxRuntime.jsx("button",{type:"button",onClick:h,disabled:g===0||i,className:`${l("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 disabled:opacity-50 disabled:cursor-not-allowed","prevButton")} ${y}`,children:P}),jsxRuntime.jsx("button",{type:"button",onClick:k,disabled:i,className:`${l("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] disabled:opacity-50 disabled:cursor-not-allowed","nextButton")} ${y}`,children:D?B:$})]})]}):jsxRuntime.jsx("div",{children:"No section found."})};exports.a=T;//# sourceMappingURL=chunk-UNKXYVXY.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-UNKXYVXY.js.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 lt=({options:d,onSave:J,title:M="We Value Your Privacy",description:W="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:Y="Accept All",rejectAllButtonText:K="Reject All",customizeButtonText:Q="Customize",saveButtonText:U="Save Preferences",position:A="bottom",zIndex:T=9999,version:f="1.0",show:p,manageStorage:R=true,storageKey:E="ndpr_consent",className:X="",buttonClassName:y="",primaryButtonClassName:q="",secondaryButtonClassName:Z="",classNames:t,unstyled:o,onAnalytics:h})=>{let[g,u]=react.useState(false),[v,a]=react.useState(false),[C,B]=react.useState({}),z=react.useRef(null),$=react.useRef(null),j=react.useRef(false),b=react.useCallback((e,n)=>{h==null||h(chunkMQFZHA2D_js.a({action:e,timestamp:Date.now(),version:f},n!==void 0?{categories:n}:{}));},[h,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(D){u(true);}else u(true);}else u(p);},[d,E,f,R]),react.useEffect(()=>{p!==void 0&&u(p);},[p]);let s=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),b("accepted_all",e),P(e);},N=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),b("rejected_all",e),P(e);},tt=(e,n)=>{B(D=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},D),{[e]:n}));},et=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),B(e);},nt=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),B(e);},H=d.length>0&&d.every(e=>C[e.id]),rt=()=>{b("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)),J(n),u(false),a(false);},_=react.useCallback(()=>{b("dismissed"),u(false),a(false);},[b]);if(react.useEffect(()=>{if(!g)return;let e=n=>{n.key==="Escape"&&_();};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[g,_]),react.useEffect(()=>{g&&!j.current&&(j.current=true,b("shown")),g||(j.current=false);},[g,b]),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 ot=(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))] ${y} ${q}`,m=(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 ${y} ${Z}`,it=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${y}`,dt=(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))] ${y} ${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 S=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":""} ${X}`,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:M}),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:W}),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:H?nt:et,className:chunkE64TU6IU_js.a("text-sm font-medium text-[rgb(var(--ndpr-primary))] hover:underline",t==null?void 0:t.selectAllButton,o),children:H?"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=>tt(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:rt,className:chunkE64TU6IU_js.a(dt,t==null?void 0:t.saveButton,o),children:U}),jsxRuntime.jsx("button",{onClick:()=>a(false),className:chunkE64TU6IU_js.a(m,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:s,className:chunkE64TU6IU_js.a(ot,t==null?void 0:t.acceptButton,o),children:Y}),jsxRuntime.jsx("button",{onClick:N,className:chunkE64TU6IU_js.a(m,t==null?void 0:t.rejectButton,o),children:K}),jsxRuntime.jsx("button",{onClick:()=>a(true),className:chunkE64TU6IU_js.a(it,t==null?void 0:t.customizeButton,o),children:Q})]}),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 S;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:S})]});return typeof document!="undefined"?reactDom.createPortal(e,document.body):e}return typeof document!="undefined"?reactDom.createPortal(S,document.body):S};exports.a=lt;//# sourceMappingURL=chunk-UOSEH6DC.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-UOSEH6DC.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),jsxRuntime=require('react/jsx-runtime');var m={consent:"Consent",dsr:"Data Subject Rights",dpia:"DPIA",breach:"Breach Notification",policy:"Privacy Policy",lawfulBasis:"Lawful Basis",crossBorder:"Cross-Border",ropa:"ROPA"},p={critical:"rgb(var(--ndpr-destructive))","needs-work":"rgb(var(--ndpr-warning))",good:"rgb(var(--ndpr-primary))",excellent:"rgb(var(--ndpr-success))"},x={critical:"Critical","needs-work":"Needs Work",good:"Good",excellent:"Excellent"},f={critical:"Critical",high:"High",medium:"Medium",low:"Low"},y=({score:t,rating:e,classNames:o,unstyled:a})=>{let r=p[e],i=2*Math.PI*40,l=i*(1-t/100);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("relative inline-flex items-center justify-center",o==null?void 0:o.scoreCircle,a),children:[jsxRuntime.jsxs("svg",{width:"120",height:"120",viewBox:"0 0 100 100","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:"rgba(0,0,0,0.08)",strokeWidth:"8"}),jsxRuntime.jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:r,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:l,transform:"rotate(-90 50 50)",style:{transition:"stroke-dashoffset 0.4s ease"}})]}),jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("absolute text-2xl font-bold tabular-nums",o==null?void 0:o.scoreValue,a),style:{color:r},children:t})]})},C=({rating:t,className:e,unstyled:o})=>{let a=p[t];return jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("inline-block px-3 py-1 rounded-full text-sm font-semibold",e,o),style:{backgroundColor:`${a.replace("rgb(","rgba(").replace(")",", 0.12)")}`,color:a,border:`1px solid ${a.replace("rgb(","rgba(").replace(")",", 0.3)")}`},children:x[t]})},h=({moduleKey:t,module:e,classNames:o,unstyled:a})=>{var b;let r=e.score>=90?"excellent":e.score>=70?"good":e.score>=40?"needs-work":"critical",i=p[r];Math.round(e.score/100*(e.gaps.length+Math.round(e.score/100*5)));let u=e.gaps.length,c=(b=m[t])!=null?b:t;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("rounded-lg border p-4 flex flex-col gap-2",o==null?void 0:o.moduleCard,a),style:{borderColor:`${i.replace("rgb(","rgba(").replace(")",", 0.25)")}`,backgroundColor:`${i.replace("rgb(","rgba(").replace(")",", 0.04)")}`},children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("text-sm font-semibold truncate",o==null?void 0:o.moduleTitle,a),children:c}),jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("text-lg font-bold tabular-nums",o==null?void 0:o.moduleScore,a),style:{color:i},children:e.score})]}),jsxRuntime.jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{backgroundColor:"rgba(0,0,0,0.08)"},role:"progressbar","aria-valuenow":e.score,"aria-valuemin":0,"aria-valuemax":100,children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${e.score}%`,backgroundColor:i}})}),u>0&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400",o==null?void 0:o.moduleGaps,a),children:[u," gap",u!==1?"s":""," to address"]})]})},R=({rec:t,classNames:e,unstyled:o})=>{var i,l;let r=(i={critical:p.critical,high:p["needs-work"],medium:p.good,low:p.excellent}[t.priority])!=null?i:p.good;return jsxRuntime.jsxs("div",{"data-testid":"recommendation-item",className:chunkE64TU6IU_js.a("flex gap-3 p-3 rounded-lg border border-gray-100 dark:border-gray-700 bg-white dark:bg-gray-800",e==null?void 0:e.recommendationItem,o),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("mt-0.5 shrink-0 inline-block px-2 py-0.5 rounded text-xs font-bold uppercase tracking-wide",e==null?void 0:e.recommendationPriority,o),style:{backgroundColor:`${r.replace("rgb(","rgba(").replace(")",", 0.12)")}`,color:r},children:(l=f[t.priority])!=null?l:t.priority}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",e==null?void 0:e.recommendationTitle,o),children:t.label}),jsxRuntime.jsx("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400 leading-relaxed",children:t.recommendation}),jsxRuntime.jsxs("p",{className:"mt-1 text-xs text-gray-400 dark:text-gray-500",children:[t.ndpaSection," \u2022 Effort: ",t.effort]})]})]})},k=({report:t,title:e="NDPA Compliance Dashboard",showRecommendations:o=true,maxRecommendations:a=5,classNames:r,unstyled:i=false})=>{let l=t.recommendations.slice(0,a),u=Object.entries(t.modules);return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-dashboard",className:chunkE64TU6IU_js.a("w-full rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-sm p-6 flex flex-col gap-8",r==null?void 0:r.root,i),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col sm:flex-row items-start sm:items-center gap-6",r==null?void 0:r.header,i),children:[jsxRuntime.jsx(y,{score:t.score,rating:t.rating,classNames:{scoreCircle:r==null?void 0:r.scoreCircle,scoreValue:r==null?void 0:r.scoreValue},unstyled:i}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-gray-100 leading-tight",children:e}),jsxRuntime.jsx(C,{rating:t.rating,className:r==null?void 0:r.ratingBadge,unstyled:i}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Generated on"," ",new Date(t.generatedAt).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})]})]})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("grid grid-cols-2 sm:grid-cols-2 md:grid-cols-4 gap-3",r==null?void 0:r.modulesGrid,i),children:u.map(([c,b])=>jsxRuntime.jsx(h,{moduleKey:c,module:b,classNames:{moduleCard:r==null?void 0:r.moduleCard,moduleTitle:r==null?void 0:r.moduleTitle,moduleScore:r==null?void 0:r.moduleScore,moduleGaps:r==null?void 0:r.moduleGaps},unstyled:i},c))}),o&&l.length>0&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col gap-3",r==null?void 0:r.recommendationsSection,i),children:[jsxRuntime.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:"Recommendations"}),l.map(c=>jsxRuntime.jsx(R,{rec:c,classNames:{recommendationItem:r==null?void 0:r.recommendationItem,recommendationPriority:r==null?void 0:r.recommendationPriority,recommendationTitle:r==null?void 0:r.recommendationTitle},unstyled:i},`${c.module}-${c.key}`))]})]})};exports.a=k;//# sourceMappingURL=chunk-V37BM2LF.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-V37BM2LF.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-AYKLAEOU.mjs';import {jsxs,jsx}from'react/jsx-runtime';var T=({sections:o,answers:p,onAnswerChange:n,currentSectionIndex:g,onNextSection:k,onPrevSection:h,validationErrors:N={},readOnly:i=false,className:w="",buttonClassName:y="",nextButtonText:$="Next",prevButtonText:P="Previous",submitButtonText:B="Submit",showProgress:A=true,progress:u,classNames:v={},unstyled:C=false})=>{let c=o[g],D=g===o.length-1,l=(e,s)=>{let r=s?v[s]:void 0;return !r&&s==="nextButton"&&(r=v.primaryButton),!r&&s==="prevButton"&&(r=v.secondaryButton),a(e,r,C)},I=e=>e.showWhen?e.showWhen.every(s=>{let r=p[s.questionId];switch(s.operator){case "equals":return r===s.value;case "contains":return Array.isArray(r)?r.includes(s.value):false;case "greaterThan":return typeof r=="number"?r>s.value:false;case "lessThan":return typeof r=="number"?r<s.value:false;default:return true}}):true,m=e=>l(`w-full px-3 py-2 border rounded-md ${e?"border-red-500":"border-gray-300 dark:border-gray-600"} focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100`,"input"),Q=e=>{if(!I(e))return null;let s=N[e.id],r=p[e.id];return jsxs("div",{className:l("mb-6","question"),children:[jsxs("div",{className:"mb-2",children:[jsxs("label",{htmlFor:e.id,className:l("block text-sm font-medium text-gray-900 dark:text-gray-100","questionText"),children:[e.text,e.required&&jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),e.guidance&&jsx("p",{className:l("mt-1 text-sm text-gray-600 dark:text-gray-400","guidance"),children:e.guidance})]}),e.type==="text"&&jsx("input",{type:"text",id:e.id,value:r||"",onChange:a=>n(e.id,a.target.value),disabled:i,className:m(s)}),e.type==="textarea"&&jsx("textarea",{id:e.id,value:r||"",onChange:a=>n(e.id,a.target.value),disabled:i,rows:4,className:m(s)}),e.type==="select"&&e.options&&jsxs("select",{id:e.id,value:r||"",onChange:a=>n(e.id,a.target.value),disabled:i,className:m(s),children:[jsx("option",{value:"",children:"Select an option"}),e.options.map(a=>jsx("option",{value:a.value,children:a.label},a.value))]}),e.type==="radio"&&e.options&&jsx("div",{className:l("space-y-2","radioGroup"),children:e.options.map(a=>jsxs("div",{className:l("flex items-center","radioOption"),children:[jsx("input",{type:"radio",id:`${e.id}_${a.value}`,name:e.id,value:a.value,checked:r===a.value,onChange:()=>n(e.id,a.value),disabled:i,className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] border-gray-300 dark:border-gray-600"}),jsxs("label",{htmlFor:`${e.id}_${a.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:[a.label,a.riskLevel&&jsxs("span",{className:`ml-2 text-xs px-2 py-1 rounded ${a.riskLevel==="low"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":a.riskLevel==="medium"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:[a.riskLevel.charAt(0).toUpperCase()+a.riskLevel.slice(1)," Risk"]})]})]},a.value))}),e.type==="checkbox"&&e.options&&jsx("div",{className:"space-y-2",children:e.options.map(a=>jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"checkbox",id:`${e.id}_${a.value}`,value:a.value,checked:Array.isArray(r)?r.includes(a.value):false,onChange:b=>{let x=Array.isArray(r)?[...r]:[];b.target.checked?n(e.id,[...x,a.value]):n(e.id,x.filter(L=>L!==a.value));},disabled:i,className:"h-4 w-4 rounded text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] border-gray-300 dark:border-gray-600"}),jsx("label",{htmlFor:`${e.id}_${a.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:a.label})]},a.value))}),e.type==="scale"&&jsxs("div",{children:[jsx("div",{className:"flex justify-between mb-2",children:e.scaleLabels&&Object.entries(e.scaleLabels).map(([a,b])=>jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 text-center",style:{width:`${100/Object.keys(e.scaleLabels||{}).length}%`},children:b},a))}),jsx("input",{type:"range",id:e.id,min:e.minValue||1,max:e.maxValue||5,value:r||e.minValue||1,onChange:a=>n(e.id,parseInt(a.target.value,10)),disabled:i,className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"}),jsxs("div",{className:"mt-1 text-sm text-gray-600 dark:text-gray-400 text-center",children:["Selected value: ",r||e.minValue||1]})]}),s&&jsx("p",{className:"mt-1 text-sm text-red-500",children:s})]},e.id)};return c?jsxs("div",{className:`${l("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6","root")} ${w}`,children:[A&&jsxs("div",{className:l("mb-6","header"),children:[jsxs("div",{className:"flex justify-between text-sm text-gray-600 dark:text-gray-400 mb-1",children:[jsxs("span",{children:["Section ",g+1," of ",o.length]}),jsx("span",{children:u!==void 0?`${u}% Complete`:""})]}),jsx("div",{className:l("w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700","progressBar"),children:jsx("div",{className:"bg-[rgb(var(--ndpr-primary))] h-2.5 rounded-full",style:{width:`${u!==void 0?u:(g+1)/o.length*100}%`}})})]}),jsx("h2",{className:l("text-xl font-bold mb-2 text-gray-900 dark:text-white","title"),children:c.title}),c.description&&jsx("p",{className:l("mb-6 text-gray-600 dark:text-gray-300","sectionTitle"),children:c.description}),jsx("div",{className:l("space-y-6","section"),children:c.questions.map(e=>Q(e))}),jsxs("div",{className:l("mt-8 flex justify-between","navigation"),children:[jsx("button",{type:"button",onClick:h,disabled:g===0||i,className:`${l("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 disabled:opacity-50 disabled:cursor-not-allowed","prevButton")} ${y}`,children:P}),jsx("button",{type:"button",onClick:k,disabled:i,className:`${l("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] disabled:opacity-50 disabled:cursor-not-allowed","nextButton")} ${y}`,children:D?B:$})]})]}):jsx("div",{children:"No section found."})};export{T as a};//# sourceMappingURL=chunk-V3MXWGXU.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-V3MXWGXU.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var p=["critical","high","medium","low"];function m(e){let i=new Date(e).getTime();return (Date.now()-i)/(1e3*60*60*24*30.44)}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()}}exports.a=A;//# sourceMappingURL=chunk-VDZKGCAF.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-VDZKGCAF.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b as b$1,c,d}from'./chunk-PYEX7DFR.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function E({initialData:S,adapter:l,onRecordAdd:p,onRecordUpdate:g,onRecordArchive:f}){let d$1=useRef(l);d$1.current=l;let[s,u]=useState(S),[v,P]=useState(l!==void 0);useEffect(()=>{if(!d$1.current)return;let t=false;try{let e=d$1.current.load();e instanceof Promise?e.then(r=>{t||(r&&u(r),P(!1));},()=>{t||P(!1);}):(e&&u(e),P(!1));}catch(e){t||P(false);}return ()=>{t=true;}},[]);let n=useCallback(t=>{d$1.current&&Promise.resolve(d$1.current.save(t)).catch(e=>{console.warn("[ndpr-toolkit] Failed to save ROPA:",e);});},[]),C=useCallback(t=>{u(e=>{let r=b(a({},e),{records:[...e.records,t],lastUpdated:Date.now()});return n(r),r}),p==null||p(t);},[p,n]),w=useCallback((t,e)=>{u(r=>{let a$1=b(a({},r),{records:r.records.map(R=>R.id===t?b(a(a({},R),e),{updatedAt:Date.now()}):R),lastUpdated:Date.now()});return n(a$1),a$1}),g==null||g(t,e);},[g,n]),x=useCallback(t=>{u(e=>{let r=b(a({},e),{records:e.records.map(a$1=>a$1.id===t?b(a({},a$1),{status:"archived",updatedAt:Date.now()}):a$1),lastUpdated:Date.now()});return n(r),r}),f==null||f(t);},[f,n]),D=useCallback(t=>s.records.find(e=>e.id===t),[s.records]),G=useCallback(()=>b$1(s),[s]),b$2=useCallback(()=>c(s),[s]),L=useCallback(()=>d(s),[s]);return {ropa:s,addRecord:C,updateRecord:w,archiveRecord:x,getRecord:D,getSummary:G,exportCSV:b$2,getComplianceGaps:L,isLoading:v}}export{E as a};//# sourceMappingURL=chunk-WLSW4Z4W.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-WLSW4Z4W.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-2SYNHRP6.mjs';import {a as a$2}from'./chunk-SBNAMPAP.mjs';import {b,a as a$1,c}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function _(c,a){return a?a$2(c):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialRequests:c$1=[],requestTypes:a$2,adapter:S,storageKey:h="ndpr_dsr_requests",useLocalStorage:P=true,onSubmit:D,onUpdate:f}){let m=S!=null?S:_(h,P),i=useRef(m);i.current=m;let[q,r]=useState(c$1),[x,d]=useState(true);useEffect(()=>{let e=false;try{let t=i.current.load();t instanceof Promise?t.then(s=>{e||(s&&r(s),d(!1));},()=>{e||d(!1);}):(t&&r(t),d(!1));}catch(t){e||d(false);}return ()=>{e=true;}},[]);let g=useCallback(e=>{Promise.resolve(i.current.save(e)).catch(t=>{console.warn("[ndpr-toolkit] Failed to save DSR requests:",t);});},[]),I=()=>"dsr_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);return {requests:q,submitRequest:e=>{let t=a$2.find(p=>p.id===e.type),s=(t==null?void 0:t.estimatedCompletionTime)||30,u=Date.now(),n=u+s*24*60*60*1e3,A=e,{createdAt:y}=A,o=c(A,["createdAt"]),R=a$1({id:I(),status:"pending",createdAt:u,updatedAt:u,dueDate:n},o);return r(p=>{let b=[...p,R];return g(b),b}),D&&D(R),R},updateRequest:(e,t)=>{let s=null;return r(u=>{let n=u.findIndex(R=>R.id===e);if(n===-1)return u;let y=u[n];s=b(a$1(a$1({},y),t),{updatedAt:Date.now()});let o=[...u];return o[n]=s,g(o),o}),s&&f&&f(s),s},getRequest:e=>q.find(t=>t.id===e)||null,getRequestsByStatus:e=>q.filter(t=>t.status===e),getRequestsByType:e=>q.filter(t=>t.type===e),getRequestType:e=>a$2.find(t=>t.id===e),formatRequest:e=>{let{formattedRequest:t}=a(e);return t},clearRequests:()=>{r([]),Promise.resolve(i.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove DSR requests:",e);});},isLoading:x}}export{Q as a};//# sourceMappingURL=chunk-XSK4BSZJ.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-XSK4BSZJ.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function p(t){return {load(){if(typeof window=="undefined")return null;try{let n=sessionStorage.getItem(t);return n?JSON.parse(n):null}catch(n){return null}},save(n){typeof window!="undefined"&&sessionStorage.setItem(t,JSON.stringify(n));},remove(){typeof window!="undefined"&&sessionStorage.removeItem(t);}}}function f(t,n={}){let{domain:r,path:a="/",expires:s=365,secure:d=true,sameSite:u="Lax"}=n;return {load(){if(typeof document=="undefined")return null;try{let e=document.cookie.split(";").map(o=>o.trim()).find(o=>o.startsWith(`${t}=`));return e?JSON.parse(decodeURIComponent(e.split("=")[1])):null}catch(e){return null}},save(e){if(typeof document=="undefined")return;let o=new Date;o.setDate(o.getDate()+s);let i=`${t}=${encodeURIComponent(JSON.stringify(e))}; path=${a}; expires=${o.toUTCString()}; samesite=${u}`;r&&(i+=`; domain=${r}`),d&&(i+="; secure"),document.cookie=i;},remove(){if(typeof document=="undefined")return;let e=`${t}=; path=${a}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;r&&(e+=`; domain=${r}`),document.cookie=e;}}}export{p as a,f as b};//# sourceMappingURL=chunk-YJCGEOLO.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-YJCGEOLO.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkSSGJREE3_js=require('./chunk-SSGJREE3.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function H(a,A){return A?chunkUK656RCG_js.a(a):{load:()=>null,save:()=>{},remove:()=>{}}}function Y({sections:a,initialAnswers:A={},adapter:h,storageKey:E="ndpr_dpia_data",useLocalStorage:T=true,onComplete:I}){let w=h!=null?h:H(E,T),d=react.useRef(w);d.current=w;let[f,g]=react.useState(0),[o,p]=react.useState(A),[C,m]=react.useState(true);react.useEffect(()=>{let r=false;try{let s=d.current.load();s instanceof Promise?s.then(e=>{r||(e&&p(e),m(!1));},()=>{r||m(!1);}):(s&&p(s),m(!1));}catch(s){r||m(false);}return ()=>{r=true;}},[]);let c=a[f]||null,W=r=>{Promise.resolve(d.current.save(r)).catch(s=>{console.warn("[ndpr-toolkit] Failed to save DPIA answers:",s);});},_=(r,s)=>{p(e=>{let t=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{[r]:s});return W(t),t});},b=r=>r.showWhen?r.showWhen.every(s=>{let e=o[s.questionId];switch(s.operator){case "equals":return e===s.value;case "contains":return Array.isArray(e)?e.includes(s.value):false;case "greaterThan":return typeof e=="number"?e>s.value:false;case "lessThan":return typeof e=="number"?e<s.value:false;default:return true}}):true,v=()=>c?c.questions.filter(b):[],P=()=>c?v().every(s=>{if(!s.required)return true;let e=o[s.id];return !(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0)}):false,$=()=>{let r={};return c&&v().forEach(e=>{if(!e.required)return;let t=o[e.id];t==null||typeof t=="string"&&t.trim()===""?r[e.id]="This question is required":Array.isArray(t)&&t.length===0&&(r[e.id]="At least one option must be selected");}),r},O=()=>P()&&f<a.length-1?(g(r=>r+1),true):false,U=()=>f>0?(g(r=>r-1),true):false,V=r=>r>=0&&r<a.length?(g(r),true):false,B=()=>a.every(r=>r.questions.filter(e=>!e.showWhen||e.showWhen.length===0?true:e.showWhen.some(t=>{let n=o[t.questionId];switch(t.operator){case "equals":return n===t.value;case "contains":return Array.isArray(n)&&n.includes(t.value);case "greaterThan":return typeof n=="number"&&n>t.value;case "lessThan":return typeof n=="number"&&n<t.value;default:return false}})).every(e=>{if(!e.required)return true;let t=o[e.id];return !(t==null||typeof t=="string"&&t.trim()===""||Array.isArray(t)&&t.length===0)})),F=()=>{let r=[];return a.forEach(s=>{s.questions.forEach(e=>{let t=o[e.id];if(t!=null&&e.riskLevel)if(["select","radio","checkbox"].includes(e.type)&&e.options)(Array.isArray(t)?t:[t]).forEach(i=>{var D;let l=(D=e.options)==null?void 0:D.find(u=>u.value===i);if(l!=null&&l.riskLevel){let u=l.riskLevel,R=u==="low"?1:u==="medium"?3:5,S=u==="low"?1:u==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:`${e.text} - ${l.label}`,likelihood:R,impact:S,score:R*S,level:u,mitigated:false,relatedQuestionIds:[e.id]});}});else {let n=e.riskLevel,i=n==="low"?1:n==="medium"?3:5,l=n==="low"?1:n==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:e.text,likelihood:i,impact:l,score:i*l,level:n,mitigated:false,relatedQuestionIds:[e.id]});}});}),r},K=(r,s,e)=>{let t=F(),n={id:`dpia_${Date.now()}`,title:s,processingDescription:e,startedAt:Date.now(),completedAt:Date.now(),assessor:r,answers:o,risks:t,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},i=chunkSSGJREE3_js.a(n);return n.overallRiskLevel=i.overallRiskLevel,n.canProceed=i.canProceed,n.conclusion=i.canProceed?"Based on the assessment, the processing can proceed with appropriate safeguards.":"Based on the assessment, the processing should not proceed without further mitigation measures.",n.recommendations=i.recommendations,I&&I(n),n},M=()=>{p({}),g(0),Promise.resolve(d.current.remove()).catch(r=>{console.warn("[ndpr-toolkit] Failed to remove DPIA data:",r);});},j=(()=>{let r=0,s=0;return a.forEach(e=>{e.questions.forEach(t=>{if(t.required&&b(t)){s++;let n=o[t.id];n!=null&&!(typeof n=="string"&&n.trim()==="")&&!(Array.isArray(n)&&n.length===0)&&r++;}});}),s>0?Math.round(r/s*100):0})();return {currentSectionIndex:f,currentSection:c,answers:o,updateAnswer:_,nextSection:O,prevSection:U,goToSection:V,isCurrentSectionValid:P,getCurrentSectionErrors:$,isComplete:B,completeDPIA:K,getVisibleQuestions:v,resetDPIA:M,progress:j,isLoading:C}}exports.a=Y;//# sourceMappingURL=chunk-ZCZ5RRZO.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-ZCZ5RRZO.js.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compliance Score Engine
|
|
3
|
+
*
|
|
4
|
+
* Evaluates an organisation's NDPA compliance posture across eight modules and
|
|
5
|
+
* returns a scored, rated report with per-module breakdowns and sorted
|
|
6
|
+
* recommendations.
|
|
7
|
+
*
|
|
8
|
+
* Pure utility — zero React dependency.
|
|
9
|
+
*/
|
|
10
|
+
type ComplianceRating = 'excellent' | 'good' | 'needs-work' | 'critical';
|
|
11
|
+
type RecommendationPriority = 'critical' | 'high' | 'medium' | 'low';
|
|
12
|
+
type EffortLevel = 'low' | 'medium' | 'high';
|
|
13
|
+
interface RegulatoryReference {
|
|
14
|
+
section: string;
|
|
15
|
+
title: string;
|
|
16
|
+
url?: string;
|
|
17
|
+
}
|
|
18
|
+
interface Recommendation {
|
|
19
|
+
module: string;
|
|
20
|
+
key: string;
|
|
21
|
+
label: string;
|
|
22
|
+
priority: RecommendationPriority;
|
|
23
|
+
effort: EffortLevel;
|
|
24
|
+
recommendation: string;
|
|
25
|
+
ndpaSection: string;
|
|
26
|
+
}
|
|
27
|
+
interface ModuleScore {
|
|
28
|
+
/** Module name (e.g. "consent") */
|
|
29
|
+
name: string;
|
|
30
|
+
/** Raw module score 0-100 */
|
|
31
|
+
score: number;
|
|
32
|
+
/** Maximum possible score for this module (always 100) */
|
|
33
|
+
maxScore: number;
|
|
34
|
+
/** Weighted contribution to the overall score */
|
|
35
|
+
weightedScore: number;
|
|
36
|
+
/** NDPA sections this module maps to */
|
|
37
|
+
ndpaSections: string[];
|
|
38
|
+
/** Gaps found — list of human-readable gap descriptions */
|
|
39
|
+
gaps: string[];
|
|
40
|
+
}
|
|
41
|
+
interface ComplianceReport {
|
|
42
|
+
/** Overall compliance score, 0–100 */
|
|
43
|
+
score: number;
|
|
44
|
+
/** Rating bucket */
|
|
45
|
+
rating: ComplianceRating;
|
|
46
|
+
/** Per-module breakdown keyed by module name */
|
|
47
|
+
modules: Record<string, ModuleScore>;
|
|
48
|
+
/** Recommendations sorted by priority (critical first) */
|
|
49
|
+
recommendations: Recommendation[];
|
|
50
|
+
/** Top-level regulatory references */
|
|
51
|
+
regulatoryReferences: RegulatoryReference[];
|
|
52
|
+
/** ISO date of when the report was generated */
|
|
53
|
+
generatedAt: string;
|
|
54
|
+
}
|
|
55
|
+
interface ComplianceInput {
|
|
56
|
+
consent: {
|
|
57
|
+
hasConsentMechanism: boolean;
|
|
58
|
+
hasPurposeSpecification: boolean;
|
|
59
|
+
hasWithdrawalMechanism: boolean;
|
|
60
|
+
hasMinorProtection: boolean;
|
|
61
|
+
consentRecordsRetained: boolean;
|
|
62
|
+
};
|
|
63
|
+
dsr: {
|
|
64
|
+
hasRequestMechanism: boolean;
|
|
65
|
+
supportsAccess: boolean;
|
|
66
|
+
supportsRectification: boolean;
|
|
67
|
+
supportsErasure: boolean;
|
|
68
|
+
supportsPortability: boolean;
|
|
69
|
+
supportsObjection: boolean;
|
|
70
|
+
/** Expected max response time in days (>30 counts as a gap) */
|
|
71
|
+
responseTimelineDays: number;
|
|
72
|
+
};
|
|
73
|
+
dpia: {
|
|
74
|
+
conductedForHighRisk: boolean;
|
|
75
|
+
documentedRisks: boolean;
|
|
76
|
+
mitigationMeasures: boolean;
|
|
77
|
+
};
|
|
78
|
+
breach: {
|
|
79
|
+
hasNotificationProcess: boolean;
|
|
80
|
+
notifiesWithin72Hours: boolean;
|
|
81
|
+
hasRiskAssessment: boolean;
|
|
82
|
+
hasRecordKeeping: boolean;
|
|
83
|
+
};
|
|
84
|
+
policy: {
|
|
85
|
+
hasPrivacyPolicy: boolean;
|
|
86
|
+
isPubliclyAccessible: boolean;
|
|
87
|
+
/** ISO date string (YYYY-MM-DD); >13 months old counts as a gap */
|
|
88
|
+
lastUpdated: string;
|
|
89
|
+
coversAllSections: boolean;
|
|
90
|
+
};
|
|
91
|
+
lawfulBasis: {
|
|
92
|
+
documentedForAllProcessing: boolean;
|
|
93
|
+
hasLegitimateInterestAssessment: boolean;
|
|
94
|
+
};
|
|
95
|
+
crossBorder: {
|
|
96
|
+
hasTransferMechanisms: boolean;
|
|
97
|
+
adequacyAssessed: boolean;
|
|
98
|
+
ndpcApprovalObtained: boolean;
|
|
99
|
+
};
|
|
100
|
+
ropa: {
|
|
101
|
+
maintained: boolean;
|
|
102
|
+
includesAllProcessing: boolean;
|
|
103
|
+
/** ISO date string (YYYY-MM-DD); >6 months since review counts as a gap */
|
|
104
|
+
lastReviewed: string;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Evaluate an organisation's NDPA compliance across all modules.
|
|
109
|
+
*
|
|
110
|
+
* @param input - Compliance input object
|
|
111
|
+
* @returns ComplianceReport with overall score, per-module breakdown, and sorted recommendations
|
|
112
|
+
*/
|
|
113
|
+
declare function getComplianceScore(input: ComplianceInput): ComplianceReport;
|
|
114
|
+
|
|
115
|
+
export { type ComplianceInput as C, type EffortLevel as E, type ModuleScore as M, type Recommendation as R, type ComplianceRating as a, type ComplianceReport as b, type RecommendationPriority as c, type RegulatoryReference as d, getComplianceScore as g };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compliance Score Engine
|
|
3
|
+
*
|
|
4
|
+
* Evaluates an organisation's NDPA compliance posture across eight modules and
|
|
5
|
+
* returns a scored, rated report with per-module breakdowns and sorted
|
|
6
|
+
* recommendations.
|
|
7
|
+
*
|
|
8
|
+
* Pure utility — zero React dependency.
|
|
9
|
+
*/
|
|
10
|
+
type ComplianceRating = 'excellent' | 'good' | 'needs-work' | 'critical';
|
|
11
|
+
type RecommendationPriority = 'critical' | 'high' | 'medium' | 'low';
|
|
12
|
+
type EffortLevel = 'low' | 'medium' | 'high';
|
|
13
|
+
interface RegulatoryReference {
|
|
14
|
+
section: string;
|
|
15
|
+
title: string;
|
|
16
|
+
url?: string;
|
|
17
|
+
}
|
|
18
|
+
interface Recommendation {
|
|
19
|
+
module: string;
|
|
20
|
+
key: string;
|
|
21
|
+
label: string;
|
|
22
|
+
priority: RecommendationPriority;
|
|
23
|
+
effort: EffortLevel;
|
|
24
|
+
recommendation: string;
|
|
25
|
+
ndpaSection: string;
|
|
26
|
+
}
|
|
27
|
+
interface ModuleScore {
|
|
28
|
+
/** Module name (e.g. "consent") */
|
|
29
|
+
name: string;
|
|
30
|
+
/** Raw module score 0-100 */
|
|
31
|
+
score: number;
|
|
32
|
+
/** Maximum possible score for this module (always 100) */
|
|
33
|
+
maxScore: number;
|
|
34
|
+
/** Weighted contribution to the overall score */
|
|
35
|
+
weightedScore: number;
|
|
36
|
+
/** NDPA sections this module maps to */
|
|
37
|
+
ndpaSections: string[];
|
|
38
|
+
/** Gaps found — list of human-readable gap descriptions */
|
|
39
|
+
gaps: string[];
|
|
40
|
+
}
|
|
41
|
+
interface ComplianceReport {
|
|
42
|
+
/** Overall compliance score, 0–100 */
|
|
43
|
+
score: number;
|
|
44
|
+
/** Rating bucket */
|
|
45
|
+
rating: ComplianceRating;
|
|
46
|
+
/** Per-module breakdown keyed by module name */
|
|
47
|
+
modules: Record<string, ModuleScore>;
|
|
48
|
+
/** Recommendations sorted by priority (critical first) */
|
|
49
|
+
recommendations: Recommendation[];
|
|
50
|
+
/** Top-level regulatory references */
|
|
51
|
+
regulatoryReferences: RegulatoryReference[];
|
|
52
|
+
/** ISO date of when the report was generated */
|
|
53
|
+
generatedAt: string;
|
|
54
|
+
}
|
|
55
|
+
interface ComplianceInput {
|
|
56
|
+
consent: {
|
|
57
|
+
hasConsentMechanism: boolean;
|
|
58
|
+
hasPurposeSpecification: boolean;
|
|
59
|
+
hasWithdrawalMechanism: boolean;
|
|
60
|
+
hasMinorProtection: boolean;
|
|
61
|
+
consentRecordsRetained: boolean;
|
|
62
|
+
};
|
|
63
|
+
dsr: {
|
|
64
|
+
hasRequestMechanism: boolean;
|
|
65
|
+
supportsAccess: boolean;
|
|
66
|
+
supportsRectification: boolean;
|
|
67
|
+
supportsErasure: boolean;
|
|
68
|
+
supportsPortability: boolean;
|
|
69
|
+
supportsObjection: boolean;
|
|
70
|
+
/** Expected max response time in days (>30 counts as a gap) */
|
|
71
|
+
responseTimelineDays: number;
|
|
72
|
+
};
|
|
73
|
+
dpia: {
|
|
74
|
+
conductedForHighRisk: boolean;
|
|
75
|
+
documentedRisks: boolean;
|
|
76
|
+
mitigationMeasures: boolean;
|
|
77
|
+
};
|
|
78
|
+
breach: {
|
|
79
|
+
hasNotificationProcess: boolean;
|
|
80
|
+
notifiesWithin72Hours: boolean;
|
|
81
|
+
hasRiskAssessment: boolean;
|
|
82
|
+
hasRecordKeeping: boolean;
|
|
83
|
+
};
|
|
84
|
+
policy: {
|
|
85
|
+
hasPrivacyPolicy: boolean;
|
|
86
|
+
isPubliclyAccessible: boolean;
|
|
87
|
+
/** ISO date string (YYYY-MM-DD); >13 months old counts as a gap */
|
|
88
|
+
lastUpdated: string;
|
|
89
|
+
coversAllSections: boolean;
|
|
90
|
+
};
|
|
91
|
+
lawfulBasis: {
|
|
92
|
+
documentedForAllProcessing: boolean;
|
|
93
|
+
hasLegitimateInterestAssessment: boolean;
|
|
94
|
+
};
|
|
95
|
+
crossBorder: {
|
|
96
|
+
hasTransferMechanisms: boolean;
|
|
97
|
+
adequacyAssessed: boolean;
|
|
98
|
+
ndpcApprovalObtained: boolean;
|
|
99
|
+
};
|
|
100
|
+
ropa: {
|
|
101
|
+
maintained: boolean;
|
|
102
|
+
includesAllProcessing: boolean;
|
|
103
|
+
/** ISO date string (YYYY-MM-DD); >6 months since review counts as a gap */
|
|
104
|
+
lastReviewed: string;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Evaluate an organisation's NDPA compliance across all modules.
|
|
109
|
+
*
|
|
110
|
+
* @param input - Compliance input object
|
|
111
|
+
* @returns ComplianceReport with overall score, per-module breakdown, and sorted recommendations
|
|
112
|
+
*/
|
|
113
|
+
declare function getComplianceScore(input: ComplianceInput): ComplianceReport;
|
|
114
|
+
|
|
115
|
+
export { type ComplianceInput as C, type EffortLevel as E, type ModuleScore as M, type Recommendation as R, type ComplianceRating as a, type ComplianceReport as b, type RecommendationPriority as c, type RegulatoryReference as d, getComplianceScore as g };
|