@tantainnovative/ndpr-toolkit 2.1.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/dist/{breach-6z0r-KuE.d.mts → breach-B_-6lDqS.d.mts} +1 -1
- package/dist/{breach-BFfnvtRk.d.ts → breach-CzXqSsaY.d.ts} +1 -1
- package/dist/{breach-BtFbDOmV.d.mts → breach-Eu9byel8.d.mts} +1 -1
- package/dist/{breach-BtFbDOmV.d.ts → breach-Eu9byel8.d.ts} +1 -1
- package/dist/breach.d.mts +81 -5
- package/dist/breach.d.ts +81 -5
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-4RGDNVR5.mjs +72 -0
- package/dist/chunk-6LM3RAFO.js +7 -0
- package/dist/chunk-7DNQSOER.js +2 -0
- package/dist/chunk-A7DRHSDQ.mjs +2 -0
- package/dist/chunk-FC6EG34C.js +72 -0
- package/dist/chunk-FDB6KZUD.mjs +2 -0
- package/dist/chunk-FZUCKGIM.mjs +7 -0
- package/dist/chunk-G3JNFZPT.js +2 -0
- package/dist/chunk-HXCRMA4J.mjs +2 -0
- package/dist/chunk-IC7VOOKJ.mjs +2 -0
- package/dist/chunk-ICUZG6CD.mjs +2 -0
- package/dist/chunk-IW5PHOG7.mjs +7 -0
- package/dist/chunk-JKEAPTYP.js +7 -0
- package/dist/chunk-N52S64SU.js +2 -0
- package/dist/chunk-SKAMVXBI.mjs +94 -0
- package/dist/chunk-VURIXCGY.js +2 -0
- package/dist/chunk-VXRY3V42.js +94 -0
- package/dist/chunk-YBPHGEL2.js +2 -0
- package/dist/consent.d.mts +68 -2
- package/dist/consent.d.ts +68 -2
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +10 -10
- package/dist/core.d.ts +10 -10
- package/dist/{cross-border-BrIy1ieh.d.ts → cross-border-BMcqLvjC.d.mts} +1 -1
- package/dist/{cross-border-BrIy1ieh.d.mts → cross-border-BMcqLvjC.d.ts} +1 -1
- package/dist/cross-border-entry-BfF7jw5o.d.mts +84 -0
- package/dist/cross-border-entry-CtX8_o-_.d.ts +84 -0
- package/dist/cross-border.d.mts +4 -58
- package/dist/cross-border.d.ts +4 -58
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/{dpia-vWfE_9bO.d.mts → dpia-5OQVA1R_.d.mts} +1 -1
- package/dist/{dpia-vWfE_9bO.d.ts → dpia-5OQVA1R_.d.ts} +1 -1
- package/dist/{dpia-fdtTd2DI.d.ts → dpia-B0Pok5us.d.ts} +1 -1
- package/dist/{dpia-B9ZZJG5a.d.mts → dpia-CUfOmzvX.d.mts} +1 -1
- package/dist/dpia.d.mts +105 -5
- package/dist/dpia.d.ts +105 -5
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/{dsr-pQzQ3H1O.d.mts → dsr-Cm9lzWG7.d.mts} +1 -1
- package/dist/{dsr-pQzQ3H1O.d.ts → dsr-Cm9lzWG7.d.ts} +1 -1
- package/dist/{dsr-whPkiI0_.d.mts → dsr-D_eTNc4S.d.mts} +1 -1
- package/dist/{dsr-jq5NUEdz.d.ts → dsr-pNtVb1BK.d.ts} +1 -1
- package/dist/dsr.d.mts +66 -5
- package/dist/dsr.d.ts +66 -5
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +13 -13
- package/dist/hooks.d.ts +13 -13
- package/dist/index.d.mts +24 -24
- package/dist/index.d.ts +24 -24
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{lawful-basis-v04AhbK2.d.ts → lawful-basis-BEyI0kGg.d.ts} +2 -2
- package/dist/{lawful-basis-D-oXFizg.d.mts → lawful-basis-C2eGaoHM.d.mts} +2 -2
- package/dist/{lawful-basis-CWtvDG1x.d.mts → lawful-basis-Cv1VmDLn.d.mts} +1 -1
- package/dist/{lawful-basis-CWtvDG1x.d.ts → lawful-basis-Cv1VmDLn.d.ts} +1 -1
- package/dist/lawful-basis-entry-BeSX7u0U.d.ts +81 -0
- package/dist/lawful-basis-entry-CMPPM9Rh.d.mts +81 -0
- package/dist/lawful-basis.d.mts +5 -55
- package/dist/lawful-basis.d.ts +5 -55
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy-dmsRlqgM.d.ts +283 -0
- package/dist/policy-kZN23hrR.d.mts +283 -0
- package/dist/policy.d.mts +3 -193
- package/dist/policy.d.ts +3 -193
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/{ropa-Rb4dsFSz.d.mts → ropa-DP7pPPql.d.mts} +2 -2
- package/dist/{ropa-BebGfqKQ.d.ts → ropa-Li6UlL5H.d.ts} +2 -2
- package/dist/ropa-entry-CZJ91ymk.d.mts +71 -0
- package/dist/ropa-entry-DIEQ9WFs.d.ts +71 -0
- package/dist/ropa.d.mts +5 -45
- package/dist/ropa.d.ts +5 -45
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/unstyled.js +1 -1
- package/dist/unstyled.mjs +1 -1
- package/dist/{useBreach-WrZzJilM.d.mts → useBreach-BBSoIcZO.d.mts} +1 -1
- package/dist/{useBreach-vrh_XMpI.d.ts → useBreach-lFLbSyAN.d.ts} +1 -1
- package/dist/{useCrossBorderTransfer-TVnY8_UX.d.mts → useCrossBorderTransfer-BZVFCXfr.d.mts} +1 -1
- package/dist/{useCrossBorderTransfer-D4FQYfFt.d.ts → useCrossBorderTransfer-DmtACeqW.d.ts} +1 -1
- package/dist/{useDPIA-DFDHBLSa.d.ts → useDPIA-DBsg2yZx.d.ts} +1 -1
- package/dist/{useDPIA-FqPofFaV.d.mts → useDPIA-Da7-Q_yW.d.mts} +1 -1
- package/dist/{useDSR-DAqqOBXb.d.ts → useDSR-CYI7WCXr.d.ts} +1 -1
- package/dist/{useDSR-OXM5Q9rf.d.mts → useDSR-YYZ6FYFs.d.mts} +1 -1
- package/dist/{useLawfulBasis-RILM_xsx.d.ts → useLawfulBasis-CCWF9waR.d.ts} +2 -2
- package/dist/{useLawfulBasis-DNQ8YszQ.d.mts → useLawfulBasis-CpWuHtyh.d.mts} +2 -2
- package/dist/{useROPA-Bcs6cRdi.d.ts → useROPA-BhJ3kvHp.d.ts} +1 -1
- package/dist/{useROPA-nmcSiUYv.d.mts → useROPA-DLFdjkxP.d.mts} +1 -1
- package/package.json +22 -15
- package/dist/chunk-2XHD22J7.mjs +0 -7
- package/dist/chunk-4DKT6IB6.js +0 -94
- package/dist/chunk-6JFTAYXV.mjs +0 -2
- package/dist/chunk-6JVYYLS7.js +0 -2
- package/dist/chunk-6SGG6WPA.mjs +0 -2
- package/dist/chunk-AQEGDEQM.js +0 -7
- package/dist/chunk-C2IJWCZQ.mjs +0 -2
- package/dist/chunk-FFW7RUAG.mjs +0 -94
- package/dist/chunk-FK3CSFLJ.js +0 -2
- package/dist/chunk-JUN6YPLL.mjs +0 -72
- package/dist/chunk-L3FKTBGV.js +0 -72
- package/dist/chunk-RB26MIRI.js +0 -2
- package/dist/chunk-RHWW5FDP.js +0 -16
- package/dist/chunk-SLNMKGQ2.mjs +0 -2
- package/dist/chunk-UUWVBENC.js +0 -2
- package/dist/chunk-XMKA6GVK.mjs +0 -16
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';var chunkVURIXCGY_js=require('./chunk-VURIXCGY.js'),jsxRuntime=require('react/jsx-runtime'),F=require('react');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var F__default=/*#__PURE__*/_interopDefault(F);var E=({sections:d,answers:k,onAnswerChange:x,currentSectionIndex:b,onNextSection:w,onPrevSection:C,validationErrors:R={},readOnly:p=false,className:I="",buttonClassName:P="",nextButtonText:n="Next",prevButtonText:N="Previous",submitButtonText:h="Submit",showProgress:o=true,progress:y,classNames:$={},unstyled:S=false})=>{let v=d[b],i=b===d.length-1,a=(e,m)=>chunkVURIXCGY_js.a(e,m?$[m]:void 0,S),u=e=>e.showWhen?e.showWhen.every(m=>{let c=k[m.questionId];switch(m.operator){case "equals":return c===m.value;case "contains":return Array.isArray(c)?c.includes(m.value):false;case "greaterThan":return typeof c=="number"?c>m.value:false;case "lessThan":return typeof c=="number"?c<m.value:false;default:return true}}):true,A=e=>a(`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-blue-500 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100`,"input"),L=e=>{if(!u(e))return null;let m=R[e.id],c=k[e.id];return jsxRuntime.jsxs("div",{className:a("mb-6","question"),children:[jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:a("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:a("mt-1 text-sm text-gray-500 dark:text-gray-400","guidance"),children:e.guidance})]}),e.type==="text"&&jsxRuntime.jsx("input",{type:"text",id:e.id,value:c||"",onChange:s=>x(e.id,s.target.value),disabled:p,className:A(m)}),e.type==="textarea"&&jsxRuntime.jsx("textarea",{id:e.id,value:c||"",onChange:s=>x(e.id,s.target.value),disabled:p,rows:4,className:A(m)}),e.type==="select"&&e.options&&jsxRuntime.jsxs("select",{id:e.id,value:c||"",onChange:s=>x(e.id,s.target.value),disabled:p,className:A(m),children:[jsxRuntime.jsx("option",{value:"",children:"Select an option"}),e.options.map(s=>jsxRuntime.jsx("option",{value:s.value,children:s.label},s.value))]}),e.type==="radio"&&e.options&&jsxRuntime.jsx("div",{className:a("space-y-2","radioGroup"),children:e.options.map(s=>jsxRuntime.jsxs("div",{className:a("flex items-center","radioOption"),children:[jsxRuntime.jsx("input",{type:"radio",id:`${e.id}_${s.value}`,name:e.id,value:s.value,checked:c===s.value,onChange:()=>x(e.id,s.value),disabled:p,className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600"}),jsxRuntime.jsxs("label",{htmlFor:`${e.id}_${s.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:[s.label,s.riskLevel&&jsxRuntime.jsxs("span",{className:`ml-2 text-xs px-2 py-1 rounded ${s.riskLevel==="low"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":s.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:[s.riskLevel.charAt(0).toUpperCase()+s.riskLevel.slice(1)," Risk"]})]})]},s.value))}),e.type==="checkbox"&&e.options&&jsxRuntime.jsx("div",{className:"space-y-2",children:e.options.map(s=>jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"checkbox",id:`${e.id}_${s.value}`,value:s.value,checked:Array.isArray(c)?c.includes(s.value):false,onChange:B=>{let Q=Array.isArray(c)?[...c]:[];B.target.checked?x(e.id,[...Q,s.value]):x(e.id,Q.filter(j=>j!==s.value));},disabled:p,className:"h-4 w-4 rounded text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600"}),jsxRuntime.jsx("label",{htmlFor:`${e.id}_${s.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:s.label})]},s.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(([s,B])=>jsxRuntime.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 text-center",style:{width:`${100/Object.keys(e.scaleLabels||{}).length}%`},children:B},s))}),jsxRuntime.jsx("input",{type:"range",id:e.id,min:e.minValue||1,max:e.maxValue||5,value:c||e.minValue||1,onChange:s=>x(e.id,parseInt(s.target.value,10)),disabled:p,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-500 dark:text-gray-400 text-center",children:["Selected value: ",c||e.minValue||1]})]}),m&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:m})]},e.id)};return v?jsxRuntime.jsxs("div",{className:`${a("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6","root")} ${I}`,children:[o&&jsxRuntime.jsxs("div",{className:a("mb-6","header"),children:[jsxRuntime.jsxs("div",{className:"flex justify-between text-sm text-gray-500 dark:text-gray-400 mb-1",children:[jsxRuntime.jsxs("span",{children:["Section ",b+1," of ",d.length]}),jsxRuntime.jsx("span",{children:y!==void 0?`${y}% Complete`:""})]}),jsxRuntime.jsx("div",{className:a("w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700","progressBar"),children:jsxRuntime.jsx("div",{className:"bg-blue-600 h-2.5 rounded-full",style:{width:`${y!==void 0?y:(b+1)/d.length*100}%`}})})]}),jsxRuntime.jsx("h2",{className:a("text-xl font-bold mb-2 text-gray-900 dark:text-white","title"),children:v.title}),v.description&&jsxRuntime.jsx("p",{className:a("mb-6 text-gray-600 dark:text-gray-300","sectionTitle"),children:v.description}),jsxRuntime.jsx("div",{className:a("space-y-6","section"),children:v.questions.map(e=>L(e))}),jsxRuntime.jsxs("div",{className:a("mt-8 flex justify-between","navigation"),children:[jsxRuntime.jsx("button",{type:"button",onClick:C,disabled:b===0||p,className:`${a("px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed","prevButton")} ${P}`,children:N}),jsxRuntime.jsx("button",{type:"button",onClick:w,disabled:p,className:`${a("px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed","nextButton")} ${P}`,children:i?h:n})]})]}):jsxRuntime.jsx("div",{children:"No section found."})};var U=({result:d,sections:k,showFullReport:x=true,allowPrint:b=true,allowExport:w=true,onExport:C,className:R="",buttonClassName:p="",classNames:I={},unstyled:P=false})=>{let n=(i,a)=>chunkVURIXCGY_js.a(i,a?I[a]:void 0,P),N=i=>new Date(i).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),y=i=>{let a=d.answers[i];return a==null?"Not answered":typeof a=="boolean"?a?"Yes":"No":Array.isArray(a)?a.join(", "):String(a)},$=()=>{window.print();},S=i=>{C&&C(i);},v=i=>jsxRuntime.jsx("span",{className:n(`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"}[i]}`,"riskBadge"),children:i.charAt(0).toUpperCase()+i.slice(1)});return jsxRuntime.jsxs("div",{className:`${n("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 print:shadow-none print:p-0","root")} ${R}`,children:[jsxRuntime.jsxs("div",{className:n("mb-8 border-b border-gray-200 dark:border-gray-700 pb-6 print:pb-4","header"),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:n("text-2xl font-bold text-gray-900 dark:text-white mb-2","title"),children:"Data Protection Impact Assessment Report"}),jsxRuntime.jsx("h2",{className:"text-xl text-gray-700 dark:text-gray-300 mb-4",children:d.title})]}),(b||w)&&jsxRuntime.jsxs("div",{className:"flex space-x-2 print:hidden",children:[b&&jsxRuntime.jsx("button",{onClick:$,className:`${n("px-3 py-1 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600","printButton")} ${p}`,children:jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})}),"Print"]})}),w&&jsxRuntime.jsx("div",{className:"relative inline-block",children:jsxRuntime.jsx("button",{onClick:()=>S("pdf"),className:`px-3 py-1 bg-blue-600 text-white rounded hover:bg-blue-700 ${p}`,children:jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Export PDF"]})})})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Assessor:"})," ",d.assessor.name,", ",d.assessor.role]}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Contact:"})," ",d.assessor.email]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Started:"})," ",N(d.startedAt)]}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Completed:"})," ",d.completedAt?N(d.completedAt):"In progress"]}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next review:"})," ",d.reviewDate?N(d.reviewDate):"Not scheduled"]})]})]})]}),jsxRuntime.jsxs("div",{className:n("mb-8","summary"),children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Executive Summary"}),jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium mr-2",children:"Overall Risk Level:"}),v(d.overallRiskLevel)]}),jsxRuntime.jsxs("div",{className:n("mb-2","conclusion"),children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Conclusion:"})," ",d.conclusion]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Can Proceed:"})," ",d.canProceed?"Yes":"No"]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Processing Activity Description"}),jsxRuntime.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-4",children:d.processingDescription}),d.recommendations&&d.recommendations.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Key Recommendations"}),jsxRuntime.jsx("ul",{className:"list-disc pl-5 text-gray-700 dark:text-gray-300",children:d.recommendations.map((i,a)=>jsxRuntime.jsx("li",{className:n("","recommendation"),children:i},a))})]})]})]}),jsxRuntime.jsxs("div",{className:"mb-8",children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Identified Risks"}),d.risks.length===0?jsxRuntime.jsx("p",{className:"text-gray-700 dark:text-gray-300",children:"No risks identified."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:n("min-w-full divide-y divide-gray-200 dark:divide-gray-700","riskTable"),children:[jsxRuntime.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Risk"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Likelihood"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Impact"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Risk Level"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Mitigated"})]})}),jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:d.risks.map(i=>jsxRuntime.jsxs("tr",{className:n("","riskRow"),children:[jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:i.description}),jsxRuntime.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400",children:[i.likelihood," / 5"]}),jsxRuntime.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400",children:[i.impact," / 5"]}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:v(i.level)}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400",children:i.mitigated?jsxRuntime.jsx("span",{className:"text-green-600 dark:text-green-400",children:"Yes"}):jsxRuntime.jsx("span",{className:"text-red-600 dark:text-red-400",children:"No"})})]},i.id))})]})})]}),x&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Full Assessment Details"}),k.map(i=>{let a=i.questions.filter(u=>d.answers[u.id]!==void 0);return a.length===0?null:jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:i.title}),jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[jsxRuntime.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Question"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Answer"})]})}),jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:a.map(u=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:u.text}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-500 dark:text-gray-400",children:y(u.id)})]},u.id))})]})})]},i.id)})]}),jsxRuntime.jsxs("div",{className:"mt-8 pt-4 border-t border-gray-200 dark:border-gray-700 text-sm text-gray-500 dark:text-gray-400",children:[jsxRuntime.jsx("p",{children:"This DPIA was conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023."}),jsxRuntime.jsxs("p",{children:["DPIA Report Version: ",d.version]}),jsxRuntime.jsxs("p",{children:["Generated on: ",new Date().toLocaleDateString()]})]})]})};var K=({steps:d,onStepClick:k,clickable:x=true,orientation:b="horizontal",className:w="",activeStepClassName:C="",completedStepClassName:R="",incompleteStepClassName:p="",classNames:I={},unstyled:P=false})=>{let n=(o,y)=>chunkVURIXCGY_js.a(o,y?I[y]:void 0,P),N=o=>{x&&k&&k(o);},h=b==="vertical";return jsxRuntime.jsx("div",{className:`${n(h?"flex flex-col space-y-4":"flex items-center justify-between","root")} ${w}`,children:d.map((o,y)=>{let $=y===d.length-1,S=o.active?n(`font-medium ${C||"text-blue-600 dark:text-blue-400"}`,"label"):o.completed?n(R||"text-green-600 dark:text-green-400","label"):n(p||"text-gray-500 dark:text-gray-400","label"),v=o.active?n("flex items-center justify-center w-8 h-8 rounded-full bg-blue-100 dark:bg-blue-900 text-blue-600 dark:text-blue-400 border-2 border-blue-600 dark:border-blue-400","stepActive"):o.completed?n("flex items-center justify-center w-8 h-8 rounded-full bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-400 border-2 border-green-600 dark:border-green-400","stepCompleted"):n("flex items-center justify-center w-8 h-8 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 border-2 border-gray-300 dark:border-gray-600","stepPending");return jsxRuntime.jsxs(F__default.default.Fragment,{children:[jsxRuntime.jsxs("div",{className:n(`${h?"flex items-start":"flex flex-col items-center"} ${x?"cursor-pointer":""}`,"step"),onClick:()=>N(o.id),children:[jsxRuntime.jsx("div",{className:`
|
|
2
|
+
flex items-center justify-center
|
|
3
|
+
${h?"mr-4":""}
|
|
4
|
+
`,children:jsxRuntime.jsx("div",{className:v,children:o.icon?o.icon:o.completed?jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):jsxRuntime.jsx("span",{children:y+1})})}),jsxRuntime.jsxs("div",{className:`
|
|
5
|
+
${h?"flex-1":"mt-2 text-center"}
|
|
6
|
+
`,children:[jsxRuntime.jsx("div",{className:`text-sm font-medium ${S}`,children:o.label}),o.description&&jsxRuntime.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:o.description})]})]}),!$&&jsxRuntime.jsx("div",{className:n(h?"ml-4 h-8 border-l-2 border-gray-300 dark:border-gray-600":"w-full border-t-2 border-gray-300 dark:border-gray-600 hidden sm:block","connector")})]},o.id)})})};exports.a=E;exports.b=U;exports.c=K;//# sourceMappingURL=chunk-6LM3RAFO.js.map
|
|
7
|
+
//# sourceMappingURL=chunk-6LM3RAFO.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkTDDAYVKK_js=require('./chunk-TDDAYVKK.js'),chunkVURIXCGY_js=require('./chunk-VURIXCGY.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var F={name:"",description:"",lawfulBasis:"consent",lawfulBasisJustification:"",dataCategories:"",involvesSensitiveData:false,sensitiveDataCondition:"",dataSubjectCategories:"",purposes:"",retentionPeriod:"",retentionJustification:"",recipients:"",crossBorderTransfer:false,reviewDate:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""},H=[{value:"consent",label:"Consent"},{value:"contract",label:"Contract"},{value:"legal_obligation",label:"Legal Obligation"},{value:"vital_interests",label:"Vital Interests"},{value:"public_interest",label:"Public Interest"},{value:"legitimate_interests",label:"Legitimate Interests"}],Y=[{value:"explicit_consent",label:"Explicit Consent"},{value:"employment_law",label:"Employment Law"},{value:"vital_interests_incapable",label:"Vital Interests (Incapable)"},{value:"nonprofit_legitimate",label:"Nonprofit Legitimate Activities"},{value:"publicly_available",label:"Publicly Available Data"},{value:"legal_claims",label:"Legal Claims"},{value:"substantial_public_interest",label:"Substantial Public Interest"},{value:"health_purposes",label:"Health Purposes"},{value:"public_health",label:"Public Health"},{value:"archiving_research",label:"Archiving / Research"}],fe=({activities:v,onAddActivity:_,onUpdateActivity:N,onArchiveActivity:j,title:W="Lawful Basis Tracker",description:q="Document and track the lawful basis for each processing activity as required by NDPA 2023 Section 25.",className:z="",buttonClassName:f="",showSummary:K=true,showComplianceGaps:Q=true,classNames:i,unstyled:n})=>{let[y,m]=react.useState("list"),[a,u]=react.useState(F),[h,S]=react.useState(null),[I,X]=react.useState(null),[k,Z]=react.useState("all"),[C,ee]=react.useState("all"),[A,te]=react.useState(""),[J,x]=react.useState([]),[R,ie]=react.useState(v);react.useEffect(()=>{let t=[...v];if(k!=="all"&&(t=t.filter(d=>d.status===k)),C!=="all"&&(t=t.filter(d=>d.lawfulBasis===C)),A){let d=A.toLowerCase();t=t.filter(s=>s.name.toLowerCase().includes(d)||s.description.toLowerCase().includes(d)||s.purposes.some(b=>b.toLowerCase().includes(d)));}t.sort((d,s)=>s.updatedAt-d.updatedAt),ie(t);},[v,k,C,A]);let w=t=>new Date(t).toLocaleDateString(),D=chunkTDDAYVKK_js.d(v),P=chunkTDDAYVKK_js.c(v),B=t=>t.split(",").map(d=>d.trim()).filter(d=>d.length>0),re=()=>{u(F),S(null),x([]),m("form");},E=t=>{u({name:t.name,description:t.description,lawfulBasis:t.lawfulBasis,lawfulBasisJustification:t.lawfulBasisJustification,dataCategories:t.dataCategories.join(", "),involvesSensitiveData:t.involvesSensitiveData,sensitiveDataCondition:t.sensitiveDataCondition||"",dataSubjectCategories:t.dataSubjectCategories.join(", "),purposes:t.purposes.join(", "),retentionPeriod:t.retentionPeriod,retentionJustification:t.retentionJustification||"",recipients:(t.recipients||[]).join(", "),crossBorderTransfer:t.crossBorderTransfer,reviewDate:t.reviewDate?new Date(t.reviewDate).toISOString().split("T")[0]:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""}),S(t.id),x([]),m("form");},ae=()=>{let t={name:a.name,description:a.description,lawfulBasis:a.lawfulBasis,lawfulBasisJustification:a.lawfulBasisJustification,dataCategories:B(a.dataCategories),involvesSensitiveData:a.involvesSensitiveData,sensitiveDataCondition:a.sensitiveDataCondition||void 0,dataSubjectCategories:B(a.dataSubjectCategories),purposes:B(a.purposes),retentionPeriod:a.retentionPeriod,retentionJustification:a.retentionJustification||void 0,recipients:a.recipients?B(a.recipients):void 0,crossBorderTransfer:a.crossBorderTransfer,reviewDate:a.reviewDate?new Date(a.reviewDate).getTime():void 0,status:"active"},d=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{id:h||"temp",createdAt:Date.now(),updatedAt:Date.now()}),s=chunkTDDAYVKK_js.a(d);if(!s.isValid){x(s.errors);return}h&&N?N(h,t):_&&_(t),u(F),S(null),x([]),m("list");},O=t=>{j&&j(t);},oe=t=>{X(t),m("detail");},l=I?v.find(t=>t.id===I):null,V=t=>{let d={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",inactive:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",under_review:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",archived:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"},s={active:"Active",inactive:"Inactive",under_review:"Under Review",archived:"Archived"};return jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a(`px-2 py-1 rounded text-xs font-medium ${d[t]}`,i==null?void 0:i.statusBadge,n),children:s[t]})},$=t=>{let d={consent:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",contract:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",legal_obligation:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",vital_interests:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",public_interest:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",legitimate_interests:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},s={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${d[t]}`,children:s[t]})},M=t=>t.dpoApproval?t.dpoApproval.approved?jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"Approved"}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",children:"Pending Approval"}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400",children:"No DPO Review"}),ne=()=>jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",i==null?void 0:i.summary,n),children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",i==null?void 0:i.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:D.totalActivities}),jsxRuntime.jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Total Activities"})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-orange-50 dark:bg-orange-900/20 p-4 rounded-lg",i==null?void 0:i.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-orange-800 dark:text-orange-200",children:D.sensitiveDataActivities}),jsxRuntime.jsx("p",{className:"text-sm text-orange-600 dark:text-orange-300",children:"Sensitive Data"})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",i==null?void 0:i.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:D.crossBorderActivities}),jsxRuntime.jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Cross-Border Transfers"})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",i==null?void 0:i.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:D.activitiesWithoutApproval.length}),jsxRuntime.jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"Pending Approval"})]})]}),le=()=>{if(P.length===0)return jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-4 rounded-lg mb-6",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"No compliance gaps detected."}),jsxRuntime.jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"All processing activities appear to be properly documented."})]});let t=P.filter(s=>s.severity==="high"),d=P.filter(s=>s.severity==="medium");return jsxRuntime.jsxs("div",{className:"mb-6",children:[t.length>0&&jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-3",i==null?void 0:i.gapAlert,n),children:[jsxRuntime.jsxs("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:["High Priority (",t.length,")"]}),jsxRuntime.jsx("ul",{className:"space-y-1",children:t.map((s,b)=>jsxRuntime.jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:s.description},b))})]}),d.length>0&&jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",i==null?void 0:i.gapAlert,n),children:[jsxRuntime.jsxs("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-2",children:["Medium Priority (",d.length,")"]}),jsxRuntime.jsx("ul",{className:"space-y-1",children:d.map((s,b)=>jsxRuntime.jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:s.description},b))})]})]})},de=()=>jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("",i==null?void 0:i.form,n),children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("flex justify-between items-center mb-4",i==null?void 0:i.header,n),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:h?"Edit Processing Activity":"New Processing Activity"}),jsxRuntime.jsx("button",{onClick:()=>{m("list"),x([]);},className:`px-4 py-2 text-gray-600 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${f}`,children:"Cancel"})]}),J.length>0&&jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:"Please correct the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside space-y-1",children:J.map((t,d)=>jsxRuntime.jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:t},d))})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"activityName",className:"block text-sm font-medium mb-1",children:"Activity Name *"}),jsxRuntime.jsx("input",{type:"text",id:"activityName",value:a.name,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{name:t.target.value})),placeholder:"e.g., Customer Account Management",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"activityDescription",className:"block text-sm font-medium mb-1",children:"Description *"}),jsxRuntime.jsx("textarea",{id:"activityDescription",value:a.description,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{description:t.target.value})),placeholder:"Describe what processing is performed...",rows:3,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasis",className:"block text-sm font-medium mb-1",children:"Lawful Basis (NDPA Section 25) *"}),jsxRuntime.jsx("select",{id:"lawfulBasis",value:a.lawfulBasis,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{lawfulBasis:t.target.value})),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.select,n),children:H.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:chunkTDDAYVKK_js.b(a.lawfulBasis)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:"Lawful Basis Justification *"}),jsxRuntime.jsx("textarea",{id:"justification",value:a.lawfulBasisJustification,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{lawfulBasisJustification:t.target.value})),placeholder:"Document why this lawful basis applies to this processing activity...",rows:3,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),a.lawfulBasis==="legitimate_interests"&&jsxRuntime.jsxs("div",{className:"border border-indigo-200 dark:border-indigo-800 rounded-lg p-4 bg-indigo-50 dark:bg-indigo-900/20",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-indigo-800 dark:text-indigo-200 mb-3",children:"Legitimate Interest Assessment (LIA)"}),jsxRuntime.jsx("p",{className:"text-xs text-indigo-600 dark:text-indigo-300 mb-4",children:"NDPA Section 25(1)(f) requires a balancing test when relying on legitimate interests."}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaPurpose",className:"block text-sm font-medium mb-1",children:"Purpose Test"}),jsxRuntime.jsx("textarea",{id:"liaPurpose",value:a.liaPurposeTest,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{liaPurposeTest:t.target.value})),placeholder:"Describe the legitimate interest being pursued...",rows:2,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaNecessity",className:"block text-sm font-medium mb-1",children:"Necessity Test"}),jsxRuntime.jsx("textarea",{id:"liaNecessity",value:a.liaNecessityTest,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{liaNecessityTest:t.target.value})),placeholder:"Explain why this processing is necessary for the stated purpose...",rows:2,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaBalancing",className:"block text-sm font-medium mb-1",children:"Balancing Test"}),jsxRuntime.jsx("textarea",{id:"liaBalancing",value:a.liaBalancingTest,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{liaBalancingTest:t.target.value})),placeholder:"Assess the impact on data subjects' rights and interests...",rows:2,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaSafeguards",className:"block text-sm font-medium mb-1",children:"Safeguards"}),jsxRuntime.jsx("input",{type:"text",id:"liaSafeguards",value:a.liaSafeguards,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{liaSafeguards:t.target.value})),placeholder:"List safeguards (comma-separated)...",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaConclusion",className:"block text-sm font-medium mb-1",children:"Conclusion"}),jsxRuntime.jsx("textarea",{id:"liaConclusion",value:a.liaConclusion,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{liaConclusion:t.target.value})),placeholder:"State your overall conclusion...",rows:2,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataCategories",className:"block text-sm font-medium mb-1",children:"Data Categories *"}),jsxRuntime.jsx("input",{type:"text",id:"dataCategories",value:a.dataCategories,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{dataCategories:t.target.value})),placeholder:"e.g., Name, Email, Phone Number (comma-separated)",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsxs("label",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:a.involvesSensitiveData,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{involvesSensitiveData:t.target.checked,sensitiveDataCondition:t.target.checked?a.sensitiveDataCondition:""})),className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Involves Sensitive Personal Data (NDPA Section 27)"})]})}),a.involvesSensitiveData&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sensitiveCondition",className:"block text-sm font-medium mb-1",children:"Sensitive Data Condition (NDPA Section 27) *"}),jsxRuntime.jsxs("select",{id:"sensitiveCondition",value:a.sensitiveDataCondition,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{sensitiveDataCondition:t.target.value})),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.select,n),children:[jsxRuntime.jsx("option",{value:"",children:"Select a condition..."}),Y.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSubjectCategories",className:"block text-sm font-medium mb-1",children:"Data Subject Categories *"}),jsxRuntime.jsx("input",{type:"text",id:"dataSubjectCategories",value:a.dataSubjectCategories,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{dataSubjectCategories:t.target.value})),placeholder:"e.g., Customers, Employees, Vendors (comma-separated)",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"purposes",className:"block text-sm font-medium mb-1",children:"Processing Purposes *"}),jsxRuntime.jsx("input",{type:"text",id:"purposes",value:a.purposes,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{purposes:t.target.value})),placeholder:"e.g., Account management, Service delivery (comma-separated)",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionPeriod",className:"block text-sm font-medium mb-1",children:"Retention Period *"}),jsxRuntime.jsx("input",{type:"text",id:"retentionPeriod",value:a.retentionPeriod,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{retentionPeriod:t.target.value})),placeholder:"e.g., 3 years after account closure",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionJustification",className:"block text-sm font-medium mb-1",children:"Retention Justification"}),jsxRuntime.jsx("input",{type:"text",id:"retentionJustification",value:a.retentionJustification,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{retentionJustification:t.target.value})),placeholder:"Reason for the retention period",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recipients",className:"block text-sm font-medium mb-1",children:"Recipients"}),jsxRuntime.jsx("input",{type:"text",id:"recipients",value:a.recipients,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{recipients:t.target.value})),placeholder:"e.g., Payment processor, Cloud provider (comma-separated)",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsxs("label",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:a.crossBorderTransfer,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{crossBorderTransfer:t.target.checked})),className:"rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Involves Cross-Border Transfer Outside Nigeria"})]})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"reviewDate",className:"block text-sm font-medium mb-1",children:"Next Review Date"}),jsxRuntime.jsx("input",{type:"date",id:"reviewDate",value:a.reviewDate,onChange:t=>u(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{reviewDate:t.target.value})),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxRuntime.jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[jsxRuntime.jsx("button",{onClick:()=>{m("list"),x([]);},className:`px-4 py-2 text-gray-600 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${f}`,children:"Cancel"}),jsxRuntime.jsx("button",{onClick:ae,className:chunkVURIXCGY_js.a(`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${f}`,i==null?void 0:i.submitButton,n),children:h?"Update Activity":"Create Activity"})]})]})]}),se=()=>{var d;if(!l)return 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-500 dark:text-gray-400",children:"Activity not found."})});let t=chunkTDDAYVKK_js.a(l);return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{onClick:()=>m("list"),className:"text-sm text-blue-600 dark:text-blue-400 hover:underline mb-2",children:"Back to list"}),jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:l.name})]}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[$(l.lawfulBasis),V(l.status),M(l)]})]}),t.warnings.length>0&&jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-1",children:"Warnings"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside space-y-1",children:t.warnings.map((s,b)=>jsxRuntime.jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:s},b))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Description:"})," ",l.description]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Lawful Basis:"})," ",chunkTDDAYVKK_js.b(l.lawfulBasis)]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})," ",l.lawfulBasisJustification]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Categories:"})," ",l.dataCategories.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subject Categories:"})," ",l.dataSubjectCategories.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Purposes:"})," ",l.purposes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Retention Period:"})," ",l.retentionPeriod,l.retentionJustification&&jsxRuntime.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[" ","(",l.retentionJustification,")"]})]})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",l.involvesSensitiveData?"Yes":"No",l.sensitiveDataCondition&&jsxRuntime.jsxs("span",{children:[" ","(Condition:"," ",((d=Y.find(s=>s.value===l.sensitiveDataCondition))==null?void 0:d.label)||l.sensitiveDataCondition,")"]})]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Cross-Border Transfer:"})," ",l.crossBorderTransfer?"Yes":"No"]}),l.recipients&&l.recipients.length>0&&jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Recipients:"})," ",l.recipients.join(", ")]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Created:"})," ",w(l.createdAt)]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Last Updated:"})," ",w(l.updatedAt)]}),l.reviewDate&&jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next Review:"})," ",w(l.reviewDate),l.reviewDate<Date.now()&&jsxRuntime.jsx("span",{className:"text-red-600 dark:text-red-400 font-medium",children:" (Overdue)"})]})]})]}),l.dpoApproval&&jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-6",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold mb-2",children:"DPO Approval"}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",l.dpoApproval.approved?"Approved":"Not Approved"]}),jsxRuntime.jsxs("p",{className:"text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Approved By:"})," ",l.dpoApproval.approvedBy]}),jsxRuntime.jsxs("p",{className:"text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Date:"})," ",w(l.dpoApproval.approvedAt)]}),l.dpoApproval.notes&&jsxRuntime.jsxs("p",{className:"text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notes:"})," ",l.dpoApproval.notes]})]}),jsxRuntime.jsxs("div",{className:"flex space-x-3",children:[jsxRuntime.jsx("button",{onClick:()=>E(l),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${f}`,children:"Edit"}),l.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>O(l.id),className:`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 ${f}`,children:"Archive"})]})]})},ue=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"basisFilter",className:"block text-sm font-medium mb-1",children:"Lawful Basis"}),jsxRuntime.jsxs("select",{id:"basisFilter",value:C,onChange:t=>ee(t.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.select,n),children:[jsxRuntime.jsx("option",{value:"all",children:"All Bases"}),H.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilterSelect",className:"block text-sm font-medium mb-1",children:"Status"}),jsxRuntime.jsxs("select",{id:"statusFilterSelect",value:k,onChange:t=>Z(t.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.select,n),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),jsxRuntime.jsx("option",{value:"active",children:"Active"}),jsxRuntime.jsx("option",{value:"inactive",children:"Inactive"}),jsxRuntime.jsx("option",{value:"under_review",children:"Under Review"}),jsxRuntime.jsx("option",{value:"archived",children:"Archived"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"searchInput",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchInput",value:A,onChange:t=>te(t.target.value),placeholder:"Search activities...",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",i==null?void 0:i.input,n)})]}),jsxRuntime.jsx("div",{className:"flex items-end",children:jsxRuntime.jsx("button",{onClick:re,className:chunkVURIXCGY_js.a(`w-full px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${f}`,i==null?void 0:i.submitButton,n),children:"Add Activity"})})]}),R.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center h-32 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No processing activities found."})}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkVURIXCGY_js.a("w-full text-sm text-left",i==null?void 0:i.table,n),children:[jsxRuntime.jsx("thead",{className:chunkVURIXCGY_js.a("text-xs uppercase bg-gray-50 dark:bg-gray-700",i==null?void 0:i.tableHeader,n),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Activity"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Status"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"DPO Approval"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Sensitive Data"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Last Updated"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{children:R.map(t=>jsxRuntime.jsxs("tr",{className:chunkVURIXCGY_js.a("border-b border-gray-200 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-700",i==null?void 0:i.tableRow,n),children:[jsxRuntime.jsxs("td",{className:"px-4 py-3",children:[jsxRuntime.jsx("button",{onClick:()=>oe(t.id),className:"font-medium text-blue-600 dark:text-blue-400 hover:underline text-left",children:t.name}),jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1 truncate max-w-xs",children:t.description})]}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:$(t.lawfulBasis)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:V(t.status)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:M(t)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsx("span",{className:`text-xs ${t.involvesSensitiveData?"text-orange-600 dark:text-orange-400 font-medium":"text-gray-500 dark:text-gray-400"}`,children:t.involvesSensitiveData?"Yes":"No"})}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-xs text-gray-500 dark:text-gray-400",children:w(t.updatedAt)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx("button",{onClick:()=>E(t),className:"text-xs text-blue-600 dark:text-blue-400 hover:underline",children:"Edit"}),t.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>O(t.id),className:"text-xs text-gray-600 dark:text-gray-400 hover:underline",children:"Archive"})]})})]},t.id))})]})})]});return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${z}`,i==null?void 0:i.root,n),children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",i==null?void 0:i.title,n),children:W}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:q}),K&&y==="list"&&ne(),Q&&y==="list"&&le(),y==="list"&&ue(),y==="form"&&de(),y==="detail"&&se()]})};exports.a=fe;//# sourceMappingURL=chunk-7DNQSOER.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-7DNQSOER.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b,d,c,a as a$2}from'./chunk-PYEX7DFR.mjs';import {a}from'./chunk-FDB6KZUD.mjs';import {a as a$1,b as b$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useMemo,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var I=[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_interest",label:"Public Interest (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}],Z=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"archived",label:"Archived"}],ke=[{value:"data_subject",label:"Directly from Data Subject"},{value:"third_party",label:"Third Party"},{value:"public_source",label:"Public Source"},{value:"other",label:"Other"}];function we(){let l=Date.now();return {id:`proc_${l}_${Math.random().toString(36).substring(2,11)}`,name:"",description:"",controllerDetails:{name:"",contact:"",address:""},lawfulBasis:"consent",lawfulBasisJustification:"",purposes:[],dataCategories:[],dataSubjectCategories:[],recipients:[],retentionPeriod:"",securityMeasures:[],dataSource:"data_subject",dpiaRequired:false,automatedDecisionMaking:false,status:"active",createdAt:l,updatedAt:l}}function ee(l){return l?new Date(l).toLocaleDateString():"N/A"}var Pe=({ropa:l,onAddRecord:R,onUpdateRecord:S,onArchiveRecord:P,title:te="Record of Processing Activities (ROPA)",description:re="Maintain a comprehensive record of all data processing activities as required by the NDPA 2023.",className:ae="",buttonClassName:A="",classNames:t,unstyled:d$1})=>{let[b$2,x]=useState("list"),[w,ie]=useState(""),[C,oe]=useState("all"),[D,de]=useState("all"),[n,f]=useState(null),[M,h]=useState([]),[O,L]=useState(""),[j,_]=useState(""),[E,T]=useState(""),[U,$]=useState(""),[J,q]=useState(""),[V,G]=useState(""),[z,H]=useState(""),c$1=useMemo(()=>b(l),[l]),v=useMemo(()=>d(l),[l]),W=useMemo(()=>{let a=[...l.records];if(C!=="all"&&(a=a.filter(r=>r.status===C)),D!=="all"&&(a=a.filter(r=>r.lawfulBasis===D)),w){let r=w.toLowerCase();a=a.filter(u=>u.name.toLowerCase().includes(r)||u.description.toLowerCase().includes(r)||u.dataCategories.some(m=>m.toLowerCase().includes(r))||u.department&&u.department.toLowerCase().includes(r));}return a},[l.records,C,D,w]);useEffect(()=>{n&&(L(n.purposes.join(", ")),_(n.dataCategories.join(", ")),T((n.sensitiveDataCategories||[]).join(", ")),$(n.dataSubjectCategories.join(", ")),q(n.recipients.join(", ")),G(n.securityMeasures.join(", ")),H((n.systemsUsed||[]).join(", ")));},[n==null?void 0:n.id]);let ne=()=>{let a=we();a.controllerDetails.name=l.organizationName,a.controllerDetails.contact=l.organizationContact,a.controllerDetails.address=l.organizationAddress,l.ndpcRegistrationNumber&&(a.controllerDetails.registrationNumber=l.ndpcRegistrationNumber),l.dpoDetails&&(a.controllerDetails.dpoContact=l.dpoDetails.email),f(a),h([]),x("form");},le=a=>{f(a$1({},a)),h([]),x("form");},p=a=>a.split(",").map(r=>r.trim()).filter(r=>r.length>0),ue=()=>{if(!n)return;let a=b$1(a$1({},n),{purposes:p(O),dataCategories:p(j),sensitiveDataCategories:p(E),dataSubjectCategories:p(U),recipients:p(J),securityMeasures:p(V),systemsUsed:p(z),updatedAt:Date.now()});a.sensitiveDataCategories&&a.sensitiveDataCategories.length===0&&(a.sensitiveDataCategories=void 0),a.systemsUsed&&a.systemsUsed.length===0&&(a.systemsUsed=void 0);let r=a$2(a);if(!r.valid){h(r.errors);return}l.records.find(m=>m.id===a.id)?S==null||S(a.id,a):R==null||R(a),f(null),h([]),x("list");},se=a=>{P==null||P(a);},ge=()=>{let a=c(l),r=new Blob([a],{type:"text/csv;charset=utf-8;"}),u=URL.createObjectURL(r),m=document.createElement("a");m.href=u,m.download=`ropa_${l.organizationName.replace(/\s+/g,"_").toLowerCase()}_${new Date().toISOString().slice(0,10)}.csv`,m.click(),setTimeout(()=>URL.revokeObjectURL(u),100);},K=()=>{f(null),h([]),x("list");},s=(a,r)=>{n&&f(u=>u&&b$1(a$1({},u),{[a]:r}));},F=(a,r)=>{n&&f(u=>u&&b$1(a$1({},u),{controllerDetails:b$1(a$1({},u.controllerDetails),{[a]:r})}));},ce=a=>!!a.nextReviewDate&&a.nextReviewDate<=Date.now(),me=a$1=>{let r={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",inactive:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},u={active:"Active",inactive:"Inactive",archived:"Archived"};return jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${r[a$1]}`,t==null?void 0:t.statusBadge,d$1),children:u[a$1]})},pe=a=>jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",children:{consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"}[a]}),be=()=>jsxs("div",{className:a("mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",t==null?void 0:t.orgInfo,d$1),children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Organization"}),jsx("p",{className:"text-sm font-semibold",children:l.organizationName})]}),l.dpoDetails&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Data Protection Officer"}),jsx("p",{className:"text-sm font-semibold",children:l.dpoDetails.name}),jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:l.dpoDetails.email})]}),l.ndpcRegistrationNumber&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"NDPC Registration No."}),jsx("p",{className:"text-sm font-semibold",children:l.ndpcRegistrationNumber})]})]}),jsxs("div",{className:"mt-2 text-xs text-gray-500 dark:text-gray-400",children:["Version ",l.version," | Last Updated: ",ee(l.lastUpdated)]})]}),xe=()=>jsxs("div",{className:a("mb-6",t==null?void 0:t.summary,d$1),children:[jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[jsxs("div",{className:a("p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center",t==null?void 0:t.summaryCard,d$1),children:[jsx("p",{className:"text-2xl font-bold text-blue-700 dark:text-blue-300",children:c$1.totalRecords}),jsx("p",{className:"text-xs text-blue-600 dark:text-blue-400",children:"Total Records"})]}),jsxs("div",{className:a("p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center",t==null?void 0:t.summaryCard,d$1),children:[jsx("p",{className:"text-2xl font-bold text-green-700 dark:text-green-300",children:c$1.activeRecords}),jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"Active"})]}),jsxs("div",{className:a("p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center",t==null?void 0:t.summaryCard,d$1),children:[jsx("p",{className:"text-2xl font-bold text-purple-700 dark:text-purple-300",children:c$1.crossBorderRecords}),jsx("p",{className:"text-xs text-purple-600 dark:text-purple-400",children:"Cross-Border"})]}),jsxs("div",{className:a("p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center",t==null?void 0:t.summaryCard,d$1),children:[jsx("p",{className:"text-2xl font-bold text-orange-700 dark:text-orange-300",children:v.length}),jsx("p",{className:"text-xs text-orange-600 dark:text-orange-400",children:"Records with Gaps"})]})]}),jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm font-medium mb-2",children:"By Lawful Basis"}),I.map(a=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:a.label.split(" (")[0]}),jsx("span",{className:"font-medium",children:c$1.byLawfulBasis[a.value]||0})]},a.value))]}),jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm font-medium mb-2",children:"Risk Indicators"}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Sensitive Data"}),jsx("span",{className:"font-medium",children:c$1.sensitiveDataRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"DPIA Required"}),jsx("span",{className:"font-medium",children:c$1.dpiaRequiredRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Automated Decisions"}),jsx("span",{className:"font-medium",children:c$1.automatedDecisionRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Due for Review"}),jsx("span",{className:`font-medium ${c$1.recordsDueForReview.length>0?"text-red-600 dark:text-red-400":""}`,children:c$1.recordsDueForReview.length})]})]}),c$1.topDepartments.length>0&&jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm font-medium mb-2",children:"Top Departments"}),c$1.topDepartments.slice(0,5).map(a=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:a.department}),jsx("span",{className:"font-medium",children:a.count})]},a.department))]})]}),v.length>0&&jsxs("div",{className:a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md",t==null?void 0:t.complianceGap,d$1),children:[jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-2",children:"Compliance Gaps Detected"}),v.slice(0,5).map(a=>jsxs("div",{className:"mb-2",children:[jsx("p",{className:"text-xs font-medium text-red-700 dark:text-red-300",children:a.recordName}),jsx("ul",{className:"list-disc list-inside",children:a.gaps.map((r,u)=>jsx("li",{className:"text-xs text-red-600 dark:text-red-400",children:r},u))})]},a.recordId)),v.length>5&&jsxs("p",{className:"text-xs text-red-600 dark:text-red-400 mt-1",children:["...and ",v.length-5," more record(s) with gaps."]})]})]}),fe=()=>jsxs("div",{children:[jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"ropaSearch",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"ropaSearch",value:w,onChange:a=>ie(a.target.value),placeholder:"Search records...",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"ropaStatusFilter",className:"block text-sm font-medium mb-1",children:"Status"}),jsxs("select",{id:"ropaStatusFilter",value:C,onChange:a=>oe(a.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.select,d$1),children:[jsx("option",{value:"all",children:"All Statuses"}),Z.map(a=>jsx("option",{value:a.value,children:a.label},a.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"ropaBasisFilter",className:"block text-sm font-medium mb-1",children:"Lawful Basis"}),jsxs("select",{id:"ropaBasisFilter",value:D,onChange:a=>de(a.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.select,d$1),children:[jsx("option",{value:"all",children:"All Bases"}),I.map(a=>jsx("option",{value:a.value,children:a.label.split(" (")[0]},a.value))]})]}),jsxs("div",{className:"flex items-end space-x-2",children:[jsx("button",{onClick:ne,className:a(`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 text-sm ${A}`,t==null?void 0:t.submitButton,d$1),children:"Add Record"}),jsx("button",{onClick:ge,className:a(`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 text-sm ${A}`,t==null?void 0:t.exportButton,d$1),children:"Export CSV"})]})]}),W.length===0?jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm text-center py-8",children:"No processing records found."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a("w-full text-sm text-left",t==null?void 0:t.table,d$1),children:[jsx("thead",{className:a("text-xs uppercase bg-gray-50 dark:bg-gray-700",t==null?void 0:t.tableHeader,d$1),children:jsxs("tr",{children:[jsx("th",{className:"px-4 py-3",children:"Name"}),jsx("th",{className:"px-4 py-3",children:"Lawful Basis"}),jsx("th",{className:"px-4 py-3",children:"Data Categories"}),jsx("th",{className:"px-4 py-3",children:"Status"}),jsx("th",{className:"px-4 py-3",children:"Last Reviewed"}),jsx("th",{className:"px-4 py-3",children:"Actions"})]})}),jsx("tbody",{children:W.map(a$1=>{let r=ce(a$1),u=v.some(m=>m.recordId===a$1.id);return jsxs("tr",{className:a(`border-b dark:border-gray-600 ${r?"bg-red-50 dark:bg-red-900/10":u?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} hover:bg-gray-50 dark:hover:bg-gray-700`,t==null?void 0:t.tableRow,d$1),children:[jsx("td",{className:"px-4 py-3",children:jsxs("div",{children:[jsx("p",{className:"font-medium",children:a$1.name}),a$1.department&&jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:a$1.department}),r&&jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-medium",children:"Review Overdue"})]})}),jsx("td",{className:"px-4 py-3",children:pe(a$1.lawfulBasis)}),jsx("td",{className:"px-4 py-3",children:jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 max-w-xs truncate",children:a$1.dataCategories.join(", ")})}),jsx("td",{className:"px-4 py-3",children:me(a$1.status)}),jsx("td",{className:"px-4 py-3 text-xs text-gray-500 dark:text-gray-400",children:ee(a$1.lastReviewedAt)}),jsx("td",{className:"px-4 py-3",children:jsxs("div",{className:"flex space-x-2",children:[jsx("button",{onClick:()=>le(a$1),className:"text-blue-600 dark:text-blue-400 hover:underline text-xs",children:"Edit"}),a$1.status!=="archived"&&jsx("button",{onClick:()=>se(a$1.id),className:"text-gray-600 dark:text-gray-400 hover:underline text-xs",children:"Archive"})]})})]},a$1.id)})})]})})]}),ve=()=>{if(!n)return null;let a$1=!l.records.find(r=>r.id===n.id);return jsxs("div",{className:a("",t==null?void 0:t.form,d$1),children:[jsxs("div",{className:a("flex justify-between items-center mb-4",t==null?void 0:t.header,d$1),children:[jsx("h3",{className:"text-lg font-medium",children:a$1?"Add Processing Record":"Edit Processing Record"}),jsx("button",{onClick:K,className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 text-sm",children:"Cancel"})]}),M.length>0&&jsxs("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-md",children:[jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Please fix the following errors:"}),jsx("ul",{className:"list-disc list-inside",children:M.map((r,u)=>jsx("li",{className:"text-xs text-red-600 dark:text-red-400",children:r},u))})]}),jsxs("div",{className:"space-y-6",children:[jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Basic Information"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"recordName",className:"block text-sm font-medium mb-1",children:"Activity Name *"}),jsx("input",{type:"text",id:"recordName",value:n.name,onChange:r=>s("name",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1),placeholder:"e.g., Customer Account Management"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recordDepartment",className:"block text-sm font-medium mb-1",children:"Department"}),jsx("input",{type:"text",id:"recordDepartment",value:n.department||"",onChange:r=>s("department",r.target.value||void 0),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1),placeholder:"e.g., Marketing"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"recordDescription",className:"block text-sm font-medium mb-1",children:"Description *"}),jsx("textarea",{id:"recordDescription",value:n.description,onChange:r=>s("description",r.target.value),rows:3,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1),placeholder:"Describe what personal data processing is performed..."})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recordStatus",className:"block text-sm font-medium mb-1",children:"Status *"}),jsx("select",{id:"recordStatus",value:n.status,onChange:r=>s("status",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.select,d$1),children:Z.map(r=>jsx("option",{value:r.value,children:r.label},r.value))})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Controller Details"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"controllerName",className:"block text-sm font-medium mb-1",children:"Controller Name *"}),jsx("input",{type:"text",id:"controllerName",value:n.controllerDetails.name,onChange:r=>F("name",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"controllerContact",className:"block text-sm font-medium mb-1",children:"Controller Contact *"}),jsx("input",{type:"text",id:"controllerContact",value:n.controllerDetails.contact,onChange:r=>F("contact",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1)})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"controllerAddress",className:"block text-sm font-medium mb-1",children:"Controller Address *"}),jsx("input",{type:"text",id:"controllerAddress",value:n.controllerDetails.address,onChange:r=>F("address",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1)})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Lawful Basis (NDPA Section 25)"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasis",className:"block text-sm font-medium mb-1",children:"Lawful Basis *"}),jsx("select",{id:"lawfulBasis",value:n.lawfulBasis,onChange:r=>s("lawfulBasis",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.select,d$1),children:I.map(r=>jsx("option",{value:r.value,children:r.label},r.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasisJustification",className:"block text-sm font-medium mb-1",children:"Justification *"}),jsx("textarea",{id:"lawfulBasisJustification",value:n.lawfulBasisJustification,onChange:r=>s("lawfulBasisJustification",r.target.value),rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1),placeholder:"Explain why this lawful basis applies..."})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Data Details"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"purposes",className:"block text-sm font-medium mb-1",children:"Purposes * (comma-separated)"}),jsx("input",{type:"text",id:"purposes",value:O,onChange:r=>L(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1),placeholder:"e.g., Account management, Service delivery"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataCategories",className:"block text-sm font-medium mb-1",children:"Data Categories * (comma-separated)"}),jsx("input",{type:"text",id:"dataCategories",value:j,onChange:r=>_(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1),placeholder:"e.g., Name, Email, Phone number"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sensitiveData",className:"block text-sm font-medium mb-1",children:"Sensitive Data Categories (comma-separated)"}),jsx("input",{type:"text",id:"sensitiveData",value:E,onChange:r=>T(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1),placeholder:"e.g., Health data, Biometric data"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"subjectCategories",className:"block text-sm font-medium mb-1",children:"Data Subject Categories * (comma-separated)"}),jsx("input",{type:"text",id:"subjectCategories",value:U,onChange:r=>$(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1),placeholder:"e.g., Customers, Employees"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recipients",className:"block text-sm font-medium mb-1",children:"Recipients * (comma-separated)"}),jsx("input",{type:"text",id:"recipients",value:J,onChange:r=>q(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1),placeholder:"e.g., Payment processors, Cloud service providers"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataSource",className:"block text-sm font-medium mb-1",children:"Data Source *"}),jsx("select",{id:"dataSource",value:n.dataSource,onChange:r=>s("dataSource",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.select,d$1),children:ke.map(r=>jsx("option",{value:r.value,children:r.label},r.value))})]}),n.dataSource==="third_party"&&jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"thirdPartyDetails",className:"block text-sm font-medium mb-1",children:"Third-Party Source Details *"}),jsx("input",{type:"text",id:"thirdPartyDetails",value:n.thirdPartySourceDetails||"",onChange:r=>s("thirdPartySourceDetails",r.target.value||void 0),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1),placeholder:"Describe the third-party data source..."})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Retention and Security"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"retentionPeriod",className:"block text-sm font-medium mb-1",children:"Retention Period *"}),jsx("input",{type:"text",id:"retentionPeriod",value:n.retentionPeriod,onChange:r=>s("retentionPeriod",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1),placeholder:"e.g., 5 years after account closure"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"retentionJustification",className:"block text-sm font-medium mb-1",children:"Retention Justification"}),jsx("input",{type:"text",id:"retentionJustification",value:n.retentionJustification||"",onChange:r=>s("retentionJustification",r.target.value||void 0),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1),placeholder:"Why this retention period is necessary..."})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"securityMeasures",className:"block text-sm font-medium mb-1",children:"Security Measures * (comma-separated)"}),jsx("input",{type:"text",id:"securityMeasures",value:V,onChange:r=>G(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1),placeholder:"e.g., Encryption at rest, Access controls, Audit logging"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"systemsUsed",className:"block text-sm font-medium mb-1",children:"Systems Used (comma-separated)"}),jsx("input",{type:"text",id:"systemsUsed",value:z,onChange:r=>H(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1),placeholder:"e.g., CRM, ERP, Cloud Storage"})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Risk Indicators"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:"dpiaRequired",checked:n.dpiaRequired,onChange:r=>s("dpiaRequired",r.target.checked),className:"rounded border-gray-300 dark:border-gray-600"}),jsx("label",{htmlFor:"dpiaRequired",className:"text-sm font-medium",children:"DPIA Required"})]}),n.dpiaRequired&&jsxs("div",{children:[jsx("label",{htmlFor:"dpiaReference",className:"block text-sm font-medium mb-1",children:"DPIA Reference *"}),jsx("input",{type:"text",id:"dpiaReference",value:n.dpiaReference||"",onChange:r=>s("dpiaReference",r.target.value||void 0),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1),placeholder:"Reference to the completed DPIA"})]}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:"automatedDecisionMaking",checked:n.automatedDecisionMaking,onChange:r=>s("automatedDecisionMaking",r.target.checked),className:"rounded border-gray-300 dark:border-gray-600"}),jsx("label",{htmlFor:"automatedDecisionMaking",className:"text-sm font-medium",children:"Automated Decision-Making"})]}),n.automatedDecisionMaking&&jsxs("div",{children:[jsx("label",{htmlFor:"automatedDecisionMakingDetails",className:"block text-sm font-medium mb-1",children:"Automated Decision-Making Details *"}),jsx("textarea",{id:"automatedDecisionMakingDetails",value:n.automatedDecisionMakingDetails||"",onChange:r=>s("automatedDecisionMakingDetails",r.target.value||void 0),rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1),placeholder:"Describe the automated decision-making process..."})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Review Schedule"}),jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:jsxs("div",{children:[jsx("label",{htmlFor:"nextReviewDate",className:"block text-sm font-medium mb-1",children:"Next Review Date"}),jsx("input",{type:"date",id:"nextReviewDate",value:n.nextReviewDate?new Date(n.nextReviewDate).toISOString().slice(0,10):"",onChange:r=>s("nextReviewDate",r.target.value?new Date(r.target.value).getTime():void 0),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",t==null?void 0:t.input,d$1)})]})})]}),jsxs("div",{className:"flex justify-end space-x-3",children:[jsx("button",{onClick:K,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-700 text-sm",children:"Cancel"}),jsx("button",{onClick:ue,className:a(`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 text-sm ${A}`,t==null?void 0:t.submitButton,d$1),children:a$1?"Add Record":"Save Changes"})]})]})]})},ye=()=>jsxs("div",{className:"flex space-x-4 mb-6 border-b border-gray-200 dark:border-gray-600",children:[jsx("button",{onClick:()=>x("list"),className:`pb-2 text-sm font-medium ${b$2==="list"?"border-b-2 border-blue-500 text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Processing Records"}),jsx("button",{onClick:()=>x("summary"),className:`pb-2 text-sm font-medium ${b$2==="summary"?"border-b-2 border-blue-500 text-blue-600 dark:text-blue-400":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Compliance Summary"})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,t==null?void 0:t.root,d$1),children:[jsx("h2",{className:a("text-xl font-bold mb-2",t==null?void 0:t.title,d$1),children:te}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:re}),be(),b$2!=="form"&&ye(),b$2==="list"&&fe(),b$2==="summary"&&xe(),b$2==="form"&&ve()]})};export{Pe as a};//# sourceMappingURL=chunk-A7DRHSDQ.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-A7DRHSDQ.mjs.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';var chunkRYZEIDNR_js=require('./chunk-RYZEIDNR.js'),chunkVURIXCGY_js=require('./chunk-VURIXCGY.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var $e=({categories:h,onSubmit:v,title:D="Report a Data Breach",formDescription:oe="Use this form to report a suspected or confirmed data breach. All fields marked with * are required.",submitButtonText:ne="Submit Report",className:te="",buttonClassName:de="",classNames:A={},unstyled:f=false,showConfirmation:m=true,confirmationMessage:u="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:I=true,maxAttachments:q=5,maxFileSize:ae=5*1024*1024,allowedFileTypes:E=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"]})=>{let[w,O]=react.useState(""),[T,Y]=react.useState(""),[$,W]=react.useState(""),[j,K]=react.useState(""),[U,Z]=react.useState(""),[G,le]=react.useState(""),[Q,se]=react.useState(""),[re,B]=react.useState(""),[k,R]=react.useState(""),[x,C]=react.useState([]),[me,_]=react.useState(""),[X,b]=react.useState([]),[S,ce]=react.useState(""),[ue,i]=react.useState("ongoing"),[p,d]=react.useState(""),[y,M]=react.useState([]),[V,be]=react.useState(false),[N,L]=react.useState({}),xe=o=>{let F=o.target.value;_(F);let J=F.split(",").map(ee=>ee.trim()).filter(Boolean);C(J);},fe=o=>{b(F=>F.includes(o)?F.filter(J=>J!==o):[...F,o]);},Ne=o=>{var ye;let F=o.target.files;if(!F)return;let J=[],ee={};if(y.length+F.length>q){ee.attachments=`Maximum of ${q} files allowed`,L(z=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},z),ee));return}for(let z=0;z<F.length;z++){let he=F[z];if(he.size>ae){ee.attachments=`File ${he.name} exceeds the maximum size of ${ae/(1024*1024)}MB`;continue}let ke="."+((ye=he.name.split(".").pop())==null?void 0:ye.toLowerCase());if(!E.includes(ke)){ee.attachments=`File type ${ke} is not allowed`;continue}J.push(he);}Object.keys(ee).length>0?L(z=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},z),ee)):(M(z=>[...z,...J]),L(z=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},z),{attachments:""})));},ve=o=>{M(F=>F.filter((J,ee)=>ee!==o));},Se=()=>{let o={};return w.trim()||(o.breachTitle="Breach title is required"),T.trim()||(o.description="Description is required"),$||(o.category="Category is required"),j||(o.discoveredAt="Discovery date is required"),G.trim()||(o.reporterName="Reporter name is required"),Q.trim()?/\S+@\S+\.\S+/.test(Q)||(o.reporterEmail="Reporter email is invalid"):o.reporterEmail="Reporter email is required",re.trim()||(o.reporterDepartment="Reporter department is required"),x.length===0&&(o.affectedSystems="At least one affected system is required"),X.length===0&&(o.dataTypes="At least one data type is required"),S&&isNaN(Number(S))&&(o.estimatedAffectedSubjects="Estimated affected subjects must be a number"),L(o),Object.keys(o).length===0},De=o=>{if(o.preventDefault(),!Se())return;let F={title:w,description:T,category:$,discoveredAt:new Date(j).getTime(),occurredAt:U?new Date(U).getTime():void 0,reportedAt:Date.now(),reporter:{name:G,email:Q,department:re,phone:k||void 0},affectedSystems:x,dataTypes:X,estimatedAffectedSubjects:S?Number(S):void 0,status:ue,initialActions:p||void 0,attachments:y.map(J=>({name:J.name,type:J.type,size:J.size,file:J}))};v(F),m&&be(true);};if(V)return jsxRuntime.jsxs("div",{className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${te}`,children:[jsxRuntime.jsx("h2",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Submitted"}),jsxRuntime.jsx("p",{className:"text-green-700 dark:text-green-300",children:u}),jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-yellow-800 dark:text-yellow-200 mb-2",children:"Important: Next Steps"}),jsxRuntime.jsx("p",{className:"text-yellow-700 dark:text-yellow-300 text-sm",children:"Under the NDPA (Section 40), data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsxRuntime.jsx("button",{onClick:()=>be(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${de}`,children:"Report Another Breach"})]});let Be=[{id:"personal",label:"Personal Information (names, addresses)"},{id:"contact",label:"Contact Information (email, phone)"},{id:"financial",label:"Financial Information (bank details, payment info)"},{id:"health",label:"Health Information"},{id:"identification",label:"Identification Documents (ID cards, passports)"},{id:"login",label:"Login Credentials"},{id:"biometric",label:"Biometric Data"},{id:"children",label:"Children's Data"},{id:"location",label:"Location Data"},{id:"communications",label:"Communications Content"}];return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${te}`,A.root,f),children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",A.title,f),children:D}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:oe}),jsxRuntime.jsx("form",{onSubmit:De,className:chunkVURIXCGY_js.a("",A.form,f),children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("",A.fieldGroup,f),children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Breach Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"breachTitle",className:chunkVURIXCGY_js.a("block text-sm font-medium mb-1",A.label,f),children:["Breach Title/Summary ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"breachTitle",value:w,onChange:o=>O(o.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",A.input,f),required:true}),N.breachTitle&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:N.breachTitle})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"category",className:chunkVURIXCGY_js.a("block text-sm font-medium mb-1",A.label,f),children:["Breach Category ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsxs("select",{id:"category",value:$,onChange:o=>W(o.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",A.select,f),required:true,children:[jsxRuntime.jsx("option",{value:"",children:"Select a category"}),h.map(o=>jsxRuntime.jsx("option",{value:o.id,children:o.name},o.id))]}),N.category&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:N.category})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"description",className:chunkVURIXCGY_js.a("block text-sm font-medium mb-1",A.label,f),children:["Detailed Description ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"description",value:T,onChange:o=>Y(o.target.value),rows:4,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",A.textarea,f),required:true}),N.description&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:N.description})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"discoveredAt",className:"block text-sm font-medium mb-1",children:["Date Discovered ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"datetime-local",id:"discoveredAt",value:j,onChange:o=>K(o.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-blue-500",required:true}),N.discoveredAt&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:N.discoveredAt})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"occurredAt",className:"block text-sm font-medium mb-1",children:"Date Occurred (if known)"}),jsxRuntime.jsx("input",{type:"datetime-local",id:"occurredAt",value:U,onChange:o=>Z(o.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-blue-500"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Reporter Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterName",className:"block text-sm font-medium mb-1",children:["Your Name ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterName",value:G,onChange:o=>le(o.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-blue-500",required:true}),N.reporterName&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:N.reporterName})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterEmail",className:"block text-sm font-medium mb-1",children:["Your Email ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",id:"reporterEmail",value:Q,onChange:o=>se(o.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-blue-500",required:true}),N.reporterEmail&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:N.reporterEmail})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterDepartment",className:"block text-sm font-medium mb-1",children:["Your Department ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterDepartment",value:re,onChange:o=>B(o.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-blue-500",required:true}),N.reporterDepartment&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:N.reporterDepartment})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"reporterPhone",className:"block text-sm font-medium mb-1",children:"Your Phone Number (Optional)"}),jsxRuntime.jsx("input",{type:"tel",id:"reporterPhone",value:k,onChange:o=>R(o.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-blue-500"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"affectedSystems",className:"block text-sm font-medium mb-1",children:["Affected Systems/Applications ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"affectedSystems",value:me,onChange:xe,placeholder:"e.g. CRM, Email Server, Website (comma separated)",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",required:true}),N.affectedSystems&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:N.affectedSystems})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"block text-sm font-medium mb-1",children:"Estimated Number of Affected Data Subjects"}),jsxRuntime.jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:S,onChange:o=>ce(o.target.value),placeholder:"e.g. 100",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"}),N.estimatedAffectedSubjects&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:N.estimatedAffectedSubjects})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Types of Data Involved ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:Be.map(o=>jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"checkbox",id:`dataType_${o.id}`,checked:X.includes(o.id),onChange:()=>fe(o.id),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),jsxRuntime.jsx("label",{htmlFor:`dataType_${o.id}`,className:"ml-2 text-sm text-gray-700 dark:text-gray-300",children:o.label})]},o.id))}),N.dataTypes&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:N.dataTypes})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"status",className:"block text-sm font-medium mb-1",children:["Current Status ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsxs("select",{id:"status",value:ue,onChange:o=>i(o.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",A.select,f),required:true,children:[jsxRuntime.jsx("option",{value:"ongoing",children:"Ongoing (breach is still active)"}),jsxRuntime.jsx("option",{value:"contained",children:"Contained (breach is stopped but not resolved)"}),jsxRuntime.jsx("option",{value:"resolved",children:"Resolved (breach is fully addressed)"})]})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"initialActions",className:"block text-sm font-medium mb-1",children:"Initial Actions Taken"}),jsxRuntime.jsx("textarea",{id:"initialActions",value:p,onChange:o=>d(o.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",rows:3,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",A.textarea,f)})]})]})]}),I&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Attachments"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Upload Supporting Files (Optional)"}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:["Max ",q," files, ",ae/(1024*1024),"MB each. Allowed types: ",E.join(", ")]}),jsxRuntime.jsx("input",{type:"file",onChange:Ne,multiple:true,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",accept:E.join(",")}),N.attachments&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:N.attachments})]}),y.length>0&&jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium mb-2",children:"Attached Files:"}),jsxRuntime.jsx("ul",{className:"space-y-2",children:y.map((o,F)=>jsxRuntime.jsxs("li",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 text-gray-500 dark:text-gray-400 mr-2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M8 4a3 3 0 00-3 3v4a5 5 0 0010 0V7a1 1 0 112 0v4a7 7 0 11-14 0V7a5 5 0 0110 0v4a3 3 0 11-6 0V7a1 1 0 012 0v4a1 1 0 102 0V7a3 3 0 00-3-3z",clipRule:"evenodd"})}),jsxRuntime.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:o.name}),jsxRuntime.jsxs("span",{className:"ml-2 text-xs text-gray-500 dark:text-gray-400",children:["(",(o.size/1024).toFixed(1)," KB)"]})]}),jsxRuntime.jsx("button",{type:"button",onClick:()=>ve(F),className:"text-red-500 hover:text-red-700",children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]},F))})]})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",A.notice,f),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. The data protection team will assess this breach and determine if notification is required."})]}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{type:"submit",className:chunkVURIXCGY_js.a(`px-6 py-3 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${de}`,A.submitButton,f),children:ne})})]})})]})};var He=({breachData:h,initialAssessment:v={},onComplete:D,title:oe="Breach Risk Assessment",description:ne="Assess the risk level of this data breach to determine notification requirements.",submitButtonText:te="Complete Assessment",className:de="",buttonClassName:A="",classNames:f={},unstyled:m=false,showBreachSummary:u=true,showNotificationRequirements:I=true})=>{let[q,ae]=react.useState(v.confidentialityImpact||3),[E,w]=react.useState(v.integrityImpact||3),[O,T]=react.useState(v.availabilityImpact||3),[Y,$]=react.useState(v.harmLikelihood||3),[W,j]=react.useState(v.harmSeverity||3),[K,U]=react.useState(v.risksToRightsAndFreedoms!==void 0?v.risksToRightsAndFreedoms:false),[Z,G]=react.useState(v.highRisksToRightsAndFreedoms!==void 0?v.highRisksToRightsAndFreedoms:false),[le,Q]=react.useState(v.justification||""),[se,re]=react.useState(0),[B,k]=react.useState("low"),[R,x]=react.useState(false),[C,me]=react.useState(0),[_,X]=react.useState(0),[b,S]=react.useState(false);react.useEffect(()=>{let N=q*.2+E*.1+O*.1+Y*.3+W*.3;re(Number(N.toFixed(1)));let L;N<2?L="low":N<3?L="medium":N<4?L="high":L="critical",k(L),x(K||L==="high"||L==="critical");let fe=h.discoveredAt+4320*60*1e3;me(fe);let Ne=Date.now(),ve=(fe-Ne)/(3600*1e3);X(Number(ve.toFixed(1)));},[q,E,O,Y,W,K,h.discoveredAt]);let ce=d=>new Date(d).toLocaleString(),ue=d=>{d.preventDefault();let y={id:v.id||`assessment_${Date.now()}`,breachId:h.id,assessedAt:Date.now(),assessor:v.assessor||{name:"Assessment User",role:"Data Protection Officer",email:"dpo@example.com"},confidentialityImpact:q,integrityImpact:E,availabilityImpact:O,harmLikelihood:Y,harmSeverity:W,overallRiskScore:se,riskLevel:B,risksToRightsAndFreedoms:K,highRisksToRightsAndFreedoms:Z,justification:le};D(y),S(true);},i=d=>{switch(d){case 1:return "Minimal";case 2:return "Low";case 3:return "Moderate";case 4:return "High";case 5:return "Severe";default:return "Unknown"}},p=d=>jsxRuntime.jsx("span",{className:chunkVURIXCGY_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"}[d]}`,f.riskBadge,m),children:d.charAt(0).toUpperCase()+d.slice(1)});return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${de}`,f.root,m),children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",f.title,m),children:oe}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:ne}),u&&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:"})," ",h.title]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Discovered:"})," ",ce(h.discoveredAt)]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",h.status.charAt(0).toUpperCase()+h.status.slice(1)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",h.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",h.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",h.estimatedAffectedSubjects||"Unknown"]})]})]})]}),b?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:"})," ",p(B)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",se," / 5"]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Assessed On:"})," ",ce(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:"})," ",K?"Yes":"No"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",Z?"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:le})]})]}),I&&jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`mb-6 p-4 rounded-md ${R?_>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"}`,f.notificationStatus,m),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Requirements"}),R?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:`text-sm font-bold mb-2 ${_>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:"})," ",ce(C)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsxRuntime.jsx("span",{className:_<24?"text-red-600 dark:text-red-400 font-bold":"",children:_>0?`${_} hours`:"Deadline passed"})]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",Z?"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:R?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"}),Z&&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:chunkVURIXCGY_js.a(`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${A}`,f.submitButton,m),children:"Edit Assessment"})]}):jsxRuntime.jsx("form",{onSubmit:ue,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-500 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:q,onChange:d=>ae(parseInt(d.target.value)),className:chunkVURIXCGY_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",f.slider,m)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[i(q)," (",q,")"]})]})]}),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-500 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:E,onChange:d=>w(parseInt(d.target.value)),className:chunkVURIXCGY_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",f.slider,m)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[i(E)," (",E,")"]})]})]}),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-500 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:O,onChange:d=>T(parseInt(d.target.value)),className:chunkVURIXCGY_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",f.slider,m)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[i(O)," (",O,")"]})]})]})]}),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-500 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:Y,onChange:d=>$(parseInt(d.target.value)),className:chunkVURIXCGY_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",f.slider,m)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[i(Y)," (",Y,")"]})]})]}),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-500 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:W,onChange:d=>j(parseInt(d.target.value)),className:chunkVURIXCGY_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",f.slider,m)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[i(W)," (",W,")"]})]})]}),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:K,onChange:d=>U(d.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),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-500 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:Z,onChange:d=>G(d.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),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-500 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:chunkVURIXCGY_js.a("",f.riskScore,m),children:[se," / 5"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Level:"}),p(B)]})]}),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:le,onChange:d=>Q(d.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-blue-500",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:chunkVURIXCGY_js.a(`px-6 py-3 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${A}`,f.submitButton,m),children:te})})]})})]})};var Ke=({breachReports:h,riskAssessments:v,regulatoryNotifications:D,onSelectBreach:oe,onRequestAssessment:ne,onRequestNotification:te,title:de="Breach Notification Manager",description:A="Manage data breach notifications and track compliance with NDPA requirements.",className:f="",buttonClassName:m="",classNames:u={},unstyled:I=false,showBreachDetails:q=true,showNotificationTimeline:ae=true,showDeadlineAlerts:E=true})=>{var ue;let[w,O]=react.useState(null),[T,Y]=react.useState(h),[$,W]=react.useState("all"),[j,K]=react.useState(""),[U,Z]=react.useState("discoveredAt"),[G,le]=react.useState("desc");react.useEffect(()=>{let i=[...h];if($!=="all"&&(i=i.filter(p=>p.status===$)),j){let p=j.toLowerCase();i=i.filter(d=>d.title.toLowerCase().includes(p)||d.description.toLowerCase().includes(p)||d.affectedSystems.some(y=>y.toLowerCase().includes(p))||d.dataTypes.some(y=>y.toLowerCase().includes(p)));}i.sort((p,d)=>{let y=0;switch(U){case "title":y=p.title.localeCompare(d.title);break;case "discoveredAt":y=p.discoveredAt-d.discoveredAt;break;case "status":y=p.status.localeCompare(d.status);break;case "riskLevel":let M=v.find(L=>L.breachId===p.id),V=v.find(L=>L.breachId===d.id),be=(M==null?void 0:M.riskLevel)||"unknown",N=(V==null?void 0:V.riskLevel)||"unknown";y=be.localeCompare(N);break;default:y=p.discoveredAt-d.discoveredAt;}return G==="asc"?y:-y}),Y(i);},[h,$,j,U,G,v]),react.useEffect(()=>{T.length>0&&!w&&O(T[0].id);},[T,w]);let Q=i=>{O(i),oe&&oe(i);},se=()=>{w&&ne&&ne(w);},re=()=>{w&&te&&te(w);},B=i=>new Date(i).toLocaleString(),k=w?h.find(i=>i.id===w):null,R=w?v.find(i=>i.breachId===w):null,x=w?D.find(i=>i.breachId===w):null,C=k?me(k,R):null;function me(i,p){let d=chunkRYZEIDNR_js.a(i,p||void 0),y=i.discoveredAt+d.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:d.notificationRequired,ndpcNotificationDeadline:y,dataSubjectNotificationRequired:(p==null?void 0:p.highRisksToRightsAndFreedoms)||false,justification:d.justification}}function _(i){let p=Date.now(),d=(i-p)/(3600*1e3);return Number(d.toFixed(1))}let X=i=>i?jsxRuntime.jsx("span",{className:chunkVURIXCGY_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"}[i]}`,u.statusBadge,I),children:i.charAt(0).toUpperCase()+i.slice(1)}):null,b=i=>jsxRuntime.jsx("span",{className:chunkVURIXCGY_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"}[i]||"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}`,u.statusBadge,I),children:i.charAt(0).toUpperCase()+i.slice(1)}),S=()=>{if(!k||!C)return null;if(!C.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(x)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 ",B(x.sentAt),"."]})]});let i=_(C.ndpcNotificationDeadline);return i<=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."})]}):i<=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 ",i," 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 ",B(C.ndpcNotificationDeadline)," (",i," hours remaining)."]})]})},ce=()=>{if(!k)return null;let i=[{title:"Breach Discovered",date:k.discoveredAt,completed:true,description:`Breach was discovered on ${B(k.discoveredAt)}.`},{title:"Risk Assessment",date:R==null?void 0:R.assessedAt,completed:!!R,description:R?`Risk assessment completed on ${B(R.assessedAt)}.`:"Risk assessment has not been completed yet."}];return C!=null&&C.ndpcNotificationRequired&&i.push({title:"NDPC Notification",date:x==null?void 0:x.sentAt,completed:!!x,description:x?`Notification sent to the NDPC on ${B(x.sentAt)}.`:`Notification must be sent to the NDPC by ${B(C.ndpcNotificationDeadline)}.`}),C!=null&&C.dataSubjectNotificationRequired&&i.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:chunkVURIXCGY_js.a("mt-6",u.timeline,I),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:i.map((p,d)=>jsxRuntime.jsxs("li",{className:chunkVURIXCGY_js.a("mb-6 ml-4",u.timelineStep,I),children:[jsxRuntime.jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${p.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsxRuntime.jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-400 dark:text-gray-500",children:p.date?B(p.date):"Pending"}),jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:p.title}),jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:p.description})]},d))})]})};return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${f}`,u.root,I),children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("",u.header,I),children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",u.title,I),children:de}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:A})]}),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:$,onChange:i=>W(i.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-blue-500",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:U,onChange:i=>Z(i.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-blue-500",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:j,onChange:i=>K(i.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-blue-500"})]})]}),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"}),T.length===0?jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No breach reports found."}):jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",u.breachList,I),children:T.map(i=>{let p=v.find(V=>V.breachId===i.id),d=D.find(V=>V.breachId===i.id),y=me(i,p),M=null;if(y!=null&&y.ndpcNotificationRequired)if(d)M=jsxRuntime.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Notified"});else {let V=_(y.ndpcNotificationDeadline);V<=0?M=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):V<=24?M=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):M=jsxRuntime.jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Required"});}else M=jsxRuntime.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Not Required"});return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`p-3 rounded-md cursor-pointer ${w===i.id?"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,u.breachItem,I),onClick:()=>Q(i.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:i.title}),b(i.status)]}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:["Discovered: ",new Date(i.discoveredAt).toLocaleDateString()]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsxRuntime.jsx("div",{children:p&&X(p.riskLevel)}),jsxRuntime.jsx("div",{children:M})]})]},i.id)})})]}),jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("md:col-span-2",u.detailPanel,I),children:k?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:k.title}),b(k.status)]}),E&&jsxRuntime.jsx("div",{className:"mb-4",children:S()}),q&&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:"})," ",B(k.discoveredAt)]}),k.occurredAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Occurred:"})," ",B(k.occurredAt)]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reporter:"})," ",k.reporter.name]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",k.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",k.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",k.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:k.description})]}),k.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:k.initialActions})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),R?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:"}),X(R.riskLevel)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",R.overallRiskScore," / 5"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",R.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:"})," ",R.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:R.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:se,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${m}`,children:"Conduct Risk Assessment"})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),x?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:"})," ",B(x.sentAt)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Method:"})," ",x.method.charAt(0).toUpperCase()+x.method.slice(1)]}),x.referenceNumber&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference Number:"})," ",x.referenceNumber]}),(x.ndpcContact||x.nitdaContact)&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(ue=x.ndpcContact||x.nitdaContact)==null?void 0:ue.name]})]}):jsxRuntime.jsx("div",{children:C!=null&&C.ndpcNotificationRequired?jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"NDPC notification is required but has not been sent yet."}),jsxRuntime.jsx("button",{onClick:re,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${m}`,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."})})})]}),ae&&ce()]}):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-500 dark:text-gray-400",children:"Select a breach to view details"})})})]})]})};var tt=({breachData:h,assessmentData:v,organizationInfo:D,onGenerate:oe,title:ne="Generate NDPC Notification Report",description:te="Generate a report for submission to the NDPC in compliance with the NDPA breach notification requirements.",generateButtonText:de="Generate Report",className:A="",buttonClassName:f="",classNames:m={},unstyled:u=false,showPreview:I=true,allowEditing:q=true,allowDownload:ae=true,downloadFormat:E="pdf"})=>{let[w,O]=react.useState(""),[T,Y]=react.useState(""),[$,W]=react.useState(""),[j,K]=react.useState(""),[U,Z]=react.useState("email"),[G,le]=react.useState(""),[Q,se]=react.useState(""),[re,B]=react.useState(false),[k,R]=react.useState(false);react.useEffect(()=>{if(!re){let b=C();O(b),B(true);}},[h,v,D]);let x=b=>new Date(b).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),C=()=>`
|
|
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: ${D.name}
|
|
11
|
+
${D.registrationNumber?`Registration Number: ${D.registrationNumber}`:""}
|
|
12
|
+
Address: ${D.address}
|
|
13
|
+
${D.website?`Website: ${D.website}`:""}
|
|
14
|
+
|
|
15
|
+
DATA PROTECTION OFFICER
|
|
16
|
+
----------------------
|
|
17
|
+
Name: ${D.dpoName}
|
|
18
|
+
Email: ${D.dpoEmail}
|
|
19
|
+
${D.dpoPhone?`Phone: ${D.dpoPhone}`:""}
|
|
20
|
+
|
|
21
|
+
BREACH DETAILS
|
|
22
|
+
-------------
|
|
23
|
+
Breach Title: ${h.title}
|
|
24
|
+
Date Discovered: ${x(h.discoveredAt)}
|
|
25
|
+
${h.occurredAt?`Date Occurred: ${x(h.occurredAt)}`:"Date Occurred: Unknown"}
|
|
26
|
+
Status: ${h.status.charAt(0).toUpperCase()+h.status.slice(1)}
|
|
27
|
+
|
|
28
|
+
Description of the Breach:
|
|
29
|
+
${h.description}
|
|
30
|
+
|
|
31
|
+
Affected Systems/Applications:
|
|
32
|
+
${h.affectedSystems.join(", ")}
|
|
33
|
+
|
|
34
|
+
Types of Personal Data Involved:
|
|
35
|
+
${h.dataTypes.join(", ")}
|
|
36
|
+
|
|
37
|
+
Estimated Number of Data Subjects Affected:
|
|
38
|
+
${h.estimatedAffectedSubjects||"Unknown"}
|
|
39
|
+
|
|
40
|
+
RISK ASSESSMENT
|
|
41
|
+
--------------
|
|
42
|
+
${v?`
|
|
43
|
+
Overall Risk Level: ${v.riskLevel.charAt(0).toUpperCase()+v.riskLevel.slice(1)}
|
|
44
|
+
Risk to Rights and Freedoms of Data Subjects: ${v.risksToRightsAndFreedoms?"Yes":"No"}
|
|
45
|
+
High Risk to Rights and Freedoms of Data Subjects: ${v.highRisksToRightsAndFreedoms?"Yes":"No"}
|
|
46
|
+
|
|
47
|
+
Justification for Risk Assessment:
|
|
48
|
+
${v.justification}
|
|
49
|
+
`:"Risk assessment has not been conducted yet."}
|
|
50
|
+
|
|
51
|
+
MEASURES TAKEN
|
|
52
|
+
-------------
|
|
53
|
+
Measures taken or proposed to address the breach:
|
|
54
|
+
${h.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
|
+
`,me=b=>{b.preventDefault();let S={id:`notification_${Date.now()}`,breachId:h.id,sentAt:Date.now(),method:U,referenceNumber:G||void 0,ndpcContact:T?{name:T,email:$,phone:j||void 0}:void 0,content:w,attachments:[]};oe(S),R(true);},_=()=>{let b=document.createElement("a"),S=new Blob([w],{type:"text/plain"});b.href=URL.createObjectURL(S),b.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.txt`,document.body.appendChild(b),b.click(),document.body.removeChild(b);},X=()=>[{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:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${A}`,m.root,u),children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("",m.header,u),children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",m.title,u),children:ne}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:te})]}),k?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:chunkVURIXCGY_js.a("text-sm",m.field,u),children:[jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a("font-medium",m.fieldLabel,u),children:"Method:"})," ",jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a("",m.fieldValue,u),children:U.charAt(0).toUpperCase()+U.slice(1)})]}),T&&jsxRuntime.jsxs("p",{className:chunkVURIXCGY_js.a("text-sm",m.field,u),children:[jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a("font-medium",m.fieldLabel,u),children:"Contact Name:"})," ",jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a("",m.fieldValue,u),children:T})]}),$&&jsxRuntime.jsxs("p",{className:chunkVURIXCGY_js.a("text-sm",m.field,u),children:[jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a("font-medium",m.fieldLabel,u),children:"Contact Email:"})," ",jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a("",m.fieldValue,u),children:$})]}),j&&jsxRuntime.jsxs("p",{className:chunkVURIXCGY_js.a("text-sm",m.field,u),children:[jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a("font-medium",m.fieldLabel,u),children:"Contact Phone:"})," ",jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a("",m.fieldValue,u),children:j})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:chunkVURIXCGY_js.a("text-sm",m.field,u),children:[jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a("font-medium",m.fieldLabel,u),children:"Date Generated:"})," ",jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a("",m.fieldValue,u),children:x(Date.now())})]}),jsxRuntime.jsxs("p",{className:chunkVURIXCGY_js.a("text-sm",m.field,u),children:[jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a("font-medium",m.fieldLabel,u),children:"Breach ID:"})," ",jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a("",m.fieldValue,u),children:h.id})]}),G&&jsxRuntime.jsxs("p",{className:chunkVURIXCGY_js.a("text-sm",m.field,u),children:[jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a("font-medium",m.fieldLabel,u),children:"Reference Number:"})," ",jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a("",m.fieldValue,u),children:G})]})]})]})]}),I&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Preview"}),jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("bg-gray-50 dark:bg-gray-700 p-4 rounded-md",m.reportPreview,u),children:jsxRuntime.jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:w})})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-3",children:[ae&&jsxRuntime.jsxs("button",{onClick:_,className:chunkVURIXCGY_js.a(`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${f}`,m.downloadButton,u),children:["Download Report (",E.toUpperCase(),")"]}),jsxRuntime.jsx("button",{onClick:()=>R(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 ${f}`,children:"Edit Report"})]})]}):jsxRuntime.jsx("form",{onSubmit:me,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:U,onChange:b=>Z(b.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-blue-500",required:true,children:X()})]}),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:G,onChange:b=>le(b.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-blue-500"})]})]})]}),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:T,onChange:b=>Y(b.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-blue-500"})]}),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:$,onChange:b=>W(b.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-blue-500"})]}),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:j,onChange:b=>K(b.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-blue-500"})]})]})]}),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:Q,onChange:b=>se(b.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-blue-500"})]})]}),q&&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:w,onChange:b=>O(b.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-blue-500 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:chunkVURIXCGY_js.a(`px-6 py-3 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${f}`,m.generateButton,u),children:de})})]})})]})};exports.a=$e;exports.b=He;exports.c=Ke;exports.d=tt;//# sourceMappingURL=chunk-FC6EG34C.js.map
|
|
72
|
+
//# sourceMappingURL=chunk-FC6EG34C.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {a}from'./chunk-FDB6KZUD.mjs';import {jsxs,jsx}from'react/jsx-runtime';import F from'react';var E=({sections:d,answers:k,onAnswerChange:x,currentSectionIndex:b,onNextSection:w,onPrevSection:C,validationErrors:R={},readOnly:p=false,className:I="",buttonClassName:P="",nextButtonText:n="Next",prevButtonText:N="Previous",submitButtonText:h="Submit",showProgress:o=true,progress:y,classNames:$={},unstyled:S=false})=>{let v=d[b],i=b===d.length-1,a$1=(e,m)=>a(e,m?$[m]:void 0,S),u=e=>e.showWhen?e.showWhen.every(m=>{let c=k[m.questionId];switch(m.operator){case "equals":return c===m.value;case "contains":return Array.isArray(c)?c.includes(m.value):false;case "greaterThan":return typeof c=="number"?c>m.value:false;case "lessThan":return typeof c=="number"?c<m.value:false;default:return true}}):true,A=e=>a$1(`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-blue-500 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100`,"input"),L=e=>{if(!u(e))return null;let m=R[e.id],c=k[e.id];return jsxs("div",{className:a$1("mb-6","question"),children:[jsxs("div",{className:"mb-2",children:[jsxs("label",{htmlFor:e.id,className:a$1("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:a$1("mt-1 text-sm text-gray-500 dark:text-gray-400","guidance"),children:e.guidance})]}),e.type==="text"&&jsx("input",{type:"text",id:e.id,value:c||"",onChange:s=>x(e.id,s.target.value),disabled:p,className:A(m)}),e.type==="textarea"&&jsx("textarea",{id:e.id,value:c||"",onChange:s=>x(e.id,s.target.value),disabled:p,rows:4,className:A(m)}),e.type==="select"&&e.options&&jsxs("select",{id:e.id,value:c||"",onChange:s=>x(e.id,s.target.value),disabled:p,className:A(m),children:[jsx("option",{value:"",children:"Select an option"}),e.options.map(s=>jsx("option",{value:s.value,children:s.label},s.value))]}),e.type==="radio"&&e.options&&jsx("div",{className:a$1("space-y-2","radioGroup"),children:e.options.map(s=>jsxs("div",{className:a$1("flex items-center","radioOption"),children:[jsx("input",{type:"radio",id:`${e.id}_${s.value}`,name:e.id,value:s.value,checked:c===s.value,onChange:()=>x(e.id,s.value),disabled:p,className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600"}),jsxs("label",{htmlFor:`${e.id}_${s.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:[s.label,s.riskLevel&&jsxs("span",{className:`ml-2 text-xs px-2 py-1 rounded ${s.riskLevel==="low"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":s.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:[s.riskLevel.charAt(0).toUpperCase()+s.riskLevel.slice(1)," Risk"]})]})]},s.value))}),e.type==="checkbox"&&e.options&&jsx("div",{className:"space-y-2",children:e.options.map(s=>jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"checkbox",id:`${e.id}_${s.value}`,value:s.value,checked:Array.isArray(c)?c.includes(s.value):false,onChange:B=>{let Q=Array.isArray(c)?[...c]:[];B.target.checked?x(e.id,[...Q,s.value]):x(e.id,Q.filter(j=>j!==s.value));},disabled:p,className:"h-4 w-4 rounded text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600"}),jsx("label",{htmlFor:`${e.id}_${s.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:s.label})]},s.value))}),e.type==="scale"&&jsxs("div",{children:[jsx("div",{className:"flex justify-between mb-2",children:e.scaleLabels&&Object.entries(e.scaleLabels).map(([s,B])=>jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 text-center",style:{width:`${100/Object.keys(e.scaleLabels||{}).length}%`},children:B},s))}),jsx("input",{type:"range",id:e.id,min:e.minValue||1,max:e.maxValue||5,value:c||e.minValue||1,onChange:s=>x(e.id,parseInt(s.target.value,10)),disabled:p,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-500 dark:text-gray-400 text-center",children:["Selected value: ",c||e.minValue||1]})]}),m&&jsx("p",{className:"mt-1 text-sm text-red-500",children:m})]},e.id)};return v?jsxs("div",{className:`${a$1("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6","root")} ${I}`,children:[o&&jsxs("div",{className:a$1("mb-6","header"),children:[jsxs("div",{className:"flex justify-between text-sm text-gray-500 dark:text-gray-400 mb-1",children:[jsxs("span",{children:["Section ",b+1," of ",d.length]}),jsx("span",{children:y!==void 0?`${y}% Complete`:""})]}),jsx("div",{className:a$1("w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700","progressBar"),children:jsx("div",{className:"bg-blue-600 h-2.5 rounded-full",style:{width:`${y!==void 0?y:(b+1)/d.length*100}%`}})})]}),jsx("h2",{className:a$1("text-xl font-bold mb-2 text-gray-900 dark:text-white","title"),children:v.title}),v.description&&jsx("p",{className:a$1("mb-6 text-gray-600 dark:text-gray-300","sectionTitle"),children:v.description}),jsx("div",{className:a$1("space-y-6","section"),children:v.questions.map(e=>L(e))}),jsxs("div",{className:a$1("mt-8 flex justify-between","navigation"),children:[jsx("button",{type:"button",onClick:C,disabled:b===0||p,className:`${a$1("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")} ${P}`,children:N}),jsx("button",{type:"button",onClick:w,disabled:p,className:`${a$1("px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed","nextButton")} ${P}`,children:i?h:n})]})]}):jsx("div",{children:"No section found."})};var U=({result:d,sections:k,showFullReport:x=true,allowPrint:b=true,allowExport:w=true,onExport:C,className:R="",buttonClassName:p="",classNames:I={},unstyled:P=false})=>{let n=(i,a$1)=>a(i,a$1?I[a$1]:void 0,P),N=i=>new Date(i).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),y=i=>{let a=d.answers[i];return a==null?"Not answered":typeof a=="boolean"?a?"Yes":"No":Array.isArray(a)?a.join(", "):String(a)},$=()=>{window.print();},S=i=>{C&&C(i);},v=i=>jsx("span",{className:n(`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"}[i]}`,"riskBadge"),children:i.charAt(0).toUpperCase()+i.slice(1)});return jsxs("div",{className:`${n("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 print:shadow-none print:p-0","root")} ${R}`,children:[jsxs("div",{className:n("mb-8 border-b border-gray-200 dark:border-gray-700 pb-6 print:pb-4","header"),children:[jsxs("div",{className:"flex justify-between items-start",children:[jsxs("div",{children:[jsx("h1",{className:n("text-2xl font-bold text-gray-900 dark:text-white mb-2","title"),children:"Data Protection Impact Assessment Report"}),jsx("h2",{className:"text-xl text-gray-700 dark:text-gray-300 mb-4",children:d.title})]}),(b||w)&&jsxs("div",{className:"flex space-x-2 print:hidden",children:[b&&jsx("button",{onClick:$,className:`${n("px-3 py-1 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600","printButton")} ${p}`,children:jsxs("span",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})}),"Print"]})}),w&&jsx("div",{className:"relative inline-block",children:jsx("button",{onClick:()=>S("pdf"),className:`px-3 py-1 bg-blue-600 text-white rounded hover:bg-blue-700 ${p}`,children:jsxs("span",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Export PDF"]})})})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Assessor:"})," ",d.assessor.name,", ",d.assessor.role]}),jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",d.assessor.email]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Started:"})," ",N(d.startedAt)]}),jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Completed:"})," ",d.completedAt?N(d.completedAt):"In progress"]}),jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Next review:"})," ",d.reviewDate?N(d.reviewDate):"Not scheduled"]})]})]})]}),jsxs("div",{className:n("mb-8","summary"),children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Executive Summary"}),jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("span",{className:"font-medium mr-2",children:"Overall Risk Level:"}),v(d.overallRiskLevel)]}),jsxs("div",{className:n("mb-2","conclusion"),children:[jsx("span",{className:"font-medium",children:"Conclusion:"})," ",d.conclusion]}),jsxs("div",{children:[jsx("span",{className:"font-medium",children:"Can Proceed:"})," ",d.canProceed?"Yes":"No"]})]}),jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Processing Activity Description"}),jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-4",children:d.processingDescription}),d.recommendations&&d.recommendations.length>0&&jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Key Recommendations"}),jsx("ul",{className:"list-disc pl-5 text-gray-700 dark:text-gray-300",children:d.recommendations.map((i,a)=>jsx("li",{className:n("","recommendation"),children:i},a))})]})]})]}),jsxs("div",{className:"mb-8",children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Identified Risks"}),d.risks.length===0?jsx("p",{className:"text-gray-700 dark:text-gray-300",children:"No risks identified."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:n("min-w-full divide-y divide-gray-200 dark:divide-gray-700","riskTable"),children:[jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Risk"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Likelihood"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Impact"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Risk Level"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Mitigated"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:d.risks.map(i=>jsxs("tr",{className:n("","riskRow"),children:[jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:i.description}),jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400",children:[i.likelihood," / 5"]}),jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400",children:[i.impact," / 5"]}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:v(i.level)}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400",children:i.mitigated?jsx("span",{className:"text-green-600 dark:text-green-400",children:"Yes"}):jsx("span",{className:"text-red-600 dark:text-red-400",children:"No"})})]},i.id))})]})})]}),x&&jsxs("div",{children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Full Assessment Details"}),k.map(i=>{let a=i.questions.filter(u=>d.answers[u.id]!==void 0);return a.length===0?null:jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:i.title}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Question"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Answer"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:a.map(u=>jsxs("tr",{children:[jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:u.text}),jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-500 dark:text-gray-400",children:y(u.id)})]},u.id))})]})})]},i.id)})]}),jsxs("div",{className:"mt-8 pt-4 border-t border-gray-200 dark:border-gray-700 text-sm text-gray-500 dark:text-gray-400",children:[jsx("p",{children:"This DPIA was conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023."}),jsxs("p",{children:["DPIA Report Version: ",d.version]}),jsxs("p",{children:["Generated on: ",new Date().toLocaleDateString()]})]})]})};var K=({steps:d,onStepClick:k,clickable:x=true,orientation:b="horizontal",className:w="",activeStepClassName:C="",completedStepClassName:R="",incompleteStepClassName:p="",classNames:I={},unstyled:P=false})=>{let n=(o,y)=>a(o,y?I[y]:void 0,P),N=o=>{x&&k&&k(o);},h=b==="vertical";return jsx("div",{className:`${n(h?"flex flex-col space-y-4":"flex items-center justify-between","root")} ${w}`,children:d.map((o,y)=>{let $=y===d.length-1,S=o.active?n(`font-medium ${C||"text-blue-600 dark:text-blue-400"}`,"label"):o.completed?n(R||"text-green-600 dark:text-green-400","label"):n(p||"text-gray-500 dark:text-gray-400","label"),v=o.active?n("flex items-center justify-center w-8 h-8 rounded-full bg-blue-100 dark:bg-blue-900 text-blue-600 dark:text-blue-400 border-2 border-blue-600 dark:border-blue-400","stepActive"):o.completed?n("flex items-center justify-center w-8 h-8 rounded-full bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-400 border-2 border-green-600 dark:border-green-400","stepCompleted"):n("flex items-center justify-center w-8 h-8 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 border-2 border-gray-300 dark:border-gray-600","stepPending");return jsxs(F.Fragment,{children:[jsxs("div",{className:n(`${h?"flex items-start":"flex flex-col items-center"} ${x?"cursor-pointer":""}`,"step"),onClick:()=>N(o.id),children:[jsx("div",{className:`
|
|
2
|
+
flex items-center justify-center
|
|
3
|
+
${h?"mr-4":""}
|
|
4
|
+
`,children:jsx("div",{className:v,children:o.icon?o.icon:o.completed?jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):jsx("span",{children:y+1})})}),jsxs("div",{className:`
|
|
5
|
+
${h?"flex-1":"mt-2 text-center"}
|
|
6
|
+
`,children:[jsx("div",{className:`text-sm font-medium ${S}`,children:o.label}),o.description&&jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:o.description})]})]}),!$&&jsx("div",{className:n(h?"ml-4 h-8 border-l-2 border-gray-300 dark:border-gray-600":"w-full border-t-2 border-gray-300 dark:border-gray-600 hidden sm:block","connector")})]},o.id)})})};export{E as a,U as b,K as c};//# sourceMappingURL=chunk-FZUCKGIM.mjs.map
|
|
7
|
+
//# sourceMappingURL=chunk-FZUCKGIM.mjs.map
|