@tantainnovative/ndpr-toolkit 3.10.6 → 3.12.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/CHANGELOG.md +111 -0
- package/README.md +38 -24
- package/dist/adapters.d.mts +90 -4
- package/dist/adapters.d.ts +90 -4
- package/dist/breach.d.mts +13 -1
- package/dist/breach.d.ts +13 -1
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/{chunk-EZCGTHQV.js → chunk-4GIMXUMI.js} +3 -3
- package/dist/{chunk-HBLGN4SD.js → chunk-5AECGMEB.js} +1 -1
- package/dist/chunk-67KA345Q.mjs +1 -0
- package/dist/chunk-6OWCUDTN.mjs +1 -0
- package/dist/{chunk-4G3SRVRI.mjs → chunk-B6BRD5SL.mjs} +1 -1
- package/dist/chunk-CAFCRCTZ.mjs +1 -0
- package/dist/{chunk-VJTQXVAF.js → chunk-EHQVTFYO.js} +1 -1
- package/dist/{chunk-CNM6G5IA.js → chunk-FC3PTJFL.js} +1 -1
- package/dist/{chunk-H3IULCE3.js → chunk-HOAC5VUF.js} +1 -1
- package/dist/{chunk-H3XJV2IR.mjs → chunk-I3V3ITN7.mjs} +1 -1
- package/dist/{chunk-MPBPAEZC.mjs → chunk-IB3KSUPZ.mjs} +1 -1
- package/dist/{chunk-TAHSSITO.mjs → chunk-IHNAFXDM.mjs} +1 -1
- package/dist/chunk-IQO3SIAG.mjs +1 -0
- package/dist/{chunk-UTFBKL73.js → chunk-IRRUYR6M.js} +1 -1
- package/dist/{chunk-C7IDR2IV.js → chunk-JLQT3W3E.js} +1 -1
- package/dist/chunk-JYZOKO2W.mjs +103 -0
- package/dist/chunk-NX5MOBRI.js +1 -0
- package/dist/chunk-O2WEABB3.js +1 -0
- package/dist/chunk-OZHUINWS.js +1 -0
- package/dist/{chunk-66NQ5CVY.mjs → chunk-Q4CSVWSS.mjs} +1 -1
- package/dist/{chunk-CR2QZTGW.js → chunk-QMAVEHOR.js} +1 -1
- package/dist/{chunk-3HOXQNCH.mjs → chunk-RFXGD5NE.mjs} +1 -1
- package/dist/chunk-ROC64RLP.js +1 -0
- package/dist/{chunk-O45PKBZA.mjs → chunk-RR3KXNET.mjs} +3 -3
- package/dist/{chunk-KY6WYHWB.mjs → chunk-TN4TH3CT.mjs} +1 -1
- package/dist/chunk-VPNK7OID.mjs +1 -0
- package/dist/{chunk-O2RDZGM2.js → chunk-VUFTRKKC.js} +1 -1
- package/dist/chunk-WKUC65HL.mjs +1 -0
- package/dist/chunk-WXUXCRAJ.js +1 -0
- package/dist/chunk-YK22SYCT.js +103 -0
- package/dist/chunk-YSD2DFBR.js +6 -0
- package/dist/chunk-ZHX62QAL.mjs +6 -0
- package/dist/consent.d.mts +23 -1
- package/dist/consent.d.ts +23 -1
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +12 -1
- package/dist/cross-border.d.ts +12 -1
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/dpia.d.mts +16 -1
- package/dist/dpia.d.ts +16 -1
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/dsr.d.mts +21 -1
- package/dist/dsr.d.ts +21 -1
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/headless.d.mts +217 -24
- package/dist/headless.d.ts +217 -24
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/hooks.d.mts +217 -24
- package/dist/hooks.d.ts +217 -24
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +419 -29
- package/dist/index.d.ts +419 -29
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.d.mts +10 -0
- package/dist/lawful-basis.d.ts +10 -0
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy.d.mts +39 -1
- package/dist/policy.d.ts +39 -1
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/ropa.d.mts +39 -3
- package/dist/ropa.d.ts +39 -3
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/server.d.mts +86 -0
- package/dist/server.d.ts +86 -0
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/styles.css +2 -0
- package/package.json +1 -1
- package/dist/chunk-3JPDTXGC.js +0 -1
- package/dist/chunk-43OQNS2J.mjs +0 -6
- package/dist/chunk-5GVMKUMP.js +0 -1
- package/dist/chunk-COD3RMTL.mjs +0 -1
- package/dist/chunk-EXEXUAF6.mjs +0 -1
- package/dist/chunk-L2BRFMVS.js +0 -1
- package/dist/chunk-MOHBL6LX.mjs +0 -1
- package/dist/chunk-PGI2LM6P.js +0 -103
- package/dist/chunk-PZRQWPWD.js +0 -1
- package/dist/chunk-RPXRPGHL.mjs +0 -1
- package/dist/chunk-RZ6GC6WN.mjs +0 -1
- package/dist/chunk-SSH4U4TJ.js +0 -6
- package/dist/chunk-WDDCKYWA.js +0 -1
- package/dist/chunk-X3GCGC3H.mjs +0 -103
- package/dist/chunk-ZQZJNKVB.mjs +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkUXUMYP4L_js=require('./chunk-UXUMYP4L.js'),chunkNDKDKDDX_js=require('./chunk-NDKDKDDX.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var fr=({categories:Ze,onSubmit:Ge,onValidationError:u,title:x,formDescription:C,submitButtonText:S,className:Q="",buttonClassName:X="",classNames:d={},unstyled:c=false,isSubmitting:f=false,showConfirmation:Ke=true,confirmationMessage:We="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:Je=true,maxAttachments:A=5,maxFileSize:D=5*1024*1024,allowedFileTypes:R=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"],defaultValues:t,onReset:w})=>{var we,Fe,qe,Pe,ke,je,Te,Ie,Ee,Be,Me,$e,Oe,Le;let F=chunkNDKDKDDX_js.c(),Qe=(we=x!=null?x:F.breach.title)!=null?we:"Report a Data Breach",Xe=(Fe=C!=null?C:F.breach.description)!=null?Fe:"Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40. All fields marked with * are required.",Ve=(qe=S!=null?S:F.breach.submitReport)!=null?qe:"Submit Report",V=r=>{if(!r)return "";let o=new Date(r),l=s=>String(s).padStart(2,"0");return `${o.getFullYear()}-${l(o.getMonth()+1)}-${l(o.getDate())}T${l(o.getHours())}:${l(o.getMinutes())}`},[q,ee]=react.useState((t==null?void 0:t.title)||""),[P,re]=react.useState((t==null?void 0:t.description)||""),[k,te]=react.useState((t==null?void 0:t.category)||""),[j,ie]=react.useState(V(t==null?void 0:t.discoveredAt)),[T,ae]=react.useState(V(t==null?void 0:t.occurredAt)),[I,ne]=react.useState(((Pe=t==null?void 0:t.reporter)==null?void 0:Pe.name)||""),[N,oe]=react.useState(((ke=t==null?void 0:t.reporter)==null?void 0:ke.email)||""),[E,se]=react.useState(((je=t==null?void 0:t.reporter)==null?void 0:je.department)||""),[B,de]=react.useState(((Te=t==null?void 0:t.reporter)==null?void 0:Te.phone)||""),[me,ce]=react.useState((t==null?void 0:t.affectedSystems)||[]),[er,pe]=react.useState(((Ie=t==null?void 0:t.affectedSystems)==null?void 0:Ie.join(", "))||""),[M,le]=react.useState((t==null?void 0:t.dataTypes)||[]),[h,ge]=react.useState((t==null?void 0:t.estimatedAffectedSubjects)!=null?String(t.estimatedAffectedSubjects):""),[$,be]=react.useState((t==null?void 0:t.approximateRecordCount)!=null?String(t.approximateRecordCount):""),[O,fe]=react.useState(((Ee=t==null?void 0:t.dataSubjectCategories)==null?void 0:Ee.join(", "))||""),[he,ve]=react.useState((Be=t==null?void 0:t.involvesSensitiveData)!=null?Be:false),[L,Ne]=react.useState((t==null?void 0:t.likelyConsequences)||""),[z,_e]=react.useState((t==null?void 0:t.mitigationMeasures)||""),[Y,ye]=react.useState(((Me=t==null?void 0:t.dpoContact)==null?void 0:Me.name)||""),[U,ue]=react.useState((($e=t==null?void 0:t.dpoContact)==null?void 0:$e.email)||""),[H,xe]=react.useState(((Oe=t==null?void 0:t.dpoContact)==null?void 0:Oe.phone)||""),[Z,Ce]=react.useState((Le=t==null?void 0:t.isPhasedReport)!=null?Le:false),[G,Se]=react.useState((t==null?void 0:t.supplementsReportId)||""),[Ae,De]=react.useState((t==null?void 0:t.status)||"ongoing"),[K,Re]=react.useState((t==null?void 0:t.initialActions)||""),[_,W]=react.useState([]),[rr,J]=react.useState(false),[a,v]=react.useState({}),tr=()=>{ee(""),re(""),te(""),ie(""),ae(""),ne(""),oe(""),se(""),de(""),ce([]),pe(""),le([]),ge(""),be(""),fe(""),ve(false),Ne(""),_e(""),ye(""),ue(""),xe(""),Ce(false),Se(""),De("ongoing"),Re(""),W([]),J(false),v({}),w==null||w();},ir=r=>{let o=r.target.value;pe(o);let l=o.split(",").map(s=>s.trim()).filter(Boolean);ce(l);},ar=r=>{le(o=>o.includes(r)?o.filter(l=>l!==r):[...o,r]);},nr=r=>{var ze;let o=r.target.files;if(!o)return;let l=[],s={};if(_.length+o.length>A){s.attachments=`Maximum of ${A} files allowed`,v(g=>chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},g),s));return}for(let g=0;g<o.length;g++){let y=o[g];if(y.size>D){s.attachments=`File ${y.name} exceeds the maximum size of ${D/(1024*1024)}MB`;continue}let Ye="."+((ze=y.name.split(".").pop())==null?void 0:ze.toLowerCase());if(!R.includes(Ye)){s.attachments=`File type ${Ye} is not allowed`;continue}l.push(y);}l.length>0&&W(g=>[...g,...l]),Object.keys(s).length>0?v(g=>chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},g),s)):v(g=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},g),{attachments:""}));},or=r=>{W(o=>o.filter((l,s)=>s!==r));},sr=()=>{let r={};return q.trim()||(r.breachTitle="Breach title is required"),P.trim()||(r.description="Description is required"),k||(r.category="Category is required"),j||(r.discoveredAt="Discovery date is required"),I.trim()||(r.reporterName="Reporter name is required"),N.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(N)||(r.reporterEmail="Reporter email is invalid"):r.reporterEmail="Reporter email is required",E.trim()||(r.reporterDepartment="Reporter department is required"),me.length===0&&(r.affectedSystems="At least one affected system is required"),M.length===0&&(r.dataTypes="At least one data type is required"),h&&isNaN(Number(h))&&(r.estimatedAffectedSubjects="Estimated affected subjects must be a number"),v(r),r},dr=r=>{r.preventDefault();let o=sr();if(Object.keys(o).length>0){u==null||u(o);return}let l={title:chunkUXUMYP4L_js.a(q),description:chunkUXUMYP4L_js.a(P),category:k,discoveredAt:new Date(j).getTime(),occurredAt:T?new Date(T).getTime():void 0,reportedAt:Date.now(),reporter:{name:chunkUXUMYP4L_js.a(I),email:chunkUXUMYP4L_js.a(N),department:chunkUXUMYP4L_js.a(E),phone:B?chunkUXUMYP4L_js.a(B):void 0},affectedSystems:me.map(s=>chunkUXUMYP4L_js.a(s)),dataTypes:M,estimatedAffectedSubjects:h?Number(h):void 0,approximateRecordCount:$?Number($):void 0,dataSubjectCategories:O?O.split(",").map(s=>chunkUXUMYP4L_js.a(s.trim())).filter(Boolean):void 0,involvesSensitiveData:he,likelyConsequences:L?chunkUXUMYP4L_js.a(L):void 0,mitigationMeasures:z?chunkUXUMYP4L_js.a(z):void 0,dpoContact:Y||U?{name:chunkUXUMYP4L_js.a(Y),email:chunkUXUMYP4L_js.a(U),phone:H?chunkUXUMYP4L_js.a(H):void 0}:void 0,isPhasedReport:Z||void 0,supplementsReportId:G?chunkUXUMYP4L_js.a(G):void 0,status:Ae,initialActions:K?chunkUXUMYP4L_js.a(K):void 0,attachments:_.map(s=>({name:s.name,type:s.type,size:s.size,file:s}))};Ge(l),Ke&&J(true);};if(rr)return jsxRuntime.jsxs("div",{"data-ndpr-component":"breach-report-form",className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${Q}`,children:[jsxRuntime.jsx("h2",{className:"text-lg font-bold ndpr-text-success mb-2",children:"Report Submitted"}),jsxRuntime.jsx("p",{className:"ndpr-text-success",children:We}),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 ndpr-text-warning mb-2",children:"Important: Next Steps"}),jsxRuntime.jsx("p",{className:"ndpr-text-warning 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:()=>J(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${X}`,children:"Report Another Breach"})]});let mr=[{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:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,d.root,c),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",d.title,c),children:Qe}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:Xe}),jsxRuntime.jsx("form",{onSubmit:dr,className:chunkAME4HJR4_js.a("",d.form,c),children:jsxRuntime.jsxs("div",{className:"ndpr-form-section",children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("",d.fieldGroup,c),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Breach Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"breachTitle",className:chunkAME4HJR4_js.a("ndpr-form-field__label",d.label,c),children:["Breach Title/Summary ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"breachTitle",value:q,onChange:r=>ee(r.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.input,c),required:true,"aria-invalid":!!a.breachTitle,"aria-describedby":a.breachTitle?"breachTitle-error":void 0}),a.breachTitle&&jsxRuntime.jsx("p",{id:"breachTitle-error",role:"alert",className:"ndpr-form-field__error",children:a.breachTitle})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"category",className:chunkAME4HJR4_js.a("ndpr-form-field__label",d.label,c),children:["Breach Category ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsxs("select",{id:"category",value:k,onChange:r=>te(r.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.select,c),required:true,"aria-invalid":!!a.category,"aria-describedby":a.category?"category-error":void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select a category"}),Ze.map(r=>jsxRuntime.jsx("option",{value:r.id,children:r.name},r.id))]}),a.category&&jsxRuntime.jsx("p",{id:"category-error",role:"alert",className:"ndpr-form-field__error",children:a.category})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"description",className:chunkAME4HJR4_js.a("ndpr-form-field__label",d.label,c),children:["Detailed Description ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"description",value:P,onChange:r=>re(r.target.value),rows:4,className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.textarea,c),required:true,"aria-invalid":!!a.description,"aria-describedby":a.description?"description-error":void 0}),a.description&&jsxRuntime.jsx("p",{id:"description-error",role:"alert",className:"ndpr-form-field__error",children:a.description})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"discoveredAt",className:"ndpr-form-field__label",children:["Date Discovered ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"datetime-local",id:"discoveredAt",value:j,onChange:r=>ie(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.discoveredAt,"aria-describedby":a.discoveredAt?"discoveredAt-error":void 0}),a.discoveredAt&&jsxRuntime.jsx("p",{id:"discoveredAt-error",role:"alert",className:"ndpr-form-field__error",children:a.discoveredAt})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"occurredAt",className:"ndpr-form-field__label",children:"Date Occurred (if known)"}),jsxRuntime.jsx("input",{type:"datetime-local",id:"occurredAt",value:T,onChange:r=>ae(r.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Reporter Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterName",className:"ndpr-form-field__label",children:["Your Name ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterName",value:I,onChange:r=>ne(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterName,"aria-describedby":a.reporterName?"reporterName-error":void 0}),a.reporterName&&jsxRuntime.jsx("p",{id:"reporterName-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterName})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterEmail",className:"ndpr-form-field__label",children:["Your Email ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",id:"reporterEmail",value:N,onChange:r=>oe(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterEmail,"aria-describedby":a.reporterEmail?"reporterEmail-error":void 0}),a.reporterEmail&&jsxRuntime.jsx("p",{id:"reporterEmail-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterEmail})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterDepartment",className:"ndpr-form-field__label",children:["Your Department ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterDepartment",value:E,onChange:r=>se(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterDepartment,"aria-describedby":a.reporterDepartment?"reporterDepartment-error":void 0}),a.reporterDepartment&&jsxRuntime.jsx("p",{id:"reporterDepartment-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterDepartment})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"reporterPhone",className:"ndpr-form-field__label",children:"Your Phone Number (Optional)"}),jsxRuntime.jsx("input",{type:"tel",id:"reporterPhone",value:B,onChange:r=>de(r.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Impact Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"affectedSystems",className:"ndpr-form-field__label",children:["Affected Systems/Applications ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"affectedSystems",value:er,onChange:ir,placeholder:"e.g. CRM, Email Server, Website (comma separated)",className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.affectedSystems,"aria-describedby":a.affectedSystems?"affectedSystems-error":void 0}),a.affectedSystems&&jsxRuntime.jsx("p",{id:"affectedSystems-error",role:"alert",className:"ndpr-form-field__error",children:a.affectedSystems})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"ndpr-form-field__label",children:"Estimated Number of Affected Data Subjects"}),jsxRuntime.jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:h,onChange:r=>ge(r.target.value),placeholder:"e.g. 100",className:"ndpr-form-field__input","aria-invalid":!!a.estimatedAffectedSubjects,"aria-describedby":a.estimatedAffectedSubjects?"estimatedAffectedSubjects-error":void 0}),a.estimatedAffectedSubjects&&jsxRuntime.jsx("p",{id:"estimatedAffectedSubjects-error",role:"alert",className:"ndpr-form-field__error",children:a.estimatedAffectedSubjects})]}),jsxRuntime.jsxs("fieldset",{className:"md:col-span-2","aria-invalid":!!a.dataTypes,"aria-describedby":a.dataTypes?"dataTypes-error":void 0,children:[jsxRuntime.jsxs("legend",{className:"ndpr-form-field__label",children:["Types of Data Involved ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required","aria-hidden":"true",children:"*"}),jsxRuntime.jsx("span",{className:"sr-only",children:"(required)"})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:mr.map(r=>jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"checkbox",id:`dataType_${r.id}`,checked:M.includes(r.id),onChange:()=>ar(r.id),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:`dataType_${r.id}`,className:"ml-2 text-sm ndpr-text-muted",children:r.label})]},r.id))}),a.dataTypes&&jsxRuntime.jsx("p",{id:"dataTypes-error",role:"alert",className:"ndpr-form-field__error",children:a.dataTypes})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"status",className:"ndpr-form-field__label",children:["Current Status ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsxs("select",{id:"status",value:Ae,onChange:r=>De(r.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.select,c),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",{children:[jsxRuntime.jsx("label",{htmlFor:"approximateRecordCount",className:"ndpr-form-field__label",children:"Approximate Number of Records Concerned"}),jsxRuntime.jsx("input",{type:"text",id:"approximateRecordCount",value:$,onChange:r=>be(r.target.value),placeholder:"e.g. 5000",className:"ndpr-form-field__input"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Required for the NDPC report (NDPA Section 40(2))."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSubjectCategories",className:"ndpr-form-field__label",children:"Categories of Data Subjects Affected"}),jsxRuntime.jsx("input",{type:"text",id:"dataSubjectCategories",value:O,onChange:r=>fe(r.target.value),placeholder:"e.g. customers, employees, minors",className:"ndpr-form-field__input"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Comma-separated. Required for the NDPC report (NDPA Section 40(2))."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2 flex items-center",children:[jsxRuntime.jsx("input",{id:"involvesSensitiveData",type:"checkbox",checked:he,onChange:r=>ve(r.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"involvesSensitiveData",className:"ml-2 text-sm ndpr-text-muted",children:"Sensitive personal data (NDPA Section 30) is involved"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"likelyConsequences",className:"ndpr-form-field__label",children:"Likely Consequences for Data Subjects"}),jsxRuntime.jsx("textarea",{id:"likelyConsequences",value:L,onChange:r=>Ne(r.target.value),placeholder:"e.g. identity theft, financial loss, reputational damage, discrimination",rows:3,className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.textarea,c)}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Required content for NDPC report and Section 40(3) communications to data subjects."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"mitigationMeasures",className:"ndpr-form-field__label",children:"Mitigation Measures"}),jsxRuntime.jsx("textarea",{id:"mitigationMeasures",value:z,onChange:r=>_e(r.target.value),placeholder:"Measures taken or proposed to mitigate possible adverse effects (NDPA Section 40(3))",rows:3,className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.textarea,c)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("h4",{className:"ndpr-section-heading text-sm mt-4",children:"Data Protection Officer (NDPC contact)"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mb-2",children:"Defaults to organisation-level DPO if left blank."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpoName",className:"ndpr-form-field__label",children:"DPO Name"}),jsxRuntime.jsx("input",{type:"text",id:"dpoName",value:Y,onChange:r=>ye(r.target.value),className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpoEmail",className:"ndpr-form-field__label",children:"DPO Email"}),jsxRuntime.jsx("input",{type:"email",id:"dpoEmail",value:U,onChange:r=>ue(r.target.value),className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpoPhone",className:"ndpr-form-field__label",children:"DPO Phone"}),jsxRuntime.jsx("input",{type:"tel",id:"dpoPhone",value:H,onChange:r=>xe(r.target.value),className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2 flex items-center mt-2",children:[jsxRuntime.jsx("input",{id:"isPhasedReport",type:"checkbox",checked:Z,onChange:r=>Ce(r.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"isPhasedReport",className:"ml-2 text-sm ndpr-text-muted",children:"This is a phased / interim report (Section 40(2) \u2014 complete info not yet available)"})]}),Z&&jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"supplementsReportId",className:"ndpr-form-field__label",children:"Supplements Report ID (if applicable)"}),jsxRuntime.jsx("input",{type:"text",id:"supplementsReportId",value:G,onChange:r=>Se(r.target.value),placeholder:"Prior report ID this report supplements",className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"initialActions",className:"ndpr-form-field__label",children:"Initial Actions Taken"}),jsxRuntime.jsx("textarea",{id:"initialActions",value:K,onChange:r=>Re(r.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",rows:3,className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.textarea,c)})]})]})]}),Je&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Attachments"}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("label",{className:"ndpr-form-field__label",children:"Upload Supporting Files (Optional)"}),jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-muted mb-2",children:["Max ",A," files, ",D/(1024*1024),"MB each. Allowed types: ",R.join(", ")]}),jsxRuntime.jsx("input",{type:"file",onChange:nr,multiple:true,className:"ndpr-form-field__input",accept:R.join(",")}),a.attachments&&jsxRuntime.jsx("p",{id:"attachments-error",role:"alert",className:"ndpr-form-field__error",children:a.attachments})]}),_.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("h4",{className:"ndpr-form-field__label",children:"Attached Files:"}),jsxRuntime.jsx("ul",{className:"ndpr-form-section",children:_.map((r,o)=>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 ndpr-text-muted 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 ndpr-text-muted",children:r.name}),jsxRuntime.jsxs("span",{className:"ml-2 text-xs ndpr-text-muted",children:["(",(r.size/1024).toFixed(1)," KB)"]})]}),jsxRuntime.jsxs("button",{type:"button",onClick:()=>or(o),"aria-label":`Remove attachment ${r.name}`,className:"text-red-500 hover:ndpr-text-destructive p-2 min-w-[44px] min-h-[44px] flex items-center justify-center",children:[jsxRuntime.jsx("svg",{"aria-hidden":"true",focusable:"false",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"})}),jsxRuntime.jsx("span",{className:"sr-only",children:"Remove"})]})]},o))})]})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--info",d.notice,c),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"ndpr-text-info 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.jsxs("div",{className:"mt-6 relative flex gap-3",children:[f&&d.loadingOverlay&&jsxRuntime.jsx("div",{className:d.loadingOverlay}),jsxRuntime.jsx("button",{type:"submit",disabled:f,className:chunkAME4HJR4_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${X} ${f?"opacity-50 cursor-not-allowed":""}`,d.primaryButton||d.submitButton,c),children:f?"Submitting...":Ve}),jsxRuntime.jsx("button",{type:"button",onClick:tr,disabled:f,className:chunkAME4HJR4_js.a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,c),children:"Reset"})]})]})})]})};
|
|
1
|
+
'use strict';var chunkUXUMYP4L_js=require('./chunk-UXUMYP4L.js'),chunkNDKDKDDX_js=require('./chunk-NDKDKDDX.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var fr=({categories:Ze,onSubmit:Ge,onValidationError:u,title:x,formDescription:C,submitButtonText:S,className:Q="",buttonClassName:X="",classNames:d={},unstyled:c=false,isSubmitting:f=false,showConfirmation:Ke=true,confirmationMessage:We="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:Je=true,maxAttachments:A=5,maxFileSize:D=5*1024*1024,allowedFileTypes:R=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"],defaultValues:t,onReset:w})=>{var we,Fe,qe,Pe,ke,je,Te,Ie,Ee,Be,Me,$e,Oe,Le;let F=chunkNDKDKDDX_js.c(),Qe=(we=x!=null?x:F.breach.title)!=null?we:"Report a Data Breach",Xe=(Fe=C!=null?C:F.breach.description)!=null?Fe:"Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40. All fields marked with * are required.",Ve=(qe=S!=null?S:F.breach.submitReport)!=null?qe:"Submit Report",V=r=>{if(!r)return "";let o=new Date(r),l=s=>String(s).padStart(2,"0");return `${o.getFullYear()}-${l(o.getMonth()+1)}-${l(o.getDate())}T${l(o.getHours())}:${l(o.getMinutes())}`},[q,ee]=react.useState((t==null?void 0:t.title)||""),[P,re]=react.useState((t==null?void 0:t.description)||""),[k,te]=react.useState((t==null?void 0:t.category)||""),[j,ie]=react.useState(V(t==null?void 0:t.discoveredAt)),[T,ae]=react.useState(V(t==null?void 0:t.occurredAt)),[I,ne]=react.useState(((Pe=t==null?void 0:t.reporter)==null?void 0:Pe.name)||""),[N,oe]=react.useState(((ke=t==null?void 0:t.reporter)==null?void 0:ke.email)||""),[E,se]=react.useState(((je=t==null?void 0:t.reporter)==null?void 0:je.department)||""),[B,de]=react.useState(((Te=t==null?void 0:t.reporter)==null?void 0:Te.phone)||""),[me,ce]=react.useState((t==null?void 0:t.affectedSystems)||[]),[er,pe]=react.useState(((Ie=t==null?void 0:t.affectedSystems)==null?void 0:Ie.join(", "))||""),[M,le]=react.useState((t==null?void 0:t.dataTypes)||[]),[h,ge]=react.useState((t==null?void 0:t.estimatedAffectedSubjects)!=null?String(t.estimatedAffectedSubjects):""),[$,be]=react.useState((t==null?void 0:t.approximateRecordCount)!=null?String(t.approximateRecordCount):""),[O,fe]=react.useState(((Ee=t==null?void 0:t.dataSubjectCategories)==null?void 0:Ee.join(", "))||""),[he,ve]=react.useState((Be=t==null?void 0:t.involvesSensitiveData)!=null?Be:false),[L,Ne]=react.useState((t==null?void 0:t.likelyConsequences)||""),[z,_e]=react.useState((t==null?void 0:t.mitigationMeasures)||""),[Y,ye]=react.useState(((Me=t==null?void 0:t.dpoContact)==null?void 0:Me.name)||""),[U,ue]=react.useState((($e=t==null?void 0:t.dpoContact)==null?void 0:$e.email)||""),[H,xe]=react.useState(((Oe=t==null?void 0:t.dpoContact)==null?void 0:Oe.phone)||""),[Z,Ce]=react.useState((Le=t==null?void 0:t.isPhasedReport)!=null?Le:false),[G,Se]=react.useState((t==null?void 0:t.supplementsReportId)||""),[Ae,De]=react.useState((t==null?void 0:t.status)||"ongoing"),[K,Re]=react.useState((t==null?void 0:t.initialActions)||""),[_,W]=react.useState([]),[rr,J]=react.useState(false),[a,v]=react.useState({}),tr=()=>{ee(""),re(""),te(""),ie(""),ae(""),ne(""),oe(""),se(""),de(""),ce([]),pe(""),le([]),ge(""),be(""),fe(""),ve(false),Ne(""),_e(""),ye(""),ue(""),xe(""),Ce(false),Se(""),De("ongoing"),Re(""),W([]),J(false),v({}),w==null||w();},ir=r=>{let o=r.target.value;pe(o);let l=o.split(",").map(s=>s.trim()).filter(Boolean);ce(l);},ar=r=>{le(o=>o.includes(r)?o.filter(l=>l!==r):[...o,r]);},nr=r=>{var ze;let o=r.target.files;if(!o)return;let l=[],s={};if(_.length+o.length>A){s.attachments=`Maximum of ${A} files allowed`,v(g=>chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},g),s));return}for(let g=0;g<o.length;g++){let y=o[g];if(y.size>D){s.attachments=`File ${y.name} exceeds the maximum size of ${D/(1024*1024)}MB`;continue}let Ye="."+((ze=y.name.split(".").pop())==null?void 0:ze.toLowerCase());if(!R.includes(Ye)){s.attachments=`File type ${Ye} is not allowed`;continue}l.push(y);}l.length>0&&W(g=>[...g,...l]),Object.keys(s).length>0?v(g=>chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},g),s)):v(g=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},g),{attachments:""}));},or=r=>{W(o=>o.filter((l,s)=>s!==r));},sr=()=>{let r={};return q.trim()||(r.breachTitle="Breach title is required"),P.trim()||(r.description="Description is required"),k||(r.category="Category is required"),j||(r.discoveredAt="Discovery date is required"),I.trim()||(r.reporterName="Reporter name is required"),N.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(N)||(r.reporterEmail="Reporter email is invalid"):r.reporterEmail="Reporter email is required",E.trim()||(r.reporterDepartment="Reporter department is required"),me.length===0&&(r.affectedSystems="At least one affected system is required"),M.length===0&&(r.dataTypes="At least one data type is required"),h&&isNaN(Number(h))&&(r.estimatedAffectedSubjects="Estimated affected subjects must be a number"),v(r),r},dr=r=>{r.preventDefault();let o=sr();if(Object.keys(o).length>0){u==null||u(o);return}let l={title:chunkUXUMYP4L_js.a(q),description:chunkUXUMYP4L_js.a(P),category:k,discoveredAt:new Date(j).getTime(),occurredAt:T?new Date(T).getTime():void 0,reportedAt:Date.now(),reporter:{name:chunkUXUMYP4L_js.a(I),email:chunkUXUMYP4L_js.a(N),department:chunkUXUMYP4L_js.a(E),phone:B?chunkUXUMYP4L_js.a(B):void 0},affectedSystems:me.map(s=>chunkUXUMYP4L_js.a(s)),dataTypes:M,estimatedAffectedSubjects:h?Number(h):void 0,approximateRecordCount:$?Number($):void 0,dataSubjectCategories:O?O.split(",").map(s=>chunkUXUMYP4L_js.a(s.trim())).filter(Boolean):void 0,involvesSensitiveData:he,likelyConsequences:L?chunkUXUMYP4L_js.a(L):void 0,mitigationMeasures:z?chunkUXUMYP4L_js.a(z):void 0,dpoContact:Y||U?{name:chunkUXUMYP4L_js.a(Y),email:chunkUXUMYP4L_js.a(U),phone:H?chunkUXUMYP4L_js.a(H):void 0}:void 0,isPhasedReport:Z||void 0,supplementsReportId:G?chunkUXUMYP4L_js.a(G):void 0,status:Ae,initialActions:K?chunkUXUMYP4L_js.a(K):void 0,attachments:_.map(s=>({name:s.name,type:s.type,size:s.size,file:s}))};Ge(l),Ke&&J(true);};if(rr)return jsxRuntime.jsxs("div",{"data-ndpr-component":"breach-report-form",className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${Q}`,children:[jsxRuntime.jsx("h2",{className:"text-lg font-bold ndpr-text-success mb-2",children:"Report Submitted"}),jsxRuntime.jsx("p",{className:"ndpr-text-success",children:We}),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 ndpr-text-warning mb-2",children:"Important: Next Steps"}),jsxRuntime.jsx("p",{className:"ndpr-text-warning 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:()=>J(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${X}`,children:"Report Another Breach"})]});let mr=[{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:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,d.root,c),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",d.title,c),children:Qe}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:Xe}),jsxRuntime.jsx("form",{onSubmit:dr,className:chunkAME4HJR4_js.a("",d.form,c),children:jsxRuntime.jsxs("div",{className:"ndpr-form-section",children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("",d.fieldGroup,c),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Breach Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"breachTitle",className:chunkAME4HJR4_js.a("ndpr-form-field__label",d.label,c),children:["Breach Title/Summary ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"breachTitle",value:q,onChange:r=>ee(r.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.input,c),required:true,"aria-invalid":!!a.breachTitle,"aria-describedby":a.breachTitle?"breachTitle-error":void 0}),a.breachTitle&&jsxRuntime.jsx("p",{id:"breachTitle-error",role:"alert",className:"ndpr-form-field__error",children:a.breachTitle})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"category",className:chunkAME4HJR4_js.a("ndpr-form-field__label",d.label,c),children:["Breach Category ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsxs("select",{id:"category",value:k,onChange:r=>te(r.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.select,c),required:true,"aria-invalid":!!a.category,"aria-describedby":a.category?"category-error":void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select a category"}),Ze.map(r=>jsxRuntime.jsx("option",{value:r.id,children:r.name},r.id))]}),a.category&&jsxRuntime.jsx("p",{id:"category-error",role:"alert",className:"ndpr-form-field__error",children:a.category})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"description",className:chunkAME4HJR4_js.a("ndpr-form-field__label",d.label,c),children:["Detailed Description ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"description",value:P,onChange:r=>re(r.target.value),rows:4,className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.textarea,c),required:true,"aria-invalid":!!a.description,"aria-describedby":a.description?"description-error":void 0}),a.description&&jsxRuntime.jsx("p",{id:"description-error",role:"alert",className:"ndpr-form-field__error",children:a.description})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"discoveredAt",className:"ndpr-form-field__label",children:["Date Discovered ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"datetime-local",id:"discoveredAt",value:j,onChange:r=>ie(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.discoveredAt,"aria-describedby":a.discoveredAt?"discoveredAt-error":void 0}),a.discoveredAt&&jsxRuntime.jsx("p",{id:"discoveredAt-error",role:"alert",className:"ndpr-form-field__error",children:a.discoveredAt})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"occurredAt",className:"ndpr-form-field__label",children:"Date Occurred (if known)"}),jsxRuntime.jsx("input",{type:"datetime-local",id:"occurredAt",value:T,onChange:r=>ae(r.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Reporter Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterName",className:"ndpr-form-field__label",children:["Your Name ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterName",value:I,onChange:r=>ne(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterName,"aria-describedby":a.reporterName?"reporterName-error":void 0}),a.reporterName&&jsxRuntime.jsx("p",{id:"reporterName-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterName})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterEmail",className:"ndpr-form-field__label",children:["Your Email ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",id:"reporterEmail",value:N,onChange:r=>oe(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterEmail,"aria-describedby":a.reporterEmail?"reporterEmail-error":void 0}),a.reporterEmail&&jsxRuntime.jsx("p",{id:"reporterEmail-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterEmail})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterDepartment",className:"ndpr-form-field__label",children:["Your Department ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterDepartment",value:E,onChange:r=>se(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterDepartment,"aria-describedby":a.reporterDepartment?"reporterDepartment-error":void 0}),a.reporterDepartment&&jsxRuntime.jsx("p",{id:"reporterDepartment-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterDepartment})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"reporterPhone",className:"ndpr-form-field__label",children:"Your Phone Number (Optional)"}),jsxRuntime.jsx("input",{type:"tel",id:"reporterPhone",value:B,onChange:r=>de(r.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Impact Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"affectedSystems",className:"ndpr-form-field__label",children:["Affected Systems/Applications ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"affectedSystems",value:er,onChange:ir,placeholder:"e.g. CRM, Email Server, Website (comma separated)",className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.affectedSystems,"aria-describedby":a.affectedSystems?"affectedSystems-error":void 0}),a.affectedSystems&&jsxRuntime.jsx("p",{id:"affectedSystems-error",role:"alert",className:"ndpr-form-field__error",children:a.affectedSystems})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"ndpr-form-field__label",children:"Estimated Number of Affected Data Subjects"}),jsxRuntime.jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:h,onChange:r=>ge(r.target.value),placeholder:"e.g. 100",className:"ndpr-form-field__input","aria-invalid":!!a.estimatedAffectedSubjects,"aria-describedby":a.estimatedAffectedSubjects?"estimatedAffectedSubjects-error":void 0}),a.estimatedAffectedSubjects&&jsxRuntime.jsx("p",{id:"estimatedAffectedSubjects-error",role:"alert",className:"ndpr-form-field__error",children:a.estimatedAffectedSubjects})]}),jsxRuntime.jsxs("fieldset",{className:"md:col-span-2","aria-invalid":!!a.dataTypes,"aria-describedby":a.dataTypes?"dataTypes-error":void 0,children:[jsxRuntime.jsxs("legend",{className:"ndpr-form-field__label",children:["Types of Data Involved ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required","aria-hidden":"true",children:"*"}),jsxRuntime.jsx("span",{className:"sr-only",children:"(required)"})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:mr.map(r=>jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"checkbox",id:`dataType_${r.id}`,checked:M.includes(r.id),onChange:()=>ar(r.id),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:`dataType_${r.id}`,className:"ml-2 text-sm ndpr-text-muted",children:r.label})]},r.id))}),a.dataTypes&&jsxRuntime.jsx("p",{id:"dataTypes-error",role:"alert",className:"ndpr-form-field__error",children:a.dataTypes})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"status",className:"ndpr-form-field__label",children:["Current Status ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsxs("select",{id:"status",value:Ae,onChange:r=>De(r.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.select,c),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",{children:[jsxRuntime.jsx("label",{htmlFor:"approximateRecordCount",className:"ndpr-form-field__label",children:"Approximate Number of Records Concerned"}),jsxRuntime.jsx("input",{type:"text",id:"approximateRecordCount",value:$,onChange:r=>be(r.target.value),placeholder:"e.g. 5000",className:"ndpr-form-field__input"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Required for the NDPC report (NDPA Section 40(2))."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSubjectCategories",className:"ndpr-form-field__label",children:"Categories of Data Subjects Affected"}),jsxRuntime.jsx("input",{type:"text",id:"dataSubjectCategories",value:O,onChange:r=>fe(r.target.value),placeholder:"e.g. customers, employees, minors",className:"ndpr-form-field__input"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Comma-separated. Required for the NDPC report (NDPA Section 40(2))."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2 flex items-center",children:[jsxRuntime.jsx("input",{id:"involvesSensitiveData",type:"checkbox",checked:he,onChange:r=>ve(r.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"involvesSensitiveData",className:"ml-2 text-sm ndpr-text-muted",children:"Sensitive personal data (NDPA Section 30) is involved"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"likelyConsequences",className:"ndpr-form-field__label",children:"Likely Consequences for Data Subjects"}),jsxRuntime.jsx("textarea",{id:"likelyConsequences",value:L,onChange:r=>Ne(r.target.value),placeholder:"e.g. identity theft, financial loss, reputational damage, discrimination",rows:3,className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.textarea,c)}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mt-1",children:"Required content for NDPC report and Section 40(3) communications to data subjects."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"mitigationMeasures",className:"ndpr-form-field__label",children:"Mitigation Measures"}),jsxRuntime.jsx("textarea",{id:"mitigationMeasures",value:z,onChange:r=>_e(r.target.value),placeholder:"Measures taken or proposed to mitigate possible adverse effects (NDPA Section 40(3))",rows:3,className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.textarea,c)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("h4",{className:"ndpr-section-heading text-sm mt-4",children:"Data Protection Officer (NDPC contact)"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mb-2",children:"Defaults to organisation-level DPO if left blank."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpoName",className:"ndpr-form-field__label",children:"DPO Name"}),jsxRuntime.jsx("input",{type:"text",id:"dpoName",value:Y,onChange:r=>ye(r.target.value),className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpoEmail",className:"ndpr-form-field__label",children:"DPO Email"}),jsxRuntime.jsx("input",{type:"email",id:"dpoEmail",value:U,onChange:r=>ue(r.target.value),className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpoPhone",className:"ndpr-form-field__label",children:"DPO Phone"}),jsxRuntime.jsx("input",{type:"tel",id:"dpoPhone",value:H,onChange:r=>xe(r.target.value),className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2 flex items-center mt-2",children:[jsxRuntime.jsx("input",{id:"isPhasedReport",type:"checkbox",checked:Z,onChange:r=>Ce(r.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"isPhasedReport",className:"ml-2 text-sm ndpr-text-muted",children:"This is a phased / interim report (Section 40(2) \u2014 complete info not yet available)"})]}),Z&&jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"supplementsReportId",className:"ndpr-form-field__label",children:"Supplements Report ID (if applicable)"}),jsxRuntime.jsx("input",{type:"text",id:"supplementsReportId",value:G,onChange:r=>Se(r.target.value),placeholder:"Prior report ID this report supplements",className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"initialActions",className:"ndpr-form-field__label",children:"Initial Actions Taken"}),jsxRuntime.jsx("textarea",{id:"initialActions",value:K,onChange:r=>Re(r.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",rows:3,className:chunkAME4HJR4_js.a("ndpr-form-field__input",d.textarea,c)})]})]})]}),Je&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Attachments"}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("label",{htmlFor:"breach-attachments",className:"ndpr-form-field__label",children:"Upload Supporting Files (Optional)"}),jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-muted mb-2",children:["Max ",A," files, ",D/(1024*1024),"MB each. Allowed types: ",R.join(", ")]}),jsxRuntime.jsx("input",{id:"breach-attachments",type:"file",onChange:nr,multiple:true,className:"ndpr-form-field__input",accept:R.join(",")}),a.attachments&&jsxRuntime.jsx("p",{id:"attachments-error",role:"alert",className:"ndpr-form-field__error",children:a.attachments})]}),_.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("h4",{className:"ndpr-form-field__label",children:"Attached Files:"}),jsxRuntime.jsx("ul",{className:"ndpr-form-section",children:_.map((r,o)=>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",{"aria-hidden":"true",focusable:"false",className:"w-4 h-4 ndpr-text-muted 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 ndpr-text-muted",children:r.name}),jsxRuntime.jsxs("span",{className:"ml-2 text-xs ndpr-text-muted",children:["(",(r.size/1024).toFixed(1)," KB)"]})]}),jsxRuntime.jsxs("button",{type:"button",onClick:()=>or(o),"aria-label":`Remove attachment ${r.name}`,className:"text-red-500 hover:ndpr-text-destructive p-2 min-w-[44px] min-h-[44px] flex items-center justify-center",children:[jsxRuntime.jsx("svg",{"aria-hidden":"true",focusable:"false",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"})}),jsxRuntime.jsx("span",{className:"sr-only",children:"Remove"})]})]},o))})]})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--info",d.notice,c),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"ndpr-text-info 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.jsxs("div",{className:"mt-6 relative flex gap-3",children:[f&&d.loadingOverlay&&jsxRuntime.jsx("div",{className:d.loadingOverlay}),jsxRuntime.jsx("button",{type:"submit",disabled:f,className:chunkAME4HJR4_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${X} ${f?"opacity-50 cursor-not-allowed":""}`,d.primaryButton||d.submitButton,c),children:f?"Submitting...":Ve}),jsxRuntime.jsx("button",{type:"button",onClick:tr,disabled:f,className:chunkAME4HJR4_js.a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,c),children:"Reset"})]})]})})]})};
|
|
2
2
|
exports.a=fr;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b as b$1,c,d}from'./chunk-XP5PL6K7.mjs';import {b,a}from'./chunk-ZJYULEER.mjs';import {useRef,useState,useEffect,useCallback,useMemo}from'react';function T({initialData:w,adapter:y,onRecordAdd:m,onRecordUpdate:P,onRecordArchive:g}){let d$1=useRef(y);d$1.current=y;let[r,p]=useState(w),[x,u]=useState(true);useEffect(()=>{if(!d$1.current){u(false);return}let t=false;try{let e=d$1.current.load();e instanceof Promise?e.then(s=>{t||(s&&p(s),u(!1));},()=>{t||u(!1);}):(e&&p(e),u(!1));}catch(e){t||u(false);}return ()=>{t=true;}},[]);let o=useCallback(t=>{d$1.current&&Promise.resolve(d$1.current.save(t)).catch(e=>{console.warn("[ndpr-toolkit] Failed to save ROPA:",e);});},[]),D=useCallback(t=>{p(e=>{let s=b(a({},e),{records:[...e.records,t],lastUpdated:Date.now()});return o(s),s}),m==null||m(t);},[m,o]),b$2=useCallback((t,e)=>{p(s=>{let n=b(a({},s),{records:s.records.map(O=>O.id===t?b(a(a({},O),e),{updatedAt:Date.now()}):O),lastUpdated:Date.now()});return o(n),n}),P==null||P(t,e);},[P,o]),L=useCallback(t=>{p(e=>{let s=b(a({},e),{records:e.records.map(n=>n.id===t?b(a({},n),{status:"archived",updatedAt:Date.now()}):n),lastUpdated:Date.now()});return o(s),s}),g==null||g(t);},[g,o]),U=useCallback(t=>r.records.find(e=>e.id===t),[r.records]),f=useMemo(()=>b$1(r),[r]),l=useMemo(()=>c(r),[r]),R=useMemo(()=>d(r),[r]),V=useCallback(()=>f,[f]),h=useCallback(()=>l,[l]),k=useCallback(()=>R,[R]);return {ropa:r,addRecord:D,updateRecord:b$2,archiveRecord:L,getRecord:U,getSummary:V,exportCSV:h,getComplianceGaps:k,summary:f,csv:l,complianceGaps:R,isLoading:x}}export{T as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk4CVBQC66_js=require('./chunk-4CVBQC66.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var q=[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_interest",label:"Public Interest (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}],ee=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"archived",label:"Archived"}],Me=[{value:"data_subject",label:"Directly from Data Subject"},{value:"third_party",label:"Third Party"},{value:"public_source",label:"Public Source"},{value:"other",label:"Other"}],Oe={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--warning",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},Te={active:"Active",inactive:"Inactive",archived:"Archived"},je={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"};function qe(){let o=Date.now();return {id:`proc_${o}_${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:o,updatedAt:o}}function te(o){return o?new Date(o).toLocaleDateString():"N/A"}var Ge=({ropa:o,onAddRecord:y,onUpdateRecord:D,onArchiveRecord:S,title:re="Record of Processing Activities (ROPA)",description:ie="Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",className:ae="",buttonClassName:B="",classNames:e,unstyled:n})=>{let[f,b]=react.useState("list"),[w,ne]=react.useState(""),[P,de]=react.useState("all"),[k,oe]=react.useState("all"),[l,h]=react.useState(null),[U,C]=react.useState([]),[I,$]=react.useState(""),[F,H]=react.useState(""),[E,V]=react.useState(""),[L,G]=react.useState(""),[M,J]=react.useState(""),[O,z]=react.useState(""),[T,W]=react.useState(""),g=react.useMemo(()=>chunk4CVBQC66_js.b(o),[o]),_=react.useMemo(()=>chunk4CVBQC66_js.d(o),[o]),K=react.useMemo(()=>{let r=[...o.records];if(P!=="all"&&(r=r.filter(a=>a.status===P)),k!=="all"&&(r=r.filter(a=>a.lawfulBasis===k)),w){let a=w.toLowerCase();r=r.filter(p=>p.name.toLowerCase().includes(a)||p.description.toLowerCase().includes(a)||p.dataCategories.some(m=>m.toLowerCase().includes(a))||p.department&&p.department.toLowerCase().includes(a));}return r},[o.records,P,k,w]);react.useEffect(()=>{l&&($(l.purposes.join(", ")),H(l.dataCategories.join(", ")),V((l.sensitiveDataCategories||[]).join(", ")),G(l.dataSubjectCategories.join(", ")),J(l.recipients.join(", ")),z(l.securityMeasures.join(", ")),W((l.systemsUsed||[]).join(", ")));},[l==null?void 0:l.id]);let le=react.useCallback(()=>{let r=qe();r.controllerDetails.name=o.organizationName,r.controllerDetails.contact=o.organizationContact,r.controllerDetails.address=o.organizationAddress,o.ndpcRegistrationNumber&&(r.controllerDetails.registrationNumber=o.ndpcRegistrationNumber),o.dpoDetails&&(r.controllerDetails.dpoContact=o.dpoDetails.email),h(r),C([]),b("form");},[o.organizationName,o.organizationContact,o.organizationAddress,o.ndpcRegistrationNumber,o.dpoDetails]),pe=react.useCallback(r=>{h(chunkRFPLZDIO_js.a({},r)),C([]),b("form");},[]),v=r=>r.split(",").map(a=>a.trim()).filter(a=>a.length>0),ue=react.useCallback(()=>{if(!l)return;let r=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},l),{purposes:v(I),dataCategories:v(F),sensitiveDataCategories:v(E),dataSubjectCategories:v(L),recipients:v(M),securityMeasures:v(O),systemsUsed:v(T),updatedAt:Date.now()});r.sensitiveDataCategories&&r.sensitiveDataCategories.length===0&&(r.sensitiveDataCategories=void 0),r.systemsUsed&&r.systemsUsed.length===0&&(r.systemsUsed=void 0);let a=chunk4CVBQC66_js.a(r);if(!a.valid){C(a.errors);return}o.records.find(m=>m.id===r.id)?D==null||D(r.id,r):y==null||y(r),h(null),C([]),b("list");},[l,I,F,E,L,M,O,T,o.records,D,y]),ce=react.useCallback(r=>{S==null||S(r);},[S]),se=react.useCallback(()=>{let r=chunk4CVBQC66_js.c(o),a=new Blob([r],{type:"text/csv;charset=utf-8;"}),p=URL.createObjectURL(a),m=document.createElement("a");m.href=p,m.download=`ropa_${o.organizationName.replace(/\s+/g,"_").toLowerCase()}_${new Date().toISOString().slice(0,10)}.csv`,m.click(),setTimeout(()=>URL.revokeObjectURL(p),100);},[o]),Q=react.useCallback(()=>{h(null),C([]),b("list");},[]),c=react.useCallback((r,a)=>{h(p=>p&&chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},p),{[r]:a}));},[]),j=react.useCallback((r,a)=>{h(p=>p&&chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},p),{controllerDetails:chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},p.controllerDetails),{[r]:a})}));},[]),ge=react.useCallback(r=>!!r.nextReviewDate&&r.nextReviewDate<=Date.now(),[]),me=react.useCallback(r=>{ne(r.target.value);},[]),ve=react.useCallback(r=>{de(r.target.value);},[]),fe=react.useCallback(r=>{oe(r.target.value);},[]),be=react.useCallback(r=>{$(r.target.value);},[]),he=react.useCallback(r=>{H(r.target.value);},[]),_e=react.useCallback(r=>{V(r.target.value);},[]),xe=react.useCallback(r=>{G(r.target.value);},[]),Ce=react.useCallback(r=>{J(r.target.value);},[]),Re=react.useCallback(r=>{z(r.target.value);},[]),ye=react.useCallback(r=>{W(r.target.value);},[]),De=react.useCallback(()=>b("list"),[]),Se=react.useCallback(()=>b("summary"),[]),we=react.useCallback(r=>jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${Oe[r]}`,e==null?void 0:e.statusBadge,n),children:Te[r]}),[e==null?void 0:e.statusBadge,n]),Pe=react.useCallback(r=>jsxRuntime.jsx("span",{className:"ndpr-badge ndpr-badge--info",children:je[r]}),[]),ke=()=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",e==null?void 0:e.orgInfo,n),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Organization"}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:o.organizationName})]}),o.dpoDetails&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Data Protection Officer"}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:o.dpoDetails.name}),jsxRuntime.jsx("p",{className:"ndpr-form-field__hint",children:o.dpoDetails.email})]}),o.ndpcRegistrationNumber&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"NDPC Registration No."}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:o.ndpcRegistrationNumber})]})]}),jsxRuntime.jsxs("div",{className:"mt-2 text-xs ndpr-text-muted",children:["Version ",o.version," | Last Updated: ",te(o.lastUpdated)]})]}),Ae=()=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mb-6",e==null?void 0:e.summary,n),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.totalRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-info",children:"Total Records"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-success",children:g.activeRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-success",children:"Active"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.crossBorderRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-info",children:"Cross-Border"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:_.length}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-warning",children:"Records with Gaps"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"By Lawful Basis"}),q.map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r.label.split(" (")[0]}),jsxRuntime.jsx("span",{className:"font-medium",children:g.byLawfulBasis[r.value]||0})]},r.value))]}),jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Sensitive Data"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.sensitiveDataRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"DPIA Required"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.dpiaRequiredRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Automated Decisions"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.automatedDecisionRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Due for Review"}),jsxRuntime.jsx("span",{className:`font-medium ${g.recordsDueForReview.length>0?"ndpr-text-destructive":""}`,children:g.recordsDueForReview.length})]})]}),g.topDepartments.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Top Departments"}),g.topDepartments.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r.department}),jsxRuntime.jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]}),_.length>0&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md",e==null?void 0:e.complianceGap,n),role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-2",children:"Compliance Gaps Detected"}),_.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium ndpr-text-destructive",children:r.recordName}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((a,p)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]},r.recordId)),_.length>5&&jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["...and ",_.length-5," more record(s) with gaps."]})]})]}),Be=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaSearch",className:"ndpr-form-field__label",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"ropaSearch",value:w,onChange:me,placeholder:"Search records...",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaStatusFilter",className:"ndpr-form-field__label",children:"Status"}),jsxRuntime.jsxs("select",{id:"ropaStatusFilter",value:P,onChange:ve,className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),ee.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaBasisFilter",className:"ndpr-form-field__label",children:"Lawful Basis"}),jsxRuntime.jsxs("select",{id:"ropaBasisFilter",value:k,onChange:fe,className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsxRuntime.jsx("option",{value:"all",children:"All Bases"}),q.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label.split(" (")[0]},r.value))]})]}),jsxRuntime.jsxs("div",{className:"flex items-end space-x-2",children:[jsxRuntime.jsx("button",{onClick:le,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${B}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:"Add Record"}),jsxRuntime.jsx("button",{onClick:se,"aria-label":"Export ROPA records as CSV",className:chunkAME4HJR4_js.a(`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 text-sm ${B}`,(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.exportButton),n),children:"Export CSV"})]})]}),K.length===0?jsxRuntime.jsx("p",{className:"ndpr-empty-state",children:"No processing records found."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkAME4HJR4_js.a("w-full text-sm text-left",e==null?void 0:e.table,n),children:[jsxRuntime.jsx("thead",{className:chunkAME4HJR4_js.a("ndpr-table__head",e==null?void 0:e.tableHeader,n),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Name"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Data Categories"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Last Reviewed"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{children:K.map(r=>{let a=ge(r),p=_.some(m=>m.recordId===r.id);return jsxRuntime.jsxs("tr",{className:chunkAME4HJR4_js.a(`border-b dark:border-gray-600 ${a?"bg-red-50 dark:bg-red-900/10":p?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} hover:bg-gray-50 dark:hover:bg-gray-700`,e==null?void 0:e.tableRow,n),children:[jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"font-medium",children:r.name}),r.department&&jsxRuntime.jsx("p",{className:"ndpr-form-field__hint",children:r.department}),a&&jsxRuntime.jsx("span",{className:"text-xs ndpr-text-destructive font-medium",children:"Review Overdue"})]})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:Pe(r.lawfulBasis)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:we(r.status)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:te(r.lastReviewedAt)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsxs("div",{className:"ndpr-card__footer",children:[jsxRuntime.jsx("button",{onClick:()=>pe(r),"aria-label":`Edit record: ${r.name}`,className:"ndpr-text-primary hover:underline text-xs",children:"Edit"}),r.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>ce(r.id),"aria-label":`Archive record: ${r.name}`,className:"ndpr-text-muted hover:underline text-xs",children:"Archive"})]})})]},r.id)})})]})})]}),Ie=react.useMemo(()=>l?!o.records.find(r=>r.id===l.id):true,[l,o.records]),Fe=()=>{if(!l)return null;let r=Ie;return jsxRuntime.jsxs("div",{"data-ndpr-component":"ropa-manager",className:chunkAME4HJR4_js.a("",e==null?void 0:e.form,n),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex justify-between items-center mb-4",e==null?void 0:e.header,n),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:r?"Add Processing Record":"Edit Processing Record"}),jsxRuntime.jsx("button",{onClick:Q,className:"ndpr-button ndpr-button--ghost ndpr-button--sm",children:"Cancel"})]}),U.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:U.map((a,p)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-section",children:[jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Basic Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordName",className:"ndpr-form-field__label",children:"Activity Name *"}),jsxRuntime.jsx("input",{type:"text",id:"recordName",value:l.name,onChange:a=>c("name",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customer Account Management"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordDepartment",className:"ndpr-form-field__label",children:"Department"}),jsxRuntime.jsx("input",{type:"text",id:"recordDepartment",value:l.department||"",onChange:a=>c("department",a.target.value||void 0),className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Marketing"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"recordDescription",className:"ndpr-form-field__label",children:"Description *"}),jsxRuntime.jsx("textarea",{id:"recordDescription",value:l.description,onChange:a=>c("description",a.target.value),rows:3,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe what personal data processing is performed..."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordStatus",className:"ndpr-form-field__label",children:"Status *"}),jsxRuntime.jsx("select",{id:"recordStatus",value:l.status,onChange:a=>c("status",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:ee.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Controller Details"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerName",className:"ndpr-form-field__label",children:"Controller Name *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerName",value:l.controllerDetails.name,onChange:a=>j("name",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerContact",className:"ndpr-form-field__label",children:"Controller Contact *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerContact",value:l.controllerDetails.contact,onChange:a=>j("contact",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"controllerAddress",className:"ndpr-form-field__label",children:"Controller Address *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerAddress",value:l.controllerDetails.address,onChange:a=>j("address",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Lawful Basis (NDPA Section 25)"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasis",className:"ndpr-form-field__label",children:"Lawful Basis *"}),jsxRuntime.jsx("select",{id:"lawfulBasis",value:l.lawfulBasis,onChange:a=>c("lawfulBasis",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:q.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasisJustification",className:"ndpr-form-field__label",children:"Justification *"}),jsxRuntime.jsx("textarea",{id:"lawfulBasisJustification",value:l.lawfulBasisJustification,onChange:a=>c("lawfulBasisJustification",a.target.value),rows:2,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Explain why this lawful basis applies..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Data Details"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"purposes",className:"ndpr-form-field__label",children:"Purposes * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"purposes",value:I,onChange:be,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Account management, Service delivery"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataCategories",className:"ndpr-form-field__label",children:"Data Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"dataCategories",value:F,onChange:he,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Name, Email, Phone number"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sensitiveData",className:"ndpr-form-field__label",children:"Sensitive Data Categories (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"sensitiveData",value:E,onChange:_e,className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Health data, Biometric data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"subjectCategories",className:"ndpr-form-field__label",children:"Data Subject Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"subjectCategories",value:L,onChange:xe,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customers, Employees"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recipients",className:"ndpr-form-field__label",children:"Recipients * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"recipients",value:M,onChange:Ce,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Payment processors, Cloud service providers"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSource",className:"ndpr-form-field__label",children:"Data Source *"}),jsxRuntime.jsx("select",{id:"dataSource",value:l.dataSource,onChange:a=>c("dataSource",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:Me.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),l.dataSource==="third_party"&&jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"thirdPartyDetails",className:"ndpr-form-field__label",children:"Third-Party Source Details *"}),jsxRuntime.jsx("input",{type:"text",id:"thirdPartyDetails",value:l.thirdPartySourceDetails||"",onChange:a=>c("thirdPartySourceDetails",a.target.value||void 0),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the third-party data source..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Retention and Security"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionPeriod",className:"ndpr-form-field__label",children:"Retention Period *"}),jsxRuntime.jsx("input",{type:"text",id:"retentionPeriod",value:l.retentionPeriod,onChange:a=>c("retentionPeriod",a.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., 5 years after account closure"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionJustification",className:"ndpr-form-field__label",children:"Retention Justification"}),jsxRuntime.jsx("input",{type:"text",id:"retentionJustification",value:l.retentionJustification||"",onChange:a=>c("retentionJustification",a.target.value||void 0),className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Why this retention period is necessary..."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"securityMeasures",className:"ndpr-form-field__label",children:"Security Measures * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"securityMeasures",value:O,onChange:Re,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Encryption at rest, Access controls, Audit logging"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"systemsUsed",className:"ndpr-form-field__label",children:"Systems Used (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"systemsUsed",value:T,onChange:ye,className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., CRM, ERP, Cloud Storage"})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"dpiaRequired",checked:l.dpiaRequired,onChange:a=>c("dpiaRequired",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"dpiaRequired",className:"ndpr-text-sm ndpr-font-medium",children:"DPIA Required"})]}),l.dpiaRequired&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpiaReference",className:"ndpr-form-field__label",children:"DPIA Reference *"}),jsxRuntime.jsx("input",{type:"text",id:"dpiaReference",value:l.dpiaReference||"",onChange:a=>c("dpiaReference",a.target.value||void 0),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Reference to the completed DPIA"})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"automatedDecisionMaking",checked:l.automatedDecisionMaking,onChange:a=>c("automatedDecisionMaking",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMaking",className:"ndpr-text-sm ndpr-font-medium",children:"Automated Decision-Making"})]}),l.automatedDecisionMaking&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMakingDetails",className:"ndpr-form-field__label",children:"Automated Decision-Making Details *"}),jsxRuntime.jsx("textarea",{id:"automatedDecisionMakingDetails",value:l.automatedDecisionMakingDetails||"",onChange:a=>c("automatedDecisionMakingDetails",a.target.value||void 0),rows:2,"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the automated decision-making process..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Review Schedule"}),jsxRuntime.jsx("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"nextReviewDate",className:"ndpr-form-field__label",children:"Next Review Date"}),jsxRuntime.jsx("input",{type:"date",id:"nextReviewDate",value:l.nextReviewDate?new Date(l.nextReviewDate).toISOString().slice(0,10):"",onChange:a=>c("nextReviewDate",a.target.value?new Date(a.target.value).getTime():void 0),className:chunkAME4HJR4_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]})})]}),jsxRuntime.jsxs("div",{className:"flex justify-end space-x-3",children:[jsxRuntime.jsx("button",{onClick:Q,className:"ndpr-button ndpr-button--secondary ndpr-button--sm",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:ue,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${B}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:r?"Add Record":"Save Changes"})]})]})]})},Ee=()=>jsxRuntime.jsxs("div",{className:"ndpr-section-divider ndpr-text-sm",children:[jsxRuntime.jsx("button",{onClick:De,className:`pb-2 text-sm font-medium ${f==="list"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Processing Records"}),jsxRuntime.jsx("button",{onClick:Se,className:`pb-2 text-sm font-medium ${f==="summary"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Compliance Summary"})]});return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,e==null?void 0:e.root,n),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",e==null?void 0:e.title,n),children:re}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:ie}),ke(),f!=="form"&&Ee(),f==="list"&&Be(),f==="summary"&&Ae(),f==="form"&&Fe()]})};exports.a=Ge;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
'use strict';var chunk3YTAOT5O_js=require('./chunk-3YTAOT5O.js'),chunkZVOIR4QH_js=require('./chunk-ZVOIR4QH.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ye=({breachData:l,initialAssessment:f={},onComplete:A,title:J="Breach Risk Assessment",description:K="Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",submitButtonText:Q="Complete Assessment",className:ae="",buttonClassName:Z="",classNames:b={},unstyled:d=false,showBreachSummary:c=true,showNotificationRequirements:D=true})=>{let[L,ie]=react.useState(f.confidentialityImpact||3),[B,h]=react.useState(f.integrityImpact||3),[I,P]=react.useState(f.availabilityImpact||3),[E,T]=react.useState(f.harmLikelihood||3),[O,F]=react.useState(f.harmSeverity||3),[U,j]=react.useState(f.risksToRightsAndFreedoms!==void 0?f.risksToRightsAndFreedoms:false),[H,M]=react.useState(f.highRisksToRightsAndFreedoms!==void 0?f.highRisksToRightsAndFreedoms:false),[X,z]=react.useState(f.justification||""),[W,re]=react.useState(0),[k,v]=react.useState("low"),[x,g]=react.useState(false),[R,ee]=react.useState(0),[q,te]=react.useState(0),[u,y]=react.useState(false),[$]=react.useState(()=>Date.now());react.useEffect(()=>{let V=L*.2+B*.1+I*.1+E*.3+O*.3;re(Number(V.toFixed(1)));let Y;V<2?Y="low":V<3?Y="medium":V<4?Y="high":Y="critical",v(Y),g(U||Y==="high"||Y==="critical");let de=l.discoveredAt+4320*60*1e3;ee(de);let fe=Date.now(),Ne=(de-fe)/(3600*1e3);te(Number(Ne.toFixed(1)));},[L,B,I,E,O,U,l.discoveredAt]);let _=r=>new Date(r).toLocaleString(),t=r=>{r.preventDefault();let C={id:f.id||`assessment_${Date.now()}`,breachId:l.id,assessedAt:Date.now(),assessor:f.assessor||{name:"Assessment User",role:"Data Protection Officer",email:"dpo@example.com"},confidentialityImpact:L,integrityImpact:B,availabilityImpact:I,harmLikelihood:E,harmSeverity:O,overallRiskScore:W,riskLevel:k,risksToRightsAndFreedoms:U,highRisksToRightsAndFreedoms:H,justification:X};A(C),y(true);},m=r=>{switch(r){case 1:return "Minimal";case 2:return "Low";case 3:return "Moderate";case 4:return "High";case 5:return "Severe";default:return "Unknown"}},N=r=>jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--warning",critical:"ndpr-badge ndpr-badge--destructive"}[r]}`,b.riskBadge,d),children:r.charAt(0).toUpperCase()+r.slice(1)});return jsxRuntime.jsxs("div",{"data-ndpr-component":"breach-risk-assessment",className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,b.root,d),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",b.title,d),children:J}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:K}),c&&jsxRuntime.jsxs("div",{className:"ndpr-panel",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:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Title:"})," ",l.title]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Discovered:"})," ",_(l.discoveredAt)]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",l.status.charAt(0).toUpperCase()+l.status.slice(1)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",l.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",l.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",l.estimatedAffectedSubjects||"Unknown"]})]})]})]}),u?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--info",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Assessment Results"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Overall Risk Level:"})," ",N(k)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",W," / 5"]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Assessed On:"})," ",_($)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",U?"Yes":"No"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",H?"Yes":"No"]})]})]}),jsxRuntime.jsxs("div",{className:"mt-3",children:[jsxRuntime.jsx("p",{className:"text-sm mb-1",children:jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})}),jsxRuntime.jsx("p",{className:"text-sm bg-white dark:bg-gray-800 p-2 rounded",children:X})]})]}),D&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`mb-6 p-4 rounded-md ${x?q>24?"ndpr-alert ndpr-alert--warning":"ndpr-alert ndpr-alert--destructive":"ndpr-alert ndpr-alert--success"}`,b.notificationStatus,d),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Requirements"}),x?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:`text-sm font-bold mb-2 ${q>24?"ndpr-text-warning":"ndpr-text-destructive"}`,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:"})," ",_(R)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsxRuntime.jsx("span",{className:q<24?"ndpr-text-destructive font-bold":"",children:q>0?`${q} hours`:"Deadline passed"})]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",H?"Required (NDPA Section 40(4))":"Not required unless directed by NDPC"]})]}):jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-bold mb-2 ndpr-text-success",children:"NDPC Notification Not Required"}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"Based on this assessment, this breach does not need to be reported to the NDPC."}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"However, the breach should still be documented internally for compliance purposes."})]}),jsxRuntime.jsxs("div",{className:"mt-3 text-sm",children:[jsxRuntime.jsx("p",{className:"font-medium",children:"Next Steps:"}),jsxRuntime.jsx("ul",{className:"list-disc pl-5 mt-1",children:x?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("li",{children:"Prepare a notification report for the NDPC"}),jsxRuntime.jsx("li",{children:"Document all aspects of the breach and your response"}),H&&jsxRuntime.jsx("li",{children:"Prepare communications for affected data subjects"}),jsxRuntime.jsx("li",{children:"Implement measures to mitigate the impact of the breach"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("li",{children:"Document the breach and this assessment in your internal records"}),jsxRuntime.jsx("li",{children:"Implement measures to prevent similar breaches in the future"}),jsxRuntime.jsx("li",{children:"Review and update security measures as needed"})]})})]})]}),jsxRuntime.jsx("button",{onClick:()=>y(false),className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${Z}`,b.primaryButton||b.submitButton,d),children:"Edit Assessment"})]}):jsxRuntime.jsx("form",{onSubmit:t,children:jsxRuntime.jsxs("div",{className:"ndpr-form-section",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Impact Assessment"}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsxs("label",{htmlFor:"confidentialityImpact",className:"ndpr-form-field__label",children:["Confidentiality Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm ndpr-text-muted",children:"How much has the confidentiality of data been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"confidentialityImpact",min:"1",max:"5",step:"1",value:L,onChange:r=>ie(parseInt(r.target.value)),className:chunkAME4HJR4_js.a("ndpr-form-field__range",b.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(L)," (",L,")"]})]})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsxs("label",{htmlFor:"integrityImpact",className:"ndpr-form-field__label",children:["Integrity Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm ndpr-text-muted",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:B,onChange:r=>h(parseInt(r.target.value)),className:chunkAME4HJR4_js.a("ndpr-form-field__range",b.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(B)," (",B,")"]})]})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsxs("label",{htmlFor:"availabilityImpact",className:"ndpr-form-field__label",children:["Availability Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm ndpr-text-muted",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:I,onChange:r=>P(parseInt(r.target.value)),className:chunkAME4HJR4_js.a("ndpr-form-field__range",b.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(I)," (",I,")"]})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Risk to Data Subjects"}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsxs("label",{htmlFor:"harmLikelihood",className:"ndpr-form-field__label",children:["Likelihood of Harm (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm ndpr-text-muted",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:E,onChange:r=>T(parseInt(r.target.value)),className:chunkAME4HJR4_js.a("ndpr-form-field__range",b.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(E)," (",E,")"]})]})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsxs("label",{htmlFor:"harmSeverity",className:"ndpr-form-field__label",children:["Severity of Harm (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm ndpr-text-muted",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:O,onChange:r=>F(parseInt(r.target.value)),className:chunkAME4HJR4_js.a("ndpr-form-field__range",b.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(O)," (",O,")"]})]})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:U,onChange:r=>j(r.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"risksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a risk to the rights and freedoms of data subjects"})]}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted 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:"ndpr-form-field",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"highRisksToRightsAndFreedoms",checked:H,onChange:r=>M(r.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"highRisksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a high risk to the rights and freedoms of data subjects"})]}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted 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:"ndpr-section-heading",children:"Overall Assessment"}),jsxRuntime.jsxs("div",{className:"ndpr-panel",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:chunkAME4HJR4_js.a("",b.riskScore,d),children:[W," / 5"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Level:"}),N(k)]})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsxs("label",{htmlFor:"justification",className:"ndpr-form-field__label",children:["Justification for Assessment ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"justification",value:X,onChange:r=>z(r.target.value),rows:4,placeholder:"Explain the reasoning behind your assessment, including any factors that influenced your decision.",className:"ndpr-form-field__input",required:true})]})]}),jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--info",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"ndpr-text-info 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:chunkAME4HJR4_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${Z}`,b.primaryButton||b.submitButton,d),children:Q})})]})})]})};var Pe=({breachReports:l,riskAssessments:f,regulatoryNotifications:A,onSelectBreach:J,onRequestAssessment:K,onRequestNotification:Q,title:ae="Breach Notification Manager",description:Z="Manage data breach notifications and track compliance with NDPA Section 40 requirements.",className:b="",buttonClassName:d="",classNames:c={},unstyled:D=false,showBreachDetails:L=true,showNotificationTimeline:ie=true,showDeadlineAlerts:B=true})=>{var _;let[h,I]=react.useState(null),[P,E]=react.useState(l),[T,O]=react.useState("all"),[F,U]=react.useState(""),[j,H]=react.useState("discoveredAt"),[M,X]=react.useState("desc");react.useEffect(()=>{let t=[...l];if(T!=="all"&&(t=t.filter(m=>m.status===T)),F){let m=F.toLowerCase();t=t.filter(N=>N.title.toLowerCase().includes(m)||N.description.toLowerCase().includes(m)||N.affectedSystems.some(r=>r.toLowerCase().includes(m))||N.dataTypes.some(r=>r.toLowerCase().includes(m)));}t.sort((m,N)=>{let r=0;switch(j){case "title":r=m.title.localeCompare(N.title);break;case "discoveredAt":r=m.discoveredAt-N.discoveredAt;break;case "status":r=m.status.localeCompare(N.status);break;case "riskLevel":let C=f.find(V=>V.breachId===m.id),w=f.find(V=>V.breachId===N.id),ne=(C==null?void 0:C.riskLevel)||"unknown",oe=(w==null?void 0:w.riskLevel)||"unknown";r=ne.localeCompare(oe);break;default:r=m.discoveredAt-N.discoveredAt;}return M==="asc"?r:-r}),E(t);},[l,T,F,j,M,f]),react.useEffect(()=>{P.length>0&&(h&&P.some(m=>m.id===h)||I(P[0].id));},[P,h]);let z=t=>{I(t),J&&J(t);},W=()=>{h&&K&&K(h);},re=()=>{h&&Q&&Q(h);},k=t=>new Date(t).toLocaleString(),v=h?l.find(t=>t.id===h):null,x=h?f.find(t=>t.breachId===h):null,g=h?A.find(t=>t.breachId===h):null,R=v?ee(v,x):null;function ee(t,m){let N=chunk3YTAOT5O_js.a(t,m||void 0),r=t.discoveredAt+N.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:N.notificationRequired,ndpcNotificationDeadline:r,dataSubjectNotificationRequired:(m==null?void 0:m.highRisksToRightsAndFreedoms)||false,justification:N.justification}}function q(t){let m=Date.now(),N=(t-m)/(3600*1e3);return Number(N.toFixed(1))}let te=t=>t?jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--warning",critical:"ndpr-badge ndpr-badge--destructive"}[t]}`,c.statusBadge,D),children:t.charAt(0).toUpperCase()+t.slice(1)}):null,u=t=>jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${{ongoing:"ndpr-badge ndpr-badge--destructive",contained:"ndpr-badge ndpr-badge--warning",resolved:"ndpr-badge ndpr-badge--success"}[t]||"ndpr-badge ndpr-badge--neutral"}`,c.statusBadge,D),children:t.charAt(0).toUpperCase()+t.slice(1)}),y=()=>{if(!v||!R)return null;if(!R.ndpcNotificationRequired)return jsxRuntime.jsxs("div",{"data-ndpr-component":"breach-notification-manager",className:"ndpr-alert ndpr-alert--success",children:[jsxRuntime.jsx("p",{className:"text-sm ndpr-text-success font-medium",children:"Notification Not Required"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-success mt-1",children:"Based on the risk assessment, NDPC notification is not required for this breach."})]});if(g)return jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--success",children:[jsxRuntime.jsx("p",{className:"text-sm ndpr-text-success font-medium",children:"Notification Sent"}),jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-success mt-1",children:["Notification was sent to the NDPC on ",k(g.sentAt),"."]})]});let t=q(R.ndpcNotificationDeadline);return t<=0?jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsxRuntime.jsx("p",{className:"text-sm ndpr-text-destructive font-medium",children:"Notification Deadline Passed"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-destructive mt-1",children:"The 72-hour deadline for NDPC notification has passed. Notification should be sent immediately."})]}):t<=24?jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsxRuntime.jsx("p",{className:"text-sm ndpr-text-destructive font-medium",children:"Urgent: Notification Due Soon"}),jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["Only ",t," hours remaining until the NDPC notification deadline."]})]}):jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsxRuntime.jsx("p",{className:"text-sm ndpr-text-warning font-medium",children:"Notification Required"}),jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-warning mt-1",children:["NDPC notification is required by ",k(R.ndpcNotificationDeadline)," (",t," hours remaining)."]})]})},$=()=>{if(!v)return null;let t=[{title:"Breach Discovered",date:v.discoveredAt,completed:true,description:`Breach was discovered on ${k(v.discoveredAt)}.`},{title:"Risk Assessment",date:x==null?void 0:x.assessedAt,completed:!!x,description:x?`Risk assessment completed on ${k(x.assessedAt)}.`:"Risk assessment has not been completed yet."}];return R!=null&&R.ndpcNotificationRequired&&t.push({title:"NDPC Notification",date:g==null?void 0:g.sentAt,completed:!!g,description:g?`Notification sent to the NDPC on ${k(g.sentAt)}.`:`Notification must be sent to the NDPC by ${k(R.ndpcNotificationDeadline)}.`}),R!=null&&R.dataSubjectNotificationRequired&&t.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:chunkAME4HJR4_js.a("mt-6",c.timeline,D),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:t.map((m,N)=>jsxRuntime.jsxs("li",{className:chunkAME4HJR4_js.a("mb-6 ml-4",c.timelineStep,D),children:[jsxRuntime.jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${m.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsxRuntime.jsx("time",{className:"mb-1 text-sm font-normal leading-none ndpr-text-muted",children:m.date?k(m.date):"Pending"}),jsxRuntime.jsx("h4",{className:"ndpr-section-heading",children:m.title}),jsxRuntime.jsx("p",{className:"ndpr-form-field__hint",children:m.description})]},N))})]})};return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${b}`,c.root,D),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("",c.header,D),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",c.title,D),children:ae}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:Z})]}),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilter",className:"ndpr-form-field__label",children:"Status Filter"}),jsxRuntime.jsxs("select",{id:"statusFilter",value:T,onChange:t=>O(t.target.value),className:"ndpr-form-field__input",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:"ndpr-form-field__label",children:"Sort By"}),jsxRuntime.jsxs("select",{id:"sortBy",value:j,onChange:t=>H(t.target.value),className:"ndpr-form-field__input",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:"ndpr-form-field__label",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchTerm",value:F,onChange:t=>U(t.target.value),placeholder:"Search breaches...",className:"ndpr-form-field__input"})]})]}),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"}),P.length===0?jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:"No breach reports found."}):jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",c.breachList,D),children:P.map(t=>{let m=f.find(w=>w.breachId===t.id),N=A.find(w=>w.breachId===t.id),r=ee(t,m),C=null;if(r!=null&&r.ndpcNotificationRequired)if(N)C=jsxRuntime.jsx("span",{className:"text-xs ndpr-text-success",children:"Notified"});else {let w=q(r.ndpcNotificationDeadline);w<=0?C=jsxRuntime.jsx("span",{className:"text-xs ndpr-text-destructive font-bold",children:"Overdue"}):w<=24?C=jsxRuntime.jsx("span",{className:"text-xs ndpr-text-destructive",children:"Urgent"}):C=jsxRuntime.jsx("span",{className:"text-xs ndpr-text-warning",children:"Required"});}else C=jsxRuntime.jsx("span",{className:"text-xs ndpr-text-success",children:"Not Required"});return jsxRuntime.jsxs("div",{role:"button",tabIndex:0,"aria-label":`View breach ${t.title}`,"aria-selected":h===t.id,className:chunkAME4HJR4_js.a(`p-3 rounded-md cursor-pointer ${h===t.id?"ndpr-alert ndpr-alert--info":"ndpr-panel"}`,c.breachItem,D),onClick:()=>z(t.id),onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),z(t.id));},children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:t.title}),u(t.status)]}),jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-muted mb-1",children:["Discovered: ",new Date(t.discoveredAt).toLocaleDateString()]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsxRuntime.jsx("div",{children:m&&te(m.riskLevel)}),jsxRuntime.jsx("div",{children:C})]})]},t.id)})})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("md:col-span-2",c.detailPanel,D),children:v?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:v.title}),u(v.status)]}),B&&jsxRuntime.jsx("div",{className:"ndpr-form-field",children:y()}),L&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Discovered:"})," ",k(v.discoveredAt)]}),v.occurredAt&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Occurred:"})," ",k(v.occurredAt)]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reporter:"})," ",v.reporter.name]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",v.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",v.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",v.estimatedAffectedSubjects||"Unknown"]})]})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-text-sm ndpr-font-medium",children:"Description:"}),jsxRuntime.jsx("p",{className:"ndpr-panel",children:v.description})]}),v.initialActions&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"ndpr-text-sm ndpr-font-medium",children:"Initial Actions Taken:"}),jsxRuntime.jsx("p",{className:"ndpr-panel",children:v.initialActions})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),x?jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsxRuntime.jsx("p",{className:"ndpr-text-sm ndpr-font-medium",children:"Risk Level:"}),te(x.riskLevel)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",x.overallRiskScore," / 5"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",x.risksToRightsAndFreedoms?"Yes":"No"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",x.highRisksToRightsAndFreedoms?"Yes":"No"]}),jsxRuntime.jsx("p",{className:"text-sm mb-1",children:jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted bg-white dark:bg-gray-800 p-2 rounded-md",children:x.justification})]}):jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsxRuntime.jsx("p",{className:"text-sm ndpr-text-warning",children:"Risk assessment has not been conducted yet."}),jsxRuntime.jsx("button",{onClick:W,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Conduct Risk Assessment"})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),g?jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notification Sent:"})," ",k(g.sentAt)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Method:"})," ",g.method.charAt(0).toUpperCase()+g.method.slice(1)]}),g.referenceNumber&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference Number:"})," ",g.referenceNumber]}),(g.ndpcContact||g.nitdaContact)&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(_=g.ndpcContact||g.nitdaContact)==null?void 0:_.name]})]}):jsxRuntime.jsx("div",{children:R!=null&&R.ndpcNotificationRequired?jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsxRuntime.jsx("p",{className:"text-sm ndpr-text-warning",children:"NDPC notification is required but has not been sent yet."}),jsxRuntime.jsx("button",{onClick:re,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Generate Notification"})]}):jsxRuntime.jsx("div",{className:"ndpr-alert ndpr-alert--success",children:jsxRuntime.jsx("p",{className:"text-sm ndpr-text-success",children:"NDPC notification is not required for this breach."})})})]}),ie&&$()]}):jsxRuntime.jsx("div",{className:"ndpr-empty-state",children:jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:"Select a breach to view details"})})})]})]})};var Le=({breachData:l,assessmentData:f,organizationInfo:A,onGenerate:J,title:K="Generate NDPC Notification Report",description:Q="Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements.",generateButtonText:ae="Generate Report",className:Z="",buttonClassName:b="",classNames:d={},unstyled:c=false,showPreview:D=true,allowEditing:L=true,allowDownload:ie=true,downloadFormat:B="pdf"})=>{let[h,I]=react.useState(""),[P,E]=react.useState(""),[T,O]=react.useState(""),[F,U]=react.useState(""),[j,H]=react.useState("email"),[M,X]=react.useState(""),[z,W]=react.useState(""),[re,k]=react.useState(false),[v,x]=react.useState(false);react.useEffect(()=>{let u=R();I(u),k(true);},[l,f,A]);let g=u=>new Date(u).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),R=()=>{var m,N,r,C,w,ne;let y=new Date().toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),$=((m=l.dpoContact)==null?void 0:m.name)||A.dpoName,_=((N=l.dpoContact)==null?void 0:N.email)||A.dpoEmail,t=((r=l.dpoContact)==null?void 0:r.phone)||A.dpoPhone;return `
|
|
2
|
+
NDPC DATA BREACH NOTIFICATION
|
|
3
|
+
|
|
4
|
+
Date: ${y}
|
|
5
|
+
${l.isPhasedReport?"Report Type: PHASED / INTERIM REPORT":"Report Type: Full Report"}
|
|
6
|
+
${l.supplementsReportId?`Supplements Report ID: ${l.supplementsReportId}`:""}
|
|
7
|
+
|
|
8
|
+
Reference: NDPA Section 40 - Personal Data Breaches
|
|
9
|
+
|
|
10
|
+
ORGANIZATION DETAILS
|
|
11
|
+
-------------------
|
|
12
|
+
Organization Name: ${A.name}
|
|
13
|
+
${A.registrationNumber?`Registration Number: ${A.registrationNumber}`:""}
|
|
14
|
+
Address: ${A.address}
|
|
15
|
+
${A.website?`Website: ${A.website}`:""}
|
|
16
|
+
|
|
17
|
+
DATA PROTECTION OFFICER (Section 32 contact point)
|
|
18
|
+
----------------------
|
|
19
|
+
Name: ${$}
|
|
20
|
+
Email: ${_}
|
|
21
|
+
${t?`Phone: ${t}`:""}
|
|
22
|
+
|
|
23
|
+
BREACH DETAILS
|
|
24
|
+
-------------
|
|
25
|
+
Breach Title: ${l.title}
|
|
26
|
+
Date Discovered: ${g(l.discoveredAt)}
|
|
27
|
+
${l.occurredAt?`Date Occurred: ${g(l.occurredAt)}`:"Date Occurred: Unknown"}
|
|
28
|
+
Status: ${l.status.charAt(0).toUpperCase()+l.status.slice(1)}
|
|
29
|
+
|
|
30
|
+
Nature of the Personal Data Breach (Section 40(2)):
|
|
31
|
+
${l.description}
|
|
32
|
+
|
|
33
|
+
Affected Systems/Applications:
|
|
34
|
+
${l.affectedSystems.join(", ")}
|
|
35
|
+
|
|
36
|
+
Types of Personal Data Involved:
|
|
37
|
+
${l.dataTypes.join(", ")}
|
|
38
|
+
${l.involvesSensitiveData?"Sensitive personal data (Section 30) involved: YES":""}
|
|
39
|
+
|
|
40
|
+
Categories of Data Subjects Affected (Section 40(2)):
|
|
41
|
+
${((C=l.dataSubjectCategories)==null?void 0:C.join(", "))||"[Not specified \u2014 required by NDPC]"}
|
|
42
|
+
|
|
43
|
+
Approximate Number of Data Subjects Affected:
|
|
44
|
+
${(w=l.estimatedAffectedSubjects)!=null?w:"Unknown"}
|
|
45
|
+
|
|
46
|
+
Approximate Number of Personal Data Records Concerned (Section 40(2)):
|
|
47
|
+
${(ne=l.approximateRecordCount)!=null?ne:"Unknown"}
|
|
48
|
+
|
|
49
|
+
RISK ASSESSMENT
|
|
50
|
+
--------------
|
|
51
|
+
${f?`
|
|
52
|
+
Overall Risk Level: ${f.riskLevel.charAt(0).toUpperCase()+f.riskLevel.slice(1)}
|
|
53
|
+
Risk to Rights and Freedoms of Data Subjects: ${f.risksToRightsAndFreedoms?"Yes":"No"}
|
|
54
|
+
High Risk to Rights and Freedoms of Data Subjects: ${f.highRisksToRightsAndFreedoms?"Yes":"No"}
|
|
55
|
+
|
|
56
|
+
Justification for Risk Assessment:
|
|
57
|
+
${f.justification}
|
|
58
|
+
`:"Risk assessment has not been conducted yet."}
|
|
59
|
+
|
|
60
|
+
LIKELY CONSEQUENCES OF THE BREACH (Section 40(3))
|
|
61
|
+
--------------------------------
|
|
62
|
+
${l.likelyConsequences||"[Please describe likely consequences for affected data subjects \u2014 identity theft, financial loss, discrimination, etc.]"}
|
|
63
|
+
|
|
64
|
+
MEASURES TAKEN OR PROPOSED
|
|
65
|
+
-------------
|
|
66
|
+
Measures taken to address the breach:
|
|
67
|
+
${l.initialActions||"To be determined"}
|
|
68
|
+
|
|
69
|
+
Measures taken or proposed to mitigate possible adverse effects (Section 40(3)):
|
|
70
|
+
${l.mitigationMeasures||"[Please specify mitigation measures]"}
|
|
71
|
+
|
|
72
|
+
NOTIFICATION TO DATA SUBJECTS (Section 40(3))
|
|
73
|
+
----------------------------
|
|
74
|
+
Have data subjects been notified: [Yes/No]
|
|
75
|
+
If yes, date of notification: [Date]
|
|
76
|
+
If no, planned date of notification: [Date]
|
|
77
|
+
Reason for delay (if applicable): [Reason]
|
|
78
|
+
|
|
79
|
+
${l.isPhasedReport?`PHASED REPORT NOTE
|
|
80
|
+
---------------------
|
|
81
|
+
This report is submitted in phases under NDPA Section 40(2) because complete
|
|
82
|
+
information was not available within 72 hours of discovery. A supplementary
|
|
83
|
+
report will be filed once additional facts are confirmed.
|
|
84
|
+
`:""}
|
|
85
|
+
ADDITIONAL INFORMATION
|
|
86
|
+
---------------------
|
|
87
|
+
[Any additional information relevant to the breach]
|
|
88
|
+
|
|
89
|
+
This notification is made in compliance with the Nigeria Data Protection Act (NDPA), Section 40.
|
|
90
|
+
|
|
91
|
+
IMPORTANT NOTICE
|
|
92
|
+
---------------------
|
|
93
|
+
${chunkZVOIR4QH_js.b}
|
|
94
|
+
`},ee=u=>{u.preventDefault();let y={id:`notification_${Date.now()}`,breachId:l.id,sentAt:Date.now(),method:j,referenceNumber:M||void 0,ndpcContact:P?{name:P,email:T,phone:F||void 0}:void 0,content:h,attachments:[]};J(y),x(true);},q=()=>{let u,y,$;switch(B){case "html":{u="text/html",y="html",$=`<!DOCTYPE html>
|
|
95
|
+
<html lang="en">
|
|
96
|
+
<head>
|
|
97
|
+
<meta charset="UTF-8">
|
|
98
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
99
|
+
<title>NDPC Breach Notification Report</title>
|
|
100
|
+
<style>body{font-family:monospace;white-space:pre-wrap;max-width:800px;margin:2rem auto;padding:0 1rem;}</style>
|
|
101
|
+
</head>
|
|
102
|
+
<body>${h.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}</body>
|
|
103
|
+
</html>`;break}case "pdf":u="text/plain",y="pdf.txt",$=h;break;case "docx":u="text/plain",y="docx.txt",$=h;break;default:u="text/plain",y="txt",$=h;}let _=document.createElement("a"),t=new Blob([$],{type:u});_.href=URL.createObjectURL(t),_.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.${y}`,document.body.appendChild(_),_.click(),document.body.removeChild(_);},te=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(y=>jsxRuntime.jsx("option",{value:y.value,children:y.label},y.value));return jsxRuntime.jsxs("div",{"data-ndpr-component":"regulatory-report-generator",className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Z}`,d.root,c),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("",d.header,c),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",d.title,c),children:K}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:Q})]}),v?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--success",children:[jsxRuntime.jsx("h3",{className:"text-lg font-bold ndpr-text-success mb-2",children:"Report Generated Successfully"}),jsxRuntime.jsx("p",{className:"ndpr-text-success",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:"ndpr-section-heading",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:chunkAME4HJR4_js.a("ndpr-text-sm",d.field,c),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("font-medium",d.fieldLabel,c),children:"Method:"})," ",jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("",d.fieldValue,c),children:j.charAt(0).toUpperCase()+j.slice(1)})]}),P&&jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("ndpr-text-sm",d.field,c),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("font-medium",d.fieldLabel,c),children:"Contact Name:"})," ",jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("",d.fieldValue,c),children:P})]}),T&&jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("ndpr-text-sm",d.field,c),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("font-medium",d.fieldLabel,c),children:"Contact Email:"})," ",jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("",d.fieldValue,c),children:T})]}),F&&jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("ndpr-text-sm",d.field,c),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("font-medium",d.fieldLabel,c),children:"Contact Phone:"})," ",jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("",d.fieldValue,c),children:F})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("ndpr-text-sm",d.field,c),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("font-medium",d.fieldLabel,c),children:"Date Generated:"})," ",jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("",d.fieldValue,c),children:g(Date.now())})]}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("ndpr-text-sm",d.field,c),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("font-medium",d.fieldLabel,c),children:"Breach ID:"})," ",jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("",d.fieldValue,c),children:l.id})]}),M&&jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("ndpr-text-sm",d.field,c),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("font-medium",d.fieldLabel,c),children:"Reference Number:"})," ",jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("",d.fieldValue,c),children:M})]})]})]})]}),D&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Report Preview"}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("ndpr-panel",d.reportPreview,c),children:jsxRuntime.jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:h})})]}),jsxRuntime.jsxs("div",{className:"ndpr-card__footer",children:[ie&&jsxRuntime.jsxs("button",{onClick:q,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${b}`,d.secondaryButton||d.downloadButton,c),children:["Download Report (",B.toUpperCase(),")"]}),jsxRuntime.jsx("button",{onClick:()=>x(false),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${b}`,children:"Edit Report"})]})]}):jsxRuntime.jsx("form",{onSubmit:ee,children:jsxRuntime.jsxs("div",{className:"ndpr-form-section",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Notification Method"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"method",className:"ndpr-form-field__label",children:["Method of Submission ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("select",{id:"method",value:j,onChange:u=>H(u.target.value),className:"ndpr-form-field__input",required:true,children:te()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"referenceNumber",className:"ndpr-form-field__label",children:"Reference Number (if available)"}),jsxRuntime.jsx("input",{type:"text",id:"referenceNumber",value:M,onChange:u=>X(u.target.value),placeholder:"e.g. NDPC/BR/2024/001",className:"ndpr-form-field__input"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",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:"ndpr-form-field__label",children:"Contact Name"}),jsxRuntime.jsx("input",{type:"text",id:"contactName",value:P,onChange:u=>E(u.target.value),className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactEmail",className:"ndpr-form-field__label",children:"Contact Email"}),jsxRuntime.jsx("input",{type:"email",id:"contactEmail",value:T,onChange:u=>O(u.target.value),className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactPhone",className:"ndpr-form-field__label",children:"Contact Phone"}),jsxRuntime.jsx("input",{type:"tel",id:"contactPhone",value:F,onChange:u=>U(u.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Additional Information"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"additionalInfo",className:"ndpr-form-field__label",children:"Additional Information to Include"}),jsxRuntime.jsx("textarea",{id:"additionalInfo",value:z,onChange:u=>W(u.target.value),rows:3,placeholder:"Any additional information you want to include in the report",className:"ndpr-form-field__input"})]})]}),L&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Report Content"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reportContent",className:"ndpr-form-field__label",children:["Edit Report Content ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"reportContent",value:h,onChange:u=>I(u.target.value),rows:20,className:"ndpr-form-field__input ndpr-form-field__input--mono",required:true})]})]}),jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--info",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"ndpr-text-info 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("p",{className:"ndpr-text-muted text-xs mt-2 italic",role:"note",children:chunkZVOIR4QH_js.a})]}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{type:"submit",className:chunkAME4HJR4_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${b}`,d.primaryButton||d.generateButton,c),children:ae})})]})})]})};exports.a=ye;exports.b=Pe;exports.c=Le;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use strict';var chunkYFBDJ4FH_js=require('./chunk-YFBDJ4FH.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var L=[{value:"adequacy_decision",label:"Adequacy Decision (Section 41)"},{value:"standard_clauses",label:"Standard Contractual Clauses (Section 42)"},{value:"binding_corporate_rules",label:"Binding Corporate Rules (Section 43)"},{value:"ndpc_authorization",label:"NDPC Authorization (Section 44)"},{value:"explicit_consent",label:"Explicit Consent (Section 45(a))"},{value:"contract_performance",label:"Contract Performance (Section 45(b))"},{value:"public_interest",label:"Public Interest (Section 45(c))"},{value:"legal_claims",label:"Legal Claims (Section 45(d))"},{value:"vital_interests",label:"Vital Interests (Section 45(e))"}],J=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],X=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],Z=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],ge={low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--destructive"},he={active:"ndpr-badge ndpr-badge--success",suspended:"ndpr-badge ndpr-badge--warning",terminated:"ndpr-badge ndpr-badge--neutral",pending_approval:"ndpr-badge ndpr-badge--info"},Ce={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"},ee={destinationCountry:"",destinationCountryCode:"",adequacyStatus:"unknown",transferMechanism:"adequacy_decision",dataCategories:"",includesSensitiveData:false,estimatedDataSubjects:"",recipientOrganization:"",recipientContactName:"",recipientContactEmail:"",recipientContactPhone:"",recipientContactAddress:"",purpose:"",safeguards:"",riskAssessment:"",riskLevel:"medium",frequency:"one_time",status:"active",tiaCompleted:false,tiaReference:"",ndpcApprovalApplied:false,ndpcApprovalApproved:false,ndpcApprovalReference:""},ke=({transfers:g,onAddTransfer:q,onUpdateTransfer:w,onRemoveTransfer:F,summary:B,title:te="Cross-Border Data Transfer Manager",description:re="Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VIII (Sections 41-43).",className:ae="",buttonClassName:M="",showSummary:ie=true,showTIA:ne=true,classNames:r,unstyled:d})=>{let[f,y]=react.useState(null),[j,S]=react.useState(false),[h,z]=react.useState(null),[n,P]=react.useState(ee),[C,$]=react.useState(null),[k,de]=react.useState("all"),[T,pe]=react.useState("all"),A=react.useMemo(()=>{let t=[...g];return k!=="all"&&(t=t.filter(a=>a.status===k)),T!=="all"&&(t=t.filter(a=>a.transferMechanism===T)),t.sort((a,o)=>o.updatedAt-a.updatedAt),t},[g,k,T]);react.useEffect(()=>{A.length>0&&!f&&y(A[0].id);},[A,f]);let U=react.useMemo(()=>{var t;return f&&(t=g.find(a=>a.id===f))!=null?t:null},[g,f]),x=react.useCallback(t=>new Date(t).toLocaleDateString(),[]),_=react.useCallback(()=>{P(ee),z(null),$(null);},[]),oe=react.useCallback(()=>{_(),S(true);},[_]),le=react.useCallback(t=>{var a,o,u,v;z(t.id),P({destinationCountry:t.destinationCountry,destinationCountryCode:t.destinationCountryCode||"",adequacyStatus:t.adequacyStatus,transferMechanism:t.transferMechanism,dataCategories:t.dataCategories.join(", "),includesSensitiveData:t.includesSensitiveData,estimatedDataSubjects:((a=t.estimatedDataSubjects)==null?void 0:a.toString())||"",recipientOrganization:t.recipientOrganization,recipientContactName:t.recipientContact.name,recipientContactEmail:t.recipientContact.email,recipientContactPhone:t.recipientContact.phone||"",recipientContactAddress:t.recipientContact.address||"",purpose:t.purpose,safeguards:t.safeguards.join(`
|
|
2
|
+
`),riskAssessment:t.riskAssessment,riskLevel:t.riskLevel,frequency:t.frequency,status:t.status,tiaCompleted:t.tiaCompleted,tiaReference:t.tiaReference||"",ndpcApprovalApplied:((o=t.ndpcApproval)==null?void 0:o.applied)||false,ndpcApprovalApproved:((u=t.ndpcApproval)==null?void 0:u.approved)||false,ndpcApprovalReference:((v=t.ndpcApproval)==null?void 0:v.referenceNumber)||""}),S(true);},[]),l=react.useCallback((t,a)=>{P(o=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},o),{[t]:a}));},[]),V=react.useCallback(()=>{let t=chunkYFBDJ4FH_js.e(n.transferMechanism),a=Date.now();return {destinationCountry:n.destinationCountry.trim(),destinationCountryCode:n.destinationCountryCode.trim()||void 0,adequacyStatus:n.adequacyStatus,transferMechanism:n.transferMechanism,dataCategories:n.dataCategories.split(",").map(o=>o.trim()).filter(Boolean),includesSensitiveData:n.includesSensitiveData,estimatedDataSubjects:n.estimatedDataSubjects?parseInt(n.estimatedDataSubjects,10):void 0,recipientOrganization:n.recipientOrganization.trim(),recipientContact:{name:n.recipientContactName.trim(),email:n.recipientContactEmail.trim(),phone:n.recipientContactPhone.trim()||void 0,address:n.recipientContactAddress.trim()||void 0},purpose:n.purpose.trim(),safeguards:n.safeguards.split(`
|
|
3
|
+
`).map(o=>o.trim()).filter(Boolean),riskAssessment:n.riskAssessment.trim(),riskLevel:n.riskLevel,frequency:n.frequency,status:t&&!n.ndpcApprovalApproved?"pending_approval":n.status,tiaCompleted:n.tiaCompleted,tiaReference:n.tiaReference.trim()||void 0,ndpcApproval:t?{required:true,applied:n.ndpcApprovalApplied,approved:n.ndpcApprovalApproved||void 0,referenceNumber:n.ndpcApprovalReference.trim()||void 0,appliedAt:n.ndpcApprovalApplied?a:void 0,approvedAt:n.ndpcApprovalApproved?a:void 0}:void 0,startDate:a,reviewDate:a+365*24*60*60*1e3}},[n]),se=react.useCallback(()=>{let t=V(),a=chunkRFPLZDIO_js.a({id:h||"temp",createdAt:Date.now(),updatedAt:Date.now()},t),o=chunkYFBDJ4FH_js.g(a);$(o),o.isValid&&(h?w&&w(h,t):q&&q(t),_(),S(false));},[V,h,w,q,_]),G=react.useCallback(()=>{_(),S(false);},[_]),ce=react.useCallback(t=>{F&&F(t),f===t&&y(null);},[F,f]),H=react.useCallback(t=>jsxRuntime.jsxs("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${ge[t]}`,r==null?void 0:r.riskBadge,d),children:[t.charAt(0).toUpperCase()+t.slice(1)," Risk"]}),[r==null?void 0:r.riskBadge,d]),K=react.useCallback(t=>jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${he[t]}`,r==null?void 0:r.statusBadge,d),children:Ce[t]}),[r==null?void 0:r.statusBadge,d]),ue=react.useCallback(t=>{var u;chunkYFBDJ4FH_js.e(t);let o=((u=L.find(v=>v.value===t))==null?void 0:u.label)||t;return jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium ndpr-badge ndpr-badge--info",children:o})},[]),D=react.useMemo(()=>{var v,c;if(B)return B;let t=0,a=[],o=[],u=[];for(let s of g){let I=s.status==="active";I&&t++,(s.status==="pending_approval"||(v=s.ndpcApproval)!=null&&v.required&&!((c=s.ndpcApproval)!=null&&c.approved))&&a.push(s),s.riskLevel==="high"&&I&&o.push(s),!s.tiaCompleted&&I&&u.push(s);}return {totalActiveTransfers:t,pendingApproval:a,highRiskTransfers:o,missingTIA:u,byMechanism:{},byAdequacy:{},dueForReview:[],lastUpdated:Date.now()}},[B,g]),me=()=>jsxRuntime.jsxs("div",{"data-ndpr-component":"cross-border-transfer-manager",role:"status","aria-label":"Transfer compliance summary",className:chunkAME4HJR4_js.a("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",r==null?void 0:r.summary,d),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--info",r==null?void 0:r.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:D.totalActiveTransfers}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-info",children:"Active Transfers"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--info",r==null?void 0:r.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:D.pendingApproval.length}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-info",children:"Pending Approval"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--destructive",r==null?void 0:r.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-destructive",children:D.highRiskTransfers.length}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-destructive",children:"High Risk"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--warning",r==null?void 0:r.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:D.missingTIA.length}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-warning",children:"Missing TIA"})]})]}),ve=()=>{let t=chunkYFBDJ4FH_js.e(n.transferMechanism);return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",r==null?void 0:r.form,d),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex justify-between items-center mb-4",r==null?void 0:r.header,d),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:h?"Edit Transfer":"Add New Transfer"}),jsxRuntime.jsx("button",{onClick:G,"aria-label":"Cancel form",className:"text-gray-600 hover:ndpr-text-muted dark:hover:text-gray-200",children:"Cancel"})]}),C&&!C.isValid&&jsxRuntime.jsxs("div",{id:"cb-form-errors",role:"alert",className:"ndpr-alert ndpr-alert--destructive",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-destructive",children:C.errors.map((a,o)=>jsxRuntime.jsx("li",{children:a},o))})]}),C&&C.warnings.length>0&&jsxRuntime.jsxs("div",{id:"cb-form-warnings",role:"alert",className:"ndpr-alert ndpr-alert--warning",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Warnings:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:C.warnings.map((a,o)=>jsxRuntime.jsx("li",{children:a},o))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-destinationCountry",className:"ndpr-form-field__label",children:["Destination Country ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-destinationCountry",type:"text",value:n.destinationCountry,onChange:a=>l("destinationCountry",a.target.value),placeholder:"e.g. United Kingdom","aria-required":"true","aria-describedby":"cb-form-errors","aria-label":"Destination country",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-destinationCountryCode",className:"ndpr-form-field__label",children:"Country Code (ISO)"}),jsxRuntime.jsx("input",{id:"cb-destinationCountryCode",type:"text",value:n.destinationCountryCode,onChange:a=>l("destinationCountryCode",a.target.value),placeholder:"e.g. GB",maxLength:3,"aria-label":"Country code in ISO format",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-recipientOrganization",className:"ndpr-form-field__label",children:["Recipient Organization ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-recipientOrganization",type:"text",value:n.recipientOrganization,onChange:a=>l("recipientOrganization",a.target.value),placeholder:"Organization name","aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-transferMechanism",className:"ndpr-form-field__label",children:["Transfer Mechanism ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("select",{id:"cb-transferMechanism",value:n.transferMechanism,onChange:a=>l("transferMechanism",a.target.value),"aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:L.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-adequacyStatus",className:"ndpr-form-field__label",children:"Adequacy Status"}),jsxRuntime.jsx("select",{id:"cb-adequacyStatus",value:n.adequacyStatus,onChange:a=>l("adequacyStatus",a.target.value),"aria-label":"Select adequacy status of destination country",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:J.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-riskLevel",className:"ndpr-form-field__label",children:"Risk Level"}),jsxRuntime.jsxs("select",{id:"cb-transfer-riskLevel",value:n.riskLevel,onChange:a=>l("riskLevel",a.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsxRuntime.jsx("option",{value:"low",children:"Low"}),jsxRuntime.jsx("option",{value:"medium",children:"Medium"}),jsxRuntime.jsx("option",{value:"high",children:"High"})]})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-dataCategories",className:"ndpr-form-field__label",children:["Data Categories ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-dataCategories",type:"text",value:n.dataCategories,onChange:a=>l("dataCategories",a.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers","aria-required":"true","aria-describedby":"cb-dataCategories-help",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)}),jsxRuntime.jsx("p",{id:"cb-dataCategories-help",className:"text-xs text-gray-500 mt-1",children:"Separate categories with commas"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:n.includesSensitiveData,onChange:a=>l("includesSensitiveData",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"includesSensitiveData",className:"ndpr-text-sm ndpr-font-medium",children:"Includes sensitive personal data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-estimatedDataSubjects",className:"ndpr-form-field__label",children:"Estimated Data Subjects"}),jsxRuntime.jsx("input",{id:"cb-transfer-estimatedDataSubjects",type:"number",value:n.estimatedDataSubjects,onChange:a=>l("estimatedDataSubjects",a.target.value),placeholder:"Number of data subjects",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-recipientContactName",className:"ndpr-form-field__label",children:["Recipient Contact Name ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-recipientContactName",type:"text",value:n.recipientContactName,onChange:a=>l("recipientContactName",a.target.value),placeholder:"Contact person name","aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-recipientContactEmail",className:"ndpr-form-field__label",children:["Recipient Contact Email ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-recipientContactEmail",type:"email",value:n.recipientContactEmail,onChange:a=>l("recipientContactEmail",a.target.value),placeholder:"contact@example.com","aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-recipientContactPhone",className:"ndpr-form-field__label",children:"Recipient Contact Phone"}),jsxRuntime.jsx("input",{id:"cb-transfer-recipientContactPhone",type:"text",value:n.recipientContactPhone,onChange:a=>l("recipientContactPhone",a.target.value),placeholder:"Phone number",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-recipientContactAddress",className:"ndpr-form-field__label",children:"Recipient Contact Address"}),jsxRuntime.jsx("input",{id:"cb-transfer-recipientContactAddress",type:"text",value:n.recipientContactAddress,onChange:a=>l("recipientContactAddress",a.target.value),placeholder:"Address",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-purpose",className:"ndpr-form-field__label",children:["Purpose of Transfer ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"cb-purpose",value:n.purpose,onChange:a=>l("purpose",a.target.value),placeholder:"Describe the purpose of this data transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-safeguards",className:"ndpr-form-field__label",children:["Safeguards ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"cb-safeguards",value:n.safeguards,onChange:a=>l("safeguards",a.target.value),placeholder:`One safeguard per line, e.g.
|
|
4
|
+
End-to-end encryption
|
|
5
|
+
Access control policies
|
|
6
|
+
Regular security audits`,rows:3,"aria-required":"true","aria-describedby":"cb-safeguards-help",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)}),jsxRuntime.jsx("p",{id:"cb-safeguards-help",className:"text-xs text-gray-500 mt-1",children:"Enter one safeguard per line"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-riskAssessment",className:"ndpr-form-field__label",children:["Risk Assessment Summary ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"cb-riskAssessment",value:n.riskAssessment,onChange:a=>l("riskAssessment",a.target.value),placeholder:"Summarize the risk assessment for this transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-frequency",className:"ndpr-form-field__label",children:"Transfer Frequency"}),jsxRuntime.jsx("select",{id:"cb-transfer-frequency",value:n.frequency,onChange:a=>l("frequency",a.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:X.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-status",className:"ndpr-form-field__label",children:"Status"}),jsxRuntime.jsx("select",{id:"cb-transfer-status",value:n.status,onChange:a=>l("status",a.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:Z.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]})]}),t&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium ndpr-text-info mb-3",children:"NDPC Approval Required"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-info mb-3",children:"The selected transfer mechanism requires approval from the Nigeria Data Protection Commission."}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:n.ndpcApprovalApplied,onChange:a=>l("ndpcApprovalApplied",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApplied",className:"ndpr-text-sm",children:"Application submitted"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:n.ndpcApprovalApproved,onChange:a=>l("ndpcApprovalApproved",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApproved",className:"ndpr-text-sm",children:"Approval granted"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-ndpcApprovalReference",className:"ndpr-form-field__label",children:"NDPC Reference Number"}),jsxRuntime.jsx("input",{id:"cb-transfer-ndpcApprovalReference",type:"text",value:n.ndpcApprovalReference,onChange:a=>l("ndpcApprovalReference",a.target.value),placeholder:"Reference number (if available)",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]})]})]}),ne&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-gray-100 dark:bg-gray-600 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium mb-3",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"tiaCompleted",checked:n.tiaCompleted,onChange:a=>l("tiaCompleted",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"tiaCompleted",className:"ndpr-text-sm",children:"TIA completed"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-transfer-tiaReference",className:"ndpr-form-field__label",children:"TIA Reference"}),jsxRuntime.jsx("input",{id:"cb-transfer-tiaReference",type:"text",value:n.tiaReference,onChange:a=>l("tiaReference",a.target.value),placeholder:"Document reference",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.input,d)})]})]})]}),jsxRuntime.jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[jsxRuntime.jsx("button",{onClick:G,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:se,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${M}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),d),children:h?"Update Transfer":"Add Transfer"})]})]})},fe=t=>{var u,v;let a=chunkYFBDJ4FH_js.h(t),o=chunkYFBDJ4FH_js.g(t);return jsxRuntime.jsxs("div",{role:"status","aria-label":"Transfer details",className:chunkAME4HJR4_js.a("",r==null?void 0:r.detailPanel,d),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsxs("h3",{className:"ndpr-section-heading",children:[t.destinationCountry," \u2014 ",t.recipientOrganization]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[K(t.status),H(t.riskLevel)]})]}),!o.isValid&&jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Compliance Issues"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-destructive",children:o.errors.map((c,s)=>jsxRuntime.jsx("li",{children:c},s))})]}),o.warnings.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Warnings"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:o.warnings.map((c,s)=>jsxRuntime.jsx("li",{children:c},s))})]}),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:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Destination:"})," ",t.destinationCountry,t.destinationCountryCode?` (${t.destinationCountryCode})`:""]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(u=J.find(c=>c.value===t.adequacyStatus))==null?void 0:u.label]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Frequency:"})," ",(v=X.find(c=>c.value===t.frequency))==null?void 0:v.label]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Start Date:"})," ",x(t.startDate)]}),t.endDate&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"End Date:"})," ",x(t.endDate)]}),t.reviewDate&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next Review:"})," ",x(t.reviewDate)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Recipient:"})," ",t.recipientOrganization]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Contact:"})," ",t.recipientContact.name," (",t.recipientContact.email,")"]}),t.estimatedDataSubjects&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",t.estimatedDataSubjects.toLocaleString()]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",t.includesSensitiveData?"Yes":"No"]})]})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Transfer Mechanism"}),jsxRuntime.jsx("div",{className:"ndpr-panel",children:jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:chunkYFBDJ4FH_js.f(t.transferMechanism)})})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Purpose"}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-muted bg-gray-50 dark:bg-gray-700 p-2 rounded-md",children:t.purpose})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Data Categories"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:t.dataCategories.map((c,s)=>jsxRuntime.jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs",children:c},s))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Safeguards"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-muted",children:t.safeguards.map((c,s)=>jsxRuntime.jsx("li",{children:c},s))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Risk Assessment"}),jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2",children:t.riskAssessment}),jsxRuntime.jsxs("div",{className:"mt-2",role:"status","aria-label":"Automated risk assessment result",children:[jsxRuntime.jsxs("p",{className:"text-xs font-medium ndpr-text-muted mb-1",children:["Automated Assessment (Score: ",a.riskScore,")"]}),a.factors.length>0&&jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs ndpr-text-muted",children:a.factors.map((c,s)=>jsxRuntime.jsx("li",{children:c},s))}),a.recommendations.length>0&&jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium ndpr-text-muted mb-1",children:"Recommendations:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs ndpr-text-muted",children:a.recommendations.map((c,s)=>jsxRuntime.jsx("li",{children:c},s))})]})]})]})]}),t.ndpcApproval&&jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"NDPC Approval"}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`p-3 rounded-md ${t.ndpcApproval.approved?"ndpr-alert ndpr-alert--success":t.ndpcApproval.applied?"ndpr-alert ndpr-alert--warning":"ndpr-alert ndpr-alert--destructive"}`,r==null?void 0:r.approvalStatus,d),children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",t.ndpcApproval.approved?"Approved":t.ndpcApproval.applied?"Application Submitted":"Not Applied"]}),t.ndpcApproval.referenceNumber&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",t.ndpcApproval.referenceNumber]}),t.ndpcApproval.appliedAt&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Applied:"})," ",x(t.ndpcApproval.appliedAt)]}),t.ndpcApproval.approvedAt&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Approved:"})," ",x(t.ndpcApproval.approvedAt)]})]})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:`p-3 rounded-md ${t.tiaCompleted?"ndpr-alert ndpr-alert--success":"ndpr-alert ndpr-alert--warning"}`,children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",t.tiaCompleted?"Completed":"Not Completed"]}),t.tiaReference&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",t.tiaReference]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-3 mt-6",children:[jsxRuntime.jsx("button",{onClick:()=>le(t),"aria-label":`Edit transfer to ${t.destinationCountry}`,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${M}`,children:"Edit"}),jsxRuntime.jsx("button",{onClick:()=>ce(t.id),"aria-label":`Remove transfer to ${t.destinationCountry}`,className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Remove"})]})]})};return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,r==null?void 0:r.root,d),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.title,d),children:te}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:re}),ie&&me(),!j&&jsxRuntime.jsx("div",{className:"mb-6",children:jsxRuntime.jsx("button",{onClick:oe,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${M}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),d),children:"Add Transfer"})}),j&&ve(),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbStatusFilter",className:"ndpr-form-field__label",children:"Status Filter"}),jsxRuntime.jsxs("select",{id:"cbStatusFilter",value:k,onChange:t=>de(t.target.value),"aria-label":"Filter transfers by status",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),Z.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbMechanismFilter",className:"ndpr-form-field__label",children:"Mechanism Filter"}),jsxRuntime.jsxs("select",{id:"cbMechanismFilter",value:T,onChange:t=>pe(t.target.value),"aria-label":"Filter transfers by mechanism",className:chunkAME4HJR4_js.a("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsxRuntime.jsx("option",{value:"all",children:"All Mechanisms"}),L.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]})]}),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:"Transfers"}),A.length===0?jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:"No cross-border transfers found."}):jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",r==null?void 0:r.transferList,d),children:A.map(t=>{var a,o;return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`p-3 rounded-md cursor-pointer ${f===t.id?"ndpr-alert ndpr-alert--info":"ndpr-panel"}`,r==null?void 0:r.transferItem,d),role:"button",tabIndex:0,"aria-label":`View transfer to ${t.destinationCountry}`,onClick:()=>y(t.id),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),y(t.id));},children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:t.destinationCountry}),H(t.riskLevel)]}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mb-1",children:t.recipientOrganization}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mb-1",children:ue(t.transferMechanism)}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[K(t.status),((a=t.ndpcApproval)==null?void 0:a.required)&&!((o=t.ndpcApproval)!=null&&o.approved)&&jsxRuntime.jsx("span",{className:"text-xs ndpr-text-info",children:"NDPC Pending"})]})]},t.id)})})]}),jsxRuntime.jsx("div",{className:"md:col-span-2",children:U?fe(U):jsxRuntime.jsx("div",{className:"ndpr-empty-state",children:jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:"Select a transfer to view details"})})})]})]})};exports.a=ke;
|